gallivm: Cast read_first_invocation source to an int

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23515>
(cherry picked from commit c3c9e28131)
This commit is contained in:
Konstantin Seurer 2023-06-07 22:23:52 +02:00 committed by Eric Engestrom
parent 835fa3d9f8
commit 777f883c36
2 changed files with 6 additions and 5 deletions

View File

@ -112,7 +112,7 @@
"description": "gallivm: Cast read_first_invocation source to an int",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@ -2211,12 +2211,13 @@ visit_intrinsic(struct lp_build_nir_context *bld_base,
#endif
case nir_intrinsic_read_invocation:
case nir_intrinsic_read_first_invocation: {
LLVMValueRef src1 = NULL;
LLVMValueRef src0 = get_src(bld_base, instr->src[0]);
if (instr->intrinsic == nir_intrinsic_read_invocation) {
src0 = cast_type(bld_base, src0, nir_type_int, nir_src_bit_size(instr->src[0]));
LLVMValueRef src1 = NULL;
if (instr->intrinsic == nir_intrinsic_read_invocation)
src1 = cast_type(bld_base, get_src(bld_base, instr->src[1]), nir_type_int, 32);
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;
}