diff options
author | Eric Anholt <[email protected]> | 2016-08-04 13:20:31 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-08-19 13:11:36 -0700 |
commit | c078c41520214baf469dd4413f868e42c2959c5e (patch) | |
tree | cd80e21860e52cac2bfdc5fc5564d9253fb93eb2 /src/gallium/drivers/freedreno/ir3 | |
parent | 3f607f9e4f4a55d62088ea85192cda04a3e79a4e (diff) |
ttn: Use nir_load_front_face instead of the TGSI-style input.
This reduces the diff between GLSL-to-NIR and TGSI-to-NIR, and gives NIR
more optimization to work on.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c index 63235663ffe..22f5525c6aa 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c @@ -571,48 +571,6 @@ create_frag_coord(struct ir3_compile *ctx, unsigned comp) } } -/* NOTE: this creates the "TGSI" style fragface (ie. input slot - * VARYING_SLOT_FACE). For NIR style nir_intrinsic_load_front_face - * we can just use the value from hw directly (since it is boolean) - */ -static struct ir3_instruction * -create_frag_face(struct ir3_compile *ctx, unsigned comp) -{ - struct ir3_block *block = ctx->block; - struct ir3_instruction *instr; - - switch (comp) { - case 0: /* .x */ - compile_assert(ctx, !ctx->frag_face); - - ctx->frag_face = create_input(block, 0); - ctx->frag_face->regs[0]->flags |= IR3_REG_HALF; - - /* for faceness, we always get -1 or 0 (int).. but TGSI expects - * positive vs negative float.. and piglit further seems to - * expect -1.0 or 1.0: - * - * mul.s tmp, hr0.x, 2 - * add.s tmp, tmp, 1 - * mov.s32f32, dst, tmp - * - */ - instr = ir3_MUL_S(block, ctx->frag_face, 0, - create_immed(block, 2), 0); - instr = ir3_ADD_S(block, instr, 0, - create_immed(block, 1), 0); - instr = ir3_COV(block, instr, TYPE_S32, TYPE_F32); - - return instr; - case 1: /* .y */ - case 2: /* .z */ - return create_immed(block, fui(0.0)); - default: - case 3: /* .w */ - return create_immed(block, fui(1.0)); - } -} - static struct ir3_instruction * create_driver_param(struct ir3_compile *ctx, enum ir3_driver_param dp) { @@ -2053,10 +2011,6 @@ setup_input(struct ir3_compile *ctx, nir_variable *in) so->inputs[n].slot = VARYING_SLOT_VAR8; so->inputs[n].bary = true; instr = create_frag_input(ctx, false); - } else if (slot == VARYING_SLOT_FACE) { - so->inputs[n].bary = false; - so->frag_face = true; - instr = create_frag_face(ctx, i); } else { bool use_ldlv = false; |