diff options
author | Timothy Arceri <[email protected]> | 2018-03-13 16:44:06 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-03-20 14:17:34 +1100 |
commit | 23777543290b9dfa17bfecb5b389ad3fc8e75820 (patch) | |
tree | 9df65c3633f658eff2f9075ad4f823e59be26303 | |
parent | 40711a7a6063eb6b5069c5f7849fe3cefb70526a (diff) |
mesa: add support propagate uniform support for packed uniforms
Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 0dad6f9c712..b0b322865b7 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2639,8 +2639,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; |