[Mesa-dev] [PATCH v2] anv: fix multiview for clear commands
Jason Ekstrand
jason at jlekstrand.net
Thu May 18 07:06:20 UTC 2017
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
On Wed, May 17, 2017 at 11:23 PM, Iago Toral Quiroga <itoral at igalia.com>
wrote:
> According to the VK_KHX_multiview spec:
>
> "Multiview causes all drawing and clear commands in the subpass to
> behave as if they were broadcast to each view, where each view is
> represented by one layer of the framebuffer attachments."
>
> This adds support for multiview clears, which were missing in the
> initial implementation.
>
> v2 (Jason):
> - split multiview from regular case
> - Use for_each_bit() macro
>
> Fixes new CTS multiview tests:
> dEQP-VK.multiview.clear_attachments.*
> ---
> src/intel/vulkan/anv_blorp.c | 41 ++++++++++++++++++++++++++++++
> +++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
> index 7b6944a..974ea31 100644
> --- a/src/intel/vulkan/anv_blorp.c
> +++ b/src/intel/vulkan/anv_blorp.c
> @@ -999,6 +999,25 @@ clear_color_attachment(struct anv_cmd_buffer
> *cmd_buffer,
> union isl_color_value clear_color =
> vk_to_isl_color(attachment->clearValue.color);
>
> + /* If multiview is enabled we ignore baseArrayLayer and layerCount */
> + if (subpass->view_mask) {
> + uint32_t view_idx;
> + for_each_bit(view_idx, subpass->view_mask) {
> + for (uint32_t r = 0; r < rectCount; ++r) {
> + const VkOffset2D offset = pRects[r].rect.offset;
> + const VkExtent2D extent = pRects[r].rect.extent;
> + blorp_clear_attachments(batch, binding_table,
> + ISL_FORMAT_UNSUPPORTED,
> pass_att->samples,
> + view_idx, 1,
> + offset.x, offset.y,
> + offset.x + extent.width,
> + offset.y + extent.height,
> + true, clear_color, false, 0.0f, 0, 0);
> + }
> + }
> + return;
> + }
> +
> for (uint32_t r = 0; r < rectCount; ++r) {
> const VkOffset2D offset = pRects[r].rect.offset;
> const VkExtent2D extent = pRects[r].rect.extent;
> @@ -1047,6 +1066,28 @@ clear_depth_stencil_attachment(struct
> anv_cmd_buffer *cmd_buffer,
> if (result != VK_SUCCESS)
> return;
>
> + /* If multiview is enabled we ignore baseArrayLayer and layerCount */
> + if (subpass->view_mask) {
> + uint32_t view_idx;
> + for_each_bit(view_idx, subpass->view_mask) {
> + for (uint32_t r = 0; r < rectCount; ++r) {
> + const VkOffset2D offset = pRects[r].rect.offset;
> + const VkExtent2D extent = pRects[r].rect.extent;
> + VkClearDepthStencilValue value = attachment->clearValue.
> depthStencil;
> + blorp_clear_attachments(batch, binding_table,
> + depth_format, pass_att->samples,
> + view_idx, 1,
> + offset.x, offset.y,
> + offset.x + extent.width,
> + offset.y + extent.height,
> + false, color_value,
> + clear_depth, value.depth,
> + clear_stencil ? 0xff : 0,
> value.stencil);
> + }
> + }
> + return;
> + }
> +
> for (uint32_t r = 0; r < rectCount; ++r) {
> const VkOffset2D offset = pRects[r].rect.offset;
> const VkExtent2D extent = pRects[r].rect.extent;
> --
> 2.7.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170518/93cc1ae9/attachment-0001.html>
More information about the mesa-dev
mailing list