summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_validate.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-11-28 08:13:41 -0800
committerPaul Berry <[email protected]>2013-12-09 10:54:33 -0800
commite00b93a1f7b4bc7f5e887591c000524e13f80826 (patch)
tree4bfdfa0f56747019aed8c427fb3349adc1e53e7e /src/glsl/ir_validate.cpp
parent2c17f97fe6a40e4a963fb4eec0ea0555f562b1be (diff)
glsl/loops: replace loop controls with a normative bound.
This patch replaces the ir_loop fields "from", "to", "increment", "counter", and "cmp" with a single integer ("normative_bound") that serves the same purpose. I've used the name "normative_bound" to emphasize the fact that the back-end is required to emit code to prevent the loop from running more than normative_bound times. (By contrast, an "informative" bound would be a bound that is informational only). Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r--src/glsl/ir_validate.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 26d63883422..8e73229572d 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -63,8 +63,6 @@ public:
virtual ir_visitor_status visit_enter(ir_if *ir);
- virtual ir_visitor_status visit_enter(ir_loop *ir);
- virtual ir_visitor_status visit_leave(ir_loop *ir);
virtual ir_visitor_status visit_enter(ir_function *ir);
virtual ir_visitor_status visit_leave(ir_function *ir);
virtual ir_visitor_status visit_enter(ir_function_signature *ir);
@@ -150,54 +148,6 @@ ir_validate::visit_enter(ir_if *ir)
ir_visitor_status
-ir_validate::visit_enter(ir_loop *ir)
-{
- if (ir->counter != NULL && hash_table_find(ht, ir->counter) != NULL) {
- printf("ir_loop @ %p specifies already-declared variable `%s' @ %p\n",
- (void *) ir, ir->counter->name, (void *) ir->counter);
- abort();
- }
- return visit_continue;
-}
-
-
-ir_visitor_status
-ir_validate::visit_leave(ir_loop *ir)
-{
- if (ir->counter != NULL) {
- if ((ir->from == NULL) || (ir->to == NULL) || (ir->increment == NULL)) {
- printf("ir_loop has invalid loop controls:\n"
- " counter: %p\n"
- " from: %p\n"
- " to: %p\n"
- " increment: %p\n",
- (void *) ir->counter, (void *) ir->from, (void *) ir->to,
- (void *) ir->increment);
- abort();
- }
-
- if ((ir->cmp < ir_binop_less) || (ir->cmp > ir_binop_nequal)) {
- printf("ir_loop has invalid comparitor %d\n", ir->cmp);
- abort();
- }
- } else {
- if ((ir->from != NULL) || (ir->to != NULL) || (ir->increment != NULL)) {
- printf("ir_loop has invalid loop controls:\n"
- " counter: %p\n"
- " from: %p\n"
- " to: %p\n"
- " increment: %p\n",
- (void *) ir->counter, (void *) ir->from, (void *) ir->to,
- (void *) ir->increment);
- abort();
- }
- }
-
- return visit_continue;
-}
-
-
-ir_visitor_status
ir_validate::visit_enter(ir_function *ir)
{
/* Function definitions cannot be nested.