diff --git a/.pick_status.json b/.pick_status.json index 929d517782d8..d4fcf66d2811 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -474,7 +474,7 @@ "description": "radv: add radv_lower_terminate_to_discard and enable for Indiana Jones", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_instance.c b/src/amd/vulkan/radv_instance.c index 0e05a7f4a74f..7843558d8c25 100644 --- a/src/amd/vulkan/radv_instance.c +++ b/src/amd/vulkan/radv_instance.c @@ -168,6 +168,7 @@ static const driOptionDescription radv_dri_options[] = { DRI_CONF_RADV_OVERRIDE_COMPUTE_SHADER_VERSION(0) DRI_CONF_RADV_OVERRIDE_RAY_TRACING_SHADER_VERSION(0) DRI_CONF_RADV_SSBO_NON_UNIFORM(false) + DRI_CONF_RADV_LOWER_TERMINATE_TO_DISCARD(false) DRI_CONF_RADV_APP_LAYER() DRI_CONF_SECTION_END }; @@ -262,6 +263,9 @@ radv_init_dri_options(struct radv_instance *instance) instance->drirc.disable_dcc_mips = driQueryOptionb(&instance->drirc.options, "radv_disable_dcc_mips"); instance->drirc.disable_dcc_stores = driQueryOptionb(&instance->drirc.options, "radv_disable_dcc_stores"); + + instance->drirc.lower_terminate_to_discard = + driQueryOptionb(&instance->drirc.options, "radv_lower_terminate_to_discard"); } static const struct vk_instance_extension_table radv_instance_extensions_supported = { diff --git a/src/amd/vulkan/radv_instance.h b/src/amd/vulkan/radv_instance.h index 57d6bdc5a48b..e0a06a58951a 100644 --- a/src/amd/vulkan/radv_instance.h +++ b/src/amd/vulkan/radv_instance.h @@ -73,6 +73,7 @@ struct radv_instance { bool vk_require_astc; bool disable_dcc_mips; bool disable_dcc_stores; + bool lower_terminate_to_discard; char *app_layer; uint8_t override_graphics_shader_version; uint8_t override_compute_shader_version; diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index 1a5d39bab3a0..2281541235bc 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -206,6 +206,7 @@ radv_physical_device_init_cache_key(struct radv_physical_device *pdev) key->split_fma = !!(instance->debug_flags & RADV_DEBUG_SPLIT_FMA); key->ssbo_non_uniform = instance->drirc.ssbo_non_uniform; key->tex_non_uniform = instance->drirc.tex_non_uniform; + key->lower_terminate_to_discard = instance->drirc.lower_terminate_to_discard; key->use_llvm = pdev->use_llvm; key->use_ngg = pdev->use_ngg; key->use_ngg_culling = pdev->use_ngg_culling; diff --git a/src/amd/vulkan/radv_physical_device.h b/src/amd/vulkan/radv_physical_device.h index e2abb5feb82e..9918a2b77e52 100644 --- a/src/amd/vulkan/radv_physical_device.h +++ b/src/amd/vulkan/radv_physical_device.h @@ -62,6 +62,7 @@ struct radv_physical_device_cache_key { uint32_t split_fma : 1; uint32_t ssbo_non_uniform : 1; uint32_t tex_non_uniform : 1; + uint32_t lower_terminate_to_discard : 1; uint32_t use_llvm : 1; uint32_t use_ngg : 1; uint32_t use_ngg_culling : 1; diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 8aa265619e5e..3fb78f626021 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -365,6 +365,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st }, .force_tex_non_uniform = pdev->cache_key.tex_non_uniform, .force_ssbo_non_uniform = pdev->cache_key.ssbo_non_uniform, + .lower_terminate_to_discard = pdev->cache_key.lower_terminate_to_discard, }; nir = spirv_to_nir(spirv, stage->spirv.size / 4, spec_entries, num_spec_entries, stage->stage, stage->entrypoint, &spirv_options, &pdev->nir_options[stage->stage]); diff --git a/src/util/00-radv-defaults.conf b/src/util/00-radv-defaults.conf index 489cea72c213..64af23a5408a 100644 --- a/src/util/00-radv-defaults.conf +++ b/src/util/00-radv-defaults.conf @@ -111,6 +111,7 @@ Application bugs worked around in this file: