From 7371803f14569e54c1d918d1937bc70d30b844e4 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 9 Sep 2022 16:59:56 -0400 Subject: [PATCH] nir: Add nir_intrinsic_texture_base_agx sysval For non-bindless textures, get the base address of the texture descriptor array, so we can crawl descriptors in the shader. For bindless, this isn't needed (since the bindless handle will be the address itself). jekstrand suggested the idea of the descriptor crawl. It worked out pretty well, all considered. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_intrinsics.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 303262137fa..0b830ccc466 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -1449,6 +1449,10 @@ intrinsic("load_fb_layers_v3d", dest_comp=1, flags=[CAN_ELIMINATE, CAN_REORDER]) # Logical complement of load_front_face, mapping to an AGX system value system_value("back_face_agx", 1, bit_sizes=[1, 32]) +# Loads the texture descriptor base for indexed (non-bindless) textures. On G13, +# the referenced array has stride 24. +system_value("texture_base_agx", 1, bit_sizes=[64]) + # Intel-specific query for loading from the brw_image_param struct passed # into the shader as a uniform. The variable is a deref to the image # variable. The const index specifies which of the six parameters to load.