broadcom/vc5: Add support for GL_EXT_provoking_vertex.
authorEric Anholt <eric@anholt.net>
Mon, 2 Oct 2017 21:09:56 +0000 (14:09 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 10 Oct 2017 18:42:05 +0000 (11:42 -0700)
The bit was missing from the spec, but it's there in the simulator.  Fixes
the piglit clipflat test.

src/broadcom/cle/v3d_packet_v33.xml
src/gallium/drivers/vc5/vc5_emit.c
src/gallium/drivers/vc5/vc5_screen.c

index ba5ceb0d92e0a359f22d01c7466a9839256a1482..1c8ffe480ea6a352be4c015a27fb72eef07cecd9 100644 (file)
   </packet>
 
   <packet code="96" name="Configuration Bits">
+    <field name="Direct3D Provoking Vertex" size="1" start="21" type="bool"/>
     <field name="Direct3D 'Point-fill' mode" size="1" start="20" type="bool"/>
     <field name="Blend enable" size="1" start="19" type="bool"/>
     <field name="Stencil enable" size="1" start="18" type="bool"/>
index 7f78817bf91b2a629305a5f74773656fe65ac806..475db7bc86803f93eba2abc32b100088c32ec837 100644 (file)
@@ -248,6 +248,9 @@ vc5_emit_state(struct pipe_context *pctx)
                         config.rasterizer_oversample_mode =
                                 vc5->rasterizer->base.multisample;
 
+                        config.direct3d_provoking_vertex =
+                                vc5->rasterizer->base.flatshade_first;
+
                         config.blend_enable = vc5->blend->rt[0].blend_enable;
 
                         config.early_z_updates_enable = true;
index 792d430722b807546b27950ba2e790a135c2bbc6..66180d27ed5d1250ebbb7b339d7d76bd1b4c51a8 100644 (file)
@@ -111,6 +111,7 @@ vc5_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
         case PIPE_CAP_COMPUTE:
         case PIPE_CAP_DRAW_INDIRECT:
+        case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
                 return 1;
 
         case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
@@ -156,7 +157,6 @@ vc5_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
         case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
         case PIPE_CAP_SEAMLESS_CUBE_MAP:
-        case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
         case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
         case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
         case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: