From c04b36de39b808bcffe0934844080e15d55fe86a Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Sun, 11 Apr 2021 14:09:58 -0700 Subject: [PATCH] vtn: Add a cap for CL drivers to support read-write images This is a required CL2.0, optional CL3.0 feature Reviewed-by: Jason Ekstrand Reviewed-by: Karol Herbst Part-of: --- src/compiler/shader_info.h | 1 + src/compiler/spirv/spirv_to_nir.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index 5208d8b73af..ebc2c43923f 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -67,6 +67,7 @@ struct spirv_supported_capabilities { bool integer_functions2; bool kernel; bool kernel_image; + bool kernel_image_read_write; bool literal_sampler; bool min_lod; bool multiview; diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index aa254f85c64..35b64570814 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -4349,11 +4349,14 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode, spv_check_supported(kernel_image, cap); break; + case SpvCapabilityImageReadWrite: + spv_check_supported(kernel_image_read_write, cap); + break; + case SpvCapabilityLiteralSampler: spv_check_supported(literal_sampler, cap); break; - case SpvCapabilityImageReadWrite: case SpvCapabilityImageMipmap: case SpvCapabilityPipes: case SpvCapabilityDeviceEnqueue: