gallivm: fix casting around read invocation.

Fixes zink KHR-GL46.shader_ballot_tests.ShaderBallotAvailability

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17588>
This commit is contained in:
Dave Airlie 2022-07-18 13:58:38 +10:00 committed by Marge Bot
parent ce65e0428a
commit a2cd47acdb

View File

@ -2184,10 +2184,12 @@ visit_intrinsic(struct lp_build_nir_context *bld_base,
case nir_intrinsic_read_invocation:
case nir_intrinsic_read_first_invocation: {
LLVMValueRef src1 = NULL;
if (instr->intrinsic == nir_intrinsic_read_invocation)
LLVMValueRef src0 = get_src(bld_base, instr->src[0]);
if (instr->intrinsic == nir_intrinsic_read_invocation) {
src1 = cast_type(bld_base, get_src(bld_base, instr->src[1]), nir_type_int, 32);
bld_base->read_invocation(bld_base, get_src(bld_base, instr->src[0]), nir_src_bit_size(instr->src[0]), src1, result);
src0 = cast_type(bld_base, src0, nir_type_int, nir_src_bit_size(instr->src[0]));
}
bld_base->read_invocation(bld_base, src0, nir_src_bit_size(instr->src[0]), src1, result);
break;
}
case nir_intrinsic_interp_deref_at_offset: