[Mesa-dev] [PATCH] Vulkan: Solve the vkCreateGraphicsPipelines crash
Jason Ekstrand
jason at jlekstrand.net
Sat Mar 18 15:19:00 UTC 2017
Seems reasonable
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Cc: "17.0 13.0" <mesa-stable at lists.freedesktop.org>
On Sat, Mar 18, 2017 at 4:20 AM, Randy Xu <randy.xu at intel.com> wrote:
> From: "Xu,Randy" <randy.xu at intel.com>
>
> The crash is due to NULL pColorBlendState, which is legal if the
> pipeline has rasterization disabled or if the subpass of the render pass
> the pipeline is created against does not use any color attachments.
>
> Test: Sample subpasses from LunarG can run without crash
>
> Signed-off-by: Xu,Randy <randy.xu at intel.com>
> ---
> src/intel/vulkan/genX_pipeline.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_
> pipeline.c
> index cfc7c06..85a9e4f 100644
> --- a/src/intel/vulkan/genX_pipeline.c
> +++ b/src/intel/vulkan/genX_pipeline.c
> @@ -902,7 +902,7 @@ emit_cb_state(struct anv_pipeline *pipeline,
> /* We can have at most 8 attachments */
> assert(i < 8);
>
> - if (binding->index >= info->attachmentCount)
> + if (info == NULL || binding->index >= info->attachmentCount)
> continue;
>
> assert(binding->binding == 0);
> @@ -1423,7 +1423,7 @@ emit_3dstate_ps(struct anv_pipeline *pipeline,
> * source blend factors.
> */
> bool dual_src_blend = false;
> - if (wm_prog_data->dual_src_blend) {
> + if (wm_prog_data->dual_src_blend && blend) {
> for (uint32_t i = 0; i < blend->attachmentCount; i++) {
> const VkPipelineColorBlendAttachmentState *bstate =
> &blend->pAttachments[i];
> --
> 2.7.4
>
> _______________________________________________
> 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/20170318/206c13ff/attachment.html>
More information about the mesa-dev
mailing list