summaryrefslogtreecommitdiff
path: root/dist/Mesa/src/glsl/ir_constant_expression.cpp
diff options
context:
space:
mode:
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, 5 insertions, 15 deletions
diff --git a/dist/Mesa/src/glsl/ir_constant_expression.cpp b/dist/Mesa/src/glsl/ir_constant_expression.cpp
index 1e8b3a3cc..8afe8f776 100644
--- a/dist/Mesa/src/glsl/ir_constant_expression.cpp
+++ b/dist/Mesa/src/glsl/ir_constant_expression.cpp
@@ -36,6 +36,7 @@
#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"
@@ -510,8 +511,6 @@ 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:
@@ -851,11 +850,7 @@ 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;
@@ -1469,12 +1464,6 @@ 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];
@@ -1794,7 +1783,8 @@ bool ir_function_signature::constant_expression_evaluate_expression_list(const s
struct hash_table *variable_context,
ir_constant **result)
{
- foreach_in_list(ir_instruction, inst, &body) {
+ foreach_list(n, &body) {
+ ir_instruction *inst = (ir_instruction *)n;
switch(inst->ir_type) {
/* (declare () type symbol) */
@@ -1933,8 +1923,8 @@ ir_function_signature::constant_expression_value(exec_list *actual_parameters, s
*/
const exec_node *parameter_info = origin ? origin->parameters.head : parameters.head;
- foreach_in_list(ir_rvalue, n, actual_parameters) {
- ir_constant *constant = n->constant_expression_value(variable_context);
+ foreach_list(n, actual_parameters) {
+ ir_constant *constant = ((ir_rvalue *) n)->constant_expression_value(variable_context);
if (constant == NULL) {
hash_table_dtor(deref_hash);
return NULL;