freedreno/a4xx: move where we deal w/ binning FS
authorRob Clark <robclark@freedesktop.org>
Mon, 7 Mar 2016 05:52:03 +0000 (00:52 -0500)
committerRob Clark <robclark@freedesktop.org>
Sun, 13 Mar 2016 16:23:41 +0000 (12:23 -0400)
Move where we pick dummy FS for binning pass, so the whole driver sees
the same dummy/no-op FS stage.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_draw.c
src/gallium/drivers/freedreno/a4xx/fd4_emit.h
src/gallium/drivers/freedreno/a4xx/fd4_program.c

index 8cbe68d5790eb2c7f6a522ceca43cc3354e1a792..bc9cfae9aa07a6bf3de62fd417f626c9a22d1673 100644 (file)
@@ -156,6 +156,7 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
        emit.key.binning_pass = false;
        emit.dirty = dirty;
        emit.vp = NULL;   /* we changed key so need to refetch vp */
+       emit.fp = NULL;
        draw_impl(ctx, ctx->ring, &emit);
 }
 
index ba4a6ecc7ee5f128cd3eacd0362775f3d0dc05ef..d8d3fd88a695400e5f01f7337db6acb938c31dcc 100644 (file)
@@ -84,8 +84,14 @@ static inline const struct ir3_shader_variant *
 fd4_emit_get_fp(struct fd4_emit *emit)
 {
        if (!emit->fp) {
-               struct fd4_shader_stateobj *so = emit->prog->fp;
-               emit->fp = ir3_shader_variant(so->shader, emit->key);
+               if (emit->key.binning_pass) {
+                       /* use dummy stateobj to simplify binning vs non-binning: */
+                       static const struct ir3_shader_variant binning_fp = {};
+                       emit->fp = &binning_fp;
+               } else {
+                       struct fd4_shader_stateobj *so = emit->prog->fp;
+                       emit->fp = ir3_shader_variant(so->shader, emit->key);
+               }
        }
        return emit->fp;
 }
index 037c67f59ddfce4bd58bac21b8e5f77d75bac85e..082313fd77320af236185202ac6fc879018d7b04 100644 (file)
@@ -151,14 +151,7 @@ setup_stages(struct fd4_emit *emit, struct stage *s)
        unsigned i;
 
        s[VS].v = fd4_emit_get_vp(emit);
-
-       if (emit->key.binning_pass) {
-               /* use dummy stateobj to simplify binning vs non-binning: */
-               static const struct ir3_shader_variant binning_fp = {};
-               s[FS].v = &binning_fp;
-       } else {
-               s[FS].v = fd4_emit_get_fp(emit);
-       }
+       s[FS].v = fd4_emit_get_fp(emit);
 
        s[HS].v = s[DS].v = s[GS].v = NULL;  /* for now */