212 if (push_constant_layout ==
nullptr) {
220 T *dst =
static_cast<T *
>(
static_cast<void *
>(&bytes[push_constant_layout->
offset]));
222 const bool is_tightly_std140_packed = (comp_len % 4) == 0;
223 if (inner_row_padding == 0 &&
225 push_constant_layout->
array_size == 0 || is_tightly_std140_packed))
227 const size_t copy_size_in_bytes = comp_len *
max_ii(array_size, 1) *
sizeof(
T);
229 "Tried to write outside the push constant allocated memory.");
230 memcpy(dst, input_data, copy_size_in_bytes);
238 const T *src = input_data;
239 if (inner_row_padding == 0) {
242 memcpy(dst, src, comp_len *
sizeof(T));
248 BLI_assert_msg(array_size == 1,
"No support for MAT3 arrays, but can be added when needed");
249 for (
const int component_index :
IndexRange(comp_len)) {
253 if ((component_index % inner_row_padding) == (inner_row_padding - 1)) {