summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-04-26 18:34:09 +0200
committerNicolai Hähnle <[email protected]>2017-05-12 10:46:07 +0200
commit5c92b1bf07b6cad80d43a15ecc44e00ec6fbcc04 (patch)
treec6ddc119c4317b9be44b87ac59ab1f79c20c5bc0 /src/compiler/glsl
parenta16ae77185813522d9b82372e18e2727eb2794b6 (diff)
glsl: include image qualifiers when printing IR
v2: - fix copy&paste errors noted by Samuel - rebase Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/ir_print_visitor.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
index f8d0dc4dec2..43be940a2f7 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -188,6 +188,12 @@ void ir_print_visitor::visit(ir_variable *ir)
snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream);
}
+ char image_format[32] = {0};
+ if (ir->data.image_format) {
+ snprintf(image_format, sizeof(image_format), "format=%x ",
+ ir->data.image_format);
+ }
+
const char *const cent = (ir->data.centroid) ? "centroid " : "";
const char *const samp = (ir->data.sample) ? "sample " : "";
const char *const patc = (ir->data.patch) ? "patch " : "";
@@ -195,6 +201,11 @@ void ir_print_visitor::visit(ir_variable *ir)
const char *const prec = (ir->data.precise) ? "precise " : "";
const char *const bindless = (ir->data.bindless) ? "bindless " : "";
const char *const bound = (ir->data.bound) ? "bound " : "";
+ const char *const memory_read_only = (ir->data.memory_read_only) ? "readonly " : "";
+ const char *const memory_write_only = (ir->data.memory_write_only) ? "writeonly " : "";
+ const char *const memory_coherent = (ir->data.memory_coherent) ? "coherent " : "";
+ const char *const memory_volatile = (ir->data.memory_volatile) ? "volatile " : "";
+ const char *const memory_restrict = (ir->data.memory_restrict) ? "restrict " : "";
const char *const mode[] = { "", "uniform ", "shader_storage ",
"shader_shared ", "shader_in ", "shader_out ",
"in ", "out ", "inout ",
@@ -203,9 +214,12 @@ void ir_print_visitor::visit(ir_variable *ir)
const char *const interp[] = { "", "smooth", "flat", "noperspective" };
STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_MODE_COUNT);
- fprintf(f, "(%s%s%s%s%s%s%s%s%s%s%s%s%s) ",
- binding, loc, component, cent, bindless, bound, samp, patc, inv,
- prec, mode[ir->data.mode], stream,
+ fprintf(f, "(%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s) ",
+ binding, loc, component, cent, bindless, bound,
+ image_format, memory_read_only, memory_write_only,
+ memory_coherent, memory_volatile, memory_restrict,
+ samp, patc, inv, prec, mode[ir->data.mode],
+ stream,
interp[ir->data.interpolation]);
print_type(f, ir->type);