aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2019-05-05 11:39:08 +0200
committerChristian Gmeiner <[email protected]>2019-05-07 07:35:59 +0200
commite00fa99b08b39b50fa8d4afe11652d9d0f395254 (patch)
tree25ae431e390a9ee71e4ab2846410c7976aea8fa5 /src
parent4e110eca42ac2c56c5763a1f502e7c80db67e064 (diff)
glsl_to_nir: drop supports_ints
At initial nir level all drivers are supporting ints. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index a2c2f13416f..47159ebd5e8 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -90,7 +90,6 @@ private:
nir_alu_instr *emit(nir_op op, unsigned dest_size, nir_ssa_def *src1,
nir_ssa_def *src2, nir_ssa_def *src3);
- bool supports_ints;
bool supports_std430;
nir_shader *shader;
@@ -263,7 +262,6 @@ glsl_to_nir(struct gl_context *ctx,
nir_visitor::nir_visitor(gl_context *ctx, nir_shader *shader)
{
- this->supports_ints = true;
this->supports_std430 = ctx->Const.UseSTD430AsDefaultPacking;
this->shader = shader;
this->is_global = true;
@@ -307,10 +305,7 @@ nir_visitor::constant_copy(ir_constant *ir, void *mem_ctx)
assert(cols == 1);
for (unsigned r = 0; r < rows; r++)
- if (supports_ints)
- ret->values[0][r].u32 = ir->value.u[r];
- else
- ret->values[0][r].f32 = ir->value.u[r];
+ ret->values[0][r].u32 = ir->value.u[r];
break;
@@ -319,10 +314,7 @@ nir_visitor::constant_copy(ir_constant *ir, void *mem_ctx)
assert(cols == 1);
for (unsigned r = 0; r < rows; r++)
- if (supports_ints)
- ret->values[0][r].i32 = ir->value.i[r];
- else
- ret->values[0][r].f32 = ir->value.i[r];
+ ret->values[0][r].i32 = ir->value.i[r];
break;
@@ -1860,16 +1852,9 @@ nir_visitor::visit(ir_expression *ir)
glsl_base_type types[4];
for (unsigned i = 0; i < ir->num_operands; i++)
- if (supports_ints || !type_is_int(ir->operands[i]->type->base_type))
- types[i] = ir->operands[i]->type->base_type;
- else
- types[i] = GLSL_TYPE_FLOAT;
+ types[i] = ir->operands[i]->type->base_type;
- glsl_base_type out_type;
- if (supports_ints || !type_is_int(ir->type->base_type))
- out_type = ir->type->base_type;
- else
- out_type = GLSL_TYPE_FLOAT;
+ glsl_base_type out_type = ir->type->base_type;
switch (ir->operation) {
case ir_unop_bit_not: result = nir_inot(&b, srcs[0]); break;
@@ -1900,19 +1885,19 @@ nir_visitor::visit(ir_expression *ir)
case ir_unop_exp2: result = nir_fexp2(&b, srcs[0]); break;
case ir_unop_log2: result = nir_flog2(&b, srcs[0]); break;
case ir_unop_i2f:
- result = supports_ints ? nir_i2f32(&b, srcs[0]) : nir_fmov(&b, srcs[0]);
+ result = nir_i2f32(&b, srcs[0]);
break;
case ir_unop_u2f:
- result = supports_ints ? nir_u2f32(&b, srcs[0]) : nir_fmov(&b, srcs[0]);
+ result = nir_u2f32(&b, srcs[0]);
break;
case ir_unop_b2f:
result = nir_b2f32(&b, srcs[0]);
break;
case ir_unop_f2i:
- result = supports_ints ? nir_f2i32(&b, srcs[0]) : nir_ftrunc(&b, srcs[0]);
+ result = nir_f2i32(&b, srcs[0]);
break;
case ir_unop_f2u:
- result = supports_ints ? nir_f2u32(&b, srcs[0]) : nir_ftrunc(&b, srcs[0]);
+ result = nir_f2u32(&b, srcs[0]);
break;
case ir_unop_f2b:
case ir_unop_i2b: