summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-12-22 11:40:32 +1000
committerDave Airlie <airlied@redhat.com>2016-02-19 11:18:23 +1000
commit2ed91e5f8f1ae1b9b7e97588e973a0462809fd9c (patch)
tree39db29ff6a08fea4b0ae7812cc103e55240f7067
parent2fd6ca7eb52cb6481a11a1cae27e3465652585fe (diff)
ABI break: need to add a new DRAW packet for this
-rw-r--r--src/gallium/include/pipe/p_state.h1
-rw-r--r--src/virgl_protocol.h3
-rw-r--r--src/vrend_decode.c2
-rw-r--r--src/vrend_renderer.c4
4 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index e6e38b2..d971777 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -542,6 +542,7 @@ struct pipe_draw_info
unsigned start_instance; /**< first instance id */
unsigned instance_count; /**< number of instances */
+ unsigned vertices_per_patch; /**< the number of vertices per patch */
/**
* For indexed drawing, these fields apply after index lookup.
*/
diff --git a/src/virgl_protocol.h b/src/virgl_protocol.h
index ca3142f..8c906c9 100644
--- a/src/virgl_protocol.h
+++ b/src/virgl_protocol.h
@@ -274,7 +274,7 @@ enum virgl_context_cmd {
#define VIRGL_SET_UNIFORM_BUFFER_RES_HANDLE 5
/* draw VBO */
-#define VIRGL_DRAW_VBO_SIZE 12
+#define VIRGL_DRAW_VBO_SIZE 13
#define VIRGL_DRAW_VBO_START 1
#define VIRGL_DRAW_VBO_COUNT 2
#define VIRGL_DRAW_VBO_MODE 3
@@ -287,6 +287,7 @@ enum virgl_context_cmd {
#define VIRGL_DRAW_VBO_MIN_INDEX 10
#define VIRGL_DRAW_VBO_MAX_INDEX 11
#define VIRGL_DRAW_VBO_COUNT_FROM_SO 12
+#define VIRGL_DRAW_VERTICES_PER_PATCH 13
/* create surface */
#define VIRGL_OBJ_SURFACE_SIZE 5
diff --git a/src/vrend_decode.c b/src/vrend_decode.c
index 4b0c561..ebde2a2 100644
--- a/src/vrend_decode.c
+++ b/src/vrend_decode.c
@@ -365,7 +365,7 @@ static int vrend_decode_draw_vbo(struct vrend_decode_ctx *ctx, int length)
info.restart_index = get_buf_entry(ctx, VIRGL_DRAW_VBO_RESTART_INDEX);
info.min_index = get_buf_entry(ctx, VIRGL_DRAW_VBO_MIN_INDEX);
info.max_index = get_buf_entry(ctx, VIRGL_DRAW_VBO_MAX_INDEX);
-
+ info.vertices_per_patch = get_buf_entry(ctx, VIRGL_DRAW_VERTICES_PER_PATCH);
cso = get_buf_entry(ctx, VIRGL_DRAW_VBO_COUNT_FROM_SO);
vrend_draw_vbo(ctx->grctx, &info, cso);
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 791c3d9..e5dfa3b 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -2870,6 +2870,10 @@ void vrend_draw_vbo(struct vrend_context *ctx,
glPrimitiveRestartIndex(info->restart_index);
}
}
+
+ if (info->vertices_per_patch) {
+ glPatchParameteri(GL_PATCH_VERTICES, info->vertices_per_patch);
+ }
/* set the vertex state up now on a delay */
if (!info->indexed) {
GLenum mode = info->mode;