From 106b33405e870e188d88f9ecd3a314901616c7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Thu, 28 Jul 2022 13:39:56 +0200 Subject: [PATCH] vc4/v3d: stop adding NORAST when SHADERDB debug option is used Right now if we use the option SHADERDB, NORAST is added automatically. There's no comment justifying it, neither a lot of info on the commits that added that. But I guess that the purpose is that SHADERDB option is assumed to be used only to gather shader-db stats, so setting setting NORAST would allow to get those dumps faster. But adding debug options automatically can be confusing, as we could get a behaviour that we were not expecting. At least I needed to check why using SHADERDB was getting a black screen. And if we want to get this behaviour, we can easily add manually the NORAST. Finally, v3dv doesn't support NORAST right now (and we don't have immediate plans to implement it), so it is somewhat inconsistent to get different behaviour from the same debug option from the two drivers. Reviewed-by: Juan A. Suarez Part-of: --- src/broadcom/common/v3d_debug.c | 9 --------- src/broadcom/common/v3d_debug.h | 2 -- src/broadcom/vulkan/v3dv_device.c | 2 -- src/gallium/drivers/v3d/v3d_screen.c | 2 -- src/gallium/drivers/vc4/vc4_screen.c | 4 ---- 5 files changed, 19 deletions(-) diff --git a/src/broadcom/common/v3d_debug.c b/src/broadcom/common/v3d_debug.c index 09a5aa95caf..3079fbf4460 100644 --- a/src/broadcom/common/v3d_debug.c +++ b/src/broadcom/common/v3d_debug.c @@ -117,12 +117,3 @@ v3d_debug_flag_for_shader_stage(gl_shader_stage stage) STATIC_ASSERT(MESA_SHADER_STAGES == 6); return flags[stage]; } - -void -v3d_process_debug_variable(void) -{ - V3D_DEBUG = debug_get_option_v3d_debug(); - - if (V3D_DEBUG & V3D_DEBUG_SHADERDB) - V3D_DEBUG |= V3D_DEBUG_NORAST; -} diff --git a/src/broadcom/common/v3d_debug.h b/src/broadcom/common/v3d_debug.h index c8822439845..4a6ae0983b6 100644 --- a/src/broadcom/common/v3d_debug.h +++ b/src/broadcom/common/v3d_debug.h @@ -90,8 +90,6 @@ extern uint32_t V3D_DEBUG; extern uint32_t v3d_debug_flag_for_shader_stage(gl_shader_stage stage); -extern void v3d_process_debug_variable(void); - #ifdef __cplusplus } #endif diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index 6681ba32b4e..88619ea3387 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -225,8 +225,6 @@ v3dv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, return vk_error(NULL, result); } - v3d_process_debug_variable(); - instance->physicalDeviceCount = -1; /* We start with the default values for the pipeline_cache envvars */ diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index 6c2b2bf6f84..fa0d5c398cc 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -889,8 +889,6 @@ v3d_screen_create(int fd, const struct pipe_screen_config *config, v3d_fence_init(screen); - v3d_process_debug_variable(); - v3d_resource_screen_init(pscreen); screen->compiler = v3d_compiler_init(&screen->devinfo, 0); diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 71ec213e4b5..e3cc3875e64 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -588,10 +588,6 @@ vc4_screen_create(int fd, struct renderonly *ro) vc4_fence_screen_init(screen); - vc4_debug = debug_get_option_vc4_debug(); - if (vc4_debug & VC4_DEBUG_SHADERDB) - vc4_debug |= VC4_DEBUG_NORAST; - #ifdef USE_VC4_SIMULATOR vc4_simulator_init(screen); #endif