aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_constbuf.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-06-16 10:17:56 +1000
committerTimothy Arceri <[email protected]>2018-03-20 14:17:33 +1100
commitedded1237607348683f492db313e823dc2e380c3 (patch)
tree1fb861be1d324eb309fbef50e6b353dfff4a0c83 /src/mesa/state_tracker/st_atom_constbuf.c
parentb13b9eb432a3b67efb29ca25c3e244b467c3c4af (diff)
mesa: rework ParameterList to allow packing
Currently everything is padded to 4 components. Making the list more flexible will allow us to do uniform packing. V2 (suggestions from Nicolai): - always pass existing calls to _mesa_add_parameter() true for padd_and_align - fix bindless param value offsets - remove left over wip logic from pad and align code - zero out param value padding - whitespace fix Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom_constbuf.c')
-rw-r--r--src/mesa/state_tracker/st_atom_constbuf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index 0a6b23aff3b..87a72b2622c 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -71,11 +71,12 @@ void st_upload_constants(struct st_context *st, struct gl_program *prog)
unsigned c;
for (c = 0; c < MAX_NUM_FRAGMENT_CONSTANTS_ATI; c++) {
+ unsigned offset = params->ParameterValueOffset[c];
if (ati_fs->LocalConstDef & (1 << c))
- memcpy(params->ParameterValues[c],
+ memcpy(params->ParameterValues + offset,
ati_fs->Constants[c], sizeof(GLfloat) * 4);
else
- memcpy(params->ParameterValues[c],
+ memcpy(params->ParameterValues + offset,
st->ctx->ATIFragmentShader.GlobalConstants[c], sizeof(GLfloat) * 4);
}
}