freedreno/ir3: fix rasterflat/glxgears
authorRob Clark <robdclark@chromium.org>
Thu, 9 May 2019 22:58:16 +0000 (15:58 -0700)
committerRob Clark <robdclark@chromium.org>
Thu, 9 May 2019 23:21:05 +0000 (16:21 -0700)
Ofc legacy gl features that are broken don't trigger fails in deqp.  I
should remember to test glxgears more often.

Fixes: 7ff6705b8d8 freedreno/ir3: convert to "new style" frag inputs
Signed-off-by: Rob Clark <robdclark@chromium.org>
src/freedreno/ir3/ir3_compiler_nir.c
src/freedreno/ir3/ir3_shader.h

index a35a1518398df6ccddd43526e911d552fb4332af..c230fbd3b708b6dbf5af25bd0941115bc9bb5dea 100644 (file)
@@ -1308,7 +1308,8 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr)
                        idx += nir_src_as_uint(intr->src[1]);
                        for (int i = 0; i < intr->num_components; i++) {
                                unsigned inloc = idx * 4 + i + comp;
-                               if (ctx->so->inputs[idx].bary) {
+                               if (ctx->so->inputs[idx].bary &&
+                                               !ctx->so->inputs[idx].use_ldlv) {
                                        dst[i] = ir3_BARY_F(b, create_immed(b, inloc), 0, coord, 0);
                                } else {
                                        /* for non-varyings use the pre-setup input, since
@@ -2406,8 +2407,6 @@ setup_input(struct ir3_context *ctx, nir_variable *in)
                                so->inputs[n].bary = true;
                                instr = create_frag_input(ctx, false, idx);
                        } else {
-                               bool use_ldlv = false;
-
                                /* detect the special case for front/back colors where
                                 * we need to do flat vs smooth shading depending on
                                 * rast state:
@@ -2428,12 +2427,12 @@ setup_input(struct ir3_context *ctx, nir_variable *in)
                                if (ctx->compiler->flat_bypass) {
                                        if ((so->inputs[n].interpolate == INTERP_MODE_FLAT) ||
                                                        (so->inputs[n].rasterflat && ctx->so->key.rasterflat))
-                                               use_ldlv = true;
+                                               so->inputs[n].use_ldlv = true;
                                }
 
                                so->inputs[n].bary = true;
 
-                               instr = create_frag_input(ctx, use_ldlv, idx);
+                               instr = create_frag_input(ctx, so->inputs[n].use_ldlv, idx);
                        }
 
                        compile_assert(ctx, idx < ctx->ir->ninputs);
index c13cf1df0bb577cadf3743515b6ea7f6f70bbe7e..c2c1a5312bc8042707159365403cf40afc6319a5 100644 (file)
@@ -459,6 +459,7 @@ struct ir3_shader_variant {
                /* fragment shader specific: */
                bool    bary       : 1;   /* fetched varying (vs one loaded into reg) */
                bool    rasterflat : 1;   /* special handling for emit->rasterflat */
+               bool    use_ldlv   : 1;   /* internal to ir3_compiler_nir */
                bool    half       : 1;
                enum glsl_interp_mode interpolate;
        } inputs[16 + 2];  /* +POSITION +FACE */