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@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13718>
This commit is contained in:
Lionel Landwerlin
2021-10-29 18:04:55 +03:00
committed by Marge Bot
parent 54489b3c09
commit 0800ec2c77
3 changed files with 8 additions and 3 deletions

View File

@@ -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.

View File

@@ -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));

View File

@@ -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),
};
/**