radv: Add driconf to force wave64 for RT
authorFriedrich Vock <friedrich.vock@gmx.de>
Sun, 11 Jun 2023 13:47:50 +0000 (15:47 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 12 Jun 2023 18:36:56 +0000 (18:36 +0000)
...and enable it for Hellblade: Senua's Sacrifice.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23585>

src/amd/vulkan/radv_instance.c
src/amd/vulkan/radv_physical_device.c
src/amd/vulkan/radv_private.h
src/util/00-radv-defaults.conf
src/util/driconf.h

index 1204a80..5c97955 100644 (file)
@@ -146,6 +146,7 @@ static const driOptionDescription radv_dri_options[] = {
       DRI_CONF_RADV_TEX_NON_UNIFORM(false)
       DRI_CONF_RADV_RT(false)
       DRI_CONF_RADV_FLUSH_BEFORE_TIMESTAMP_WRITE(false)
+      DRI_CONF_RADV_RT_WAVE64(false)
       DRI_CONF_RADV_APP_LAYER()
    DRI_CONF_SECTION_END
 };
@@ -207,6 +208,8 @@ radv_init_dri_options(struct radv_instance *instance)
 
    instance->flush_before_timestamp_write =
       driQueryOptionb(&instance->dri_options, "radv_flush_before_timestamp_write");
+
+   instance->force_rt_wave64 = driQueryOptionb(&instance->dri_options, "radv_rt_wave64");
 }
 
 static const struct vk_instance_extension_table radv_instance_extensions_supported = {
index afe8755..fce403e 100644 (file)
@@ -2061,7 +2061,7 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
        * problematic)
        */
       if (!(device->instance->perftest_flags & RADV_PERFTEST_RT_WAVE_64) &&
-          device->rad_info.gfx_level < GFX11)
+          !(device->instance->force_rt_wave64) && device->rad_info.gfx_level < GFX11)
          device->rt_wave_size = 32;
    }
 
index c7ed6b3..01b7a09 100644 (file)
@@ -416,6 +416,7 @@ struct radv_instance {
    bool enable_unified_heap_on_apu;
    bool tex_non_uniform;
    bool flush_before_timestamp_write;
+   bool force_rt_wave64;
    char *app_layer;
 };
 
index f127955..7ff99aa 100644 (file)
@@ -156,6 +156,12 @@ Application bugs worked around in this file:
             <option name="radv_app_layer" value="metroexodus" />
         </application>
 
+        <application name="Hellblade: Senua's Sacrifice" application_name_match="HellbladeGame-Win64-Shipping.exe">
+            <!-- RT shaders in Hellblade: Senua's Sacrifice cause misrenders because they assume full subgroups.
+                 This is only guaranteed with wave64, so force wave64 on for this game. -->
+            <option name="radv_rt_wave64" value="true" />
+        </application>
+
         <!-- OpenGL Game workarounds (zink) -->
         <application name="Black Geyser: Couriers of Darkness" executable="BlackGeyser.x86_64">
             <option name="radv_zero_vram" value="true" />
index 108cc01..fa6fb75 100644 (file)
    DRI_CONF_OPT_B(radv_flush_before_timestamp_write, def, \
                   "Wait for previous commands to finish before writing timestamps")
 
+#define DRI_CONF_RADV_RT_WAVE64(def) \
+   DRI_CONF_OPT_B(radv_rt_wave64, def, \
+                  "Force wave64 in RT shaders")
+
 #define DRI_CONF_RADV_APP_LAYER() DRI_CONF_OPT_S_NODEF(radv_app_layer, "Select an application layer.")
 
 /**