glsl: make use of glsl_type::is_double()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
This commit is contained in:
@@ -1505,7 +1505,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
|
|||||||
*/
|
*/
|
||||||
glsl_base_type param_base_type = first_param->type->base_type;
|
glsl_base_type param_base_type = first_param->type->base_type;
|
||||||
assert(param_base_type == GLSL_TYPE_FLOAT ||
|
assert(param_base_type == GLSL_TYPE_FLOAT ||
|
||||||
param_base_type == GLSL_TYPE_DOUBLE);
|
first_param->type->is_double());
|
||||||
ir_variable *rhs_var =
|
ir_variable *rhs_var =
|
||||||
new(ctx) ir_variable(glsl_type::get_instance(param_base_type, 4, 1),
|
new(ctx) ir_variable(glsl_type::get_instance(param_base_type, 4, 1),
|
||||||
"mat_ctor_vec",
|
"mat_ctor_vec",
|
||||||
|
@@ -445,9 +445,9 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b,
|
|||||||
*/
|
*/
|
||||||
assert(type_a->is_matrix() || type_b->is_matrix());
|
assert(type_a->is_matrix() || type_b->is_matrix());
|
||||||
assert(type_a->base_type == GLSL_TYPE_FLOAT ||
|
assert(type_a->base_type == GLSL_TYPE_FLOAT ||
|
||||||
type_a->base_type == GLSL_TYPE_DOUBLE);
|
type_a->is_double());
|
||||||
assert(type_b->base_type == GLSL_TYPE_FLOAT ||
|
assert(type_b->base_type == GLSL_TYPE_FLOAT ||
|
||||||
type_b->base_type == GLSL_TYPE_DOUBLE);
|
type_b->is_double());
|
||||||
|
|
||||||
/* "* The operator is add (+), subtract (-), or divide (/), and the
|
/* "* The operator is add (+), subtract (-), or divide (/), and the
|
||||||
* operands are matrices with the same number of rows and the same
|
* operands are matrices with the same number of rows and the same
|
||||||
@@ -4950,7 +4950,7 @@ ast_declarator_list::hir(exec_list *instructions,
|
|||||||
if (state->is_version(120, 300))
|
if (state->is_version(120, 300))
|
||||||
break;
|
break;
|
||||||
case GLSL_TYPE_DOUBLE:
|
case GLSL_TYPE_DOUBLE:
|
||||||
if (check_type->base_type == GLSL_TYPE_DOUBLE && (state->is_version(410, 0) || state->ARB_vertex_attrib_64bit_enable))
|
if (check_type->is_double() && (state->is_version(410, 0) || state->ARB_vertex_attrib_64bit_enable))
|
||||||
break;
|
break;
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
|
@@ -3417,7 +3417,7 @@ builtin_builder::imm(const glsl_type *type, const ir_constant_data &data)
|
|||||||
return new(mem_ctx) ir_constant(type, &data);
|
return new(mem_ctx) ir_constant(type, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IMM_FP(type, val) (type->base_type == GLSL_TYPE_DOUBLE) ? imm(val) : imm((float)val)
|
#define IMM_FP(type, val) (type->is_double()) ? imm(val) : imm((float)val)
|
||||||
|
|
||||||
ir_dereference_variable *
|
ir_dereference_variable *
|
||||||
builtin_builder::var_ref(ir_variable *var)
|
builtin_builder::var_ref(ir_variable *var)
|
||||||
@@ -3985,14 +3985,14 @@ builtin_builder::_step(builtin_available_predicate avail, const glsl_type *edge_
|
|||||||
ir_variable *t = body.make_temp(x_type, "t");
|
ir_variable *t = body.make_temp(x_type, "t");
|
||||||
if (x_type->vector_elements == 1) {
|
if (x_type->vector_elements == 1) {
|
||||||
/* Both are floats */
|
/* Both are floats */
|
||||||
if (edge_type->base_type == GLSL_TYPE_DOUBLE)
|
if (edge_type->is_double())
|
||||||
body.emit(assign(t, f2d(b2f(gequal(x, edge)))));
|
body.emit(assign(t, f2d(b2f(gequal(x, edge)))));
|
||||||
else
|
else
|
||||||
body.emit(assign(t, b2f(gequal(x, edge))));
|
body.emit(assign(t, b2f(gequal(x, edge))));
|
||||||
} else if (edge_type->vector_elements == 1) {
|
} else if (edge_type->vector_elements == 1) {
|
||||||
/* x is a vector but edge is a float */
|
/* x is a vector but edge is a float */
|
||||||
for (int i = 0; i < x_type->vector_elements; i++) {
|
for (int i = 0; i < x_type->vector_elements; i++) {
|
||||||
if (edge_type->base_type == GLSL_TYPE_DOUBLE)
|
if (edge_type->is_double())
|
||||||
body.emit(assign(t, f2d(b2f(gequal(swizzle(x, i, 1), edge))), 1 << i));
|
body.emit(assign(t, f2d(b2f(gequal(swizzle(x, i, 1), edge))), 1 << i));
|
||||||
else
|
else
|
||||||
body.emit(assign(t, b2f(gequal(swizzle(x, i, 1), edge)), 1 << i));
|
body.emit(assign(t, b2f(gequal(swizzle(x, i, 1), edge)), 1 << i));
|
||||||
@@ -4000,7 +4000,7 @@ builtin_builder::_step(builtin_available_predicate avail, const glsl_type *edge_
|
|||||||
} else {
|
} else {
|
||||||
/* Both are vectors */
|
/* Both are vectors */
|
||||||
for (int i = 0; i < x_type->vector_elements; i++) {
|
for (int i = 0; i < x_type->vector_elements; i++) {
|
||||||
if (edge_type->base_type == GLSL_TYPE_DOUBLE)
|
if (edge_type->is_double())
|
||||||
body.emit(assign(t, f2d(b2f(gequal(swizzle(x, i, 1), swizzle(edge, i, 1)))),
|
body.emit(assign(t, f2d(b2f(gequal(swizzle(x, i, 1), swizzle(edge, i, 1)))),
|
||||||
1 << i));
|
1 << i));
|
||||||
else
|
else
|
||||||
@@ -4452,7 +4452,7 @@ builtin_builder::_outerProduct(builtin_available_predicate avail, const glsl_typ
|
|||||||
ir_variable *c;
|
ir_variable *c;
|
||||||
ir_variable *r;
|
ir_variable *r;
|
||||||
|
|
||||||
if (type->base_type == GLSL_TYPE_DOUBLE) {
|
if (type->is_double()) {
|
||||||
r = in_var(glsl_type::dvec(type->matrix_columns), "r");
|
r = in_var(glsl_type::dvec(type->matrix_columns), "r");
|
||||||
c = in_var(glsl_type::dvec(type->vector_elements), "c");
|
c = in_var(glsl_type::dvec(type->vector_elements), "c");
|
||||||
} else {
|
} else {
|
||||||
@@ -5475,7 +5475,7 @@ builtin_builder::_fma(builtin_available_predicate avail, const glsl_type *type)
|
|||||||
ir_function_signature *
|
ir_function_signature *
|
||||||
builtin_builder::_ldexp(const glsl_type *x_type, const glsl_type *exp_type)
|
builtin_builder::_ldexp(const glsl_type *x_type, const glsl_type *exp_type)
|
||||||
{
|
{
|
||||||
return binop(x_type->base_type == GLSL_TYPE_DOUBLE ? fp64 : gpu_shader5_or_es31_or_integer_functions,
|
return binop(x_type->is_double() ? fp64 : gpu_shader5_or_es31_or_integer_functions,
|
||||||
ir_binop_ldexp, x_type, x_type, exp_type);
|
ir_binop_ldexp, x_type, x_type, exp_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -784,7 +784,7 @@ ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
|
|||||||
if (type->is_matrix()) {
|
if (type->is_matrix()) {
|
||||||
/* Matrix - fill diagonal (rest is already set to 0) */
|
/* Matrix - fill diagonal (rest is already set to 0) */
|
||||||
assert(type->base_type == GLSL_TYPE_FLOAT ||
|
assert(type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
type->base_type == GLSL_TYPE_DOUBLE);
|
type->is_double());
|
||||||
for (unsigned i = 0; i < type->matrix_columns; i++) {
|
for (unsigned i = 0; i < type->matrix_columns; i++) {
|
||||||
if (type->base_type == GLSL_TYPE_FLOAT)
|
if (type->base_type == GLSL_TYPE_FLOAT)
|
||||||
this->value.f[i * type->vector_elements + i] =
|
this->value.f[i * type->vector_elements + i] =
|
||||||
|
@@ -58,7 +58,7 @@ ir_constant::equals(const ir_instruction *ir, enum ir_node_type) const
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (unsigned i = 0; i < type->components(); i++) {
|
for (unsigned i = 0; i < type->components(); i++) {
|
||||||
if (type->base_type == GLSL_TYPE_DOUBLE) {
|
if (type->is_double()) {
|
||||||
if (value.d[i] != other->value.d[i])
|
if (value.d[i] != other->value.d[i])
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -180,7 +180,7 @@ constant_template_mul = mako.template.Template("""\
|
|||||||
for (unsigned j = 0; j < p; j++) {
|
for (unsigned j = 0; j < p; j++) {
|
||||||
for (unsigned i = 0; i < n; i++) {
|
for (unsigned i = 0; i < n; i++) {
|
||||||
for (unsigned k = 0; k < m; k++) {
|
for (unsigned k = 0; k < m; k++) {
|
||||||
if (op[0]->type->base_type == GLSL_TYPE_DOUBLE)
|
if (op[0]->type->is_double())
|
||||||
data.d[i+n*j] += op[0]->value.d[i+n*k]*op[1]->value.d[k+m*j];
|
data.d[i+n*j] += op[0]->value.d[i+n*k]*op[1]->value.d[k+m*j];
|
||||||
else
|
else
|
||||||
data.f[i+n*j] += op[0]->value.f[i+n*k]*op[1]->value.f[k+m*j];
|
data.f[i+n*j] += op[0]->value.f[i+n*k]*op[1]->value.f[k+m*j];
|
||||||
@@ -277,11 +277,11 @@ constant_template_vector = mako.template.Template("""\
|
|||||||
constant_template_lrp = mako.template.Template("""\
|
constant_template_lrp = mako.template.Template("""\
|
||||||
case ${op.get_enum_name()}: {
|
case ${op.get_enum_name()}: {
|
||||||
assert(op[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(op[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
op[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
op[0]->type->is_double());
|
||||||
assert(op[1]->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(op[1]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
op[1]->type->base_type == GLSL_TYPE_DOUBLE);
|
op[1]->type->is_double());
|
||||||
assert(op[2]->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(op[2]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
op[2]->type->base_type == GLSL_TYPE_DOUBLE);
|
op[2]->type->is_double());
|
||||||
|
|
||||||
unsigned c2_inc = op[2]->type->is_scalar() ? 0 : 1;
|
unsigned c2_inc = op[2]->type->is_scalar() ? 0 : 1;
|
||||||
for (unsigned c = 0, c2 = 0; c < components; c2 += c2_inc, c++) {
|
for (unsigned c = 0, c2 = 0; c < components; c2 += c2_inc, c++) {
|
||||||
|
@@ -149,7 +149,7 @@ get_parameter_match_type(const ir_variable *param,
|
|||||||
if (from_type == to_type)
|
if (from_type == to_type)
|
||||||
return PARAMETER_EXACT_MATCH;
|
return PARAMETER_EXACT_MATCH;
|
||||||
|
|
||||||
if (to_type->base_type == GLSL_TYPE_DOUBLE) {
|
if (to_type->is_double()) {
|
||||||
if (from_type->base_type == GLSL_TYPE_FLOAT)
|
if (from_type->base_type == GLSL_TYPE_FLOAT)
|
||||||
return PARAMETER_FLOAT_TO_DOUBLE;
|
return PARAMETER_FLOAT_TO_DOUBLE;
|
||||||
return PARAMETER_INT_TO_DOUBLE;
|
return PARAMETER_INT_TO_DOUBLE;
|
||||||
|
@@ -253,7 +253,7 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
case ir_unop_sign:
|
case ir_unop_sign:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT ||
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT ||
|
||||||
ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE ||
|
ir->operands[0]->type->is_double() ||
|
||||||
ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
|
ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
|
||||||
assert(ir->type == ir->operands[0]->type);
|
assert(ir->type == ir->operands[0]->type);
|
||||||
break;
|
break;
|
||||||
@@ -262,7 +262,7 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
case ir_unop_rsq:
|
case ir_unop_rsq:
|
||||||
case ir_unop_sqrt:
|
case ir_unop_sqrt:
|
||||||
assert(ir->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(ir->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->type->base_type == GLSL_TYPE_DOUBLE);
|
ir->type->is_double());
|
||||||
assert(ir->type == ir->operands[0]->type);
|
assert(ir->type == ir->operands[0]->type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -334,18 +334,18 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
|
|
||||||
case ir_unop_bitcast_u642d:
|
case ir_unop_bitcast_u642d:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
|
||||||
assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->type->is_double());
|
||||||
break;
|
break;
|
||||||
case ir_unop_bitcast_i642d:
|
case ir_unop_bitcast_i642d:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
|
||||||
assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->type->is_double());
|
||||||
break;
|
break;
|
||||||
case ir_unop_bitcast_d2u64:
|
case ir_unop_bitcast_d2u64:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_UINT64);
|
assert(ir->type->base_type == GLSL_TYPE_UINT64);
|
||||||
break;
|
break;
|
||||||
case ir_unop_bitcast_d2i64:
|
case ir_unop_bitcast_d2i64:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_INT64);
|
assert(ir->type->base_type == GLSL_TYPE_INT64);
|
||||||
break;
|
break;
|
||||||
case ir_unop_i642i:
|
case ir_unop_i642i:
|
||||||
@@ -378,11 +378,11 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
break;
|
break;
|
||||||
case ir_unop_i642d:
|
case ir_unop_i642d:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
|
||||||
assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->type->is_double());
|
||||||
break;
|
break;
|
||||||
case ir_unop_u642d:
|
case ir_unop_u642d:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
|
||||||
assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->type->is_double());
|
||||||
break;
|
break;
|
||||||
case ir_unop_i2i64:
|
case ir_unop_i2i64:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
|
||||||
@@ -401,7 +401,7 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
assert(ir->type->base_type == GLSL_TYPE_INT64);
|
assert(ir->type->base_type == GLSL_TYPE_INT64);
|
||||||
break;
|
break;
|
||||||
case ir_unop_d2i64:
|
case ir_unop_d2i64:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_INT64);
|
assert(ir->type->base_type == GLSL_TYPE_INT64);
|
||||||
break;
|
break;
|
||||||
case ir_unop_i2u64:
|
case ir_unop_i2u64:
|
||||||
@@ -417,7 +417,7 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
assert(ir->type->base_type == GLSL_TYPE_UINT64);
|
assert(ir->type->base_type == GLSL_TYPE_UINT64);
|
||||||
break;
|
break;
|
||||||
case ir_unop_d2u64:
|
case ir_unop_d2u64:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_UINT64);
|
assert(ir->type->base_type == GLSL_TYPE_UINT64);
|
||||||
break;
|
break;
|
||||||
case ir_unop_u642i64:
|
case ir_unop_u642i64:
|
||||||
@@ -434,7 +434,7 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
case ir_unop_floor:
|
case ir_unop_floor:
|
||||||
case ir_unop_fract:
|
case ir_unop_fract:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
ir->operands[0]->type->is_double());
|
||||||
assert(ir->operands[0]->type == ir->type);
|
assert(ir->operands[0]->type == ir->type);
|
||||||
break;
|
break;
|
||||||
case ir_unop_sin:
|
case ir_unop_sin:
|
||||||
@@ -539,42 +539,42 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ir_unop_d2f:
|
case ir_unop_d2f:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_FLOAT);
|
assert(ir->type->base_type == GLSL_TYPE_FLOAT);
|
||||||
break;
|
break;
|
||||||
case ir_unop_f2d:
|
case ir_unop_f2d:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
|
||||||
assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->type->is_double());
|
||||||
break;
|
break;
|
||||||
case ir_unop_d2i:
|
case ir_unop_d2i:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_INT);
|
assert(ir->type->base_type == GLSL_TYPE_INT);
|
||||||
break;
|
break;
|
||||||
case ir_unop_i2d:
|
case ir_unop_i2d:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
|
||||||
assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->type->is_double());
|
||||||
break;
|
break;
|
||||||
case ir_unop_d2u:
|
case ir_unop_d2u:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_UINT);
|
assert(ir->type->base_type == GLSL_TYPE_UINT);
|
||||||
break;
|
break;
|
||||||
case ir_unop_u2d:
|
case ir_unop_u2d:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT);
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT);
|
||||||
assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->type->is_double());
|
||||||
break;
|
break;
|
||||||
case ir_unop_d2b:
|
case ir_unop_d2b:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->is_boolean());
|
assert(ir->type->is_boolean());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ir_unop_frexp_sig:
|
case ir_unop_frexp_sig:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
|
assert(ir->type->is_double());
|
||||||
break;
|
break;
|
||||||
case ir_unop_frexp_exp:
|
case ir_unop_frexp_exp:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
ir->operands[0]->type->is_double());
|
||||||
assert(ir->type->base_type == GLSL_TYPE_INT);
|
assert(ir->type->base_type == GLSL_TYPE_INT);
|
||||||
break;
|
break;
|
||||||
case ir_unop_subroutine_to_int:
|
case ir_unop_subroutine_to_int:
|
||||||
@@ -708,7 +708,7 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
assert(ir->type == glsl_type::float_type ||
|
assert(ir->type == glsl_type::float_type ||
|
||||||
ir->type == glsl_type::double_type);
|
ir->type == glsl_type::double_type);
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
ir->operands[0]->type->is_double());
|
||||||
assert(ir->operands[0]->type->is_vector());
|
assert(ir->operands[0]->type->is_vector());
|
||||||
assert(ir->operands[0]->type == ir->operands[1]->type);
|
assert(ir->operands[0]->type == ir->operands[1]->type);
|
||||||
break;
|
break;
|
||||||
@@ -749,7 +749,7 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
|
|
||||||
case ir_triop_fma:
|
case ir_triop_fma:
|
||||||
assert(ir->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(ir->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->type->base_type == GLSL_TYPE_DOUBLE);
|
ir->type->is_double());
|
||||||
assert(ir->type == ir->operands[0]->type);
|
assert(ir->type == ir->operands[0]->type);
|
||||||
assert(ir->type == ir->operands[1]->type);
|
assert(ir->type == ir->operands[1]->type);
|
||||||
assert(ir->type == ir->operands[2]->type);
|
assert(ir->type == ir->operands[2]->type);
|
||||||
@@ -757,7 +757,7 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||||||
|
|
||||||
case ir_triop_lrp:
|
case ir_triop_lrp:
|
||||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
|
ir->operands[0]->type->is_double());
|
||||||
assert(ir->operands[0]->type == ir->operands[1]->type);
|
assert(ir->operands[0]->type == ir->operands[1]->type);
|
||||||
assert(ir->operands[2]->type == ir->operands[0]->type ||
|
assert(ir->operands[2]->type == ir->operands[0]->type ||
|
||||||
ir->operands[2]->type == glsl_type::float_type ||
|
ir->operands[2]->type == glsl_type::float_type ||
|
||||||
|
@@ -772,7 +772,7 @@ private:
|
|||||||
|
|
||||||
if (type->without_array()->is_matrix()) {
|
if (type->without_array()->is_matrix()) {
|
||||||
const glsl_type *matrix = type->without_array();
|
const glsl_type *matrix = type->without_array();
|
||||||
const unsigned N = matrix->base_type == GLSL_TYPE_DOUBLE ? 8 : 4;
|
const unsigned N = matrix->is_double() ? 8 : 4;
|
||||||
const unsigned items =
|
const unsigned items =
|
||||||
row_major ? matrix->matrix_columns : matrix->vector_elements;
|
row_major ? matrix->matrix_columns : matrix->vector_elements;
|
||||||
|
|
||||||
|
@@ -165,7 +165,7 @@ lower_buffer_access::emit_access(void *mem_ctx,
|
|||||||
* gather the vector from each stored row.
|
* gather the vector from each stored row.
|
||||||
*/
|
*/
|
||||||
assert(deref->type->base_type == GLSL_TYPE_FLOAT ||
|
assert(deref->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
deref->type->base_type == GLSL_TYPE_DOUBLE);
|
deref->type->is_double());
|
||||||
/* Matrices, row_major or not, are stored as if they were
|
/* Matrices, row_major or not, are stored as if they were
|
||||||
* arrays of vectors of the appropriate size in std140.
|
* arrays of vectors of the appropriate size in std140.
|
||||||
* Arrays have their strides rounded up to a vec4, so the
|
* Arrays have their strides rounded up to a vec4, so the
|
||||||
|
@@ -650,7 +650,7 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
|||||||
case ir_binop_div:
|
case ir_binop_div:
|
||||||
if (is_vec_one(op_const[0]) && (
|
if (is_vec_one(op_const[0]) && (
|
||||||
ir->type->base_type == GLSL_TYPE_FLOAT ||
|
ir->type->base_type == GLSL_TYPE_FLOAT ||
|
||||||
ir->type->base_type == GLSL_TYPE_DOUBLE)) {
|
ir->type->is_double())) {
|
||||||
return new(mem_ctx) ir_expression(ir_unop_rcp,
|
return new(mem_ctx) ir_expression(ir_unop_rcp,
|
||||||
ir->operands[1]->type,
|
ir->operands[1]->type,
|
||||||
ir->operands[1],
|
ir->operands[1],
|
||||||
|
@@ -2330,7 +2330,7 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, st_src_reg *op)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ir_binop_ldexp:
|
case ir_binop_ldexp:
|
||||||
if (ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE) {
|
if (ir->operands[0]->type->is_double()) {
|
||||||
emit_asm(ir, TGSI_OPCODE_DLDEXP, result_dst, op[0], op[1]);
|
emit_asm(ir, TGSI_OPCODE_DLDEXP, result_dst, op[0], op[1]);
|
||||||
} else {
|
} else {
|
||||||
assert(!"Invalid ldexp for non-double opcode in glsl_to_tgsi_visitor::visit()");
|
assert(!"Invalid ldexp for non-double opcode in glsl_to_tgsi_visitor::visit()");
|
||||||
|
Reference in New Issue
Block a user