[Mesa-dev] [PATCH 2/2] anv: Allow vp_info to be NULL in 3DSTATE_CLIP code.

Kenneth Graunke kenneth at whitecape.org
Wed Oct 12 00:17:24 UTC 2016


pViewportState may be NULL if rasterization is disabled.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/intel/vulkan/genX_pipeline_util.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/vulkan/genX_pipeline_util.h b/src/intel/vulkan/genX_pipeline_util.h
index 0ff92f1..b5142ac 100644
--- a/src/intel/vulkan/genX_pipeline_util.h
+++ b/src/intel/vulkan/genX_pipeline_util.h
@@ -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];
-- 
2.10.0



More information about the mesa-dev mailing list