diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index 24526071d..1742adb13 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -8685,14 +8685,15 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_RunVertexStateShader) PGRAPHState* pg = &(dev->pgraph); float vertex_state_shader_v0[4]; - - for (int slot = 0; slot < 4; slot++) - { - if (pData != nullptr) - vertex_state_shader_v0[slot] = pData[slot]; - else + if (pData != nullptr) + //if pData != nullptr, then it contents v0.xyzw, we shall copy the binary content directly. + memcpy(vertex_state_shader_v0,pData, sizeof(vertex_state_shader_v0)); + else + //for pData == nullptr, this data is not supposed to be used. but we assign v0.xyzw 0.0f in each component just in case. + for (int slot = 0; slot < 4; slot++) + { vertex_state_shader_v0[slot] = 0.0f; - } + } int shader_slot = Address; Nv2aVshProgram program;