panfrost,panvk: distinguish fbd bounding box from framebuffer size
On panvk, we can use the render area to set fbd bbox extents instead of setting them based on image sizes. Doing this improves partial updates (eg. loadOp:load with renderArea < image_size) of AFBC render targets. This commit introduces a new structure for this setting and uses it on both panvk and panfrost. We can't reuse the existing extent here as that is based on viewport+scissor, which can change within a renderpass/batch, which causes issues on panfrost. No functional changes for panfrost, as it doesn't have an equivalent to renderpass::renderArea so we can't do the same thing there, it still uses the entire framebuffer extent. Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37771>
This commit is contained in:
@@ -486,6 +486,8 @@ panfrost_batch_to_fb_info(const struct panfrost_batch *batch,
|
||||
fb->z_tile_buf_budget = dev->optimal_z_tib_size;
|
||||
fb->width = batch->key.width;
|
||||
fb->height = batch->key.height;
|
||||
fb->frame_bounding_box.maxx = batch->key.width - 1;
|
||||
fb->frame_bounding_box.maxy = batch->key.height - 1;
|
||||
fb->draw_extent.minx = batch->minx;
|
||||
fb->draw_extent.miny = batch->miny;
|
||||
fb->draw_extent.maxx = batch->maxx - 1;
|
||||
|
||||
@@ -1089,9 +1089,10 @@ GENX(pan_emit_fbd)(const struct pan_fb_info *fb, unsigned layer_idx,
|
||||
#endif
|
||||
cfg.width = fb->width;
|
||||
cfg.height = fb->height;
|
||||
cfg.bound_max_x = fb->width - 1;
|
||||
cfg.bound_max_y = fb->height - 1;
|
||||
|
||||
cfg.bound_min_x = fb->frame_bounding_box.minx;
|
||||
cfg.bound_min_y = fb->frame_bounding_box.miny;
|
||||
cfg.bound_max_x = fb->frame_bounding_box.maxx;
|
||||
cfg.bound_max_y = fb->frame_bounding_box.maxy;
|
||||
cfg.effective_tile_size = fb->tile_size;
|
||||
/* Ensure we cover the samples on the edge for 16x MSAA */
|
||||
cfg.tie_break_rule = fb->nr_samples == 16 ?
|
||||
|
||||
@@ -129,13 +129,20 @@ struct pan_fb_bifrost_info {
|
||||
} pre_post;
|
||||
};
|
||||
|
||||
struct pan_bbox {
|
||||
unsigned minx, miny, maxx, maxy;
|
||||
};
|
||||
|
||||
struct pan_fb_info {
|
||||
unsigned width, height;
|
||||
/* Draw-extent controlled by viewports/scissors. */
|
||||
struct {
|
||||
/* Max values are exclusive */
|
||||
unsigned minx, miny, maxx, maxy;
|
||||
} draw_extent;
|
||||
/* Draw-extent controlled by viewports/scissors.
|
||||
* Max values are exclusive */
|
||||
struct pan_bbox draw_extent;
|
||||
/* frame_bounding_box controls the bounding box in the framebuffer
|
||||
* descriptor for the entire pass. This is being controlled by the
|
||||
* renderArea of a renderpass in Vulkan. On GL, this covers the
|
||||
* entire frame. Max values are exclusive. */
|
||||
struct pan_bbox frame_bounding_box;
|
||||
unsigned nr_samples;
|
||||
unsigned force_samples; /* samples used for rasterization */
|
||||
unsigned rt_count;
|
||||
|
||||
@@ -343,6 +343,8 @@ panvk_per_arch(cmd_init_render_state)(struct panvk_cmd_buffer *cmdbuf,
|
||||
fbinfo->draw_extent.maxy = pRenderingInfo->renderArea.offset.y +
|
||||
pRenderingInfo->renderArea.extent.height - 1;
|
||||
|
||||
fbinfo->frame_bounding_box = fbinfo->draw_extent;
|
||||
|
||||
if (state->render.bound_attachments) {
|
||||
fbinfo->width = att_width;
|
||||
fbinfo->height = att_height;
|
||||
|
||||
Reference in New Issue
Block a user