summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-10-28 15:30:09 -0700
committerEric Anholt <eric@anholt.net>2010-10-28 15:38:38 -0700
commitb271445e3731a512425fa28f20579e8af48bbfa2 (patch)
tree015e0b45eec85a3e34eab9b211b00c54dca2b4aa /src/mesa/drivers
parentc5114c7eab12af3936675324298c278e3939bccb (diff)
i965: Upload required gen6 VS push constants even when using pull constants.
Matches pre-gen6, and fixes glsl-vs-large-uniform-array.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_vs_state.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c
index 1d5c5701b3..d8da216d15 100644
--- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
@@ -40,12 +40,11 @@ upload_vs_state(struct brw_context *brw)
struct gl_context *ctx = &intel->ctx;
const struct brw_vertex_program *vp =
brw_vertex_program_const(brw->vertex_program);
- unsigned int nr_params = vp->program.Base.Parameters->NumParameters;
+ unsigned int nr_params = brw->vs.prog_data->nr_params / 4;
drm_intel_bo *constant_bo;
int i;
- if (vp->use_const_buffer || (nr_params == 0 &&
- !ctx->Transform.ClipPlanesEnabled)) {
+ if (brw->vs.prog_data->nr_params == 0 && !ctx->Transform.ClipPlanesEnabled) {
/* Disable the push constant buffers. */
BEGIN_BATCH(5);
OUT_BATCH(CMD_3D_CONSTANT_VS_STATE << 16 | (5 - 2));
@@ -89,11 +88,22 @@ upload_vs_state(struct brw_context *brw)
params_uploaded++;
}
- for (i = 0; i < nr_params; i++) {
- memcpy(param, vp->program.Base.Parameters->ParameterValues[i],
- 4 * sizeof(float));
- param += 4;
- params_uploaded++;
+ if (vp->use_const_buffer) {
+ for (i = 0; i < vp->program.Base.Parameters->NumParameters; i++) {
+ if (brw->vs.constant_map[i] != -1) {
+ memcpy(param + brw->vs.constant_map[i] * 4,
+ vp->program.Base.Parameters->ParameterValues[i],
+ 4 * sizeof(float));
+ params_uploaded++;
+ }
+ }
+ } else {
+ for (i = 0; i < nr_params; i++) {
+ memcpy(param, vp->program.Base.Parameters->ParameterValues[i],
+ 4 * sizeof(float));
+ param += 4;
+ params_uploaded++;
+ }
}
if (0) {