i965g: add more missing pipe callbacks
authorKeith Whitwell <keithw@vmware.com>
Wed, 4 Nov 2009 18:26:34 +0000 (18:26 +0000)
committerKeith Whitwell <keithw@vmware.com>
Wed, 4 Nov 2009 18:26:34 +0000 (18:26 +0000)
src/gallium/drivers/i965/brw_pipe_fb.c
src/gallium/drivers/i965/brw_pipe_misc.c

index c65f9bc374779b01e1f41672a824790a805af450..d9b70f4eefd80470ae81f7a5372ab62e914747e8 100644 (file)
@@ -41,6 +41,7 @@ static void brw_set_framebuffer_state( struct pipe_context *pipe,
    brw->curr.fb.nr_cbufs = fb->nr_cbufs;
 }
 
+
 static void brw_set_viewport_state( struct pipe_context *pipe,
                                    const struct pipe_viewport_state *viewport )
 {
@@ -58,4 +59,12 @@ void brw_pipe_framebuffer_init( struct brw_context *brw )
 
 void brw_pipe_framebuffer_cleanup( struct brw_context *brw )
 {
+   struct pipe_framebuffer_state *fb = &brw->curr.fb;
+   int i;
+
+   for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+      pipe_surface_reference(&fb->cbufs[i], NULL);
+   }
+
+   pipe_surface_reference(&fb->zsbuf, NULL);
 }
index a7ccde591702842df8856ab73787d284d7f10867..0d0d92df82d9914025878b8211babdddd67df113 100644 (file)
@@ -16,13 +16,45 @@ static void brw_set_polygon_stipple( struct pipe_context *pipe,
 
    for (i = 0; i < 32; i++)
       bps->stipple[i] = stip->stipple[i]; /* don't invert */
+
+   brw->state.dirty.mesa |= PIPE_NEW_POLYGON_STIPPLE;
+}
+
+
+static void brw_set_scissor_state( struct pipe_context *pipe,
+                                   const struct pipe_scissor_state *scissor )
+{
+   struct brw_context *brw = brw_context(pipe);
+
+   brw->curr.scissor =  *scissor;
+   brw->state.dirty.mesa |= PIPE_NEW_SCISSOR;
+}
+
+static void brw_set_viewport_state( struct pipe_context *pipe,
+                                    const struct pipe_viewport_state *viewport )
+{
+   struct brw_context *brw = brw_context(pipe);
+
+   brw->curr.viewport = *viewport;
+   brw->state.dirty.mesa |= PIPE_NEW_VIEWPORT;
 }
 
+static void brw_set_clip_state( struct pipe_context *pipe,
+                                const struct pipe_clip_state *clip )
+{
+   struct brw_context *brw = brw_context(pipe);
+
+   brw->curr.ucp = *clip;
+   brw->state.dirty.mesa |= PIPE_NEW_CLIP;
+}
 
 
 void brw_pipe_misc_init( struct brw_context *brw )
 {
    brw->base.set_polygon_stipple = brw_set_polygon_stipple;
+   brw->base.set_scissor_state = brw_set_scissor_state;
+   brw->base.set_clip_state = brw_set_clip_state;
+   brw->base.set_viewport_state = brw_set_viewport_state;
 }