From 5f5cb088a9f5218de3e11ace26f90be7cd397284 Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Thu, 3 Apr 2025 18:25:23 -0400 Subject: [PATCH] nak: Disable cbuf textures on blackwell There are bound texture forms on blackwell, but they don't correspond directly to the cbuf textures we have on sm70. Switch to only bindless for now. Part-of: --- src/nouveau/compiler/nak_nir_lower_tex.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/nouveau/compiler/nak_nir_lower_tex.c b/src/nouveau/compiler/nak_nir_lower_tex.c index 66e84e16aaf..3e1d60a1820 100644 --- a/src/nouveau/compiler/nak_nir_lower_tex.c +++ b/src/nouveau/compiler/nak_nir_lower_tex.c @@ -9,6 +9,12 @@ #include "util/u_math.h" +static bool +has_cbuf_tex(const struct nak_compiler *nak) { + /* TODO: Figure out how bound textures work on blackwell */ + return nak->sm >= 70 && nak->sm < 100; +} + static bool tex_handle_as_cbuf(nir_def *tex_h, uint32_t *cbuf_out) { @@ -73,7 +79,7 @@ lower_tex(nir_builder *b, nir_tex_instr *tex, const struct nak_compiler *nak) } enum nak_nir_tex_ref_type ref_type = NAK_NIR_TEX_REF_TYPE_BINDLESS; - if (nak->sm >= 70 && tex_handle_as_cbuf(tex_h, &tex->texture_index)) { + if (has_cbuf_tex(nak) && tex_handle_as_cbuf(tex_h, &tex->texture_index)) { ref_type = NAK_NIR_TEX_REF_TYPE_CBUF; tex_h = NULL; } @@ -362,7 +368,7 @@ lower_txq(nir_builder *b, nir_tex_instr *tex, const struct nak_compiler *nak) } enum nak_nir_tex_ref_type ref_type = NAK_NIR_TEX_REF_TYPE_BINDLESS; - if (nak->sm >= 70 && tex_handle_as_cbuf(tex_h, &tex->texture_index)) { + if (has_cbuf_tex(nak) && tex_handle_as_cbuf(tex_h, &tex->texture_index)) { ref_type = NAK_NIR_TEX_REF_TYPE_CBUF; tex_h = NULL; } @@ -654,7 +660,7 @@ lower_image_txq(nir_builder *b, nir_intrinsic_instr *intrin, uint32_t texture_index = 0; enum nak_nir_tex_ref_type ref_type = NAK_NIR_TEX_REF_TYPE_BINDLESS; - if (nak->sm >= 70 && tex_handle_as_cbuf(img_h, &texture_index)) { + if (has_cbuf_tex(nak) && tex_handle_as_cbuf(img_h, &texture_index)) { ref_type = NAK_NIR_TEX_REF_TYPE_CBUF; img_h = NULL; }