/**
* Scissor depends on the scissor box, and the framebuffer dimensions.
*/
-static void
-update_scissor( struct st_context *st )
+void
+st_update_scissor( struct st_context *st )
{
struct pipe_scissor_state scissor[PIPE_MAX_VIEWPORTS];
const struct gl_context *ctx = st->ctx;
unsigned i;
bool changed = false;
- for (i = 0 ; i < ctx->Const.MaxViewports; i++) {
+ for (i = 0 ; i < st->state.num_viewports; i++) {
scissor[i].minx = 0;
scissor[i].miny = 0;
scissor[i].maxx = fb_width;
/* Now invert Y if needed.
* Gallium drivers use the convention Y=0=top for surfaces.
*/
- if (st_fb_orientation(fb) == Y_0_TOP) {
+ if (st->state.fb_orientation == Y_0_TOP) {
miny = fb->Height - scissor[i].maxy;
maxy = fb->Height - scissor[i].miny;
scissor[i].miny = miny;
changed = true;
}
}
- if (changed)
- st->pipe->set_scissor_states(st->pipe, 0, ctx->Const.MaxViewports, scissor); /* activate */
+
+ if (changed) {
+ struct pipe_context *pipe = st->pipe;
+
+ pipe->set_scissor_states(pipe, 0, st->state.num_viewports, scissor);
+ }
}
-static void
-update_window_rectangles(struct st_context *st)
+void
+st_update_window_rectangles(struct st_context *st)
{
struct pipe_scissor_state new_rects[PIPE_MAX_WINDOW_RECTANGLES];
const struct gl_context *ctx = st->ctx;
st->pipe->set_window_rectangles(
st->pipe, include, num_rects, new_rects);
}
-
-const struct st_tracked_state st_update_scissor = {
- { /* dirty */
- (_NEW_SCISSOR | _NEW_BUFFERS), /* mesa */
- 0, /* st */
- },
- update_scissor /* update */
-};
-
-const struct st_tracked_state st_update_window_rectangles = {
- { /* dirty */
- (_NEW_SCISSOR | _NEW_BUFFERS), /* mesa */
- 0, /* st */
- },
- update_window_rectangles /* update */
-};