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.
This commit is contained in:
Lioncash 2019-07-26 19:27:55 -04:00
parent 287b446ef7
commit 0ce6264f90
1 changed files with 4 additions and 3 deletions

View File

@ -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