diff options
author | Eric Anholt <eric@anholt.net> | 2009-11-10 14:11:46 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-11-10 14:44:40 -0800 |
commit | 1220aba99bc78290bb89ade649719508e3031e4b (patch) | |
tree | ebae402605307db51d1674b41a386a68526d4650 /src/mesa | |
parent | e5ffb9f5ea03c2acd148222259a334cde0f3afc9 (diff) | |
download | external_mesa3d-1220aba99bc78290bb89ade649719508e3031e4b.zip external_mesa3d-1220aba99bc78290bb89ade649719508e3031e4b.tar.gz external_mesa3d-1220aba99bc78290bb89ade649719508e3031e4b.tar.bz2 |
i965: Fix VS constant buffer value loading.
Previously, we'd load linearly from ParameterValues[0] for the constants,
though ParameterValues[1] may not equal ParameterValues[0] + 4. Additionally,
the STATE_VAL type paramters didn't get updated.
Fixes piglit vp-constant-array-huge.vpfp and ET:QW object locations.
Bug #23226.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 89f4752..746d097 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -53,6 +53,7 @@ brw_vs_update_constant_buffer(struct brw_context *brw) const struct gl_program_parameter_list *params = vp->program.Base.Parameters; const int size = params->NumParameters * 4 * sizeof(GLfloat); drm_intel_bo *const_buffer; + int i; /* BRW_NEW_VERTEX_PROGRAM */ if (!vp->use_const_buffer) @@ -62,7 +63,16 @@ brw_vs_update_constant_buffer(struct brw_context *brw) size, 64); /* _NEW_PROGRAM_CONSTANTS */ - dri_bo_subdata(const_buffer, 0, size, params->ParameterValues); + + /* Updates the ParamaterValues[i] pointers for all parameters of the + * basic type of PROGRAM_STATE_VAR. + */ + _mesa_load_state_parameters(&brw->intel.ctx, vp->program.Base.Parameters); + + for (i = 0; i < params->NumParameters; i++) { + dri_bo_subdata(const_buffer, i * 4 * sizeof(float), 4 * sizeof(float), + params->ParameterValues[i]); + } return const_buffer; } |