nir: Rename in-bounds-agx to in-bounds

This will be used by lavapipe for skipping bounds checking when
robustness is disabled.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32963>
This commit is contained in:
Konstantin Seurer 2024-12-14 11:20:44 +01:00 committed by Marge Bot
parent 92083fc70d
commit 7905029629
6 changed files with 8 additions and 10 deletions

View file

@ -572,7 +572,7 @@ lower_1d_image(nir_builder *b, nir_intrinsic_instr *intr)
static bool
lower_image_load_robustness(nir_builder *b, nir_intrinsic_instr *intr)
{
if (nir_intrinsic_access(intr) & ACCESS_IN_BOUNDS_AGX)
if (nir_intrinsic_access(intr) & ACCESS_IN_BOUNDS)
return false;
/* We only need to worry about array-like loads */

View file

@ -259,7 +259,7 @@ load_memory(nir_builder *b, unsigned bindless_base, unsigned nr_samples,
return nir_bindless_image_load(
b, comps, bit_size, image, coords, sample, lod, .image_dim = dim,
.image_array = true, .format = format, .access = ACCESS_IN_BOUNDS_AGX);
.image_array = true, .format = format, .access = ACCESS_IN_BOUNDS);
}
static nir_def *

View file

@ -107,12 +107,12 @@ libagx_decompress(constant struct libagx_decompress_images *images,
if (samples == 1) {
texels[i] = nir_bindless_image_load(
HANDLE(compressed), c_sa, 0, 0, GLSL_SAMPLER_DIM_2D, true, 0,
ACCESS_IN_BOUNDS_AGX, nir_type_uint32);
ACCESS_IN_BOUNDS, nir_type_uint32);
} else {
int4 dec_px = decompose_px(c_sa, samples);
texels[i] = nir_bindless_image_load(
HANDLE(compressed), dec_px, sample_id(c_sa, samples), 0,
GLSL_SAMPLER_DIM_MS, true, 0, ACCESS_IN_BOUNDS_AGX,
GLSL_SAMPLER_DIM_MS, true, 0, ACCESS_IN_BOUNDS,
nir_type_uint32);
}
}

View file

@ -818,7 +818,7 @@ print_access(enum gl_access_qualifier access, print_state *state, const char *se
{ ACCESS_FMASK_LOWERED_AMD, "fmask-lowered-amd" },
{ ACCESS_CAN_SPECULATE, "speculatable" },
{ ACCESS_CP_GE_COHERENT_AMD, "cp-ge-coherent-amd" },
{ ACCESS_IN_BOUNDS_AGX, "in-bounds-agx" },
{ ACCESS_IN_BOUNDS, "in-bounds" },
{ ACCESS_KEEP_SCALAR, "keep-scalar" },
{ ACCESS_SMEM_AMD, "smem-amd" },
};

View file

@ -1142,10 +1142,8 @@ enum gl_access_qualifier
*/
ACCESS_CP_GE_COHERENT_AMD = (1 << 13),
/* Guarantee that an image_load is in bounds so we can skip robustness code
* on AGX, used for some internal shaders.
*/
ACCESS_IN_BOUNDS_AGX = (1 << 14),
/* Guarantee that an image_load is in bounds so we can skip robustness code. */
ACCESS_IN_BOUNDS = (1 << 14),
/**
* Disallow vectorization.

View file

@ -145,7 +145,7 @@ asahi_blit_compute_shader(struct pipe_context *ctx, struct asahi_blit_key *key)
colour1 = nir_image_load(
b, 4, 32, nir_imm_int(b, 0), nir_pad_vec4(b, image_pos_nd), zero, zero,
.image_array = key->array, .image_dim = GLSL_SAMPLER_DIM_2D,
.access = ACCESS_IN_BOUNDS_AGX, .dest_type = nir_type_uint32);
.access = ACCESS_IN_BOUNDS, .dest_type = nir_type_uint32);
}
nir_pop_if(b, NULL);
nir_def *color = nir_if_phi(b, colour0, colour1);