diff options
author | Boris Brezillon <[email protected]> | 2019-10-01 20:12:12 +0200 |
---|---|---|
committer | Boris Brezillon <[email protected]> | 2019-10-03 16:55:38 -0400 |
commit | 12f790f7dac469909a30fa6d882a2790207df9a2 (patch) | |
tree | 42d1ce02264913861cc4f4f2037dcbba55a1af79 /src/gallium | |
parent | 02c265be9dcc5c5c23123e716ef62b384540d2fa (diff) |
panfrost: Add the shader BO to the batch in patch_shader_state()
We know a shader will be used by a batch when
panfrost_patch_shader_state() is called, so let's add the shader BO at
that time.
Suggested-by: Alyssa Rosenzweig <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 1b8558c1c2c..ba32564b6e0 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -842,12 +842,15 @@ panfrost_patch_shader_state( unsigned ubo_count = panfrost_ubo_count(ctx, stage); ss->tripipe->midgard1.uniform_buffer_count = ubo_count; + struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx); + + /* Add the shader BO to the batch. */ + panfrost_batch_add_bo(batch, ss->bo); + /* We can't reuse over frames; that's not safe. The descriptor must be * transient uploaded */ if (should_upload) { - struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx); - return panfrost_upload_transient(batch, ss->tripipe, sizeof(struct mali_shader_meta)); } @@ -936,8 +939,6 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data) panfrost_patch_shader_state(ctx, variant, PIPE_SHADER_FRAGMENT, false); - panfrost_batch_add_bo(batch, variant->bo); - #define COPY(name) ctx->fragment_shader_core.name = variant->tripipe->name COPY(shader); @@ -1121,8 +1122,6 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data) struct panfrost_shader_state *ss = &all->variants[all->active_variant]; - panfrost_batch_add_bo(batch, ss->bo); - /* Uniforms are implicitly UBO #0 */ bool has_uniforms = buf->enabled_mask & (1 << 0); |