aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-18 19:38:33 -0500
committerMarek Olšák <[email protected]>2020-03-04 19:54:42 -0500
commit4c6323c49f1f394f54ea9b9d8e514c2706e3984d (patch)
treee890c5be94a18f0e102d91218414d2275d3f111b /src
parentf97341a9d6d4377950e313e76f75230d80f6240d (diff)
vbo: handle GS and tess primitive types when splitting Begin/End
Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/vbo/vbo_exec.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index afda3635fc9..8fae73adfa2 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -256,11 +256,36 @@ vbo_copy_vertices(struct gl_context *ctx,
copy = count % 3;
break;
case GL_QUADS:
+ case GL_LINES_ADJACENCY:
copy = count % 4;
break;
+ case GL_TRIANGLES_ADJACENCY:
+ copy = count % 6;
+ break;
case GL_LINE_STRIP:
copy = MIN2(1, count);
break;
+ case GL_LINE_STRIP_ADJACENCY:
+ /* We need to copy 3 vertices, because:
+ * Last strip: ---o---o---x (last line)
+ * Next strip: x---o---o--- (next line)
+ */
+ copy = MIN2(3, count);
+ break;
+ case GL_PATCHES:
+ if (in_dlist) {
+ /* We don't know the value of GL_PATCH_VERTICES when compiling
+ * a display list.
+ *
+ * Fail an assertion in debug builds and use the value of 3
+ * in release builds, which is more likely than any other value.
+ */
+ assert(!"patch_vertices is unknown");
+ copy = count % 3;
+ } else {
+ copy = count % ctx->TessCtrlProgram.patch_vertices;
+ }
+ break;
case GL_LINE_LOOP:
if (!in_dlist && last_prim->begin == 0) {
/* We're dealing with the second or later section of a split/wrapped
@@ -299,6 +324,8 @@ vbo_copy_vertices(struct gl_context *ctx,
break;
case PRIM_OUTSIDE_BEGIN_END:
return 0;
+ case GL_TRIANGLE_STRIP_ADJACENCY:
+ /* TODO: Splitting tri strips with adjacency is too complicated. */
default:
unreachable("Unexpected primitive type");
return 0;