intel/compiler: drop unused ray-tracing fields from cache hash

The compiler only references `intel_device_info->subslice_masks` for
ray tracing workloads.  Platforms which lack raytracing support can
share a cache even if they differ on this field.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28311>
This commit is contained in:
Mark Janes
2024-03-20 17:00:00 -07:00
committed by Marge Bot
parent 9a72116367
commit 4acea392af
2 changed files with 10 additions and 1 deletions

View File

@@ -47,7 +47,12 @@ void
brw_device_sha1_update(struct mesa_sha1 *ctx,
const struct intel_device_info *devinfo) {
% for member in compiler_fields:
% if member.ray_tracing_field:
if (devinfo->has_ray_tracing)
SHA_UPDATE_FIELD(${member.name});
% else:
SHA_UPDATE_FIELD(${member.name});
% endif
% endfor
}

View File

@@ -65,13 +65,16 @@ class Enum:
class Member:
"""Stores details needed to declare and serialize the member of a struct."""
def __init__(self, member_type, name, array=None, compiler_field=False, comment=None):
def __init__(self, member_type, name, array=None,
compiler_field=False, ray_tracing_field=False,
comment=None):
self.member_type = member_type
self.name = name
self.array = array
# indicates whether this field is used by the compiler, and whether it
# should be included in the shader compiler cache hash function.
self.compiler_field = compiler_field
self.ray_tracing_field = ray_tracing_field
self.comment=comment
class Struct:
@@ -362,6 +365,7 @@ Struct("intel_device_info",
Member("uint8_t", "subslice_masks",
array="INTEL_DEVICE_MAX_SLICES * DIV_ROUND_UP(INTEL_DEVICE_MAX_SUBSLICES, 8)",
compiler_field=True,
ray_tracing_field=True,
comment=dedent("""\
An array of bit mask of the subslices available, use subslice_slice_stride
to access this array.""")),