Mesa (master): nir: Add reorderable memory access enum
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 19 12:19:10 UTC 2019
Module: Mesa
Branch: master
Commit: c813c5776d0926527d9fcd44827811ccb7551154
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c813c5776d0926527d9fcd44827811ccb7551154
Author: Connor Abbott <cwabbott0 at gmail.com>
Date: Fri May 31 19:03:48 2019 +0200
nir: Add reorderable memory access enum
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
---
src/compiler/nir/nir_print.c | 3 ++-
src/compiler/shader_enums.h | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 6dac4eb5f5c..6b5e7395221 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -448,7 +448,8 @@ print_var_decl(nir_variable *var, print_state *state)
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);
+ const char *const reorder = (access & ACCESS_CAN_REORDER) ? "reorderable " : "";
+ fprintf(fp, "%s%s%s%s%s%s", coher, volat, restr, ronly, wonly, reorder);
#define FORMAT_CASE(x) case x: fprintf(stderr, #x " "); break
switch (var->data.image.format) {
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index 47b1ca01dd6..cf753df3791 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -725,6 +725,14 @@ enum gl_access_qualifier
/** The access may use a non-uniform buffer or image index */
ACCESS_NON_UNIFORM = (1 << 5),
+
+ /* This has the same semantics as NIR_INTRINSIC_CAN_REORDER, only to be
+ * used with loads. In other words, it means that the load can be
+ * arbitrarily reordered, or combined with other loads to the same address.
+ * It is implied by ACCESS_NON_WRITEABLE together with ACCESS_RESTRICT, and
+ * a lack of ACCESS_COHERENT and ACCESS_VOLATILE.
+ */
+ ACCESS_CAN_REORDER = (1 << 6),
};
/**
More information about the mesa-commit
mailing list