From 58c988ada56114b56477983f66b4039219f1a82c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 17 Jan 2011 22:07:55 -0800 Subject: glsl: Skip the rest of loop unrolling if no loops were found. Shaves 1.6% (+/- 1.0%) off of ff_fragment_shader glean texCombine time (n=5). --- src/glsl/loop_analysis.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/glsl/loop_analysis.cpp') diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp index ff7adf00a2..3cf86ebaa3 100644 --- a/src/glsl/loop_analysis.cpp +++ b/src/glsl/loop_analysis.cpp @@ -38,6 +38,7 @@ loop_state::loop_state() this->ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); this->mem_ctx = talloc_init("loop state"); + this->loop_found = false; } @@ -52,7 +53,9 @@ loop_variable_state * loop_state::insert(ir_loop *ir) { loop_variable_state *ls = new(this->mem_ctx) loop_variable_state; + hash_table_insert(this->ht, ls, ir); + this->loop_found = true; return ls; } -- cgit v1.2.3