From 43be445c3762476efa68cc14a355cb5ef04c50bd Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 30 Nov 2020 23:47:49 +1300 Subject: [PATCH] Copy constants regardless of dirty state --- src/core/hle/D3D8/Direct3D9/Direct3D9.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index a433b2f60..53f68c76b 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -7393,18 +7393,10 @@ extern float* HLE_get_NV2A_vertex_constant_float4_ptr(unsigned const_index); // // remove our patches on D3DDevice_SetVertexShaderConstant (and CxbxImpl_SetVertexShaderConstant) void CxbxUpdateHostVertexShaderConstants() { - // Transfer all constants that have been flagged dirty to host - auto nv2a = g_NV2A->GetDeviceState(); - for (int i = 0; i < X_D3DVS_CONSTREG_COUNT; i++) { - if (nv2a->pgraph.vsh_constants_dirty[i]) { - nv2a->pgraph.vsh_constants_dirty[i] = false; - - float *constant_floats = HLE_get_NV2A_vertex_constant_float4_ptr(i); - // Note : If host SetVertexShaderConstantF has high overhead (unlikely), - // we could combine multiple adjacent constants into one call. - g_pD3DDevice->SetVertexShaderConstantF(i, constant_floats, 1); - } - } + // Copy all constants (as they may have been overwritten with fixed-function mode) + // Though we should only have to copy overwritten or dirty constants + float* constant_floats = HLE_get_NV2A_vertex_constant_float4_ptr(0); + g_pD3DDevice->SetVertexShaderConstantF(0, constant_floats, X_D3DVS_CONSTREG_COUNT); // FIXME our viewport constants don't match Xbox values // If we write them to pgraph constants, like we do with constants set by the title,