freedreno/a6xx: don't evaluate FS tex state in binning pass
authorRob Clark <robdclark@chromium.org>
Thu, 16 May 2019 17:58:48 +0000 (10:58 -0700)
committerRob Clark <robdclark@chromium.org>
Mon, 20 May 2019 16:10:12 +0000 (09:10 -0700)
It is unneeded since FS doesn't run in binning pass.

Signed-off-by: Rob Clark <robdclark@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/a6xx/fd6_emit.h

index dfa0944cedbb90fae9bd0629239bfca7218b797b..23449ee892317227b888843edc2c2361700f820f 100644 (file)
@@ -566,12 +566,15 @@ fd6_emit_combined_textures(struct fd_ringbuffer *ring, struct fd6_emit *emit,
        struct fd_context *ctx = emit->ctx;
        bool needs_border = false;
 
-       static const enum fd6_state_id state_id[PIPE_SHADER_TYPES] = {
-               [PIPE_SHADER_VERTEX]    = FD6_GROUP_VS_TEX,
-               [PIPE_SHADER_FRAGMENT]  = FD6_GROUP_FS_TEX,
+       static const struct {
+               enum fd6_state_id state_id;
+               unsigned enable_mask;
+       } s[PIPE_SHADER_TYPES] = {
+               [PIPE_SHADER_VERTEX]    = { FD6_GROUP_VS_TEX, 0x7 },
+               [PIPE_SHADER_FRAGMENT]  = { FD6_GROUP_FS_TEX, 0x6 },
        };
 
-       debug_assert(state_id[type]);
+       debug_assert(s[type].state_id);
 
        if (!v->image_mapping.num_tex && !v->fb_read) {
                /* in the fast-path, when we don't have to mix in any image/SSBO
@@ -595,7 +598,8 @@ fd6_emit_combined_textures(struct fd_ringbuffer *ring, struct fd6_emit *emit,
 
                        needs_border |= tex->needs_border;
 
-                       fd6_emit_add_group(emit, tex->stateobj, state_id[type], 0x7);
+                       fd6_emit_add_group(emit, tex->stateobj, s[type].state_id,
+                                       s[type].enable_mask);
                }
        } else {
                /* In the slow-path, create a one-shot texture state object
@@ -615,7 +619,8 @@ fd6_emit_combined_textures(struct fd_ringbuffer *ring, struct fd6_emit *emit,
                        needs_border |= fd6_emit_textures(ctx->pipe, stateobj, type, tex,
                                        bcolor_offset, v, ctx);
 
-                       fd6_emit_add_group(emit, stateobj, state_id[type], 0x7);
+                       fd6_emit_add_group(emit, stateobj, s[type].state_id,
+                                       s[type].enable_mask);
 
                        fd_ringbuffer_del(stateobj);
                }
index 1780ae0bda99bc0c34cb7fef1570791574a00d11..5c86b9927402b6c6b6b6af7c27230ef791255749 100644 (file)
@@ -61,6 +61,9 @@ enum fd6_state_id {
 struct fd6_state_group {
        struct fd_ringbuffer *stateobj;
        enum fd6_state_id group_id;
+       /* enable_mask controls which states the stateobj is evaluated in,
+        * b0 is binning pass b1 and/or b2 is draw pass
+        */
        uint8_t enable_mask;
 };