st/mesa: Reset clip state when clearing with quads.

This commit is contained in:
Michal Krol 2010-02-24 16:41:18 +01:00
parent 5b3f8369c6
commit a9aa811af0
2 changed files with 6 additions and 1 deletions

View file

@ -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);
}

View file

@ -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 */