anv: Allow vp_info to be NULL in 3DSTATE_CLIP code.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 29 Sep 2016 18:52:34 +0000 (11:52 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 12 Oct 2016 05:50:19 +0000 (22:50 -0700)
pViewportState may be NULL if rasterization is disabled.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/genX_pipeline_util.h

index 0ff92f16ef878e5c6c966c1212c814c6bc34c0a6..b5142ac9a6f15b00cad46bdafaf5e6503dac0d8f 100644 (file)
@@ -948,7 +948,7 @@ emit_3dstate_clip(struct anv_pipeline *pipeline,
 
       clip.MinimumPointWidth = 0.125;
       clip.MaximumPointWidth = 255.875;
-      clip.MaximumVPIndex    = vp_info->viewportCount - 1;
+      clip.MaximumVPIndex    = (vp_info ? vp_info->viewportCount : 1) - 1;
 
 #if GEN_GEN == 7
       clip.FrontWinding            = vk_to_gen_front_face[rs_info->frontFace];