mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
radv: Specify semantics of HTILE layout helpers.
And correct implementation to specify only what we support. Signed-off-by: Bas Nieuwenhuizen <basni@google.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
62e182acd0
commit
0628580eff
3 changed files with 20 additions and 3 deletions
|
|
@ -1104,6 +1104,10 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer)
|
||||||
struct radv_image *image = att->attachment->image;
|
struct radv_image *image = att->attachment->image;
|
||||||
cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, att->attachment->bo, 8);
|
cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, att->attachment->bo, 8);
|
||||||
|
|
||||||
|
/* We currently don't support writing decompressed HTILE */
|
||||||
|
assert(radv_layout_has_htile(image, layout) ==
|
||||||
|
radv_layout_is_htile_compressed(image, layout));
|
||||||
|
|
||||||
radv_emit_fb_ds_state(cmd_buffer, &att->ds, image, layout);
|
radv_emit_fb_ds_state(cmd_buffer, &att->ds, image, layout);
|
||||||
|
|
||||||
if (att->ds.offset_scale != cmd_buffer->state.offset_scale) {
|
if (att->ds.offset_scale != cmd_buffer->state.offset_scale) {
|
||||||
|
|
|
||||||
|
|
@ -773,14 +773,17 @@ radv_image_view_init(struct radv_image_view *iview,
|
||||||
bool radv_layout_has_htile(const struct radv_image *image,
|
bool radv_layout_has_htile(const struct radv_image *image,
|
||||||
VkImageLayout layout)
|
VkImageLayout layout)
|
||||||
{
|
{
|
||||||
return (layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL ||
|
return image->surface.htile_size &&
|
||||||
layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
|
(layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL ||
|
||||||
|
layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool radv_layout_is_htile_compressed(const struct radv_image *image,
|
bool radv_layout_is_htile_compressed(const struct radv_image *image,
|
||||||
VkImageLayout layout)
|
VkImageLayout layout)
|
||||||
{
|
{
|
||||||
return layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
return image->surface.htile_size &&
|
||||||
|
(layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL ||
|
||||||
|
layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool radv_layout_can_fast_clear(const struct radv_image *image,
|
bool radv_layout_can_fast_clear(const struct radv_image *image,
|
||||||
|
|
|
||||||
|
|
@ -1186,10 +1186,20 @@ struct radv_image {
|
||||||
uint32_t clear_value_offset;
|
uint32_t clear_value_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Whether the image has a htile that is known consistent with the contents of
|
||||||
|
* the image. */
|
||||||
bool radv_layout_has_htile(const struct radv_image *image,
|
bool radv_layout_has_htile(const struct radv_image *image,
|
||||||
VkImageLayout layout);
|
VkImageLayout layout);
|
||||||
|
|
||||||
|
/* Whether the image has a htile that is known consistent with the contents of
|
||||||
|
* the image and is allowed to be in compressed form.
|
||||||
|
*
|
||||||
|
* If this is false reads that don't use the htile should be able to return
|
||||||
|
* correct results.
|
||||||
|
*/
|
||||||
bool radv_layout_is_htile_compressed(const struct radv_image *image,
|
bool radv_layout_is_htile_compressed(const struct radv_image *image,
|
||||||
VkImageLayout layout);
|
VkImageLayout layout);
|
||||||
|
|
||||||
bool radv_layout_can_fast_clear(const struct radv_image *image,
|
bool radv_layout_can_fast_clear(const struct radv_image *image,
|
||||||
VkImageLayout layout,
|
VkImageLayout layout,
|
||||||
unsigned queue_mask);
|
unsigned queue_mask);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue