mesa: added _mesa_print_swizzle() debugging helper
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 2 Jul 2008 18:40:03 +0000 (12:40 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 2 Jul 2008 18:41:39 +0000 (12:41 -0600)
src/mesa/shader/prog_print.c
src/mesa/shader/prog_print.h

index 2c5e03acc25e7d2157446c33b46e8fcd60f410dd..11f82c1fc1826c3ebd08cb8924169c0f60e18c8c 100644 (file)
@@ -356,6 +356,19 @@ _mesa_swizzle_string(GLuint swizzle, GLuint negateBase, GLboolean extended)
 }
 
 
+void
+_mesa_print_swizzle(GLuint swizzle)
+{
+   if (swizzle == SWIZZLE_XYZW) {
+      _mesa_printf(".xyzw\n");
+   }
+   else {
+      char *s = _mesa_swizzle_string(swizzle, 0, 0);
+      _mesa_printf("%s\n", s);
+   }
+}
+
+
 static const char *
 writemask_string(GLuint writeMask)
 {
index 36c47e0dff921b68b59d18ffa59bfda3736431cb..3cdb1b195e05dd7c587f8fa0c34f2c82e64528f6 100644 (file)
@@ -43,6 +43,9 @@ _mesa_condcode_string(GLuint condcode);
 extern const char *
 _mesa_swizzle_string(GLuint swizzle, GLuint negateBase, GLboolean extended);
 
+extern void
+_mesa_print_swizzle(GLuint swizzle);
+
 extern void
 _mesa_print_alu_instruction(const struct prog_instruction *inst,
                             const char *opcode_string, GLuint numRegs);