From: Jason Ekstrand Date: Wed, 19 Aug 2020 16:26:53 +0000 (-0500) Subject: spirv: Drop the constant_as_global as option X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6678f1e81cc19522d9ac064cb0a6e8b3da553ac3;p=mesa.git spirv: Drop the constant_as_global as option Reviewed-by: Eric Anholt Reviewed-by: Jesse Natalie Reviewed-by: Karol Herbst Part-of: --- diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h index dd7b5b36996..8d5c1008aa2 100644 --- a/src/compiler/spirv/nir_spirv.h +++ b/src/compiler/spirv/nir_spirv.h @@ -80,12 +80,6 @@ struct spirv_to_nir_options { nir_address_format temp_addr_format; nir_address_format constant_addr_format; - /* Whether UniformConstant memory should be treated as normal global memory. - * This is usefull for CL 2.0 implementations with fine grain system SVM - * support. - */ - bool constant_as_global; - struct { void (*func)(void *private_data, enum nir_spirv_debug_level level, diff --git a/src/compiler/spirv/spirv2nir.c b/src/compiler/spirv/spirv2nir.c index 6bc946e9b5d..bbec4d2af6a 100644 --- a/src/compiler/spirv/spirv2nir.c +++ b/src/compiler/spirv/spirv2nir.c @@ -137,7 +137,6 @@ int main(int argc, char **argv) spirv_opts.caps.int16 = true; spirv_opts.caps.int64 = true; spirv_opts.caps.kernel = true; - spirv_opts.constant_as_global = true; } nir_shader *nir = spirv_to_nir(map, word_count, NULL, 0, diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index b9f1fae0115..399e5ea3ede 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -4481,10 +4481,8 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode, assert(nir_address_format_num_components(b->options->global_addr_format) == 1); assert(nir_address_format_bit_size(b->options->shared_addr_format) == 32); assert(nir_address_format_num_components(b->options->shared_addr_format) == 1); - if (!b->options->constant_as_global) { - assert(nir_address_format_bit_size(b->options->constant_addr_format) == 32); - assert(nir_address_format_num_components(b->options->constant_addr_format) == 1); - } + assert(nir_address_format_bit_size(b->options->constant_addr_format) == 32); + assert(nir_address_format_num_components(b->options->constant_addr_format) == 1); break; case SpvAddressingModelPhysical64: vtn_fail_if(b->shader->info.stage != MESA_SHADER_KERNEL, @@ -4495,10 +4493,8 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode, assert(nir_address_format_num_components(b->options->global_addr_format) == 1); assert(nir_address_format_bit_size(b->options->shared_addr_format) == 64); assert(nir_address_format_num_components(b->options->shared_addr_format) == 1); - if (!b->options->constant_as_global) { - assert(nir_address_format_bit_size(b->options->constant_addr_format) == 64); - assert(nir_address_format_num_components(b->options->constant_addr_format) == 1); - } + assert(nir_address_format_bit_size(b->options->constant_addr_format) == 64); + assert(nir_address_format_num_components(b->options->constant_addr_format) == 1); break; case SpvAddressingModelLogical: vtn_fail_if(b->shader->info.stage == MESA_SHADER_KERNEL, diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 52c2837e9eb..f5ba73f4fca 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -1803,13 +1803,8 @@ vtn_storage_class_to_mode(struct vtn_builder *b, break; case SpvStorageClassUniformConstant: if (b->shader->info.stage == MESA_SHADER_KERNEL) { - if (b->options->constant_as_global) { - mode = vtn_variable_mode_cross_workgroup; - nir_mode = nir_var_mem_global; - } else { - mode = vtn_variable_mode_constant; - nir_mode = nir_var_mem_constant; - } + mode = vtn_variable_mode_constant; + nir_mode = nir_var_mem_constant; } else { mode = vtn_variable_mode_uniform; nir_mode = nir_var_uniform;