diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2010-11-29 21:37:09 +0100 |
---|---|---|
committer | Jakob Bornecrantz <wallbraker@gmail.com> | 2011-01-21 20:53:29 +0100 |
commit | 2e60aa511dd232f88697d1cc2091442caaef79b2 (patch) | |
tree | ab5b478e618aa54cd6f87141cc7de43be87d2b01 /src/gallium/drivers/i915/i915_state.c | |
parent | 7287964f944d7e2bcf409b758163ab75c61b0f8e (diff) | |
download | external_mesa3d-2e60aa511dd232f88697d1cc2091442caaef79b2.zip external_mesa3d-2e60aa511dd232f88697d1cc2091442caaef79b2.tar.gz external_mesa3d-2e60aa511dd232f88697d1cc2091442caaef79b2.tar.bz2 |
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.c | 11 |
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 f5b60ed..cc8bd3b 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; } |