Mesa (master): r300-gallium: Space accounting for textures.

Corbin Simpson csimpson at kemper.freedesktop.org
Thu May 14 00:01:20 UTC 2009


Module: Mesa
Branch: master
Commit: 15601e970250e12f5d566ba782aae06d9714fbdc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=15601e970250e12f5d566ba782aae06d9714fbdc

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Wed May 13 17:01:03 2009 -0700

r300-gallium: Space accounting for textures.

---

 src/gallium/drivers/r300/r300_emit.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index c73d5a0..cd5c38a 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -460,7 +460,6 @@ void r300_emit_dirty_state(struct r300_context* r300)
     for (i = 0; i < r300->framebuffer_state.nr_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,
                 0, RADEON_GEM_DOMAIN_VRAM);
     }
@@ -468,10 +467,16 @@ void r300_emit_dirty_state(struct r300_context* r300)
     if (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,
                 0, RADEON_GEM_DOMAIN_VRAM);
     }
+    /* ...textures... */
+    for (i = 0; i < r300->texture_count; i++) {
+        tex = r300->textures[i];
+        assert(tex && tex->buffer && "zsbuf is marked, but NULL!");
+        r300->winsys->add_buffer(r300->winsys, tex->buffer,
+                RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+    }
     /* ...and vertex buffer. */
     if (r300->vbo) {
         r300->winsys->add_buffer(r300->winsys, r300->vbo,




More information about the mesa-commit mailing list