[Mesa-dev] [PATCH 07/14] mesa: add support propagate uniform support for packed uniforms
Marek Olšák
maraeo at gmail.com
Mon Mar 19 21:22:26 UTC 2018
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Wed, Mar 14, 2018 at 2:01 AM, Timothy Arceri <tarceri at itsqueeze.com>
wrote:
> ---
> src/mesa/program/ir_to_mesa.cpp | 20 ++++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/program/ir_to_mesa.cpp
> b/src/mesa/program/ir_to_mesa.cpp
> index 149d914bc4..19a9fd3fc2 100644
> --- a/src/mesa/program/ir_to_mesa.cpp
> +++ b/src/mesa/program/ir_to_mesa.cpp
> @@ -2635,8 +2635,24 @@ _mesa_associate_uniform_storage(struct gl_context
> *ctx,
> */
> if (propagate_to_storage) {
> unsigned array_elements = MAX2(1, storage->array_elements);
> - _mesa_propagate_uniforms_to_driver_storage(storage, 0,
> - array_elements);
> + if (ctx->Const.PackedDriverUniformStorage &&
> !prog->is_arb_asm &&
> + (storage->is_bindless || !storage->type->contains_opaque()))
> {
> + const int dmul = storage->type->is_64bit() ? 2 : 1;
> + const unsigned components =
> + storage->type->vector_elements *
> + storage->type->matrix_columns;
> +
> + for (unsigned s = 0; s < storage->num_driver_storage; s++)
> {
> + gl_constant_value *uni_storage = (gl_constant_value *)
> + storage->driver_storage[s].data;
> + memcpy(uni_storage, storage->storage,
> + sizeof(storage->storage[0]) * components *
> + array_elements * dmul);
> + }
> + } else {
> + _mesa_propagate_uniforms_to_driver_storage(storage, 0,
> + array_elements);
> + }
> }
>
> last_location = location;
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180319/6df4fb69/attachment-0001.html>
More information about the mesa-dev
mailing list