r300-gallium: Fix bad cast. Space accounting completely works now.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 9 May 2009 05:05:18 +0000 (22:05 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 9 May 2009 05:05:18 +0000 (22:05 -0700)
Boy, is my face red. :C

src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_texture.c

index 38b1682415153ce709830c0fe16a38df00a5a3d7..c73d5a0b443b7b25d2efa91668081653d999d2b6 100644 (file)
@@ -458,7 +458,7 @@ void r300_emit_dirty_state(struct r300_context* r300)
     /* XXX check size */
     /* Color buffers... */
     for (i = 0; i < r300->framebuffer_state.nr_cbufs; i++) {
-        tex = (struct r300_texture*)r300->framebuffer_state.cbufs[i];
+        tex = (struct r300_texture*)r300->framebuffer_state.cbufs[i]->texture;
         assert(tex && tex->buffer && "cbuf is marked, but NULL!");
         if (!tex->buffer) return;
         r300->winsys->add_buffer(r300->winsys, tex->buffer,
@@ -466,7 +466,7 @@ void r300_emit_dirty_state(struct r300_context* r300)
     }
     /* ...depth buffer... */
     if (r300->framebuffer_state.zsbuf) {
-        tex = (struct r300_texture*)r300->framebuffer_state.zsbuf;
+        tex = (struct r300_texture*)r300->framebuffer_state.zsbuf->texture;
         assert(tex && tex->buffer && "zsbuf is marked, but NULL!");
         if (!tex->buffer) return;
         r300->winsys->add_buffer(r300->winsys, tex->buffer,
index 6c9d3b741277b2f8f72e5e79a93376c013757822..5ea9f56247be39509f7a4e50e08927f74e9ffc0c 100644 (file)
@@ -86,8 +86,6 @@ static struct pipe_texture*
     r300_texture_create(struct pipe_screen* screen,
                         const struct pipe_texture* template)
 {
-    /* XXX struct r300_screen* r300screen = r300_screen(screen); */
-
     struct r300_texture* tex = CALLOC_STRUCT(r300_texture);
 
     if (!tex) {
@@ -187,7 +185,6 @@ static struct pipe_texture*
             tex->stride);
 
     pipe_buffer_reference(&tex->buffer, buffer);
-    debug_printf("%p is the buffer\n", tex->buffer);
 
     return (struct pipe_texture*)tex;
 }