zink/spirv: add support for nir_op_flrp

This fixes the following piglit:

spec@ati_fragment_shader@ati_fragment_shader-render-fog

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
This commit is contained in:
Erik Faye-Lund
2019-11-06 15:13:58 +01:00
parent 863872e141
commit d7a6cc8f4a
@@ -710,6 +710,15 @@ emit_builtin_binop(struct ntv_context *ctx, enum GLSLstd450 op, SpvId type,
op, args, ARRAY_SIZE(args));
}
static SpvId
emit_builtin_triop(struct ntv_context *ctx, enum GLSLstd450 op, SpvId type,
SpvId src0, SpvId src1, SpvId src2)
{
SpvId args[] = { src0, src1, src2 };
return spirv_builder_emit_ext_inst(&ctx->builder, type, ctx->GLSL_std_450,
op, args, ARRAY_SIZE(args));
}
static SpvId
get_fvec_constant(struct ntv_context *ctx, unsigned bit_size,
unsigned num_components, float value)
@@ -1013,6 +1022,12 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
}
break;
case nir_op_flrp:
assert(nir_op_infos[alu->op].num_inputs == 3);
result = emit_builtin_triop(ctx, GLSLstd450FMix, dest_type,
src[0], src[1], src[2]);
break;
case nir_op_fcsel:
result = emit_binop(ctx, SpvOpFOrdGreaterThan,
get_bvec_type(ctx, num_components),