diff options
author | Jason Ekstrand <[email protected]> | 2018-08-16 15:11:12 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-08-29 14:04:02 -0500 |
commit | 3942943819a87ad423df56e3138223fc37f5db21 (patch) | |
tree | b99ea979073e479a25136d32d96846ee646ac24c /src/compiler/nir/nir_print.c | |
parent | 48e4fa7dd8c4b777989c4a731d6ac54cfe6c24eb (diff) |
nir: Use a bitfield for image access qualifiers
This commit expands the current memory access enum to contain the extra
two bits provided for images. We choose to follow the SPIR-V convention
of NonReadable and NonWriteable because readonly implies that you *can*
read so readonly + writeonly doesn't make as much sense as NonReadable +
NonWriteable.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_print.c')
-rw-r--r-- | src/compiler/nir/nir_print.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 7cb16abd146..9175560383f 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -433,11 +433,12 @@ 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)); - const char *const coher = (var->data.image.coherent) ? "coherent " : ""; - const char *const volat = (var->data.image._volatile) ? "volatile " : ""; - const char *const restr = (var->data.image.restrict_flag) ? "restrict " : ""; - const char *const ronly = (var->data.image.read_only) ? "readonly " : ""; - const char *const wonly = (var->data.image.write_only) ? "writeonly " : ""; + enum gl_access_qualifier access = var->data.image.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 " : ""; + const char *const ronly = (access & ACCESS_NON_WRITEABLE) ? "readonly " : ""; + const char *const wonly = (access & ACCESS_NON_READABLE) ? "writeonly " : ""; fprintf(fp, "%s%s%s%s%s", coher, volat, restr, ronly, wonly); fprintf(fp, "%s %s", glsl_get_type_name(var->type), |