return framebuffer;
}
-/* Are we currently rendering to the screen (rather than an FBO)? */
-
-bool
-panfrost_is_scanout(struct panfrost_context *ctx)
-{
- /* If there is no color buffer, it's an FBO */
- if (ctx->pipe_framebuffer.nr_cbufs != 1)
- return false;
-
- /* If we're too early that no framebuffer was sent, it's scanout */
- if (!ctx->pipe_framebuffer.cbufs[0])
- return true;
-
- return ctx->pipe_framebuffer.cbufs[0]->texture->bind & PIPE_BIND_DISPLAY_TARGET ||
- ctx->pipe_framebuffer.cbufs[0]->texture->bind & PIPE_BIND_SCANOUT ||
- ctx->pipe_framebuffer.cbufs[0]->texture->bind & PIPE_BIND_SHARED;
-}
-
static void
panfrost_clear(
struct pipe_context *pipe,
*/
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
- bool is_scanout = panfrost_is_scanout(ctx);
+ bool is_scanout = panfrost_batch_is_scanout(batch);
bool has_draws = batch->last_job.gpu;
/* Bail out early when the current and new states are the same. */
struct pipe_fence_handle **fence,
unsigned flags);
-bool
-panfrost_is_scanout(struct panfrost_context *ctx);
-
mali_ptr panfrost_sfbd_fragment(struct panfrost_context *ctx, bool has_draws);
mali_ptr panfrost_mfbd_fragment(struct panfrost_context *ctx, bool has_draws);
batch->maxy = MIN2(batch->maxy, maxy);
}
+/* Are we currently rendering to the screen (rather than an FBO)? */
+
+bool
+panfrost_batch_is_scanout(struct panfrost_batch *batch)
+{
+ /* If there is no color buffer, it's an FBO */
+ if (batch->key.nr_cbufs != 1)
+ return false;
+
+ /* If we're too early that no framebuffer was sent, it's scanout */
+ if (!batch->key.cbufs[0])
+ return true;
+
+ return batch->key.cbufs[0]->texture->bind & PIPE_BIND_DISPLAY_TARGET ||
+ batch->key.cbufs[0]->texture->bind & PIPE_BIND_SCANOUT ||
+ batch->key.cbufs[0]->texture->bind & PIPE_BIND_SHARED;
+}
+
void
panfrost_batch_init(struct panfrost_context *ctx)
{
void
panfrost_scoreboard_link_batch(struct panfrost_batch *batch);
+bool
+panfrost_batch_is_scanout(struct panfrost_batch *batch);
+
#endif
* The exception is ReadPixels, but this is not supported on GLES so we
* can safely ignore it. */
- if (panfrost_is_scanout(ctx)) {
+ if (panfrost_batch_is_scanout(batch))
batch->requirements &= ~PAN_REQ_DEPTH_WRITE;
- }
/* Actualize the requirements */