summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_context.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-11-29 21:37:09 +0100
committerJakob Bornecrantz <[email protected]>2011-01-21 20:53:29 +0100
commit2e60aa511dd232f88697d1cc2091442caaef79b2 (patch)
treeab5b478e618aa54cd6f87141cc7de43be87d2b01 /src/gallium/drivers/i915/i915_context.c
parent7287964f944d7e2bcf409b758163ab75c61b0f8e (diff)
i915g: Don't emit FS constants when VS contants change
Diffstat (limited to 'src/gallium/drivers/i915/i915_context.c')
-rw-r--r--src/gallium/drivers/i915/i915_context.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c
index 9d43381f7b3..15454d02cfb 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -51,6 +51,14 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
struct draw_context *draw = i915->draw;
void *mapped_indices = NULL;
unsigned i;
+ unsigned cbuf_dirty;
+
+
+ /*
+ * Ack vs contants here, helps ipers a lot.
+ */
+ cbuf_dirty = i915->dirty & I915_NEW_VS_CONSTANTS;
+ i915->dirty &= ~I915_NEW_VS_CONSTANTS;
if (i915->dirty)
i915_update_derived(i915);
@@ -70,10 +78,12 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
mapped_indices = i915_buffer(i915->index_buffer.buffer)->data;
draw_set_mapped_index_buffer(draw, mapped_indices);
- draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
- i915->current.constants[PIPE_SHADER_VERTEX],
- (i915->current.num_user_constants[PIPE_SHADER_VERTEX] *
- 4 * sizeof(float)));
+ if (cbuf_dirty) {
+ draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
+ i915->current.constants[PIPE_SHADER_VERTEX],
+ (i915->current.num_user_constants[PIPE_SHADER_VERTEX] *
+ 4 * sizeof(float)));
+ }
/*
* Do the drawing