Revert "mesa: Remove pointless comparison of unsigned integer with a negative constant."
authorVinson Lee <vlee@vmware.com>
Fri, 5 Mar 2010 01:40:36 +0000 (17:40 -0800)
committerVinson Lee <vlee@vmware.com>
Fri, 5 Mar 2010 01:41:20 +0000 (17:41 -0800)
This reverts commit a05fdbcb719ac64e6be842372813f0f4ca2f4f93.

Removing the comparison is wrong. The comparison with -1 should be changed
to another value (probably PROGRAM_UNDEFINED) along with another
change in the shader assembler.

Conflicts:

src/mesa/shader/prog_execute.c

src/mesa/shader/prog_execute.c

index a1c20a325e6b85116da00904757c170539bfbc91..37750cc330aa42e75c6529ab7d34311f3b1e6c10 100644 (file)
@@ -1767,10 +1767,15 @@ _mesa_execute_program(GLcontext * ctx,
          break;
       case OPCODE_PRINT:
          {
-            GLfloat a[4];
-            fetch_vector4(&inst->SrcReg[0], machine, a);
-            printf("%s%g, %g, %g, %g\n", (const char *) inst->Data,
-                  a[0], a[1], a[2], a[3]);
+            if (inst->SrcReg[0].File != -1) {
+               GLfloat a[4];
+               fetch_vector4(&inst->SrcReg[0], machine, a);
+               printf("%s%g, %g, %g, %g\n", (const char *) inst->Data,
+                            a[0], a[1], a[2], a[3]);
+            }
+            else {
+               printf("%s\n", (const char *) inst->Data);
+            }
          }
          break;
       case OPCODE_END: