From 1ed6edf096928ff4a3eeddb1b9c7a2c3a699a765 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sat, 3 Apr 2021 17:25:04 +0200 Subject: [PATCH] [d3d9] respect Vector4 alignment in GetShaderConstants --- src/d3d9/d3d9_device.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/d3d9/d3d9_device.h b/src/d3d9/d3d9_device.h index ccc7e494..e9c3c1cc 100644 --- a/src/d3d9/d3d9_device.h +++ b/src/d3d9/d3d9_device.h @@ -1152,16 +1152,16 @@ namespace dxvk { return D3DERR_INVALIDCALL; if constexpr (ConstantType == D3D9ConstantType::Float) { - auto begin = &set.fConsts[StartRegister]; - auto end = &begin[Count]; + const float* source = set.fConsts[StartRegister].data; + const size_t size = Count * sizeof(Vector4); - std::copy(begin, end, reinterpret_cast(pConstantData)); + std::memcpy(pConstantData, source, size); } else if constexpr (ConstantType == D3D9ConstantType::Int) { - auto begin = &set.iConsts[StartRegister]; - auto end = &begin[Count]; + const int* source = set.iConsts[StartRegister].data; + const size_t size = Count * sizeof(Vector4i); - std::copy(begin, end, reinterpret_cast(pConstantData)); + std::memcpy(pConstantData, source, size); } else { for (uint32_t i = 0; i < Count; i++) {