st/mesa: Reset clip state when clearing with quads.
authorMichal Krol <michal@vmware.com>
Wed, 24 Feb 2010 15:41:18 +0000 (16:41 +0100)
committerMichal Krol <michal@vmware.com>
Wed, 24 Feb 2010 15:41:18 +0000 (16:41 +0100)
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_context.h

index 5edab55ccabbbeb40516f8bdb8fcfcf3a60df29f..9e66eed36348cae45fc5c96d6dd4b6998b938981 100644 (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);
 }
index 13b7b0e22d7b1d7f09c184706c3abc2ed104a0c2..045c029c3055394d711817beb5ad9c8454ae80b1 100644 (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 */