From 3bd176fd7ce5163b56b765bc22905e289562b856 Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Sat, 3 Jun 2006 03:11:19 +0000 Subject: [PATCH] Need to always set the render state since caching the render state doesn't seem to work (possibly due to Cg shader setting D3D render states). Fixes problem with sails and ship damage. --- panda/src/dxgsg9/dxGraphicsStateGuardian9.I | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.I b/panda/src/dxgsg9/dxGraphicsStateGuardian9.I index be0c742dd9..642cbd9044 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.I +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.I @@ -149,6 +149,8 @@ get_safe_buffer_start() { return _safe_buffer_start; } +#define ALWAYS_SET_RENDER_STATE true + //////////////////////////////////////////////////////////////////// // Function: DXGraphicsStateGuardian9::set_render_state // Access: @@ -162,7 +164,7 @@ set_render_state (D3DRENDERSTATETYPE state, DWORD value) HRESULT hr; hr = D3D_OK; - if (_render_state_array [state] != value) + if (ALWAYS_SET_RENDER_STATE || _render_state_array [state] != value) { hr = _d3d_device->SetRenderState(state, value); _render_state_array [state] = value; @@ -184,7 +186,7 @@ set_texture_stage_state (DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value HRESULT hr; hr = D3D_OK; - if (_texture_stage_states_array [stage].state_array [type] != value) + if (ALWAYS_SET_RENDER_STATE || _texture_stage_states_array [stage].state_array [type] != value) { hr = _d3d_device->SetTextureStageState(stage, type, value); _texture_stage_states_array [stage].state_array [type] = value; @@ -206,7 +208,7 @@ set_sampler_state (DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value) HRESULT hr; hr = D3D_OK; - if (_texture_render_states_array [sampler].state_array [type] != value) + if (ALWAYS_SET_RENDER_STATE || _texture_render_states_array [sampler].state_array [type] != value) { hr = _d3d_device->SetSamplerState(sampler, type, value); _texture_render_states_array [sampler].state_array [type] = value;