i965: Add a new debug mode for the VUE map

INTEL_DEBUG=vue now emits a listing of each slot in the VUE map,
and the corresponding interpolation mode.

V2: Fix whitespace issues.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Chris Forbes 2013-08-04 19:38:37 +12:00
parent 5894898148
commit e114b13dae
3 changed files with 29 additions and 0 deletions

View file

@ -23,6 +23,17 @@
#include "brw_state.h"
static char const *get_qual_name(int mode)
{
switch (mode) {
case INTERP_QUALIFIER_NONE: return "none";
case INTERP_QUALIFIER_FLAT: return "flat";
case INTERP_QUALIFIER_SMOOTH: return "smooth";
case INTERP_QUALIFIER_NOPERSPECTIVE: return "nopersp";
default: return "???";
}
}
/* Set up interpolation modes for every element in the VUE */
static void
@ -72,6 +83,22 @@ brw_setup_vue_interpolation(struct brw_context *brw)
brw->interpolation_mode.mode[i] = mode;
}
if (unlikely(INTEL_DEBUG & DEBUG_VUE)) {
printf("VUE map:\n");
for (int i = 0; i < vue_map->num_slots; i++) {
int varying = vue_map->slot_to_varying[i];
if (varying == -1) {
printf("%d: --\n", i);
continue;
}
printf("%d: %d %s ofs %d\n",
i, varying,
get_qual_name(brw->interpolation_mode.mode[i]),
brw_vue_slot_to_offset(i));
}
}
}

View file

@ -332,6 +332,7 @@ static const struct dri_debug_control debug_control[] = {
{ "shader_time", DEBUG_SHADER_TIME },
{ "no16", DEBUG_NO16 },
{ "blorp", DEBUG_BLORP },
{ "vue", DEBUG_VUE },
{ NULL, 0 }
};

View file

@ -190,6 +190,7 @@ extern int INTEL_DEBUG;
#define DEBUG_SHADER_TIME 0x8000000
#define DEBUG_BLORP 0x10000000
#define DEBUG_NO16 0x20000000
#define DEBUG_VUE 0x40000000
#ifdef HAVE_ANDROID_PLATFORM
#define LOG_TAG "INTEL-MESA"