panfrost_flush(pctx, NULL, PIPE_FLUSH_END_OF_FRAME);
}
+ /* Invalidate the FBO job cache since we've just been assigned a new
+ * FB state.
+ */
+ ctx->job = NULL;
+
util_copy_framebuffer_state(&ctx->pipe_framebuffer, fb);
/* Given that we're rendering, we'd love to have compression */
*
*/
+#include <assert.h>
+
#include "pan_context.h"
#include "util/hash_table.h"
#include "util/ralloc.h"
/* If we already began rendering, use that */
- if (ctx->job)
+ if (ctx->job) {
+ assert(ctx->job->key.zsbuf == ctx->pipe_framebuffer.zsbuf &&
+ !memcmp(ctx->job->key.cbufs,
+ ctx->pipe_framebuffer.cbufs,
+ sizeof(ctx->job->key.cbufs)));
return ctx->job;
+ }
/* If not, look up the job */
struct pipe_surface *zsbuf = ctx->pipe_framebuffer.zsbuf;
struct panfrost_job *job = panfrost_get_job(ctx, cbufs, zsbuf);
+ /* Set this job as the current FBO job. Will be reset when updating the
+ * FB state and when submitting or releasing a job.
+ */
+ ctx->job = job;
return job;
}
if (ret)
fprintf(stderr, "panfrost_job_submit failed: %d\n", ret);
+
+ /* The job has been submitted, let's invalidate the current FBO job
+ * cache.
+ */
+ assert(!ctx->job || job == ctx->job);
+ ctx->job = NULL;
}
void