From 26a48d8d352b84dcfd11dcb0af08d9ae6333e543 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 26 Jun 2020 09:36:46 +0200 Subject: [PATCH] radv: enable VK_AMD_shader_ballot on GFX6-7 with both compiler backends MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It gives +1-2 FPS with Doom Eternal on Pitcairn. Signed-off-by: Samuel Pitoiset Reviewed-by: Daniel Schürmann Part-of: --- docs/envvars.rst | 2 -- src/amd/vulkan/radv_debug.h | 11 +++++------ src/amd/vulkan/radv_device.c | 4 ---- src/amd/vulkan/radv_extensions.py | 2 +- src/amd/vulkan/radv_private.h | 3 --- src/amd/vulkan/radv_shader.c | 2 +- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/docs/envvars.rst b/docs/envvars.rst index 3177347eab5..8ffec2cdac1 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -585,8 +585,6 @@ RADV driver environment variables enable local BOs ``pswave32`` enable wave32 for pixel shaders (GFX10+) - ``shader_ballot`` - enable shader ballot ``tccompatcmask`` enable TC-compat cmask for MSAA images diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h index df7d4d2374f..40ecf77cc84 100644 --- a/src/amd/vulkan/radv_debug.h +++ b/src/amd/vulkan/radv_debug.h @@ -62,12 +62,11 @@ enum { RADV_PERFTEST_LOCAL_BOS = 0x1, RADV_PERFTEST_DCC_MSAA = 0x2, RADV_PERFTEST_BO_LIST = 0x4, - RADV_PERFTEST_SHADER_BALLOT = 0x8, - RADV_PERFTEST_TC_COMPAT_CMASK = 0x10, - RADV_PERFTEST_CS_WAVE_32 = 0x20, - RADV_PERFTEST_PS_WAVE_32 = 0x40, - RADV_PERFTEST_GE_WAVE_32 = 0x80, - RADV_PERFTEST_DFSM = 0x100, + RADV_PERFTEST_TC_COMPAT_CMASK = 0x8, + RADV_PERFTEST_CS_WAVE_32 = 0x10, + RADV_PERFTEST_PS_WAVE_32 = 0x20, + RADV_PERFTEST_GE_WAVE_32 = 0x40, + RADV_PERFTEST_DFSM = 0x80, }; bool diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index ef309249fd8..4401f39e77c 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -372,9 +372,6 @@ radv_physical_device_try_create(struct radv_instance *instance, device->dcc_msaa_allowed = (device->instance->perftest_flags & RADV_PERFTEST_DCC_MSAA); - device->use_shader_ballot = (!device->use_llvm && device->rad_info.chip_class >= GFX8) || - (device->instance->perftest_flags & RADV_PERFTEST_SHADER_BALLOT); - device->use_ngg = device->rad_info.chip_class >= GFX10 && device->rad_info.family != CHIP_NAVI14 && !(device->instance->debug_flags & RADV_DEBUG_NO_NGG); @@ -520,7 +517,6 @@ static const struct debug_control radv_perftest_options[] = { {"localbos", RADV_PERFTEST_LOCAL_BOS}, {"dccmsaa", RADV_PERFTEST_DCC_MSAA}, {"bolist", RADV_PERFTEST_BO_LIST}, - {"shader_ballot", RADV_PERFTEST_SHADER_BALLOT}, {"tccompatcmask", RADV_PERFTEST_TC_COMPAT_CMASK}, {"cswave32", RADV_PERFTEST_CS_WAVE_32}, {"pswave32", RADV_PERFTEST_PS_WAVE_32}, diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index 4027eec0c38..a390ffe556f 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -171,7 +171,7 @@ EXTENSIONS = [ # Disable mixed attachment samples on GFX6-GFX7 until the CTS failures have been resolved. Extension('VK_AMD_mixed_attachment_samples', 1, 'device->rad_info.chip_class >= GFX8'), Extension('VK_AMD_rasterization_order', 1, 'device->rad_info.has_out_of_order_rast'), - Extension('VK_AMD_shader_ballot', 1, 'device->use_shader_ballot'), + Extension('VK_AMD_shader_ballot', 1, True), Extension('VK_AMD_shader_core_properties', 1, True), Extension('VK_AMD_shader_core_properties2', 1, True), Extension('VK_AMD_shader_explicit_vertex_parameter', 1, True), diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 902893a7d40..17d83eaaaa8 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -294,9 +294,6 @@ struct radv_physical_device { /* Whether DCC should be enabled for MSAA textures. */ bool dcc_msaa_allowed; - /* Whether to enable the AMD_shader_ballot extension */ - bool use_shader_ballot; - /* Whether to enable NGG. */ bool use_ngg; diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 2aa6b191699..0946560b833 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -365,7 +365,7 @@ radv_shader_compile_to_nir(struct radv_device *device, .amd_gcn_shader = true, .amd_image_gather_bias_lod = true, .amd_image_read_write_lod = true, - .amd_shader_ballot = device->physical_device->use_shader_ballot, + .amd_shader_ballot = true, .amd_shader_explicit_vertex_parameter = true, .amd_trinary_minmax = true, .demote_to_helper_invocation = true, -- 2.30.2