aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorSergii Romantsov <[email protected]>2018-08-30 15:04:35 +0300
committerDylan Baker <[email protected]>2019-07-03 12:13:37 -0700
commit9f85b4940c58b36fe5f26222e3f94e97fc654afa (patch)
tree437c45934d032d3557e56644955bd097b9db63d4 /src/compiler/glsl
parentea5b7de138bb7e9a4e7e4f0c39c4ceb16acae923 (diff)
glsl/standalone: exit on unsupported texture functions
glsl/standalone with --dump-builder will exit when unsupported texture functions are encountered. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107767 Signed-off-by: Sergii Romantsov <[email protected]> Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/ir_builder_print_visitor.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/compiler/glsl/ir_builder_print_visitor.cpp b/src/compiler/glsl/ir_builder_print_visitor.cpp
index 57424699d00..d34afa3daee 100644
--- a/src/compiler/glsl/ir_builder_print_visitor.cpp
+++ b/src/compiler/glsl/ir_builder_print_visitor.cpp
@@ -60,6 +60,8 @@ public:
virtual ir_visitor_status visit_leave(class ir_swizzle *);
virtual ir_visitor_status visit_leave(class ir_return *);
+ virtual ir_visitor_status visit_enter(ir_texture *ir);
+
private:
void print_with_indent(const char *fmt, ...);
void print_without_indent(const char *fmt, ...);
@@ -445,6 +447,7 @@ ir_builder_print_visitor::print_without_declaration(const ir_swizzle *ir)
print_without_declaration(ir->val);
print_without_indent(")");
} else {
+ assert(he);
print_without_indent("swizzle_%c(r%04X)",
swiz[ir->mask.x],
(unsigned)(uintptr_t) he->data);
@@ -452,6 +455,7 @@ ir_builder_print_visitor::print_without_declaration(const ir_swizzle *ir)
} else {
static const char swiz[4] = { 'X', 'Y', 'Z', 'W' };
+ assert(he);
print_without_indent("swizzle(r%04X, MAKE_SWIZZLE4(SWIZZLE_%c, SWIZZLE_%c, SWIZZLE_%c, SWIZZLE_%c), %u)",
(unsigned)(uintptr_t) he->data,
swiz[ir->mask.x],
@@ -526,6 +530,7 @@ ir_builder_print_visitor::visit_leave(ir_assignment *ir)
_mesa_hash_table_search(index_map, ir->rhs);
assert(ir->condition == NULL);
+ assert(ir->lhs && ir->rhs);
print_with_indent("body.emit(assign(r%04X, r%04X, 0x%02x));\n\n",
(unsigned)(uintptr_t) he_lhs->data,
@@ -640,7 +645,7 @@ ir_builder_print_visitor::visit_enter(ir_if *ir)
if (s != visit_continue_with_parent) {
s = visit_list_elements(this, &ir->then_instructions);
if (s == visit_stop)
- return s;
+ return s;
}
print_without_indent("\n");
@@ -683,6 +688,14 @@ ir_builder_print_visitor::visit_leave(ir_return *ir)
}
ir_visitor_status
+ir_builder_print_visitor::visit_enter(ir_texture *ir)
+{
+ print_with_indent("\nUnsupported IR is encountered: texture functions are not supported. Exiting.\n");
+
+ return visit_stop;
+}
+
+ir_visitor_status
ir_builder_print_visitor::visit_leave(ir_call *ir)
{
const unsigned my_index = next_ir_index++;