diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-31 14:15:19 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-01 16:23:03 -0700 |
commit | 3113be312762584a79f120c9cd7fd4e786a8dc3b (patch) | |
tree | f8420ac96c4dcebca51f6759ce1273cac7446050 /src/gallium/drivers/panfrost | |
parent | ac6aa93f9e500acf7abda3d8e826f4d207e5c1b8 (diff) |
panfrost: Unify-driven cleanup
Again, now that stages are unified some logic goes away.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index b5e50854502..fe0d0254d6a 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -1278,24 +1278,12 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data) memcpy(transfer.cpu + sys_size, cpu, uniform_size); } - int uniform_count = 0; + int uniform_count = + ctx->shader[i]->variants[ctx->shader[i]->active_variant].uniform_count; struct mali_vertex_tiler_postfix *postfix = &ctx->payloads[i].postfix; - switch (i) { - case PIPE_SHADER_VERTEX: - uniform_count = ctx->shader[PIPE_SHADER_VERTEX]->variants[ctx->shader[PIPE_SHADER_VERTEX]->active_variant].uniform_count; - break; - - case PIPE_SHADER_FRAGMENT: - uniform_count = ctx->shader[PIPE_SHADER_FRAGMENT]->variants[ctx->shader[PIPE_SHADER_FRAGMENT]->active_variant].uniform_count; - break; - - default: - unreachable("Invalid shader stage\n"); - } - /* Next up, attach UBOs. UBO #0 is the uniforms we just * uploaded */ @@ -2060,14 +2048,12 @@ panfrost_bind_shader_state( { struct panfrost_context *ctx = pan_context(pctx); - if (type == PIPE_SHADER_FRAGMENT) { - ctx->shader[PIPE_SHADER_FRAGMENT] = hwcso; + ctx->shader[type] = hwcso; + + if (type == PIPE_SHADER_FRAGMENT) ctx->dirty |= PAN_DIRTY_FS; - } else { - assert(type == PIPE_SHADER_VERTEX); - ctx->shader[PIPE_SHADER_VERTEX] = hwcso; + else ctx->dirty |= PAN_DIRTY_VS; - } if (!hwcso) return; |