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);