Commit 4c4927f3 authored by Sagar Ghuge's avatar Sagar Ghuge
Browse files

anv: Enable R11G11B10_FLOAT CCS_E compression via driconf for DXVK title


Signed-off-by: Sagar Ghuge's avatarSagar Ghuge <sagar.ghuge@intel.com>
parent 5976305c
Pipeline #202111 waiting for manual action with stages
......@@ -121,7 +121,7 @@ modifier_is_supported(const struct gen_device_info *devinfo,
ISL_SURF_USAGE_RENDER_TARGET_BIT).fmt;
if (rt_format == ISL_FORMAT_UNSUPPORTED ||
!isl_format_supports_ccs_e(devinfo, rt_format))
!isl_format_supports_ccs_e(devinfo, rt_format, false))
return false;
break;
}
......@@ -466,7 +466,7 @@ static bool
want_ccs_e_for_format(const struct gen_device_info *devinfo,
enum isl_format format)
{
if (!isl_format_supports_ccs_e(devinfo, format))
if (!isl_format_supports_ccs_e(devinfo, format, false))
return false;
const struct isl_format_layout *fmtl = isl_format_get_layout(format);
......
......@@ -1390,7 +1390,7 @@ isl_calc_row_pitch_alignment(const struct isl_device *dev,
* matches CCS expectations.
*/
if (ISL_DEV_GEN(dev) >= 12 &&
isl_format_supports_ccs_e(dev->info, surf_info->format) &&
isl_format_supports_ccs_e(dev->info, surf_info->format, false) &&
tile_info->tiling != ISL_TILING_X &&
!(surf_info->usage & ISL_SURF_USAGE_DISABLE_AUX_BIT) &&
surf_info->row_pitch_B == 0) {
......
......@@ -1555,7 +1555,8 @@ bool isl_format_supports_typed_reads(const struct gen_device_info *devinfo,
bool isl_format_supports_ccs_d(const struct gen_device_info *devinfo,
enum isl_format format);
bool isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
enum isl_format format);
enum isl_format format,
bool enable_r11g11b10_ccs_e);
bool isl_format_supports_multisampling(const struct gen_device_info *devinfo,
enum isl_format format);
......
......@@ -854,7 +854,8 @@ isl_format_supports_ccs_d(const struct gen_device_info *devinfo,
*/
bool
isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
enum isl_format format)
enum isl_format format,
bool enable_r11g11b10_ccs_e)
{
if (!format_info_exists(format))
return false;
......@@ -865,7 +866,7 @@ isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
* there is no way to copy to/from it which doesn't potentially loose data
* if one of the bit patterns being copied isn't valid finite floats.
*/
if (format == ISL_FORMAT_R11G11B10_FLOAT)
if (format == ISL_FORMAT_R11G11B10_FLOAT && !enable_r11g11b10_ccs_e)
return false;
return format_gen(devinfo) >= format_info[format].ccs_e;
......@@ -924,8 +925,8 @@ isl_formats_are_ccs_e_compatible(const struct gen_device_info *devinfo,
enum isl_format format2)
{
/* They must support CCS_E */
if (!isl_format_supports_ccs_e(devinfo, format1) ||
!isl_format_supports_ccs_e(devinfo, format2))
if (!isl_format_supports_ccs_e(devinfo, format1, false) ||
!isl_format_supports_ccs_e(devinfo, format2, false))
return false;
/* Gen12 added CCS_E support for A8_UNORM, A8_UNORM and R8_UNORM share the
......
......@@ -55,6 +55,7 @@ DRI_CONF_BEGIN
DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT("false")
DRI_CONF_DISABLE_D16UNORM_COMPRESSION("false")
DRI_CONF_ENABLE_R11G11B10_CCS_E("false")
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
......@@ -319,6 +320,8 @@ anv_parse_dri_options(struct anv_physical_device *device)
device->disable_d16unorm_compression =
driQueryOptionb(&instance->dri_options,
"disable_d16unorm_compression");
device->enable_r11g11b10_ccs_e =
driQueryOptionb(&instance->dri_options, "enable_r11g11b10_ccs_e");
}
static VkResult
......
......@@ -755,7 +755,8 @@ get_wsi_format_modifier_properties_list(const struct anv_physical_device *physic
if (mod_info->aux_usage == ISL_AUX_USAGE_CCS_E &&
!isl_format_supports_ccs_e(&physical_device->info,
anv_format->planes[0].isl_format))
anv_format->planes[0].isl_format,
physical_device->enable_r11g11b10_ccs_e))
continue;
/* Gen12's CCS layout changes compared to Gen9-11. */
......
......@@ -214,7 +214,8 @@ anv_formats_ccs_e_compatible(struct anv_physical_device *physical,
anv_get_isl_format(devinfo, vk_format,
VK_IMAGE_ASPECT_COLOR_BIT, vk_tiling);
if (!isl_format_supports_ccs_e(devinfo, format))
if (!isl_format_supports_ccs_e(devinfo, format,
physical->enable_r11g11b10_ccs_e))
return false;
if (!(create_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT))
......
......@@ -1117,6 +1117,7 @@ struct anv_physical_device {
bool always_flush_cache;
bool disable_d16unorm_compression;
bool enable_r11g11b10_ccs_e;
struct anv_device_extension_table supported_extensions;
......
......@@ -100,7 +100,7 @@ format_supports_ccs_e(const struct brw_context *brw, mesa_format format)
*/
mesa_format linear_format = _mesa_get_srgb_format_linear(format);
enum isl_format isl_format = brw_isl_format_for_mesa_format(linear_format);
return isl_format_supports_ccs_e(&brw->screen->devinfo, isl_format);
return isl_format_supports_ccs_e(&brw->screen->devinfo, isl_format, false);
}
/**
......
......@@ -383,7 +383,8 @@ modifier_is_supported(const struct gen_device_info *devinfo,
format = _mesa_format_fallback_rgbx_to_rgba(format);
format = _mesa_get_srgb_format_linear(format);
if (!isl_format_supports_ccs_e(devinfo,
brw_isl_format_for_mesa_format(format)))
brw_isl_format_for_mesa_format(format),
false))
return false;
}
......
......@@ -724,6 +724,9 @@ TODO: document the other workarounds.
<application name="Fallout 4" executable="Fallout4.exe">
<option name="disable_d16unorm_compression" value="true" />
</application>
<engine engine_name_match="DXVK.*" engine_versions="0:1.7.1">
<option name="enable_r11g11b10_ccs_e" value="true" />
</engine>
</device>
<device driver="radv">
<application name="Shadow Of The Tomb Raider" executable="ShadowOfTheTombRaider">
......
......@@ -532,3 +532,8 @@ DRI_CONF_OPT_END
DRI_CONF_OPT_BEGIN_B(disable_d16unorm_compression, def) \
DRI_CONF_DESC("Disable HIZ_CCS_WT compression for D16_UNORM surface format") \
DRI_CONF_OPT_END
#define DRI_CONF_ENABLE_R11G11B10_CCS_E(def) \
DRI_CONF_OPT_BEGIN_B(enable_r11g11b10_ccs_e, def) \
DRI_CONF_DESC("Enable CCS_E support for R11G11B10_FLOAT surfaces)") \
DRI_CONF_OPT_END
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