WINED3D: Fix a few TRACEs in pixelshader.c

H. Verbeet hverbeet at gmail.com
Thu Jan 19 15:53:10 CST 2006


Some traces in dlls/wined3d/pixelshader.c cause problems, like missing
a \n at the and of a line, displaying incorrect information or
crashing. This patch fixes a few of those.

Changelog:
  - Fix a few TRACEs in pixelshader.c
-------------- next part --------------
diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c
index 21cc284..a202942 100644
--- a/dlls/wined3d/pixelshader.c
+++ b/dlls/wined3d/pixelshader.c
@@ -864,7 +864,7 @@ inline static void addline(unsigned int 
     }
 
     *pgmLength += lineLen;
-    ++lineNum;
+    ++(*lineNum);
     TRACE("GL HW (%u, %u) : %s", *lineNum, *pgmLength, line);
 }
 
@@ -1095,7 +1095,6 @@ inline static VOID IWineD3DPixelShaderIm
 #endif
             pInstr = pToken;
             curOpcode = pshader_program_get_opcode(*pToken, version);
-            TRACE("Found opcode %s %s\n", curOpcode->name,curOpcode->glname);
             ++pToken;
             if (NULL == curOpcode) {
                 /* unknown current opcode ... (shouldn't be any!) */
@@ -1108,6 +1107,7 @@ inline static VOID IWineD3DPixelShaderIm
                 FIXME("Token %s requires greater functionality than Fragment_Progarm_ARB supports\n", curOpcode->name);
                 pToken += curOpcode->num_params;
             } else {
+                TRACE("Found opcode %s %s\n", curOpcode->name, curOpcode->glname);
                 saturate = FALSE;
 
                 /* Build opcode for GL vertex_program */
@@ -1399,7 +1399,7 @@ inline static VOID IWineD3DPixelShaderIm
                     case D3DSPDM_D8: D8 = TRUE; break;
 #endif
                     default:
-                        TRACE("_unhandled_modifier(0x%08lx)", mask);
+                        TRACE("_unhandled_modifier(0x%08lx)\n", mask);
                     }
                 }
 
@@ -1491,9 +1491,14 @@ inline static VOID IWineD3DPixelShaderIm
     /* finally null terminate the pgmStr*/
     pgmStr[pgmLength] = 0;
     if (GL_SUPPORT(ARB_VERTEX_PROGRAM)) {
-        TRACE("(%p) : Generated program %s\n", This, pgmStr);
         /*  Create the hw shader */
 
+        /* pgmStr sometimes gets too long for a normal TRACE */
+        TRACE("Generated program:\n");
+        if (TRACE_ON(d3d_shader)) {
+            fprintf(stderr, "%s\n", pgmStr);
+        }
+
         /* TODO: change to resource.glObjectHandel or something like that */
         GL_EXTCALL(glGenProgramsARB(1, &This->prgId));
 




More information about the wine-patches mailing list