aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir_print_visitor.cpp
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-11-30 10:38:55 +0100
committerNicolai Hähnle <[email protected]>2016-12-12 09:03:47 +0100
commit173d80b40159669b303ea19e8b6abd24d7fce39b (patch)
treeca4e28a59a1edb334ad856c60d21038935b3b4ed /src/compiler/glsl/ir_print_visitor.cpp
parent6092169b96edb1eb85fd195c426858d4430f9bb3 (diff)
glsl: remember per-component vertex streams for packed varyings
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_print_visitor.cpp')
-rw-r--r--src/compiler/glsl/ir_print_visitor.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
index 703169eb976..d4014265ef3 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -177,6 +177,17 @@ void ir_print_visitor::visit(ir_variable *ir)
if (ir->data.explicit_component)
snprintf(component, sizeof(component), "component=%i ", ir->data.location_frac);
+ char stream[32] = {0};
+ if (ir->data.stream & (1u << 31)) {
+ if (ir->data.stream & ~(1u << 31)) {
+ snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ",
+ ir->data.stream & 3, (ir->data.stream >> 2) & 3,
+ (ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3);
+ }
+ } else if (ir->data.stream) {
+ snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream);
+ }
+
const char *const cent = (ir->data.centroid) ? "centroid " : "";
const char *const samp = (ir->data.sample) ? "sample " : "";
const char *const patc = (ir->data.patch) ? "patch " : "";
@@ -187,13 +198,12 @@ void ir_print_visitor::visit(ir_variable *ir)
"in ", "out ", "inout ",
"const_in ", "sys ", "temporary " };
STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count);
- const char *const stream [] = {"", "stream1 ", "stream2 ", "stream3 "};
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) ",
binding, loc, component, cent, samp, patc, inv, prec, mode[ir->data.mode],
- stream[ir->data.stream],
+ stream,
interp[ir->data.interpolation]);
print_type(f, ir->type);