From 3cc5b75577d3e9817887c35496ceff36ee47146a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 19 Jun 2020 17:00:46 +1000 Subject: [PATCH] gallivm/nir: split tex/sampler indirect offsets vulkan has these separate, should be fine for GL as well as the values will be the same anyways. Fixes: dEQP-VK.binding_model.shader_access.secondary_cmd_buf.uniform_texel_buffer.* dEQP-VK.binding_model.descriptorset_random.sets4.noarray.ubolimitlow.sbolimitlow.sampledimglow.outimgtexlow.noiub.uab.vert.noia* dEQP-VK.binding_model.descriptor_copy.graphics.uniform_texel_buffer.* Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_nir.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index c7a4973f9da..fe5068b1db9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -1775,11 +1775,17 @@ static void visit_tex(struct lp_build_nir_context *bld_base, nir_tex_instr *inst coords[4] = lp_build_mul(&bld_base->base, coords[4], projector); } - uint32_t base_index = 0; - if (!texture_deref_instr) { + uint32_t samp_base_index = 0, tex_base_index = 0; + if (!sampler_deref_instr) { int samp_src_index = nir_tex_instr_src_index(instr, nir_tex_src_sampler_handle); if (samp_src_index == -1) { - base_index = instr->sampler_index; + samp_base_index = instr->sampler_index; + } + } + if (!texture_deref_instr) { + int tex_src_index = nir_tex_instr_src_index(instr, nir_tex_src_texture_handle); + if (tex_src_index == -1) { + tex_base_index = instr->texture_index; } } @@ -1798,9 +1804,9 @@ static void visit_tex(struct lp_build_nir_context *bld_base, nir_tex_instr *inst sample_key |= lod_property << LP_SAMPLER_LOD_PROPERTY_SHIFT; params.sample_key = sample_key; params.offsets = offsets; - params.texture_index = base_index; + params.texture_index = tex_base_index; params.texture_index_offset = texture_unit_offset; - params.sampler_index = base_index; + params.sampler_index = samp_base_index; params.coords = coords; params.texel = texel; params.lod = explicit_lod; -- 2.30.2