vtn: Allow SPIR-V debug options in release builds
As long as no one sets any flags, they cost us virtually nothing. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30875>
This commit is contained in:

committed by
Marge Bot

parent
ee7b596abc
commit
9520fb8ecc
@@ -199,7 +199,6 @@ static const struct spirv_capabilities implemented_capabilities = {
|
||||
.WorkgroupMemoryExplicitLayout16BitAccessKHR = true,
|
||||
};
|
||||
|
||||
#ifndef NDEBUG
|
||||
uint32_t mesa_spirv_debug = 0;
|
||||
|
||||
static const struct debug_named_value mesa_spirv_debug_control[] = {
|
||||
@@ -226,6 +225,7 @@ mesa_spirv_debug_init(void)
|
||||
call_once(&initialized_debug_flag, initialize_mesa_spirv_debug);
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
static enum nir_spirv_debug_level
|
||||
vtn_default_log_level(void)
|
||||
{
|
||||
@@ -6845,9 +6845,7 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
|
||||
const nir_shader_compiler_options *nir_options)
|
||||
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
mesa_spirv_debug_init();
|
||||
#endif
|
||||
|
||||
const uint32_t *word_end = words + word_count;
|
||||
|
||||
|
@@ -36,11 +36,7 @@
|
||||
|
||||
extern uint32_t mesa_spirv_debug;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define MESA_SPIRV_DEBUG(flag) unlikely(mesa_spirv_debug & (MESA_SPIRV_DEBUG_ ## flag))
|
||||
#else
|
||||
#define MESA_SPIRV_DEBUG(flag) false
|
||||
#endif
|
||||
|
||||
#define MESA_SPIRV_DEBUG_STRUCTURED (1u << 0)
|
||||
#define MESA_SPIRV_DEBUG_VALUES (1u << 1)
|
||||
|
Reference in New Issue
Block a user