[Mesa-dev] [PATCH 6/7] glsl: Add support for constant expression evaluation on trunc().

Eric Anholt eric at anholt.net
Tue Sep 27 15:08:40 PDT 2011


Fixes the glsl-1.30/compiler/built-in-functions/trunc-* tests under 1.30.
---
 src/glsl/ir_constant_expression.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 56a4237..b3fe6cf 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -1373,6 +1373,8 @@ ir_call::constant_expression_value()
 	    data.f[m*i+j] += op[0]->value.f[i+n*j];
 	 }
       }
+   } else if (strcmp(callee, "trunc") == 0) {
+      expr = new(mem_ctx) ir_expression(ir_unop_trunc, op[0]);
    } else {
       /* Unsupported builtin - some are not allowed in constant expressions. */
       return NULL;
-- 
1.7.5.4



More information about the mesa-dev mailing list