radv: add RADV_DEBUG=novrsflatshading option

To easily debug if enabling VRS for flat shading is broken.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9515>
This commit is contained in:
Samuel Pitoiset 2021-03-10 17:04:18 +01:00
parent f5540209ab
commit 92764abc82
4 changed files with 8 additions and 0 deletions

View File

@ -601,6 +601,8 @@ RADV driver environment variables
disable LLVM threaded compilation
``noumr``
disable UMR dumps during GPU hang detection (only with RADV_DEBUG=hang)
``novrsflatshading``
disable VRS for flat shading (only on GFX10.3+)
``preoptir``
dump LLVM IR before any optimizations
``shaders``

View File

@ -62,6 +62,7 @@ enum {
RADV_DEBUG_INVARIANT_GEOM = 1ull << 31,
RADV_DEBUG_NO_DISPLAY_DCC = 1ull << 32,
RADV_DEBUG_NO_TC_COMPAT_CMASK= 1ull << 33,
RADV_DEBUG_NO_VRS_FLAT_SHADING = 1ull << 34,
};
enum {

View File

@ -797,6 +797,7 @@ static const struct debug_control radv_debug_options[] = {
{"invariantgeom", RADV_DEBUG_INVARIANT_GEOM},
{"nodisplaydcc", RADV_DEBUG_NO_DISPLAY_DCC},
{"notccompatcmask", RADV_DEBUG_NO_TC_COMPAT_CMASK},
{"novrsflatshading", RADV_DEBUG_NO_VRS_FLAT_SHADING},
{NULL, 0}
};

View File

@ -5312,6 +5312,10 @@ static bool
gfx103_pipeline_vrs_coarse_shading(const struct radv_pipeline *pipeline)
{
struct radv_shader_variant *ps = pipeline->shaders[MESA_SHADER_FRAGMENT];
struct radv_device *device = pipeline->device;
if (device->instance->debug_flags & RADV_DEBUG_NO_VRS_FLAT_SHADING)
return false;
if (!ps->info.ps.allow_flat_shading)
return false;