freedreno/a3xx: move where we deal w/ binning FS
authorRob Clark <robclark@freedesktop.org>
Sun, 13 Mar 2016 16:15:28 +0000 (12:15 -0400)
committerRob Clark <robclark@freedesktop.org>
Sun, 13 Mar 2016 16:23:41 +0000 (12:23 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a3xx/fd3_draw.c
src/gallium/drivers/freedreno/a3xx/fd3_emit.h
src/gallium/drivers/freedreno/a3xx/fd3_program.c

index b8a31d84b3ff0d1deb9d38b58ddf40b2e36b4155..f48d464c2947c4cd3d50527e337550d380ed2874 100644 (file)
@@ -167,6 +167,7 @@ fd3_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 fd9c3caae677201c92456be0c8cfc6ce9d1abe30..5dbb11599b564824b89ef6d74c7d8ce5bd89284b 100644 (file)
@@ -75,8 +75,14 @@ static inline const struct ir3_shader_variant *
 fd3_emit_get_fp(struct fd3_emit *emit)
 {
        if (!emit->fp) {
-               struct fd3_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 fd3_shader_stateobj *so = emit->prog->fp;
+                       emit->fp = ir3_shader_variant(so->shader, emit->key);
+               }
        }
        return emit->fp;
 }
index a0fa40d1c25be7c3e62f78cb4048071f5a4ea119..57e269cc21f1a5013d3127c2a9778eb3a27d1467 100644 (file)
@@ -140,14 +140,7 @@ fd3_program_emit(struct fd_ringbuffer *ring, struct fd3_emit *emit,
        debug_assert(nr <= ARRAY_SIZE(color_regid));
 
        vp = fd3_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 = {};
-               fp = &binning_fp;
-       } else {
-               fp = fd3_emit_get_fp(emit);
-       }
+       fp = fd3_emit_get_fp(emit);
 
        vsi = &vp->info;
        fsi = &fp->info;