summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nvc0
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-08-13 02:29:56 -0400
committerMarge Bot <eric+marge@anholt.net>2021-08-21 00:08:11 +0000
commit10a46226b1ea157189120acc68ffad4abb728e94 (patch)
tree7fdd854e92d08c2a44f52d009dac0982d027f9f8 /src/gallium/drivers/nouveau/nvc0
parent6d7611262445cdc36a827a3062694f3f61fa2e41 (diff)
gallium: remove vertices_per_patch, add pipe_context::set_patch_vertices
We would like draw-only display lists to have immutable draw info and this is the only GL non-draw state in pipe_draw_info (not counting view_mask). It also allows removing some code from draw_vbo for tessellation. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12351>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_context.h1
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_state.c9
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c4
3 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
index c6871dc5440..0ad06db7984 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
@@ -254,6 +254,7 @@ struct nvc0_context {
float default_tess_outer[4];
float default_tess_inner[2];
+ uint8_t patch_vertices;
bool vbo_push_hint;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index e0b43ec1623..13c4fc6a27b 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -1004,6 +1004,14 @@ nvc0_set_tess_state(struct pipe_context *pipe,
}
static void
+nvc0_set_patch_vertices(struct pipe_context *pipe, uint8_t patch_vertices)
+{
+ struct nvc0_context *nvc0 = nvc0_context(pipe);
+
+ nvc0->patch_vertices = patch_vertices;
+}
+
+static void
nvc0_set_vertex_buffers(struct pipe_context *pipe,
unsigned start_slot, unsigned count,
unsigned unbind_num_trailing_slots,
@@ -1499,6 +1507,7 @@ nvc0_init_state_functions(struct nvc0_context *nvc0)
pipe->set_viewport_states = nvc0_set_viewport_states;
pipe->set_window_rectangles = nvc0_set_window_rectangles;
pipe->set_tess_state = nvc0_set_tess_state;
+ pipe->set_patch_vertices = nvc0_set_patch_vertices;
pipe->create_vertex_elements_state = nvc0_vertex_state_create;
pipe->delete_vertex_elements_state = nvc0_vertex_state_delete;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
index 29bc9b28fac..ca6bfda6c11 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
@@ -977,8 +977,8 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info,
}
if (info->mode == PIPE_PRIM_PATCHES &&
- nvc0->state.patch_vertices != info->vertices_per_patch) {
- nvc0->state.patch_vertices = info->vertices_per_patch;
+ nvc0->state.patch_vertices != nvc0->patch_vertices) {
+ nvc0->state.patch_vertices = nvc0->patch_vertices;
PUSH_SPACE(push, 1);
IMMED_NVC0(push, NVC0_3D(PATCH_VERTICES), nvc0->state.patch_vertices);
}