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 <jason@jlekstrand.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3913>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3913>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2020-01-10 16:25:02 -08:00
committed by Marge Bot
parent 6be766336a
commit 956e4b2d37
5 changed files with 8 additions and 8 deletions

View File

@@ -2921,6 +2921,11 @@ typedef struct nir_shader_compiler_options {
*/ */
bool has_imul24; 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? * Is this the Intel vec4 backend?
* *

View File

@@ -67,11 +67,6 @@ struct spirv_to_nir_options {
*/ */
bool frag_coord_is_sysval; 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; struct spirv_supported_capabilities caps;
/* Address format for various kinds of pointers. */ /* Address format for various kinds of pointers. */

View File

@@ -3576,7 +3576,7 @@ void
vtn_emit_memory_barrier(struct vtn_builder *b, SpvScope scope, vtn_emit_memory_barrier(struct vtn_builder *b, SpvScope scope,
SpvMemorySemanticsMask semantics) 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); vtn_emit_scoped_memory_barrier(b, scope, semantics);
return; return;
} }

View File

@@ -47,7 +47,8 @@
.vectorize_io = true, \ .vectorize_io = true, \
.use_interpolated_input_intrinsics = true, \ .use_interpolated_input_intrinsics = true, \
.vertex_id_zero_based = true, \ .vertex_id_zero_based = true, \
.lower_base_vertex = true .lower_base_vertex = true, \
.use_scoped_memory_barrier = true
#define COMMON_SCALAR_OPTIONS \ #define COMMON_SCALAR_OPTIONS \
.lower_to_scalar = true, \ .lower_to_scalar = true, \

View File

@@ -160,7 +160,6 @@ anv_shader_compile_to_nir(struct anv_device *device,
}; };
struct spirv_to_nir_options spirv_options = { struct spirv_to_nir_options spirv_options = {
.frag_coord_is_sysval = true, .frag_coord_is_sysval = true,
.use_scoped_memory_barrier = true,
.caps = { .caps = {
.demote_to_helper_invocation = true, .demote_to_helper_invocation = true,
.derivative_group = true, .derivative_group = true,