summaryrefslogtreecommitdiff
path: root/dist/Mesa/src/glsl/ir_constant_expression.cpp
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-01-25 14:41:23 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-01-25 14:41:23 +0000
commit69046388722f87a91f007ac11410f2dff09ad12f (patch)
tree61362408f4facf272a1773863a602738c0251586 /dist/Mesa/src/glsl/ir_constant_expression.cpp
parent82f614b5136cd14bb85337a82d24199c08d26322 (diff)
Merge Mesa 10.4.3
Tested by matthieu@ mpi@ and myself. landry@ ran a ports bulk build. kettenis@ tracked down the cause of an alignment fault on archs that require strict eight byte pointer alignment.
Diffstat (limited to 'dist/Mesa/src/glsl/ir_constant_expression.cpp')
-rw-r--r--dist/Mesa/src/glsl/ir_constant_expression.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/dist/Mesa/src/glsl/ir_constant_expression.cpp b/dist/Mesa/src/glsl/ir_constant_expression.cpp
index 8afe8f776..1e8b3a3cc 100644
--- a/dist/Mesa/src/glsl/ir_constant_expression.cpp
+++ b/dist/Mesa/src/glsl/ir_constant_expression.cpp
@@ -36,7 +36,6 @@
#include <math.h>
#include "main/core.h" /* for MAX2, MIN2, CLAMP */
#include "ir.h"
-#include "ir_visitor.h"
#include "glsl_types.h"
#include "program/hash_table.h"
@@ -511,6 +510,8 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
case ir_binop_lshift:
case ir_binop_rshift:
case ir_binop_ldexp:
+ case ir_binop_interpolate_at_offset:
+ case ir_binop_interpolate_at_sample:
case ir_binop_vector_extract:
case ir_triop_csel:
case ir_triop_bitfield_extract:
@@ -850,7 +851,11 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
break;
case ir_unop_dFdx:
+ case ir_unop_dFdx_coarse:
+ case ir_unop_dFdx_fine:
case ir_unop_dFdy:
+ case ir_unop_dFdy_coarse:
+ case ir_unop_dFdy_fine:
assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
for (unsigned c = 0; c < op[0]->type->components(); c++) {
data.f[c] = 0.0;
@@ -1464,6 +1469,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
}
break;
+ case ir_unop_saturate:
+ for (unsigned c = 0; c < components; c++) {
+ data.f[c] = CLAMP(op[0]->value.f[c], 0.0f, 1.0f);
+ }
+ break;
+
case ir_triop_bitfield_extract: {
int offset = op[1]->value.i[0];
int bits = op[2]->value.i[0];
@@ -1783,8 +1794,7 @@ bool ir_function_signature::constant_expression_evaluate_expression_list(const s
struct hash_table *variable_context,
ir_constant **result)
{
- foreach_list(n, &body) {
- ir_instruction *inst = (ir_instruction *)n;
+ foreach_in_list(ir_instruction, inst, &body) {
switch(inst->ir_type) {
/* (declare () type symbol) */
@@ -1923,8 +1933,8 @@ ir_function_signature::constant_expression_value(exec_list *actual_parameters, s
*/
const exec_node *parameter_info = origin ? origin->parameters.head : parameters.head;
- foreach_list(n, actual_parameters) {
- ir_constant *constant = ((ir_rvalue *) n)->constant_expression_value(variable_context);
+ foreach_in_list(ir_rvalue, n, actual_parameters) {
+ ir_constant *constant = n->constant_expression_value(variable_context);
if (constant == NULL) {
hash_table_dtor(deref_hash);
return NULL;