Commit 15211031 authored by Rhys Perry's avatar Rhys Perry
Browse files

radv: always consider some outputs as invariant



Now that we try to create ffma from the beginning and are less reliant on
inexact optimizations, we can enable this with much less regressions on
GFX10.3.

fossil-db (GFX10.3):
Totals from 53274 (36.42% of 146267) affected shaders:
VGPRs: 1979216 -> 1975944 (-0.17%); split: -0.67%, +0.50%
SpillSGPRs: 1462 -> 1446 (-1.09%)
CodeSize: 77389256 -> 79231200 (+2.38%); split: -0.06%, +2.44%
MaxWaves: 1418040 -> 1419400 (+0.10%); split: +0.34%, -0.24%
Instrs: 15015014 -> 15453979 (+2.92%); split: -0.14%, +3.06%
Latency: 89229974 -> 89562172 (+0.37%); split: -0.76%, +1.13%
InvThroughput: 15488878 -> 15990928 (+3.24%); split: -0.25%, +3.50%

fossil-db (GFX10):
Totals from 12563 (8.59% of 146267) affected shaders:
VGPRs: 532880 -> 532200 (-0.13%); split: -0.42%, +0.29%
SpillSGPRs: 1462 -> 1446 (-1.09%)
CodeSize: 30125368 -> 30275508 (+0.50%); split: -0.06%, +0.56%
MaxWaves: 327120 -> 327484 (+0.11%); split: +0.31%, -0.20%
Instrs: 5783753 -> 5834581 (+0.88%); split: -0.02%, +0.89%
Latency: 29271625 -> 29349407 (+0.27%); split: -0.14%, +0.41%
InvThroughput: 6801730 -> 6855695 (+0.79%); split: -0.04%, +0.83%

fossil-db (GFX9):
Totals from 12563 (8.58% of 146401) affected shaders:
SGPRs: 717840 -> 717888 (+0.01%); split: -0.16%, +0.16%
VGPRs: 531464 -> 531892 (+0.08%); split: -0.23%, +0.31%
SpillSGPRs: 1770 -> 1750 (-1.13%)
CodeSize: 27658752 -> 27814028 (+0.56%); split: -0.05%, +0.61%
MaxWaves: 81149 -> 81224 (+0.09%); split: +0.24%, -0.14%
Instrs: 5489024 -> 5537939 (+0.89%); split: -0.02%, +0.91%
Latency: 43480815 -> 43657720 (+0.41%); split: -0.08%, +0.49%
InvThroughput: 19853380 -> 20017416 (+0.83%); split: -0.04%, +0.87%

