freedreno/ir3: Add has_gs flag to shader key
authorKristian H. Kristensen <hoegsberg@google.com>
Thu, 10 Oct 2019 22:37:19 +0000 (15:37 -0700)
committerKristian H. Kristensen <hoegsberg@google.com>
Thu, 17 Oct 2019 20:43:53 +0000 (13:43 -0700)
Since the presence of GS changes how the VS operates we need to track
that in the shader key.

Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
src/freedreno/ir3/ir3_shader.h
src/gallium/drivers/freedreno/a6xx/fd6_draw.c

index 3073dfd07eba323af57a03beb557ae708c974bb3..fa6d5b7d387a4419be5fedae4182fee2667dc087 100644 (file)
@@ -213,6 +213,8 @@ struct ir3_shader_key {
                         */
                        unsigned rasterflat : 1;
                        unsigned fclamp_color : 1;
+
+                       unsigned has_gs : 1;
                };
                uint32_t global;
        };
@@ -310,9 +312,11 @@ ir3_normalize_key(struct ir3_shader_key *key, gl_shader_stage type)
                        key->vsaturate_r = 0;
                        key->vastc_srgb = 0;
                        key->vsamples = 0;
+                       key->has_gs = false; /* FS doesn't care */
                }
                break;
        case MESA_SHADER_VERTEX:
+       case MESA_SHADER_GEOMETRY:
                key->color_two_side = false;
                key->half_precision = false;
                key->rasterflat = false;
index 1d5df60c533da1af162f8e8b0bf51c887af6aeb6..a0df3dbc1eaae65ad14fcd34ec914d3c999764ee 100644 (file)
@@ -157,6 +157,9 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
                .sprite_coord_mode = ctx->rasterizer->sprite_coord_mode,
        };
 
+       if (emit.key.gs)
+               emit.key.key.has_gs = true;
+
        fixup_shader_state(ctx, &emit.key.key);
 
        if (!(ctx->dirty & FD_DIRTY_PROG)) {
@@ -209,13 +212,12 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
         */
        emit_marker6(ring, 7);
 
-       /* leave vis mode blank for now, it will be patched up when
-        * we know if we are binning or not
-        */
        uint32_t draw0 =
                CP_DRAW_INDX_OFFSET_0_PRIM_TYPE(primtype) |
-               CP_DRAW_INDX_OFFSET_0_VIS_CULL(USE_VISIBILITY) |
-               0x2000;
+               CP_DRAW_INDX_OFFSET_0_VIS_CULL(USE_VISIBILITY);
+
+       if (emit.key.gs)
+               draw0 |= CP_DRAW_INDX_OFFSET_0_GS_ENABLE;
 
        if (info->index_size) {
                draw0 |=