Module: Mesa
Branch: main
Commit: 4f217e9670be51d7bb88d9ba859cb4af5eb622ee
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f217e9670be51d7bb88d9ba859cb4af5eb622ee

Author: Faith Ekstrand <[email protected]>
Date:   Mon Aug  7 10:46:26 2023 -0500

nvk: Remove plane sources from tex instructions

The plane source is entirely handled by lower_tex() so there's no need
to keep it around.  Codegen currently just ignores these but NAK will
assert if it sees an unknown source type.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24549>

---

 src/nouveau/vulkan/nvk_nir_lower_descriptors.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/nouveau/vulkan/nvk_nir_lower_descriptors.c 
b/src/nouveau/vulkan/nvk_nir_lower_descriptors.c
index 3155b262758..7ba83f2d36a 100644
--- a/src/nouveau/vulkan/nvk_nir_lower_descriptors.c
+++ b/src/nouveau/vulkan/nvk_nir_lower_descriptors.c
@@ -360,12 +360,10 @@ lower_tex(nir_builder *b, nir_tex_instr *tex,
                               nir_src_as_deref(tex->src[sampler_src_idx].src);
    assert(texture);
 
-   const int plane_src_idx =
-      nir_tex_instr_src_index(tex, nir_tex_src_plane);
-
-   uint32_t plane = (plane_src_idx < 0) ? 0 : 
-      nir_src_as_uint(tex->src[plane_src_idx].src);
-   uint64_t plane_offset_B = plane * sizeof(struct nvk_image_descriptor);
+   nir_ssa_def *plane_ssa = nir_steal_tex_src(tex, nir_tex_src_plane);
+   const uint32_t plane =
+      plane_ssa ? nir_src_as_uint(nir_src_for_ssa(plane_ssa)) : 0;
+   const uint64_t plane_offset_B = plane * sizeof(struct nvk_image_descriptor);
 
    nir_ssa_def *combined_handle;
    if (texture == sampler) {

Reply via email to