nir/opt_preamble: add sampler class

AGX will use.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36127>
This commit is contained in:
Alyssa Rosenzweig 2025-07-14 19:10:21 -04:00 committed by Marge Bot
parent f146a3a13a
commit 58cc66238a
2 changed files with 8 additions and 2 deletions

View file

@ -231,6 +231,7 @@ typedef enum {
typedef enum {
nir_preamble_class_general,
nir_preamble_class_image,
nir_preamble_class_sampler,
nir_preamble_num_classes,
} nir_preamble_class;

View file

@ -1709,8 +1709,13 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
case NIR_INTRINSIC_PREAMBLE_CLASS: {
/* "General" handled above */
nir_preamble_class cls = nir_intrinsic_preamble_class(instr);
assert(cls == nir_preamble_class_image);
fprintf(fp, "class=image");
if (cls == nir_preamble_class_image)
fprintf(fp, "class=image");
else if (cls == nir_preamble_class_sampler)
fprintf(fp, "class=sampler");
else
unreachable("invalid class");
break;
}