aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-07-15 15:16:08 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-16 07:19:28 -0700
commitf7621a8c5f6f61f41196aa797c439cbee64d5233 (patch)
tree5540e1bf5600105d1d506d3eb1cecd9d4bd32423 /src
parentaaae6180bfeaced3d1c03c35340d4e39a34f66a6 (diff)
panfrost: Add Z/S and MRT BOs to the job
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_drm.c6
-rw-r--r--src/gallium/drivers/panfrost/pan_fragment.c16
2 files changed, 12 insertions, 10 deletions
diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c
index 8ff761ab2bd..5bd2e340751 100644
--- a/src/gallium/drivers/panfrost/pan_drm.c
+++ b/src/gallium/drivers/panfrost/pan_drm.c
@@ -293,12 +293,6 @@ panfrost_drm_submit_vs_fs_job(struct panfrost_context *ctx, bool has_draws, bool
}
if (job->first_tiler.gpu || job->clear) {
- struct pipe_surface *surf = ctx->pipe_framebuffer.cbufs[0];
- if (surf) {
- struct panfrost_resource *res = pan_resource(surf->texture);
- assert(res->bo);
- panfrost_job_add_bo(job, res->bo);
- }
ret = panfrost_drm_submit_job(ctx, panfrost_fragment_job(ctx, has_draws), PANFROST_JD_REQ_FS);
assert(!ret);
}
diff --git a/src/gallium/drivers/panfrost/pan_fragment.c b/src/gallium/drivers/panfrost/pan_fragment.c
index fe21cd094df..ab42e763be7 100644
--- a/src/gallium/drivers/panfrost/pan_fragment.c
+++ b/src/gallium/drivers/panfrost/pan_fragment.c
@@ -31,12 +31,17 @@
/* Mark a surface as written */
static void
-panfrost_initialize_surface(struct pipe_surface *surf)
+panfrost_initialize_surface(
+ struct panfrost_job *batch,
+ struct pipe_surface *surf)
{
unsigned level = surf->u.tex.level;
struct panfrost_resource *rsrc = pan_resource(surf->texture);
rsrc->slices[level].initialized = true;
+
+ assert(rsrc->bo);
+ panfrost_job_add_bo(batch, rsrc->bo);
}
/* Generate a fragment job. This should be called once per frame. (According to
@@ -49,15 +54,18 @@ panfrost_fragment_job(struct panfrost_context *ctx, bool has_draws)
panfrost_sfbd_fragment(ctx, has_draws) :
panfrost_mfbd_fragment(ctx, has_draws);
- /* Mark the affected buffers as initialized, since we're writing to it */
+ /* Mark the affected buffers as initialized, since we're writing to it.
+ * Also, add the surfaces we're writing to to the batch */
+
struct pipe_framebuffer_state *fb = &ctx->pipe_framebuffer;
+ struct panfrost_job *batch = panfrost_get_job_for_fbo(ctx);
for (unsigned i = 0; i < fb->nr_cbufs; ++i) {
- panfrost_initialize_surface(fb->cbufs[i]);
+ panfrost_initialize_surface(batch, fb->cbufs[i]);
}
if (fb->zsbuf)
- panfrost_initialize_surface(fb->zsbuf);
+ panfrost_initialize_surface(batch, fb->zsbuf);
struct mali_job_descriptor_header header = {
.job_type = JOB_TYPE_FRAGMENT,