summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_exec.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2013-02-22 15:34:30 +0000
committerJosé Fonseca <[email protected]>2013-02-22 16:19:58 +0000
commitcd01cc3b48fa093c9d31dcd2a9e4033d6d789840 (patch)
treea576198f0bbc0bad3022c82f38dc97ae2494f63e /src/gallium/auxiliary/tgsi/tgsi_exec.c
parentf8436c17e49e53cac1fb0ae66f06416fb7fd9730 (diff)
tgsi: Improve execution debugging.
- zero temps/outputs instead of copying (otherwise we won't be able to see the temps/outputs assignments for small shaders where nothing changes across big areas - also show the inputs (as it's often impossible to infer from the rest) Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_exec.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 1099d062dd8..a2b2a81ddbc 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -62,6 +62,9 @@
#include "util/u_math.h"
+#define DEBUG_EXECUTION 0
+
+
#define FAST_MATH 0
#define TILE_TOP_LEFT 0
@@ -2456,6 +2459,23 @@ exec_declaration(struct tgsi_exec_machine *mach,
}
}
}
+
+ if (DEBUG_EXECUTION) {
+ uint i, j;
+ for (i = first; i <= last; ++i) {
+ debug_printf("IN[%2u] = ", i);
+ for (j = 0; j < TGSI_NUM_CHANNELS; j++) {
+ if (j > 0) {
+ debug_printf(" ");
+ }
+ debug_printf("(%6f %u, %6f %u, %6f %u, %6f %u)\n",
+ mach->Inputs[i].xyzw[0].f[j], mach->Inputs[i].xyzw[0].u[j],
+ mach->Inputs[i].xyzw[1].f[j], mach->Inputs[i].xyzw[1].u[j],
+ mach->Inputs[i].xyzw[2].f[j], mach->Inputs[i].xyzw[2].u[j],
+ mach->Inputs[i].xyzw[3].f[j], mach->Inputs[i].xyzw[3].u[j]);
+ }
+ }
+ }
}
}
@@ -4304,9 +4324,6 @@ exec_instruction(
}
-#define DEBUG_EXECUTION 0
-
-
/**
* Run TGSI interpreter.
* \return bitmask of "alive" quad components
@@ -4351,8 +4368,10 @@ tgsi_exec_machine_run( struct tgsi_exec_machine *mach )
struct tgsi_exec_vector outputs[PIPE_MAX_ATTRIBS];
uint inst = 1;
- memcpy(temps, mach->Temps, sizeof(temps));
- memcpy(outputs, mach->Outputs, sizeof(outputs));
+ memset(mach->Temps, 0, sizeof(temps));
+ memset(mach->Outputs, 0, sizeof(outputs));
+ memset(temps, 0, sizeof(temps));
+ memset(outputs, 0, sizeof(outputs));
#endif
/* execute instructions, until pc is set to -1 */