From e114b13dae28abfe39fb610c05db7acd7457cbcf Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 4 Aug 2013 19:38:37 +1200 Subject: [PATCH] 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 Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_interpolation_map.c | 27 +++++++++++++++++++++++ src/mesa/drivers/dri/i965/intel_context.c | 1 + src/mesa/drivers/dri/i965/intel_context.h | 1 + 3 files changed, 29 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_interpolation_map.c b/src/mesa/drivers/dri/i965/brw_interpolation_map.c index 7b7dbef..597fc96 100644 --- a/src/mesa/drivers/dri/i965/brw_interpolation_map.c +++ b/src/mesa/drivers/dri/i965/brw_interpolation_map.c @@ -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)); + } + } } diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c index 461d493..840c1a5 100644 --- a/src/mesa/drivers/dri/i965/intel_context.c +++ b/src/mesa/drivers/dri/i965/intel_context.c @@ -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 } }; diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h index 188ac89..734c57c 100644 --- a/src/mesa/drivers/dri/i965/intel_context.h +++ b/src/mesa/drivers/dri/i965/intel_context.h @@ -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" -- 2.7.4