diff options
author | Kenneth Graunke <[email protected]> | 2015-02-18 17:31:29 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-02-19 15:15:45 -0800 |
commit | 7c891e8ddd41a77ccdc804ce938f2a1ed46e97e8 (patch) | |
tree | 684d510e5cb1381e849f2f0fbbaf1bd4af6f6658 | |
parent | 7555d1bafb089bc5130f86602a23725e184c490e (diff) |
i965: Add a function to translate MESA_SHADER_* into DEBUG_* enums.
When compiling, we have a gl_shader_stage (MESA_SHADER_*) enum, and want
to know whether debugging is enabled for that stage. This allows us to
easily translate it into the corresponding debug flag.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_debug.c | 13 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_debug.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_debug.c b/src/mesa/drivers/dri/i965/intel_debug.c index 013602c4abe..0cb7aef3231 100644 --- a/src/mesa/drivers/dri/i965/intel_debug.c +++ b/src/mesa/drivers/dri/i965/intel_debug.c @@ -72,6 +72,19 @@ static const struct dri_debug_control debug_control[] = { { NULL, 0 } }; +uint64_t +intel_debug_flag_for_shader_stage(gl_shader_stage stage) +{ + int flags[] = { + [MESA_SHADER_VERTEX] = DEBUG_VS, + [MESA_SHADER_GEOMETRY] = DEBUG_GS, + [MESA_SHADER_FRAGMENT] = DEBUG_WM, + [MESA_SHADER_COMPUTE] = 0, /* no debug flag yet */ + }; + STATIC_ASSERT(MESA_SHADER_STAGES == 4); + return flags[stage]; +} + void brw_process_intel_debug_variable(struct brw_context *brw) { diff --git a/src/mesa/drivers/dri/i965/intel_debug.h b/src/mesa/drivers/dri/i965/intel_debug.h index 01b4dcfd3fe..ed879aba8d3 100644 --- a/src/mesa/drivers/dri/i965/intel_debug.h +++ b/src/mesa/drivers/dri/i965/intel_debug.h @@ -110,6 +110,8 @@ extern uint64_t INTEL_DEBUG; } \ } while (0) +extern uint64_t intel_debug_flag_for_shader_stage(gl_shader_stage stage); + struct brw_context; extern void brw_process_intel_debug_variable(struct brw_context *brw); |