aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-11-07 16:53:58 -0500
committerMarek Olšák <[email protected]>2019-11-19 18:20:05 -0500
commitebe757965567c85286245f82ba5b8f90804da19a (patch)
treeaf76883208d4ff9f1dbcbd2ca471711922ffce0e /src/compiler/nir
parent3a8d6868897c7dfe72bac09c1eddd551144ca751 (diff)
nir: move data.image.access to data.access
The size of the data structure doesn't change. Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir.c2
-rw-r--r--src/compiler/nir/nir.h11
-rw-r--r--src/compiler/nir/nir_deref.c2
-rw-r--r--src/compiler/nir/nir_opt_access.c8
-rw-r--r--src/compiler/nir/nir_print.c2
5 files changed, 13 insertions, 12 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index f97c3175a22..d7bdc7ed4ca 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -2210,7 +2210,7 @@ nir_rewrite_image_intrinsic(nir_intrinsic_instr *intrin, nir_ssa_def *src,
nir_intrinsic_set_image_dim(intrin, glsl_get_sampler_dim(deref->type));
nir_intrinsic_set_image_array(intrin, glsl_sampler_type_is_array(deref->type));
- nir_intrinsic_set_access(intrin, access | var->data.image.access);
+ nir_intrinsic_set_access(intrin, access | var->data.access);
nir_intrinsic_set_format(intrin, var->data.image.format);
nir_instr_rewrite_src(&intrin->instr, &intrin->src[0],
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 942e647f94c..31d611a620d 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -431,6 +431,12 @@ typedef struct nir_variable {
unsigned stream:9;
/**
+ * Access flags for memory variables (SSBO/global), image uniforms, and
+ * bindless images in uniforms/inputs/outputs.
+ */
+ enum gl_access_qualifier access:8;
+
+ /**
* output index for dual source blending.
*/
unsigned index;
@@ -480,12 +486,7 @@ typedef struct nir_variable {
unsigned offset;
union {
- /**
- * ARB_shader_image_load_store qualifiers.
- */
struct {
- enum gl_access_qualifier access:8;
-
/** Image internal format if specified explicitly, otherwise GL_NONE. */
GLenum16 format;
} image;
diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index b81edde8dac..74dd776aed6 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -401,7 +401,7 @@ deref_path_contains_coherent_decoration(nir_deref_path *path)
{
assert(path->path[0]->deref_type == nir_deref_type_var);
- if (path->path[0]->var->data.image.access & ACCESS_COHERENT)
+ if (path->path[0]->var->data.access & ACCESS_COHERENT)
return true;
for (nir_deref_instr **p = &path->path[1]; *p; p++) {
diff --git a/src/compiler/nir/nir_opt_access.c b/src/compiler/nir/nir_opt_access.c
index 766f056568a..731b129ad97 100644
--- a/src/compiler/nir/nir_opt_access.c
+++ b/src/compiler/nir/nir_opt_access.c
@@ -158,12 +158,12 @@ process_variable(struct access_state *state, nir_variable *var)
return false;
/* Ignore variables we've already marked */
- if (var->data.image.access & ACCESS_CAN_REORDER)
+ if (var->data.access & ACCESS_CAN_REORDER)
return false;
- if (!(var->data.image.access & ACCESS_NON_WRITEABLE) &&
+ if (!(var->data.access & ACCESS_NON_WRITEABLE) &&
!_mesa_set_search(state->vars_written, var)) {
- var->data.image.access |= ACCESS_NON_WRITEABLE;
+ var->data.access |= ACCESS_NON_WRITEABLE;
return true;
}
@@ -246,7 +246,7 @@ process_intrinsic(struct access_state *state, nir_intrinsic_instr *instr)
/* Check if we were able to mark the whole variable non-writeable */
if (!(nir_intrinsic_access(instr) & ACCESS_NON_WRITEABLE) &&
- var->data.image.access & ACCESS_NON_WRITEABLE) {
+ var->data.access & ACCESS_NON_WRITEABLE) {
progress = true;
nir_intrinsic_set_access(instr,
nir_intrinsic_access(instr) |
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index ca9dab79e96..8dbf701f8ef 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -458,7 +458,7 @@ print_var_decl(nir_variable *var, print_state *state)
cent, samp, patch, inv, get_variable_mode_str(var->data.mode, false),
glsl_interp_mode_name(var->data.interpolation));
- enum gl_access_qualifier access = var->data.image.access;
+ enum gl_access_qualifier access = var->data.access;
const char *const coher = (access & ACCESS_COHERENT) ? "coherent " : "";
const char *const volat = (access & ACCESS_VOLATILE) ? "volatile " : "";
const char *const restr = (access & ACCESS_RESTRICT) ? "restrict " : "";