<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 17, 2017 at 4:18 AM, James Legg <span dir="ltr"><<a href="mailto:jlegg@feralinteractive.com" target="_blank">jlegg@feralinteractive.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="">On Tue, 2017-07-11 at 17:04 -0700, Jason Ekstrand wrote:<br>
> We were early returning and never created the NULL surface state.<br>
><br>
> Cc: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.<wbr>org</a><br>
<br>
</span>This patch fixes a bug that affected me.<br>
<br>
Tested-by: James Legg <<a href="mailto:jlegg@feralinteractive.com">jlegg@feralinteractive.com</a>><br></blockquote><div><br></div><div>Thanks! Lionel already reviewed the patch so I went ahead and pushed this one. It's got a stable CC so it should end up back-ported to 17.1 as well.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I submitted a similar patch before seeing this one<br>
(<a href="https://patchwork.freedesktop.org/patch/167047/" rel="noreferrer" target="_blank">https://patchwork.<wbr>freedesktop.org/patch/167047/</a>)<wbr>. I'll drop that if<br>
this one is merged.<br>
<span class="HOEnZb"><font color="#888888"><br>
James<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> ---<br>
> src/intel/vulkan/genX_cmd_<wbr>buffer.c | 23 +++++++++++------------<br>
> 1 file changed, 11 insertions(+), 12 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/genX_cmd_<wbr>buffer.c b/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> index 53c58ca..9b3bb10 100644<br>
> --- a/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> +++ b/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> @@ -429,19 +429,18 @@ genX(cmd_buffer_setup_<wbr>attachments)(struct anv_cmd_buffer *cmd_buffer,<br>
> <br>
> vk_free(&cmd_buffer->pool-<wbr>>alloc, state->attachments);<br>
> <br>
> - if (pass->attachment_count == 0) {<br>
> + if (pass->attachment_count > 0) {<br>
> + state->attachments = vk_alloc(&cmd_buffer->pool-><wbr>alloc,<br>
> + <wbr> pass->attachment_count *<br>
> + <wbr> sizeof(state-><wbr>attachments[0]),<br>
> + <wbr> 8, VK_SYSTEM_ALLOCATION_SCOPE_<wbr>OBJECT);<br>
> + if (state->attachments == NULL) {<br>
> + /* Propagate VK_ERROR_OUT_OF_HOST_MEMORY to vkEndCommandBuffer */<br>
> + return anv_batch_set_error(&cmd_<wbr>buffer->batch,<br>
> + <wbr> VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
> + }<br>
> + } else {<br>
> state->attachments = NULL;<br>
> - return VK_SUCCESS;<br>
> - }<br>
> -<br>
> - state->attachments = vk_alloc(&cmd_buffer->pool-><wbr>alloc,<br>
> - <wbr> pass->attachment_count *<br>
> - <wbr> sizeof(state-><wbr>attachments[0]),<br>
> - <wbr> 8, VK_SYSTEM_ALLOCATION_SCOPE_<wbr>OBJECT);<br>
> - if (state->attachments == NULL) {<br>
> - /* Propagate VK_ERROR_OUT_OF_HOST_MEMORY to vkEndCommandBuffer */<br>
> - return anv_batch_set_error(&cmd_<wbr>buffer->batch,<br>
> - <wbr> VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
> }<br>
> <br>
> /* Reserve one for the NULL state. */<br>
> -- <br>
> 2.5.0.400.gff86faf<br>
</div></div></blockquote></div><br></div></div>