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 <konstantin.seurer@gmail.com> Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30358>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user