From 4f217e9670be51d7bb88d9ba859cb4af5eb622ee Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 7 Aug 2023 10:46:26 -0500 Subject: [PATCH] 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: --- 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) {