summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/indices/u_unfilled_indices.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-05-25 11:58:29 -0600
committerBrian Paul <[email protected]>2016-05-26 17:44:17 -0600
commit0f983e1793360d98eb8e254755d95d33e2ea8ea2 (patch)
tree459d24b151c5166178d57e5a5fec7387bd48761c /src/gallium/auxiliary/indices/u_unfilled_indices.c
parentd6c2c7d7109785935086551ac3d82c4ad819483a (diff)
util/indices: implement unfilled (tri->line) conversion for adjacency prims
Tested with new piglit gl-3.2-adj-prims test. v2: re-order trisadj and tristripadj code, per Roland. Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/indices/u_unfilled_indices.c')
-rw-r--r--src/gallium/auxiliary/indices/u_unfilled_indices.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/indices/u_unfilled_indices.c b/src/gallium/auxiliary/indices/u_unfilled_indices.c
index 49fff6b8a9c..8cb5192d9a2 100644
--- a/src/gallium/auxiliary/indices/u_unfilled_indices.c
+++ b/src/gallium/auxiliary/indices/u_unfilled_indices.c
@@ -22,6 +22,12 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+
+/*
+ * NOTE: This file is not compiled by itself. It's actually #included
+ * by the generated u_unfilled_gen.c file!
+ */
+
#include "u_indices.h"
#include "u_indices_priv.h"
#include "util/u_prim.h"
@@ -104,6 +110,14 @@ nr_lines(unsigned prim, unsigned nr)
return (nr - 2) / 2 * 8;
case PIPE_PRIM_POLYGON:
return 2 * nr; /* a line (two verts) for each polygon edge */
+ /* Note: these cases can't really be handled since drawing lines instead
+ * of triangles would also require changing the GS. But if there's no GS,
+ * this should work.
+ */
+ case PIPE_PRIM_TRIANGLES_ADJACENCY:
+ return (nr / 6) * 6;
+ case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY:
+ return ((nr - 4) / 2) * 6;
default:
assert(0);
return 0;