From 860b262f4487977fcab0d7efe89187dcaf202ee6 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Fri, 10 May 2024 19:01:48 +0200 Subject: [PATCH] microsoft/clc: fix incorrect changes that got through while the Windows CI was down Fixes: e80d52223e13f02ab9a3 ("microsoft: Use spirv_capabilities for spirv_to_dxil") Part-of: --- src/microsoft/clc/clc_compiler.c | 34 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/microsoft/clc/clc_compiler.c b/src/microsoft/clc/clc_compiler.c index fc9569d4542..6440178f060 100644 --- a/src/microsoft/clc/clc_compiler.c +++ b/src/microsoft/clc/clc_compiler.c @@ -35,6 +35,7 @@ #include "util/u_debug.h" #include #include "spirv/nir_spirv.h" +#include "spirv/spirv_info.h" #include "nir_builder.h" #include "nir_builtin_builder.h" @@ -741,6 +742,22 @@ clc_spirv_to_dxil(struct clc_libclc *lib, return false; } + const struct spirv_capabilities libclc_spirv_caps = { + .Addresses = true, + .Float64 = true, + .Int8 = true, + .Int16 = true, + .Int64 = true, + .Kernel = true, + .ImageBasic = true, + .ImageReadWrite = true, + .LiteralSampler = true, + + // These aren't fully supported, but silence warnings about them from + // code that doesn't really use them. + .Linkage = true, + .GenericPointer = true, + }; const struct spirv_to_nir_options spirv_options = { .environment = NIR_SPIRV_OPENCL, .clc_shader = clc_libclc_get_clc_shader(lib), @@ -750,22 +767,7 @@ clc_spirv_to_dxil(struct clc_libclc *lib, .temp_addr_format = nir_address_format_32bit_offset_as_64bit, .float_controls_execution_mode = FLOAT_CONTROLS_DENORM_FLUSH_TO_ZERO_FP32, .printf = true, - .caps = { - .address = true, - .float64 = true, - .int8 = true, - .int16 = true, - .int64 = true, - .kernel = true, - .kernel_image = true, - .kernel_image_read_write = true, - .literal_sampler = true, - - // These aren't fully supported, but silence warnings about them from - // code that doesn't really use them. - .linkage = true, - .generic_pointers = true, - }, + .capabilities = &libclc_spirv_caps, }; unsigned supported_int_sizes = (16 | 32 | 64); unsigned supported_float_sizes = (16 | 32);