<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 18, 2017 at 2:55 AM, Samuel Iglesias Gonsálvez <span dir="ltr"><<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 15/12/17 16:46, Jason Ekstrand wrote:<br>
> Ugh... The problem here is that we may not know the framebuffer in<br>
> CmdCearAttachments if it's in a secondary command buffer. I'm not<br>
> actually sure what to do in that case. I guess we could store the<br>
> number of later somewhere and teach blorp how to do an indirect draw. <br>
> Really, I think it makes more sense to just disallow VK_REMAINING_LAYERS<br>
> in that function.<br>
><br>
<br>
</span>Makes sense. How do you want to disallow it? assert(), print an error<br>
and return...? because this function doesn't return a VkResult.<br></blockquote><div><br></div><div>Assert should be fine. Looking at the spec, I don't think it allows it. In particular, the struct passed into vkCmdClearAttachment is *not* a VkImageSubresourceLayout.</div><div><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sam<br>
<div class="HOEnZb"><div class="h5"><br>
> --Jason<br>
><br>
><br>
> On December 15, 2017 03:36:07 Samuel Iglesias Gonsálvez<br>
> <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>> wrote:<br>
><br>
>> Blorp was not supporting the use of the constant<br>
>> VK_REMAINING_ARRAY_LAYERS<br>
>> (whose value is ~0) in the VkClearRect structure. If we receive it, we<br>
>> need<br>
>> to calculate the layer count as the image layers count minus the base<br>
>> array<br>
>> layer.<br>
>><br>
>> Signed-off-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>><br>
>> ---<br>
>> src/intel/vulkan/anv_blorp.c | 14 ++++++++++++--<br>
>> 1 file changed, 12 insertions(+), 2 deletions(-)<br>
>><br>
>> diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c<br>
>> index e244468e03..4ab4458246 100644<br>
>> --- a/src/intel/vulkan/anv_blorp.c<br>
>> +++ b/src/intel/vulkan/anv_blorp.c<br>
>> @@ -989,10 +989,15 @@ clear_color_attachment(struct anv_cmd_buffer<br>
>> *cmd_buffer,<br>
>> for (uint32_t r = 0; r < rectCount; ++r) {<br>
>> const VkOffset2D offset = pRects[r].rect.offset;<br>
>> const VkExtent2D extent = pRects[r].rect.extent;<br>
>> + unsigned layer_count =<br>
>> + anv_get_layerCount(<br>
>> + cmd_buffer->state.framebuffer-<wbr>>attachments[att_idx]->image,<br>
>> + &pRects[r]);<br>
>> +<br>
>> blorp_clear_attachments(batch, binding_table,<br>
>> ISL_FORMAT_UNSUPPORTED, pass_att->samples,<br>
>> pRects[r].baseArrayLayer,<br>
>> - pRects[r].layerCount,<br>
>> + layer_count,<br>
>> offset.x, offset.y,<br>
>> offset.x + extent.width, offset.y +<br>
>> extent.height,<br>
>> true, clear_color, false, 0.0f, 0, 0);<br>
>> @@ -1059,11 +1064,16 @@ clear_depth_stencil_<wbr>attachment(struct<br>
>> anv_cmd_buffer *cmd_buffer,<br>
>> for (uint32_t r = 0; r < rectCount; ++r) {<br>
>> const VkOffset2D offset = pRects[r].rect.offset;<br>
>> const VkExtent2D extent = pRects[r].rect.extent;<br>
>> + unsigned layer_count =<br>
>> + anv_get_layerCount(<br>
>> + cmd_buffer->state.framebuffer-<wbr>>attachments[att_idx]->image,<br>
>> + &pRects[r]);<br>
>> +<br>
>> VkClearDepthStencilValue value =<br>
>> attachment->clearValue.<wbr>depthStencil;<br>
>> blorp_clear_attachments(batch, binding_table,<br>
>> depth_format, pass_att->samples,<br>
>> pRects[r].baseArrayLayer,<br>
>> - pRects[r].layerCount,<br>
>> + layer_count,<br>
>> offset.x, offset.y,<br>
>> offset.x + extent.width, offset.y +<br>
>> extent.height,<br>
>> false, color_value,<br>
>> --<br>
>> 2.14.1<br>
>><br>
>> ______________________________<wbr>_________________<br>
>> mesa-dev mailing list<br>
>> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
>> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div></div>