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:
parent
287b446ef7
commit
0ce6264f90
|
@ -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)
|
AbstractShader::BinaryData Shader::CreateByteCode(const void* data, size_t length)
|
||||||
{
|
{
|
||||||
BinaryData bytecode(length);
|
const auto* const begin = static_cast<const u8*>(data);
|
||||||
std::memcpy(bytecode.data(), data, length);
|
const auto* const end = begin + length;
|
||||||
return bytecode;
|
|
||||||
|
return {begin, end};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace D3DCommon
|
} // namespace D3DCommon
|
||||||
|
|
Loading…
Reference in New Issue