From 0ce6264f90e5591a7f28b2545f727809beaa8415 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 26 Jul 2019 19:27:55 -0400 Subject: [PATCH] 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. --- Source/Core/VideoBackends/D3DCommon/Shader.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoBackends/D3DCommon/Shader.cpp b/Source/Core/VideoBackends/D3DCommon/Shader.cpp index 268f75370c..81d88c0968 100644 --- a/Source/Core/VideoBackends/D3DCommon/Shader.cpp +++ b/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(data); + const auto* const end = begin + length; + + return {begin, end}; } } // namespace D3DCommon