diff options
author | Jakob Bornecrantz <[email protected]> | 2010-12-01 05:45:42 +0100 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2011-01-21 20:53:29 +0100 |
commit | 0c3352b6df7972fd530a901396b392d0293d27ae (patch) | |
tree | 951a343ab506c1f3c99e2f42dbae5d5be840e2b9 /src/gallium/drivers/i915/i915_context.c | |
parent | 2e60aa511dd232f88697d1cc2091442caaef79b2 (diff) |
i915g: Don't do unnecessary copies of constants
Even tho st/mesa use user buffers for constants align buffers
other state trackers doesn't use user buffers.
Diffstat (limited to 'src/gallium/drivers/i915/i915_context.c')
-rw-r--r-- | src/gallium/drivers/i915/i915_context.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index 15454d02cfb..ea3c10b5e78 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -80,7 +80,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) if (cbuf_dirty) { draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, - i915->current.constants[PIPE_SHADER_VERTEX], + i915_buffer(i915->constants[PIPE_SHADER_VERTEX])->data, (i915->current.num_user_constants[PIPE_SHADER_VERTEX] * 4 * sizeof(float))); } @@ -127,6 +127,11 @@ static void i915_destroy(struct pipe_context *pipe) } pipe_surface_reference(&i915->framebuffer.zsbuf, NULL); + /* unbind constant buffers */ + for (i = 0; i < PIPE_SHADER_TYPES; i++) { + pipe_resource_reference(&i915->constants[i], NULL); + } + FREE(i915); } |