i965: If control_data_header_size_bits is zero, don't do EndPrimitive
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 23 May 2016 22:17:02 +0000 (15:17 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 1 Jun 2016 18:11:39 +0000 (11:11 -0700)
This can occur when max_vertices=0 is explicitly specified.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp

index 58191fc5611ebdc03a6f44f6b8328bd449240e29..e9f6999f9c35992102c25b0693edeaf7d34f1db2 100644 (file)
@@ -1668,6 +1668,9 @@ fs_visitor::emit_gs_end_primitive(const nir_src &vertex_count_nir_src)
    struct brw_gs_prog_data *gs_prog_data =
       (struct brw_gs_prog_data *) prog_data;
 
+   if (gs_compile->control_data_header_size_bits == 0)
+      return;
+
    /* We can only do EndPrimitive() functionality when the control data
     * consists of cut bits.  Fortunately, the only time it isn't is when the
     * output type is points, in which case EndPrimitive() is a no-op.
index 76a80a54f44113c9067c5ae3cadb8e693af6c60e..927438f9345f05fa82e5ebf9e48558951638437c 100644 (file)
@@ -539,6 +539,9 @@ vec4_gs_visitor::gs_end_primitive()
       return;
    }
 
+   if (c->control_data_header_size_bits == 0)
+      return;
+
    /* Cut bits use one bit per vertex. */
    assert(c->control_data_bits_per_vertex == 1);