isl: Drop compile time "use separate stencil" checks.

This code is a lot of mess for no real benefit.  It's existed since
the dawn of isl, and serves to let you optimize out a single check
in release builds for Ironlake and Sandybridge systems.  All other
uses are for asserts, which already get compiled out in release mode.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33764>
This commit is contained in:
Kenneth Graunke
2025-02-24 18:42:49 -08:00
parent 26418817a7
commit 59c9bfa8f3
5 changed files with 6 additions and 19 deletions
+3 -4
View File
@@ -330,13 +330,12 @@ isl_device_init(struct isl_device *dev,
* properties chosen during runtime.
*/
ISL_GFX_VER_SANITIZE(dev);
ISL_DEV_USE_SEPARATE_STENCIL_SANITIZE(dev);
/* Did we break hiz or stencil? */
if (ISL_DEV_USE_SEPARATE_STENCIL(dev))
if (dev->use_separate_stencil)
assert(info->has_hiz_and_separate_stencil);
if (info->must_use_separate_stencil)
assert(ISL_DEV_USE_SEPARATE_STENCIL(dev));
assert(dev->use_separate_stencil);
dev->ss.size = RENDER_SURFACE_STATE_length(info) * 4;
dev->ss.align = isl_align(dev->ss.size, 32);
@@ -1846,7 +1845,7 @@ isl_choose_array_pitch_span(const struct isl_device *dev,
return ISL_ARRAY_PITCH_SPAN_FULL;
} else if ((ISL_GFX_VER(dev) == 5 || ISL_GFX_VER(dev) == 6) &&
ISL_DEV_USE_SEPARATE_STENCIL(dev) &&
dev->use_separate_stencil &&
isl_surf_usage_is_stencil(info->usage)) {
/* [ILK-SNB] Errata from the Sandy Bridge PRM >> Volume 4 Part 1:
* Graphics Core >> Section 7.18.3.7: Surface Arrays:
-12
View File
@@ -87,18 +87,6 @@ struct intel_device_info;
#define ISL_DEV_IS_BAYTRAIL(__dev) ((__dev)->info->platform == INTEL_PLATFORM_BYT)
#endif
#ifndef ISL_DEV_USE_SEPARATE_STENCIL
/**
* You can define this as a compile-time constant in the CFLAGS. For example,
* ``gcc -DISL_DEV_USE_SEPARATE_STENCIL(dev)=1 ...``.
*/
#define ISL_DEV_USE_SEPARATE_STENCIL(__dev) ((__dev)->use_separate_stencil)
#define ISL_DEV_USE_SEPARATE_STENCIL_SANITIZE(__dev)
#else
#define ISL_DEV_USE_SEPARATE_STENCIL_SANITIZE(__dev) \
(assert(ISL_DEV_USE_SEPARATE_STENCIL(__dev) == (__dev)->use_separate_stencil))
#endif
/**
* Hardware enumeration SURFACE_FORMAT.
*
+1 -1
View File
@@ -212,7 +212,7 @@ isl_genX(emit_depth_stencil_hiz_s)(const struct isl_device *dev, void *batch,
const bool separate_stencil =
info->stencil_surf && info->stencil_surf->format == ISL_FORMAT_R8_UINT;
if (separate_stencil || info->hiz_usage == ISL_AUX_USAGE_HIZ) {
assert(ISL_DEV_USE_SEPARATE_STENCIL(dev));
assert(dev->use_separate_stencil);
/* From the IronLake PRM, Vol 2 Part 1:
*
* 3DSTATE_DEPTH_BUFFER::Separate Stencil Buffer Enable
+1 -1
View File
@@ -48,7 +48,7 @@ isl_gfx4_filter_tiling(const struct isl_device *dev,
*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));
assert(!dev->use_separate_stencil);
/* From the g35 PRM Vol. 2, 3DSTATE_DEPTH_BUFFER::Tile Walk:
*
+1 -1
View File
@@ -194,7 +194,7 @@ isl_gfx6_filter_tiling(const struct isl_device *dev,
isl_tiling_flags_t *flags)
{
/* IVB+ requires separate stencil */
assert(ISL_DEV_USE_SEPARATE_STENCIL(dev));
assert(dev->use_separate_stencil);
/* Clear flags unsupported on this hardware */
assert(ISL_GFX_VERX10(dev) < 125);