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 <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
@@ -72,6 +72,19 @@ static const struct dri_debug_control debug_control[] = {
|
|||||||
{ NULL, 0 }
|
{ 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
|
void
|
||||||
brw_process_intel_debug_variable(struct brw_context *brw)
|
brw_process_intel_debug_variable(struct brw_context *brw)
|
||||||
{
|
{
|
||||||
|
@@ -110,6 +110,8 @@ extern uint64_t INTEL_DEBUG;
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
extern uint64_t intel_debug_flag_for_shader_stage(gl_shader_stage stage);
|
||||||
|
|
||||||
struct brw_context;
|
struct brw_context;
|
||||||
|
|
||||||
extern void brw_process_intel_debug_variable(struct brw_context *brw);
|
extern void brw_process_intel_debug_variable(struct brw_context *brw);
|
||||||
|
Reference in New Issue
Block a user