summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_state.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_state.c
parent7287964f944d7e2bcf409b758163ab75c61b0f8e (diff)
i915g: Don't emit FS constants when VS contants change
Diffstat (limited to 'src/gallium/drivers/i915/i915_state.c')
-rw-r--r--src/gallium/drivers/i915/i915_state.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index f5b60ed5942..cc8bd3b0c39 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -527,6 +527,10 @@ static void i915_set_constant_buffer(struct pipe_context *pipe,
struct i915_context *i915 = i915_context(pipe);
draw_flush(i915->draw);
+ /* XXX don't support geom shaders now */
+ if (shader == PIPE_SHADER_GEOMETRY)
+ return;
+
/* Make a copy of shader constants.
* During fragment program translation we may add additional
* constants to the array.
@@ -538,6 +542,10 @@ static void i915_set_constant_buffer(struct pipe_context *pipe,
*/
if (buf) {
struct i915_buffer *ir = i915_buffer(buf);
+
+ if (!memcmp(i915->current.constants[shader], ir->data, ir->b.b.width0))
+ return;
+
memcpy(i915->current.constants[shader], ir->data, ir->b.b.width0);
i915->current.num_user_constants[shader] = (ir->b.b.width0 /
4 * sizeof(float));
@@ -546,8 +554,7 @@ static void i915_set_constant_buffer(struct pipe_context *pipe,
i915->current.num_user_constants[shader] = 0;
}
-
- i915->dirty |= I915_NEW_CONSTANTS;
+ i915->dirty |= shader == PIPE_SHADER_VERTEX ? I915_NEW_VS_CONSTANTS : I915_NEW_FS_CONSTANTS;
}