[WINED3D 1/4] Only run parse_decl_usage on vshader INPUT registers.

Ivan Gyurdiev ivg2 at cornell.edu
Sun May 21 16:12:53 CDT 2006


There's three types of declaration that the DCL instruction applies to:

1) Vertex shader input declaration
2) Vertex shader output/Pixel shader input declaration
3) Sampler declaration

While some of them may look similar (justifying a shared trace fn), 
they're completely different from a functionality standpoint. The 
parse_decl_usage() function currently runs on all 3, while it only 
handles vshader input declarations. This is bad - it causes, for 
example, the vertex shader inputs to be overwritten with output register 
numbers in Painkiller.

-------------- next part --------------
---

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

854e35bc1206e15ddc080f16260db38cd76b3e47
diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c
index 29a92d1..ff6d6ed 100644
--- a/dlls/wined3d/vertexshader.c
+++ b/dlls/wined3d/vertexshader.c
@@ -709,7 +709,7 @@ inline static void vshader_program_add_p
   }
 }
 
-static void parse_decl_usage(IWineD3DVertexShaderImpl *This, INT usage, INT arrayNo)
+static void vshader_parse_input_decl_usage(IWineD3DVertexShaderImpl *This, INT usage, INT arrayNo)
 {
     switch(usage & 0xFFFF) {
         case D3DDECLUSAGE_POSITION:
@@ -1541,8 +1541,10 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_
 
                     DWORD usage = *pToken;
                     DWORD param = *(pToken + 1);
+                    DWORD regtype = shader_get_regtype(param);
 
-                    parse_decl_usage(This, usage, param & D3DSP_REGNUM_MASK);
+                    if (regtype == D3DSPR_INPUT)
+                        vshader_parse_input_decl_usage(This, usage, param & D3DSP_REGNUM_MASK);
                     shader_program_dump_decl_usage(usage, param);
                     shader_dump_ins_modifiers(param);
                     TRACE(" ");
-- 
1.3.1



More information about the wine-patches mailing list