mesa: fix a second bug in merging light state parameters with unpacked uniforms

The memcpy size should be packed even if the allocated parameter size
is padded to 4 components.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8017>
This commit is contained in:
Marek Olšák
2021-01-01 14:01:25 -05:00
committed by Marge Bot
parent 45acf9b49a
commit a0314083be

View File

@@ -1389,8 +1389,14 @@ _mesa_optimize_state_parameters(struct gl_constants *consts,
list->Parameters[first_param].StateIndexes[1] * /* light index */
sizeof(struct gl_light_uniforms) / 4 +
(list->Parameters[first_param].StateIndexes[2] - STATE_AMBIENT) * 4;
/* Set the size in floats. */
/* Set the real size in floats that we will upload (memcpy). */
list->Parameters[first_param].StateIndexes[2] =
_mesa_program_state_value_size(list->Parameters[last_param].StateIndexes) +
list->Parameters[last_param].ValueOffset -
list->Parameters[first_param].ValueOffset;
/* Set the allocated size, which can be aligned to 4 components. */
list->Parameters[first_param].Size =
list->Parameters[last_param].Size +
list->Parameters[last_param].ValueOffset -