aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-06-12 00:46:18 -0400
committerIlia Mirkin <[email protected]>2016-06-18 13:38:30 -0400
commitb21a00d1295d721275946e045e92920acdcb1a85 (patch)
tree737ab6c6b8be2cdc991426406936a58b3ca7dca5 /src/gallium/drivers/nouveau/nvc0/nvc0_state.c
parentd1bdc1238a39469e6760758876e8832019795a54 (diff)
nvc0: add support for GL_EXT_window_rectangles
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_state.c')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_state.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index 92161ec9e65..7e42be76bf1 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -1000,6 +1000,22 @@ nvc0_set_viewport_states(struct pipe_context *pipe,
}
static void
+nvc0_set_window_rectangles(struct pipe_context *pipe,
+ boolean include,
+ unsigned num_rectangles,
+ const struct pipe_scissor_state *rectangles)
+{
+ struct nvc0_context *nvc0 = nvc0_context(pipe);
+
+ nvc0->window_rect.inclusive = include;
+ nvc0->window_rect.rects = MIN2(num_rectangles, NVC0_MAX_WINDOW_RECTANGLES);
+ memcpy(nvc0->window_rect.rect, rectangles,
+ sizeof(struct pipe_scissor_state) * nvc0->window_rect.rects);
+
+ nvc0->dirty_3d |= NVC0_NEW_3D_WINDOW_RECTS;
+}
+
+static void
nvc0_set_tess_state(struct pipe_context *pipe,
const float default_tess_outer[4],
const float default_tess_inner[2])
@@ -1490,6 +1506,7 @@ nvc0_init_state_functions(struct nvc0_context *nvc0)
pipe->set_polygon_stipple = nvc0_set_polygon_stipple;
pipe->set_scissor_states = nvc0_set_scissor_states;
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->create_vertex_elements_state = nvc0_vertex_state_create;