From a9aa811af01273cef8a73118abdc87313f365ad3 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 24 Feb 2010 16:41:18 +0100 Subject: [PATCH] st/mesa: Reset clip state when clearing with quads. --- src/mesa/state_tracker/st_cb_clear.c | 6 +++++- src/mesa/state_tracker/st_context.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 5edab55ccab..9e66eed3634 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -62,7 +62,8 @@ st_init_clear(struct st_context *st) { struct pipe_context *pipe = st->pipe; - memset(&st->clear.raster, 0, sizeof(st->clear.raster)); + memset(&st->clear, 0, sizeof(st->clear)); + st->clear.raster.gl_rasterization_rules = 1; /* fragment shader state: color pass-through program */ @@ -209,6 +210,7 @@ clear_with_quad(GLcontext *ctx, cso_save_depth_stencil_alpha(st->cso_context); cso_save_rasterizer(st->cso_context); cso_save_viewport(st->cso_context); + cso_save_clip(st->cso_context); cso_save_fragment_shader(st->cso_context); cso_save_vertex_shader(st->cso_context); @@ -279,6 +281,7 @@ clear_with_quad(GLcontext *ctx, cso_set_viewport(st->cso_context, &vp); } + cso_set_clip(st->cso_context, &st->clear.clip); cso_set_fragment_shader_handle(st->cso_context, st->clear.fs); cso_set_vertex_shader_handle(st->cso_context, st->clear.vs); @@ -291,6 +294,7 @@ clear_with_quad(GLcontext *ctx, cso_restore_depth_stencil_alpha(st->cso_context); cso_restore_rasterizer(st->cso_context); cso_restore_viewport(st->cso_context); + cso_restore_clip(st->cso_context); cso_restore_fragment_shader(st->cso_context); cso_restore_vertex_shader(st->cso_context); } diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 13b7b0e22d7..045c029c305 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -166,6 +166,7 @@ struct st_context struct { struct pipe_rasterizer_state raster; struct pipe_viewport_state viewport; + struct pipe_clip_state clip; void *vs; void *fs; float vertices[4][2][4]; /**< vertex pos + color */ -- 2.30.2