summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXu,Randy <randy.xu@intel.com>2017-03-18 19:20:17 +0800
committerTapani Pälli <tapani.palli@intel.com>2017-03-20 08:31:18 +0200
commit57595cb0739d50a3fbd0841d7475bd775f3e24f3 (patch)
tree4b4fd3658e542faf4b7c515af6b354aaee3cc39e /src
parente70e7cc7ffcb40f2ac6844b19a2d9b1bb26693a7 (diff)
anv/genX: Solve the vkCreateGraphicsPipelines crash
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@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "17.0 13.0" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/genX_pipeline.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index cfc7c06fa4c..85a9e4fd290 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];