summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJakob Bornecrantz <wallbraker@gmail.com>2010-11-29 20:53:26 +0100
committerJakob Bornecrantz <wallbraker@gmail.com>2010-12-02 01:34:14 +0100
commitde3ff5af49369d187d88e5399f388c6e48c5384f (patch)
tree502fba325dde95bfa33a5e888bbd6754369bcd70 /src/gallium/drivers
parent442e567aa0f0cf91cbd30ffdfc74d281d619dd5e (diff)
i915g: Make sure that new vbo gets updated
Malloc likes to reuse old address as soon as possible this would cause the new vbo buffer to get the same address as the old. So make sure we set it to NULL when we allocate a new one. This fixes ipers which will fill up a couple of VBO buffers per frame. Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/i915/TODO4
-rw-r--r--src/gallium/drivers/i915/i915_prim_vbuf.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/i915/TODO b/src/gallium/drivers/i915/TODO
index 7fa407c150..94c428bebf 100644
--- a/src/gallium/drivers/i915/TODO
+++ b/src/gallium/drivers/i915/TODO
@@ -18,10 +18,6 @@ Random list of problems with i915g:
Texture sampling from Y-tiled buffers seems to work, though (save above
problems).
-- Review buffer usage/cache domain handling in the winsys. Related: vbo cache
- coherency is bunk: openarena tends to have a bunch of flatshaded triangles
- popping up all over the screen.
-
- Need to validate buffers before usage. Currently do_exec on the batchbuffer
can fail with -ENOSPC.
diff --git a/src/gallium/drivers/i915/i915_prim_vbuf.c b/src/gallium/drivers/i915/i915_prim_vbuf.c
index d760b2c4da..baebbc7bae 100644
--- a/src/gallium/drivers/i915/i915_prim_vbuf.c
+++ b/src/gallium/drivers/i915/i915_prim_vbuf.c
@@ -172,6 +172,7 @@ i915_vbuf_render_reserve(struct i915_vbuf_render *i915_render, size_t size)
*
* Side effects:
* Updates hw_offset, sw_offset, index and allocates a new buffer.
+ * Will set i915->vbo to null on buffer allocation.
*/
static void
i915_vbuf_render_new_buf(struct i915_vbuf_render *i915_render, size_t size)
@@ -179,8 +180,16 @@ i915_vbuf_render_new_buf(struct i915_vbuf_render *i915_render, size_t size)
struct i915_context *i915 = i915_render->i915;
struct i915_winsys *iws = i915->iws;
- if (i915_render->vbo)
+ if (i915_render->vbo) {
iws->buffer_destroy(iws, i915_render->vbo);
+ /*
+ * XXX If buffers where referenced then this should be done in
+ * update_vbo_state but since they arn't and malloc likes to reuse
+ * memory we need to set it to null
+ */
+ i915->vbo = NULL;
+ i915_render->vbo = NULL;
+ }
i915->vbo_flushed = 0;