Signed-off-by: Rhys Perry's avatarRhys Perry <pendingchaos02@gmail.com>
parent f030b75b
Pipeline #518619 waiting for manual action with stages
......@@ -622,9 +622,6 @@ RADV driver environment variables
Print image info
``info``
show GPU-related information
``invariantgeom``
Mark geometry-affecting outputs as invariant. This works around a common
class of application bugs appearing as flickering.
``metashaders``
dump internal meta shaders
``noatocdithering``
......
......@@ -49,11 +49,9 @@ Application bugs worked around in this file:
<!-- Game workarounds -->
<application name="Shadow Of The Tomb Raider (Native)" application_name_match="ShadowOfTheTomb">
<option name="radv_report_llvm9_version_string" value="true" />
<option name="radv_invariant_geom" value="true" />
</application>
<application name="Shadow Of The Tomb Raider (DX11/DX12)" application_name_match="SOTTR.exe">
<option name="radv_invariant_geom" value="true" />
<option name="radv_split_fma" value="true" />
</application>
......@@ -86,7 +84,6 @@ Application bugs worked around in this file:
<application name="World War Z (and World War Z: Aftermath)" application_name_match="WWZ|wwz">
<option name="radv_override_uniform_offset_alignment" value="16" />
<option name="radv_disable_shrink_image_store" value="true" />
<option name="radv_invariant_geom" value="true" />
</application>
<application name="DOOM VFR" application_name_match="DOOM_VFR">
......@@ -101,10 +98,6 @@ Application bugs worked around in this file:
<option name="radv_lower_discard_to_demote" value="true" />
</application>
<application name="Monster Hunter World" application_name_match="MonsterHunterWorld.exe">
<option name="radv_invariant_geom" value="true" />
</application>
<application name="DOOM (2016)" application_name_match="DOOM$">
<option name="radv_disable_dcc" value="true" />
</application>
......@@ -117,10 +110,6 @@ Application bugs worked around in this file:
<option name="radv_report_apu_as_dgpu" value="true" />
</application>
<application name="Resident Evil Village" application_name_match="re8.exe">
<option name="radv_invariant_geom" value="true" />
</application>
<application name="F1 2021" application_name_match="F1_2021_dx12.exe">
<option name="radv_disable_htile_layers" value="true" />
</application>
......
......@@ -57,15 +57,14 @@ enum {
RADV_DEBUG_HANG = 1ull << 26,
RADV_DEBUG_IMG = 1ull << 27,
RADV_DEBUG_NO_UMR = 1ull << 28,
RADV_DEBUG_INVARIANT_GEOM = 1ull << 29,
RADV_DEBUG_NO_DISPLAY_DCC = 1ull << 30,
RADV_DEBUG_NO_TC_COMPAT_CMASK = 1ull << 31,
RADV_DEBUG_NO_VRS_FLAT_SHADING = 1ull << 32,
RADV_DEBUG_NO_ATOC_DITHERING = 1ull << 33,
RADV_DEBUG_NO_NGGC = 1ull << 34,
RADV_DEBUG_DUMP_PROLOGS = 1ull << 35,
RADV_DEBUG_NO_DMA_BLIT = 1ull << 36,
RADV_DEBUG_SPLIT_FMA = 1ull << 37,
RADV_DEBUG_NO_DISPLAY_DCC = 1ull << 29,
RADV_DEBUG_NO_TC_COMPAT_CMASK = 1ull << 30,
RADV_DEBUG_NO_VRS_FLAT_SHADING = 1ull << 31,
RADV_DEBUG_NO_ATOC_DITHERING = 1ull << 32,
RADV_DEBUG_NO_NGGC = 1ull << 33,
RADV_DEBUG_DUMP_PROLOGS = 1ull << 34,
RADV_DEBUG_NO_DMA_BLIT = 1ull << 35,
RADV_DEBUG_SPLIT_FMA = 1ull << 36,
};
enum {
......
......@@ -858,7 +858,6 @@ static const struct debug_control radv_debug_options[] = {
{"hang", RADV_DEBUG_HANG},
{"img", RADV_DEBUG_IMG},
{"noumr", RADV_DEBUG_NO_UMR},
{"invariantgeom", RADV_DEBUG_INVARIANT_GEOM},
{"splitfma", RADV_DEBUG_SPLIT_FMA},
{"nodisplaydcc", RADV_DEBUG_NO_DISPLAY_DCC},
{"notccompatcmask", RADV_DEBUG_NO_TC_COMPAT_CMASK},
......@@ -919,7 +918,6 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(false)
DRI_CONF_RADV_ZERO_VRAM(false)
DRI_CONF_RADV_LOWER_DISCARD_TO_DEMOTE(false)
DRI_CONF_RADV_INVARIANT_GEOM(false)
DRI_CONF_RADV_SPLIT_FMA(false)
DRI_CONF_RADV_DISABLE_TC_COMPAT_HTILE_GENERAL(false)
DRI_CONF_RADV_DISABLE_DCC(false)
......@@ -961,9 +959,6 @@ radv_init_dri_options(struct radv_instance *instance)
if (driQueryOptionb(&instance->dri_options, "radv_lower_discard_to_demote"))
instance->debug_flags |= RADV_DEBUG_DISCARD_TO_DEMOTE;
if (driQueryOptionb(&instance->dri_options, "radv_invariant_geom"))
instance->debug_flags |= RADV_DEBUG_INVARIANT_GEOM;
if (driQueryOptionb(&instance->dri_options, "radv_split_fma"))
instance->debug_flags |= RADV_DEBUG_SPLIT_FMA;
......
......@@ -3000,9 +3000,6 @@ radv_generate_graphics_pipeline_key(const struct radv_pipeline *pipeline,
key.ps.force_vrs_enabled = pipeline->device->force_vrs_enabled;
if (pipeline->device->instance->debug_flags & RADV_DEBUG_INVARIANT_GEOM)
key.invariant_geom = true;
key.use_ngg = pipeline->device->physical_device->use_ngg;
return key;
......
......@@ -701,7 +701,7 @@ radv_shader_compile_to_nir(struct radv_device *device, struct vk_shader_module *
NIR_PASS_V(nir, nir_lower_global_vars_to_local);
NIR_PASS_V(nir, nir_lower_vars_to_ssa);
NIR_PASS_V(nir, nir_propagate_invariant, key->invariant_geom);
NIR_PASS_V(nir, nir_propagate_invariant, true);
NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays);
......
......@@ -58,7 +58,6 @@ enum radv_vs_input_alpha_adjust {
struct radv_pipeline_key {
uint32_t has_multiview_view_index : 1;
uint32_t optimisations_disabled : 1;
uint32_t invariant_geom : 1;
uint32_t use_ngg : 1;
struct {
......
......@@ -544,10 +544,6 @@
DRI_CONF_OPT_B(radv_lower_discard_to_demote, def, \
"Lower discard instructions to demote")
#define DRI_CONF_RADV_INVARIANT_GEOM(def) \
DRI_CONF_OPT_B(radv_invariant_geom, def, \
"Mark geometry-affecting outputs as invariant")
#define DRI_CONF_RADV_SPLIT_FMA(def) \
DRI_CONF_OPT_B(radv_split_fma, def, \
"Split application-provided fused multiply-add in geometry stages")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment