Mesa (vulkan): gen{7,8}_pipeline: Apply 3DPRIM_RECTLIST restrictions

Nanley Chery nchery at kemper.freedesktop.org
Thu Apr 14 01:04:20 UTC 2016


Module: Mesa
Branch: vulkan
Commit: 992bbed98d0eb226c2ad45eafb3cb2ad68f3fed7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=992bbed98d0eb226c2ad45eafb3cb2ad68f3fed7

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Thu Mar 31 10:04:46 2016 -0700

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 <nanley.g.chery at intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen at intel.com>

---

 src/intel/vulkan/gen7_pipeline.c | 4 ++--
 src/intel/vulkan/gen8_pipeline.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/intel/vulkan/gen7_pipeline.c b/src/intel/vulkan/gen7_pipeline.c
index 37e4639..1039734 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 b8b29d4..0d71e07 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),




More information about the mesa-commit mailing list