isl: select a tiling for shader detiling
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32676>
This commit is contained in:
committed by
Marge Bot
parent
8e1cad8d8f
commit
ba03e6734c
@@ -426,6 +426,19 @@ isl_device_init(struct isl_device *dev,
|
||||
dev->emit_depth_stencil_hiz_s = isl_emit_depth_stencil_hiz_s_get_func(dev);
|
||||
dev->null_fill_state_s = isl_null_fill_state_s_get_func(dev);
|
||||
dev->emit_cpb_control_s = isl_emit_cpb_control_s_get_func(dev);
|
||||
|
||||
isl_tiling_flags_t supported_tilings = isl_device_get_supported_tilings(dev);
|
||||
#define CHOOSE(__tiling) \
|
||||
if ((1u << __tiling) & supported_tilings) { \
|
||||
dev->shader_tiling = __tiling; \
|
||||
break; \
|
||||
}
|
||||
do {
|
||||
CHOOSE(ISL_TILING_4);
|
||||
CHOOSE(ISL_TILING_Y0);
|
||||
unreachable("Cannot find shader tiling");
|
||||
} while (0);
|
||||
#undef CHOOSE
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1291,6 +1291,13 @@ struct isl_device {
|
||||
bool use_separate_stencil;
|
||||
bool has_bit6_swizzling;
|
||||
|
||||
/**
|
||||
* Tiling use for software detiling in shaders
|
||||
*
|
||||
* Used to implement image 64bits atomic
|
||||
*/
|
||||
enum isl_tiling shader_tiling;
|
||||
|
||||
/**
|
||||
* Describes the layout of a RENDER_SURFACE_STATE structure for the
|
||||
* current gen.
|
||||
|
||||
@@ -46,6 +46,9 @@ isl_gfx125_filter_tiling(const struct isl_device *dev,
|
||||
|
||||
*flags &= isl_device_get_supported_tilings(dev);
|
||||
|
||||
if (info->usage & ISL_SURF_USAGE_SOFTWARE_DETILING)
|
||||
*flags &= (1 << dev->shader_tiling) | ISL_TILING_LINEAR_BIT;
|
||||
|
||||
if (isl_surf_usage_is_depth_or_stencil(info->usage)) {
|
||||
*flags &= ISL_TILING_4_BIT | ISL_TILING_64_BIT;
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ isl_gfx20_filter_tiling(const struct isl_device *dev,
|
||||
|
||||
*flags &= isl_device_get_supported_tilings(dev);
|
||||
|
||||
if (info->usage & ISL_SURF_USAGE_SOFTWARE_DETILING)
|
||||
*flags &= (1 << dev->shader_tiling) | ISL_TILING_LINEAR_BIT;
|
||||
|
||||
if (isl_surf_usage_is_depth_or_stencil(info->usage)) {
|
||||
*flags &= ISL_TILING_4_BIT | ISL_TILING_64_XE2_BIT;
|
||||
|
||||
|
||||
@@ -42,7 +42,10 @@ isl_gfx4_filter_tiling(const struct isl_device *dev,
|
||||
const struct isl_surf_init_info *restrict info,
|
||||
isl_tiling_flags_t *flags)
|
||||
{
|
||||
*flags &= isl_device_get_supported_tilings(dev);;
|
||||
*flags &= isl_device_get_supported_tilings(dev);
|
||||
|
||||
if (info->usage & ISL_SURF_USAGE_SOFTWARE_DETILING)
|
||||
*flags &= (1 << dev->shader_tiling) | ISL_TILING_LINEAR_BIT;
|
||||
|
||||
if (isl_surf_usage_is_depth_or_stencil(info->usage)) {
|
||||
assert(!ISL_DEV_USE_SEPARATE_STENCIL(dev));
|
||||
|
||||
@@ -201,6 +201,9 @@ isl_gfx6_filter_tiling(const struct isl_device *dev,
|
||||
|
||||
*flags &= isl_device_get_supported_tilings(dev);
|
||||
|
||||
if (info->usage & ISL_SURF_USAGE_SOFTWARE_DETILING)
|
||||
*flags &= (1 << dev->shader_tiling) | ISL_TILING_LINEAR_BIT;
|
||||
|
||||
/* TODO: Investigate Yf failures (~5000 VK CTS failures at the time of this
|
||||
* writing).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user