Mesa (main): nir: add a new access flag to allow access in helper invocations
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Dec 5 13:55:38 UTC 2021
Module: Mesa
Branch: main
Commit: 0800ec2c7733d0c7e3580c006a89a39a7e9d2e70
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0800ec2c7733d0c7e3580c006a89a39a7e9d2e70
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Fri Oct 29 18:04:55 2021 +0300
nir: add a new access flag to allow access in helper invocations
v2: Add nir_print support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13718>
---
src/compiler/nir/nir.h | 2 +-
src/compiler/nir/nir_print.c | 6 ++++--
src/compiler/shader_enums.h | 3 +++
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 019e60f9238..91647d23cfd 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -577,7 +577,7 @@ typedef struct nir_variable {
* Access flags for memory variables (SSBO/global), image uniforms, and
* bindless images in uniforms/inputs/outputs.
*/
- unsigned access:8;
+ unsigned access:9;
/**
* Descriptor set binding for sampler or UBO.
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 457cddd19c1..5815ae6dc26 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -508,8 +508,10 @@ print_var_decl(nir_variable *var, print_state *state)
const char *const reorder = (access & ACCESS_CAN_REORDER) ? "reorderable " : "";
const char *const stream_cache_policy = (access & ACCESS_STREAM_CACHE_POLICY) ?
"stream-cache-policy " : "";
- fprintf(fp, "%s%s%s%s%s%s%s", coher, volat, restr, ronly, wonly, reorder,
- stream_cache_policy);
+ const char *const include_helpers = (access & ACCESS_INCLUDE_HELPERS) ?
+ "include-helpers " : "";
+ fprintf(fp, "%s%s%s%s%s%s%s%s", coher, volat, restr, ronly, wonly, reorder,
+ stream_cache_policy, include_helpers);
if (glsl_get_base_type(glsl_without_array(var->type)) == GLSL_TYPE_IMAGE) {
fprintf(fp, "%s ", util_format_short_name(var->data.image.format));
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index 1dc8f7a646c..b1e443f2594 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -903,6 +903,9 @@ enum gl_access_qualifier
/** Use as little cache space as possible. */
ACCESS_STREAM_CACHE_POLICY = (1 << 7),
+
+ /** Execute instruction also in helpers. */
+ ACCESS_INCLUDE_HELPERS = (1 << 8),
};
/**
More information about the mesa-commit
mailing list