Stefan Dösinger : wined3d: Don' t dirtify too many shader constants.

Alexandre Julliard julliard at winehq.org
Wed Jul 1 09:28:11 CDT 2009


Module: wine
Branch: master
Commit: c82da7d97506b638ded678abb93160e4bd6de2dd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c82da7d97506b638ded678abb93160e4bd6de2dd

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun Jun 28 18:33:22 2009 +0200

wined3d: Don't dirtify too many shader constants.

If we have start = 4, count = 3, the highest dirty constant is the one with index 6. start + count gives 7,
so it already includes the zero-based array correction. Don't add an additional 1.

Additionally to the inefficiency of looking at one extra constant, this causes problems if the driver
rejects loading 257 constants on the initial load. In this case no constant is loaded if
GL_EXT_gpu_program_parameters is used.

---

 dlls/wined3d/arb_program_shader.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 28118c7..66a7634 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -515,7 +515,7 @@ static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT
      * context. On a context switch the old context will be fully dirtified */
     memset(This->activeContext->vshader_const_dirty + start, 1,
             sizeof(*This->activeContext->vshader_const_dirty) * count);
-    This->highest_dirty_vs_const = max(This->highest_dirty_vs_const, start + count + 1);
+    This->highest_dirty_vs_const = max(This->highest_dirty_vs_const, start + count);
 }
 
 static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT start, UINT count)
@@ -526,7 +526,7 @@ static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT
      * context. On a context switch the old context will be fully dirtified */
     memset(This->activeContext->pshader_const_dirty + start, 1,
             sizeof(*This->activeContext->pshader_const_dirty) * count);
-    This->highest_dirty_ps_const = max(This->highest_dirty_ps_const, start + count + 1);
+    This->highest_dirty_ps_const = max(This->highest_dirty_ps_const, start + count);
 }
 
 static DWORD *local_const_mapping(IWineD3DBaseShaderImpl *This)




More information about the wine-cvs mailing list