summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_algebraic.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-04-06 23:28:02 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-04-08 00:02:06 -0700
commit73f80c20f68cd30421c13da29d7d7801ed096101 (patch)
tree6478908221483953d212402d595ce60f4bb84f74 /src/glsl/opt_algebraic.cpp
parent169c645f12337cdc3e02b628f9cde6a9fb72acc2 (diff)
downloadexternal_mesa3d-73f80c20f68cd30421c13da29d7d7801ed096101.zip
external_mesa3d-73f80c20f68cd30421c13da29d7d7801ed096101.tar.gz
external_mesa3d-73f80c20f68cd30421c13da29d7d7801ed096101.tar.bz2
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 <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
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 2db877d..9d55392 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);