[Mesa-dev] [PATCH 1/2] anv: Fix anv_pipeline_validate_create_info assertions.

Jason Ekstrand jason at jlekstrand.net
Wed Oct 12 02:10:17 UTC 2016


Sends reasonable. Rb

On Oct 11, 2016 5:17 PM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:

> Many of these can be "NULL if the pipeline has rasterization disabled."
> Also, we should assert that pMultisampleState exists.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/intel/vulkan/anv_pipeline.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_
> pipeline.c
> index f96fe22..6b393a6 100644
> --- a/src/intel/vulkan/anv_pipeline.c
> +++ b/src/intel/vulkan/anv_pipeline.c
> @@ -953,8 +953,7 @@ anv_pipeline_validate_create_info(const
> VkGraphicsPipelineCreateInfo *info)
>     struct anv_subpass *subpass = NULL;
>
>     /* Assert that all required members of VkGraphicsPipelineCreateInfo are
> -    * present, as explained by the Vulkan (20 Oct 2015, git-aa308cb),
> Section
> -    * 4.2 Graphics Pipeline.
> +    * present.  See the Vulkan 1.0.28 spec, Section 9.2 Graphics
> Pipelines.
>      */
>     assert(info->sType == VK_STRUCTURE_TYPE_GRAPHICS_
> PIPELINE_CREATE_INFO);
>
> @@ -969,14 +968,17 @@ anv_pipeline_validate_create_info(const
> VkGraphicsPipelineCreateInfo *info)
>     assert(info->stageCount >= 1);
>     assert(info->pVertexInputState);
>     assert(info->pInputAssemblyState);
> -   assert(info->pViewportState);
>     assert(info->pRasterizationState);
> +   if (!info->pRasterizationState->rasterizerDiscardEnable) {
> +      assert(info->pViewportState);
> +      assert(info->pMultisampleState);
>
> -   if (subpass && subpass->depth_stencil_attachment !=
> VK_ATTACHMENT_UNUSED)
> -      assert(info->pDepthStencilState);
> +      if (subpass && subpass->depth_stencil_attachment !=
> VK_ATTACHMENT_UNUSED)
> +         assert(info->pDepthStencilState);
>
> -   if (subpass && subpass->color_count > 0)
> -      assert(info->pColorBlendState);
> +      if (subpass && subpass->color_count > 0)
> +         assert(info->pColorBlendState);
> +   }
>
>     for (uint32_t i = 0; i < info->stageCount; ++i) {
>        switch (info->pStages[i].stage) {
> --
> 2.10.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161011/a64f2c3c/attachment-0001.html>


More information about the mesa-dev mailing list