mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 09:00:10 +01:00
radv: add new drirc option radv_enable_mrt_output_nan_fixup
To replace NaN from FS with zeros to fix game bugs. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5359>
This commit is contained in:
parent
b33f811068
commit
6f21995f98
5 changed files with 17 additions and 0 deletions
|
|
@ -590,6 +590,10 @@ radv_handle_per_app_options(struct radv_instance *instance,
|
|||
instance->debug_flags |= RADV_DEBUG_ZERO_VRAM;
|
||||
}
|
||||
}
|
||||
|
||||
instance->enable_mrt_output_nan_fixup =
|
||||
driQueryOptionb(&instance->dri_options,
|
||||
"radv_enable_mrt_output_nan_fixup");
|
||||
}
|
||||
|
||||
static const char radv_dri_options_xml[] =
|
||||
|
|
@ -599,6 +603,7 @@ DRI_CONF_BEGIN
|
|||
DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
|
||||
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT("false")
|
||||
DRI_CONF_RADV_REPORT_LLVM9_VERSION_STRING("false")
|
||||
DRI_CONF_RADV_ENABLE_MRT_OUTPUT_NAN_FIXUP("false")
|
||||
DRI_CONF_SECTION_END
|
||||
|
||||
DRI_CONF_SECTION_DEBUG
|
||||
|
|
|
|||
|
|
@ -354,6 +354,11 @@ struct radv_instance {
|
|||
|
||||
struct driOptionCache dri_options;
|
||||
struct driOptionCache available_dri_options;
|
||||
|
||||
/**
|
||||
* Workarounds for game bugs.
|
||||
*/
|
||||
bool enable_mrt_output_nan_fixup;
|
||||
};
|
||||
|
||||
static inline
|
||||
|
|
|
|||
|
|
@ -1116,6 +1116,7 @@ shader_variant_compile(struct radv_device *device,
|
|||
options->address32_hi = device->physical_device->rad_info.address32_hi;
|
||||
options->has_ls_vgpr_init_bug = device->physical_device->rad_info.has_ls_vgpr_init_bug;
|
||||
options->use_ngg_streamout = device->physical_device->use_ngg_streamout;
|
||||
options->enable_mrt_output_nan_fixup = device->instance->enable_mrt_output_nan_fixup;
|
||||
|
||||
struct radv_shader_args args = {};
|
||||
args.options = options;
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ struct radv_nir_compiler_options {
|
|||
bool check_ir;
|
||||
bool has_ls_vgpr_init_bug;
|
||||
bool use_ngg_streamout;
|
||||
bool enable_mrt_output_nan_fixup;
|
||||
enum radeon_family family;
|
||||
enum chip_class chip_class;
|
||||
uint32_t tess_offchip_block_dw_size;
|
||||
|
|
|
|||
|
|
@ -430,3 +430,8 @@ DRI_CONF_OPT_END
|
|||
DRI_CONF_OPT_BEGIN_B(radv_report_llvm9_version_string, def) \
|
||||
DRI_CONF_DESC(en,gettext("Report LLVM 9.0.1 for games that apply shader workarounds if missing (for ACO only)")) \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_RADV_ENABLE_MRT_OUTPUT_NAN_FIXUP(def) \
|
||||
DRI_CONF_OPT_BEGIN_B(radv_enable_mrt_output_nan_fixup, def) \
|
||||
DRI_CONF_DESC(en,gettext("Replace NaN outputs from fragment shaders with zeroes for floating point render target")) \
|
||||
DRI_CONF_OPT_END
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue