205 if (push_constant_layout ==
nullptr) {
213 T *dst =
static_cast<T *
>(
static_cast<void *
>(&bytes[push_constant_layout->
offset]));
215 const bool is_tightly_std140_packed = (comp_len % 4) == 0;
217 const bool is_tightly_std430_packed = comp_len != 3 || array_size == 0;
218 if (inner_row_padding == 0 &&
220 is_tightly_std430_packed) ||
221 array_size == 0 || push_constant_layout->
array_size == 0 || is_tightly_std140_packed))
223 const size_t copy_size_in_bytes = comp_len *
max_ii(array_size, 1) *
sizeof(
T);
225 "Tried to write outside the push constant allocated memory.");
226 memcpy(dst, input_data, copy_size_in_bytes);
233 const T *src = input_data;
234 if (inner_row_padding == 0) {
237 memcpy(dst, src, comp_len *
sizeof(
T));
243 BLI_assert_msg(array_size == 1,
"No support for MAT3 arrays, but can be added when needed");
244 for (
const int component_index :
IndexRange(comp_len)) {
248 if ((component_index % inner_row_padding) == (inner_row_padding - 1)) {