Stefan Dösinger : wined3d: Ignore unused attributes when generating the swizzle array.

Alexandre Julliard julliard at winehq.org
Thu Dec 6 08:26:49 CST 2007


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Dec  5 22:03:34 2007 +0100

wined3d: Ignore unused attributes when generating the swizzle array.

---

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

diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c
index 37a3705..f67cbae 100644
--- a/dlls/wined3d/vertexshader.c
+++ b/dlls/wined3d/vertexshader.c
@@ -296,6 +296,9 @@ static inline void find_swizzled_attribs(IWineD3DVertexDeclaration *declaration,
 
     for(i = 0; i < decl->num_swizzled_attribs; i++) {
         for(j = 0; j < MAX_ATTRIBS; j++) {
+
+            if(!This->baseShader.reg_maps.attributes[j]) continue;
+
             usage_token = This->semantics_in[j].usage;
             usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT;
             usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT;
@@ -679,7 +682,7 @@ static inline BOOL swizzled_attribs_differ(IWineD3DVertexShaderImpl *This, IWine
 
     for(i = 0; i < vdecl->declarationWNumElements; i++) {
         for(j = 0; j < MAX_ATTRIBS; j++) {
-            if(!This->baseShader.reg_maps.attributes) continue;
+            if(!This->baseShader.reg_maps.attributes[j]) continue;
 
             usage_token = This->semantics_in[j].usage;
             usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT;




More information about the wine-cvs mailing list