miny = MIN2(ctx->pipe_framebuffer.height, miny);
maxy = MIN2(ctx->pipe_framebuffer.height, maxy);
+ /* Update the job, unless we're doing wallpapering (whose lack of
+ * scissor we can ignore, since if we "miss" a tile of wallpaper, it'll
+ * just... be faster :) */
+
+ if (!ctx->in_wallpaper)
+ panfrost_job_union_scissor(job, minx, miny, maxx, maxy);
+
/* Upload */
view.viewport0[0] = minx;
return;
/* Blit the wallpaper in */
+ ctx->in_wallpaper = true;
panfrost_blit_wallpaper(ctx);
+ ctx->in_wallpaper = false;
/* We are flushing all queued draws and we know that no more jobs will
* be added until the next frame.
struct primconvert_context *primconvert;
struct blitter_context *blitter;
+ bool in_wallpaper;
struct panfrost_blend_state *blend;
#endif
};
+ struct panfrost_job *job = panfrost_get_job_for_fbo(ctx);
+
struct mali_payload_fragment payload = {
- .min_tile_coord = MALI_COORDINATE_TO_TILE_MIN(0, 0),
- .max_tile_coord = MALI_COORDINATE_TO_TILE_MAX(ctx->pipe_framebuffer.width, ctx->pipe_framebuffer.height),
+ .min_tile_coord = MALI_COORDINATE_TO_TILE_MIN(job->minx, job->miny),
+ .max_tile_coord = MALI_COORDINATE_TO_TILE_MAX(job->maxx, job->maxy),
.framebuffer = framebuffer,
};
job->bos = _mesa_set_create(job,
_mesa_hash_pointer,
_mesa_key_pointer_equal);
+
+ job->minx = job->miny = ~0;
+ job->maxx = job->maxy = 0;
return job;
}
}
job->clear |= buffers;
+
+ /* Clearing affects the entire framebuffer (by definition -- this is
+ * the Gallium clear callback, which clears the whole framebuffer. If
+ * the scissor test were enabled from the GL side, the state tracker
+ * would emit a quad instead and we wouldn't go down this code path) */
+
+ panfrost_job_union_scissor(job, 0, 0,
+ ctx->pipe_framebuffer.width,
+ ctx->pipe_framebuffer.height);
}
void
return _mesa_hash_data(key, sizeof(struct panfrost_job_key));
}
+/* Given a new bounding rectangle (scissor), let the job cover the union of the
+ * new and old bounding rectangles */
+
+void
+panfrost_job_union_scissor(struct panfrost_job *job,
+ unsigned minx, unsigned miny,
+ unsigned maxx, unsigned maxy)
+{
+ job->minx = MIN2(job->minx, minx);
+ job->miny = MIN2(job->miny, miny);
+ job->maxx = MAX2(job->maxx, maxx);
+ job->maxy = MAX2(job->maxy, maxy);
+}
+
void
panfrost_job_init(struct panfrost_context *ctx)
{
* bitmask) */
unsigned requirements;
+ /* The bounding box covered by this job, taking scissors into account.
+ * Basically, the bounding box we have to run fragment shaders for */
+
+ unsigned minx, miny;
+ unsigned maxx, maxy;
+
/* BOs referenced -- will be used for flushing logic */
struct set *bos;
};
const union pipe_color_union *color,
double depth, unsigned stencil);
+void
+panfrost_job_union_scissor(struct panfrost_job *job,
+ unsigned minx, unsigned miny,
+ unsigned maxx, unsigned maxy);
+
#endif