From: Nanley Chery Date: Thu, 31 Mar 2016 17:04:46 +0000 (-0700) Subject: gen{7,8}_pipeline: Apply 3DPRIM_RECTLIST restrictions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=992bbed98d0eb226c2ad45eafb3cb2ad68f3fed7;p=mesa.git gen{7,8}_pipeline: Apply 3DPRIM_RECTLIST restrictions According to 3D Primitives Overview in the Bspec, when the RECTLIST primitive is in use, the CLIP stage should be disabled or set to have a different Clip Mode, and Viewport Mapping must be disabled: Clipping: Must not require clipping or rely on the CLIP unit’s ClipTest logic to determine if clipping is required. Either the CLIP unit should be DISABLED, or the CLIP unit’s Clip Mode should be set to a value other than CLIPMODE_NORMAL. Viewport Mapping must be DISABLED (as is typical with the use of screen-space coordinates). We swap out ::disable_viewport for ::use_rectlist, because we currently always use the RECTLIST primitive when we disable viewport mapping, and we'll likely continue to use this primitive. Signed-off-by: Nanley Chery Reviewed-by: Kristian Høgsberg Kristensen --- diff --git a/src/intel/vulkan/gen7_pipeline.c b/src/intel/vulkan/gen7_pipeline.c index 37e4639b287..10397343e5f 100644 --- a/src/intel/vulkan/gen7_pipeline.c +++ b/src/intel/vulkan/gen7_pipeline.c @@ -47,7 +47,7 @@ gen7_emit_rs_state(struct anv_pipeline *pipeline, .StatisticsEnable = true, .FrontFaceFillMode = vk_to_gen_fillmode[info->polygonMode], .BackFaceFillMode = vk_to_gen_fillmode[info->polygonMode], - .ViewTransformEnable = !(extra && extra->disable_viewport), + .ViewTransformEnable = !(extra && extra->use_rectlist), .FrontWinding = vk_to_gen_front_face[info->frontFace], /* bool AntiAliasingEnable; */ @@ -225,7 +225,7 @@ genX(graphics_pipeline_create)( anv_batch_emit(&pipeline->batch, GENX(3DSTATE_CLIP), .FrontWinding = vk_to_gen_front_face[rs_info->frontFace], .CullMode = vk_to_gen_cullmode[rs_info->cullMode], - .ClipEnable = true, + .ClipEnable = !(extra && extra->use_rectlist), .APIMode = APIMODE_OGL, .ViewportXYClipTestEnable = !(extra && extra->disable_viewport), .ClipMode = CLIPMODE_NORMAL, diff --git a/src/intel/vulkan/gen8_pipeline.c b/src/intel/vulkan/gen8_pipeline.c index b8b29d46b8a..0d71e0719da 100644 --- a/src/intel/vulkan/gen8_pipeline.c +++ b/src/intel/vulkan/gen8_pipeline.c @@ -56,7 +56,7 @@ emit_rs_state(struct anv_pipeline *pipeline, struct GENX(3DSTATE_SF) sf = { GENX(3DSTATE_SF_header), - .ViewportTransformEnable = !(extra && extra->disable_viewport), + .ViewportTransformEnable = !(extra && extra->use_rectlist), .TriangleStripListProvokingVertexSelect = 0, .LineStripListProvokingVertexSelect = 0, .TriangleFanProvokingVertexSelect = 1, @@ -348,7 +348,7 @@ genX(graphics_pipeline_create)( const struct brw_wm_prog_data *wm_prog_data = get_wm_prog_data(pipeline); anv_batch_emit(&pipeline->batch, GENX(3DSTATE_CLIP), - .ClipEnable = true, + .ClipEnable = !(extra && extra->use_rectlist), .EarlyCullEnable = true, .APIMode = 1, /* D3D */ .ViewportXYClipTestEnable = !(extra && extra->disable_viewport),