diff --git a/docs/envvars.rst b/docs/envvars.rst index 752cc582e39..aac9d963c1c 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -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`` diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h index f0f889d79fd..65928b69093 100644 --- a/src/amd/vulkan/radv_debug.h +++ b/src/amd/vulkan/radv_debug.h @@ -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 { diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 2a2698faba0..e0494a2924e 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -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} }; diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index c4176cc44bb..3d144fa0429 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -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;