Skip to content
Permalink
Browse files

D3DCommon/Shader: Create vector via iterators in CreateByteCode()

Same behavior, but without unnecessary zeroing of data contents.
Instead, we supply the dataset to use directly.
  • Loading branch information...
lioncash committed Jul 26, 2019
1 parent 287b446 commit 0ce6264f90e5591a7f28b2545f727809beaa8415
Showing with 4 additions and 3 deletions.
  1. +4 −3 Source/Core/VideoBackends/D3DCommon/Shader.cpp
@@ -132,9 +132,10 @@ bool Shader::CompileShader(D3D_FEATURE_LEVEL feature_level, BinaryData* out_byte

AbstractShader::BinaryData Shader::CreateByteCode(const void* data, size_t length)
{
BinaryData bytecode(length);
std::memcpy(bytecode.data(), data, length);
return bytecode;
const auto* const begin = static_cast<const u8*>(data);
const auto* const end = begin + length;

return {begin, end};
}

} // namespace D3DCommon

0 comments on commit 0ce6264

Please sign in to comment.
You can’t perform that action at this time.