From: Caio Marcelo de Oliveira Filho Date: Sat, 11 Jan 2020 00:25:02 +0000 (-0800) Subject: nir, intel: Move use_scoped_memory_barrier to nir_options X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=956e4b2d371736e073542cf8556f0c972c197989;p=mesa.git nir, intel: Move use_scoped_memory_barrier to nir_options This option will be used later by GLSL, so move to a common struct. Because nir_options is filled in the compiler instead of the Vulkan driver, fix that up. GLSL will ignore that for now. Reviewed-by: Jason Ekstrand Tested-by: Marge Bot Part-of: --- diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 9591285f28f..1547bf0c641 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2921,6 +2921,11 @@ typedef struct nir_shader_compiler_options { */ bool has_imul24; + /* Whether to generate only scoped_memory_barrier intrinsics instead of the + * set of memory barrier intrinsics based on GLSL. + */ + bool use_scoped_memory_barrier; + /** * Is this the Intel vec4 backend? * diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h index 81175ebf022..37fbf351bc9 100644 --- a/src/compiler/spirv/nir_spirv.h +++ b/src/compiler/spirv/nir_spirv.h @@ -67,11 +67,6 @@ struct spirv_to_nir_options { */ bool frag_coord_is_sysval; - /* Whether to generate only scoped_memory_barrier intrinsics instead of the - * set of memory barrier intrinsics based on GLSL. - */ - bool use_scoped_memory_barrier; - struct spirv_supported_capabilities caps; /* Address format for various kinds of pointers. */ diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index fa391168043..5ee75877e8b 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -3576,7 +3576,7 @@ void vtn_emit_memory_barrier(struct vtn_builder *b, SpvScope scope, SpvMemorySemanticsMask semantics) { - if (b->options->use_scoped_memory_barrier) { + if (b->shader->options->use_scoped_memory_barrier) { vtn_emit_scoped_memory_barrier(b, scope, semantics); return; } diff --git a/src/intel/compiler/brw_compiler.c b/src/intel/compiler/brw_compiler.c index 3d0bec30dcf..20f32b552c0 100644 --- a/src/intel/compiler/brw_compiler.c +++ b/src/intel/compiler/brw_compiler.c @@ -47,7 +47,8 @@ .vectorize_io = true, \ .use_interpolated_input_intrinsics = true, \ .vertex_id_zero_based = true, \ - .lower_base_vertex = true + .lower_base_vertex = true, \ + .use_scoped_memory_barrier = true #define COMMON_SCALAR_OPTIONS \ .lower_to_scalar = true, \ diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 2dbb2eac0a7..e6bd5f903f8 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -160,7 +160,6 @@ anv_shader_compile_to_nir(struct anv_device *device, }; struct spirv_to_nir_options spirv_options = { .frag_coord_is_sysval = true, - .use_scoped_memory_barrier = true, .caps = { .demote_to_helper_invocation = true, .derivative_group = true,