nouveau: store render buffer pointers in context, to access them when clearing buffer
authorPatrice Mandin <pmandin@caramail.com>
Thu, 16 Aug 2007 19:28:40 +0000 (21:28 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Thu, 16 Aug 2007 19:28:40 +0000 (21:28 +0200)
src/mesa/drivers/dri/nouveau/nouveau_context.h
src/mesa/drivers/dri/nouveau/nv10_state.c

index dc904ad6b353254f29fd30ca4d0503daaff6b627..65ecf21cab830405ef774491e2f307e9815fd22e 100644 (file)
@@ -123,6 +123,10 @@ typedef struct nouveau_context {
        struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
        GLuint vertex_attr_count;
 
+       /* Color and depth renderbuffers */
+       nouveau_renderbuffer_t *color_buffer[2];
+       nouveau_renderbuffer_t *depth_buffer;
+
        /* Color buffer clear value */
        uint32_t clear_color_value;
 
index 0e1637015fdfbcf7284b3dfbe2d839a3b964ed72..2183fc1577c78c49d36552610947ba7aa190f359 100644 (file)
@@ -715,6 +715,11 @@ static GLboolean nv10BindBuffers(nouveauContextPtr nmesa, int num_color,
        GLuint x, y, w, h;
        GLuint pitch, format, depth_pitch;
 
+       /* Store buffer pointers in context */
+       nmesa->color_buffer[0] = color[0];
+       nmesa->color_buffer[1] = color[1];
+       nmesa->depth_buffer = depth;
+
        w = color[0]->mesa.Width;
        h = color[0]->mesa.Height;
        x = nmesa->drawX;