panfrost_blend_context_init(struct pipe_context *pipe);
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 *
panfrost_get_blend_shader(
/* Create a final blend given the context */
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);
final.shader.work_count = shader->work_count;
final.shader.first_tag = shader->first_tag;
- /* Upload the shader, sharing a BO */
- if (!(*bo)) {
- *bo = panfrost_batch_create_bo(batch, 4096,
+ /* Upload the shader */
+ struct panfrost_bo *bo = panfrost_batch_create_bo(batch, shader->size,
PAN_BO_EXECUTE,
PAN_BO_ACCESS_PRIVATE |
PAN_BO_ACCESS_READ |
- PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
- }
-
- /* Size check */
- assert((*shader_offset + shader->size) < 4096);
- memcpy((*bo)->cpu + *shader_offset, shader->buffer, shader->size);
- final.shader.gpu = (*bo)->gpu + *shader_offset;
+ memcpy(bo->cpu, shader->buffer, shader->size);
+ final.shader.gpu = bo->gpu;
if (shader->patch_index) {
/* We have to specialize the blend shader to use constants, so
* 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);
}
- *shader_offset += shader->size;
-
return final;
}
unsigned rt_count = MAX2(ctx->pipe_framebuffer.nr_cbufs, 1);
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)
- blend[c] = panfrost_get_blend_for_context(ctx, c, &shader_bo,
- &shader_offset);
+ blend[c] = panfrost_get_blend_for_context(ctx, c);
/* Disable shader execution if we can */
if (dev->quirks & MIDGARD_SHADERLESS