From 3e01422a16a16028e74bbb11ec9c7bf99a1d81d0 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 25 Jul 2024 07:53:53 +1000 Subject: [PATCH] gallivm/sample: fix sampling indirect from vertex shaders When doing indirect sampling, we just fetch one value per lane, but type.length == 1 caused num_quads to be 0 which caused things to crash. Fixes dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.vertex.sampler2d Cc: mesa-stable Reviewed-by: Konstantin Seurer Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index f31d7ee8b19..1ded3308047 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -3468,7 +3468,7 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, const enum pipe_texture_target target = static_texture_state->target; const unsigned dims = texture_dims(target); - const unsigned num_quads = type.length / 4; + const unsigned num_quads = type.length == 1 ? 1 : type.length / 4; struct lp_build_sample_context bld; struct lp_static_sampler_state derived_sampler_state = *static_sampler_state; LLVMTypeRef i32t = LLVMInt32TypeInContext(gallivm->context);