summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-06-19 17:00:46 +1000
committerDave Airlie <airlied@redhat.com>2020-08-19 10:16:40 +1000
commit3cc5b75577d3e9817887c35496ceff36ee47146a (patch)
treed57ae4c94c5836305f1160ee6adaf7554c2cc6e1
parente616223024d05c86df104368b558ffa612fdec7c (diff)
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 <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6339>
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_nir.c16
1 files 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;