aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_algebraic.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-04-06 23:28:02 -0700
committerKenneth Graunke <[email protected]>2014-04-08 00:02:06 -0700
commit73f80c20f68cd30421c13da29d7d7801ed096101 (patch)
tree6478908221483953d212402d595ce60f4bb84f74 /src/glsl/opt_algebraic.cpp
parent169c645f12337cdc3e02b628f9cde6a9fb72acc2 (diff)
glsl: Pass ctx->Const.NativeIntegers to do_algebraic.
The next patch will introduce an optimization that only works when integers are not represented as floating point values. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/opt_algebraic.cpp')
-rw-r--r--src/glsl/opt_algebraic.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp
index 2db877d5b8b..9d553925207 100644
--- a/src/glsl/opt_algebraic.cpp
+++ b/src/glsl/opt_algebraic.cpp
@@ -45,10 +45,11 @@ namespace {
class ir_algebraic_visitor : public ir_rvalue_visitor {
public:
- ir_algebraic_visitor()
+ ir_algebraic_visitor(bool native_integers)
{
this->progress = false;
this->mem_ctx = NULL;
+ this->native_integers = native_integers;
}
virtual ~ir_algebraic_visitor()
@@ -70,6 +71,7 @@ public:
void *mem_ctx;
+ bool native_integers;
bool progress;
};
@@ -645,9 +647,9 @@ ir_algebraic_visitor::handle_rvalue(ir_rvalue **rvalue)
}
bool
-do_algebraic(exec_list *instructions)
+do_algebraic(exec_list *instructions, bool native_integers)
{
- ir_algebraic_visitor v;
+ ir_algebraic_visitor v(native_integers);
visit_list_elements(&v, instructions);