<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, May 7, 2018 at 11:42 PM, 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">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    On 07/05/18 16:46, Jason Ekstrand wrote:<br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
    Thanks.<span class=""><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">Have you audited to ensure that we don't actually
        use it in this case?<br>
      </div>
    </blockquote>
    <br></span>
    I checked its usage in the driver. There is no problem except in one
    call to has_color_buffer_write_enable(<wbr>) that could be problematic.
    If you agree, I will add this hunk to this patch to avoid any
    problem:<br>
    <br>
    diff --git a/src/intel/vulkan/genX_<wbr>pipeline.c
    b/src/intel/vulkan/genX_<wbr>pipeline.c<br>
    index d3af9304ba3..6016d257584 100644<br>
    --- a/src/intel/vulkan/genX_<wbr>pipeline.c<br>
    +++ b/src/intel/vulkan/genX_<wbr>pipeline.c<br>
    @@ -1361,7 +1361,7 @@ has_color_buffer_write_<wbr>enabled(const struct
    anv_pipeline *pipeline,<br>
           if (binding->index == UINT32_MAX)<br>
              continue;<br>
     <br>
    -      if (blend->pAttachments[binding-><wbr>index].colorWriteMask
    != 0)<br>
    +      if (blend &&
    blend->pAttachments[binding-><wbr>index].colorWriteMask != 0)<br>
              return true;<br>
        }<br>
     <br>
    What do you think?<br></div></blockquote><div><br></div><div>Sounds good.<br><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"><div text="#000000" bgcolor="#FFFFFF">
    Sam<div><div class="h5"><br>
    <br>
    <blockquote type="cite">
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, May 7, 2018 at 1:01 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">According
            to Vulkan spec:<br>
            <br>
              "pColorBlendState is a pointer to an instance of the<br>
               <wbr>VkPipelineColorBlendStateCreat<wbr>eInfo structure, and
            is ignored if the<br>
               pipeline has rasterization disabled or if the subpass of
            the render pass the<br>
               pipeline is created against does not use any color
            attachments."<br>
            <br>
            Fixes tests from CL#2505:<br>
            <br>
               dEQP-VK.renderpass.*.simple.c<wbr>olor_unused_omit_blend_state<br>
            <br>
            Signed-off-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>><br>
            ---<br>
             src/intel/vulkan/anv_<wbr>pipeline.c | 14 ++++++++++++--<br>
             1 file changed, 12 insertions(+), 2 deletions(-)<br>
            <br>
            diff --git a/src/intel/vulkan/anv_pipelin<wbr>e.c
            b/src/intel/vulkan/anv_pipelin<wbr>e.c<br>
            index 87788de10a5..8f30136b100 100644<br>
            --- a/src/intel/vulkan/anv_pipelin<wbr>e.c<br>
            +++ b/src/intel/vulkan/anv_pipelin<wbr>e.c<br>
            @@ -1247,8 +1247,18 @@ anv_pipeline_validate_create_i<wbr>nfo(const
            VkGraphicsPipelineCreateInfo *info)<br>
                   if (subpass && subpass->depth_stencil_attachm<wbr>ent.attachment
            != VK_ATTACHMENT_UNUSED)<br>
                      assert(info->pDepthStencilStat<wbr>e);<br>
            <br>
            -      if (subpass && subpass->color_count >
            0)<br>
            -         assert(info-><wbr>pColorBlendState);<br>
            +      if (subpass && subpass->color_count >
            0) {<br>
            +         bool all_color_unused = true;<br>
            +         for (int i = 0; i < subpass->color_count;
            i++) {<br>
            +            if (subpass->color_attachments[i]<wbr>.attachment
            != VK_ATTACHMENT_UNUSED)<br>
            +               all_color_unused = false;<br>
            +         }<br>
            +         /* pColorBlendState is ignored if the pipeline has
            rasterization<br>
            +          * disabled or if the subpass of the render pass
            the pipeline is<br>
            +          * created against does not use any color
            attachments.<br>
            +          */<br>
            +         assert(info->pColorBlendState ||
            all_color_unused);<br>
            +      }<br>
                }<br>
            <br>
                for (uint32_t i = 0; i < info->stageCount; ++i) {<br>
            <span class="m_-7672901890159776544HOEnZb"><font color="#888888">-- <br>
                2.17.0<br>
                <br>
                ______________________________<wbr>_________________<br>
                mesa-dev mailing list<br>
                <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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>
              </font></span></blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div></div>