From 511733b862d2cb6836beb0965bdc5d699e6a2233 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 2 Jul 2008 12:40:03 -0600 Subject: mesa: added _mesa_print_swizzle() debugging helper --- src/mesa/shader/prog_print.c | 13 +++++++++++++ src/mesa/shader/prog_print.h | 3 +++ 2 files changed, 16 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 2c5e03acc2..11f82c1fc1 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -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) { diff --git a/src/mesa/shader/prog_print.h b/src/mesa/shader/prog_print.h index 36c47e0dff..3cdb1b195e 100644 --- a/src/mesa/shader/prog_print.h +++ b/src/mesa/shader/prog_print.h @@ -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); -- cgit v1.2.3