From f423d91790a2341c14909a63e7083ac9b51076db Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 11 Sep 2023 16:53:55 +1000 Subject: [PATCH] spirv: use a pointer sized int type for opencl event_t llvm16 + opaque pointers uses a ptr to event for the opaque type, llvm 17 fixes this properly, but the fix doesn't look too backportable. Cc: mesa-stable Reviewed-by: Karol Herbst Reviewed-by: Jesse Natalie Part-of: --- src/compiler/spirv/spirv_to_nir.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index ef4d73b88ce..0376bc2d324 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -1932,7 +1932,11 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode, case SpvOpTypeEvent: val->type->base_type = vtn_base_type_event; - val->type->type = glsl_int_type(); + /* + * this makes the event type compatible with pointer size due to LLVM 16. + * llvm 17 fixes this properly, but with 16 and opaque ptrs it's still wrong. + */ + val->type->type = b->shader->info.cs.ptr_size == 64 ? glsl_int64_t_type() : glsl_int_type(); break; case SpvOpTypeDeviceEvent: