mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 15:40:11 +01:00
panfrost: Drop implicit blend pooling
We dropped blend shader pools a long time ago for various reasons, but the indirection required remained. Oops. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
This commit is contained in:
parent
d8deb1eb6a
commit
dc7fbe114b
3 changed files with 8 additions and 19 deletions
|
|
@ -115,7 +115,7 @@ void
|
||||||
panfrost_blend_context_init(struct pipe_context *pipe);
|
panfrost_blend_context_init(struct pipe_context *pipe);
|
||||||
|
|
||||||
struct panfrost_blend_final
|
struct panfrost_blend_final
|
||||||
panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rt, struct panfrost_bo **bo, unsigned *shader_offset);
|
panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rt);
|
||||||
|
|
||||||
struct panfrost_blend_shader *
|
struct panfrost_blend_shader *
|
||||||
panfrost_get_blend_shader(
|
panfrost_get_blend_shader(
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ panfrost_blend_constant(float *out, float *in, unsigned mask)
|
||||||
/* Create a final blend given the context */
|
/* Create a final blend given the context */
|
||||||
|
|
||||||
struct panfrost_blend_final
|
struct panfrost_blend_final
|
||||||
panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti, struct panfrost_bo **bo, unsigned *shader_offset)
|
panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti)
|
||||||
{
|
{
|
||||||
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
|
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
|
||||||
|
|
||||||
|
|
@ -268,32 +268,24 @@ panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti, struc
|
||||||
final.shader.work_count = shader->work_count;
|
final.shader.work_count = shader->work_count;
|
||||||
final.shader.first_tag = shader->first_tag;
|
final.shader.first_tag = shader->first_tag;
|
||||||
|
|
||||||
/* Upload the shader, sharing a BO */
|
/* Upload the shader */
|
||||||
if (!(*bo)) {
|
struct panfrost_bo *bo = panfrost_batch_create_bo(batch, shader->size,
|
||||||
*bo = panfrost_batch_create_bo(batch, 4096,
|
|
||||||
PAN_BO_EXECUTE,
|
PAN_BO_EXECUTE,
|
||||||
PAN_BO_ACCESS_PRIVATE |
|
PAN_BO_ACCESS_PRIVATE |
|
||||||
PAN_BO_ACCESS_READ |
|
PAN_BO_ACCESS_READ |
|
||||||
PAN_BO_ACCESS_VERTEX_TILER |
|
|
||||||
PAN_BO_ACCESS_FRAGMENT);
|
PAN_BO_ACCESS_FRAGMENT);
|
||||||
}
|
|
||||||
|
|
||||||
/* Size check */
|
memcpy(bo->cpu, shader->buffer, shader->size);
|
||||||
assert((*shader_offset + shader->size) < 4096);
|
final.shader.gpu = bo->gpu;
|
||||||
|
|
||||||
memcpy((*bo)->cpu + *shader_offset, shader->buffer, shader->size);
|
|
||||||
final.shader.gpu = (*bo)->gpu + *shader_offset;
|
|
||||||
|
|
||||||
if (shader->patch_index) {
|
if (shader->patch_index) {
|
||||||
/* We have to specialize the blend shader to use constants, so
|
/* We have to specialize the blend shader to use constants, so
|
||||||
* patch in the current constants */
|
* patch in the current constants */
|
||||||
|
|
||||||
float *patch = (float *) ((*bo)->cpu + *shader_offset + shader->patch_index);
|
float *patch = (float *) (bo->cpu + shader->patch_index);
|
||||||
memcpy(patch, ctx->blend_color.color, sizeof(float) * 4);
|
memcpy(patch, ctx->blend_color.color, sizeof(float) * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
*shader_offset += shader->size;
|
|
||||||
|
|
||||||
return final;
|
return final;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -554,12 +554,9 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx,
|
||||||
unsigned rt_count = MAX2(ctx->pipe_framebuffer.nr_cbufs, 1);
|
unsigned rt_count = MAX2(ctx->pipe_framebuffer.nr_cbufs, 1);
|
||||||
|
|
||||||
struct panfrost_blend_final blend[PIPE_MAX_COLOR_BUFS];
|
struct panfrost_blend_final blend[PIPE_MAX_COLOR_BUFS];
|
||||||
unsigned shader_offset = 0;
|
|
||||||
struct panfrost_bo *shader_bo = NULL;
|
|
||||||
|
|
||||||
for (unsigned c = 0; c < rt_count; ++c)
|
for (unsigned c = 0; c < rt_count; ++c)
|
||||||
blend[c] = panfrost_get_blend_for_context(ctx, c, &shader_bo,
|
blend[c] = panfrost_get_blend_for_context(ctx, c);
|
||||||
&shader_offset);
|
|
||||||
|
|
||||||
/* Disable shader execution if we can */
|
/* Disable shader execution if we can */
|
||||||
if (dev->quirks & MIDGARD_SHADERLESS
|
if (dev->quirks & MIDGARD_SHADERLESS
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue