Vulkan: Push constants #104880
|
@ -216,7 +216,9 @@ class VKPushConstants : NonCopyable {
|
||||||
|
|
||||||
uint8_t *bytes = static_cast<uint8_t *>(data_);
|
uint8_t *bytes = static_cast<uint8_t *>(data_);
|
||||||
T *dst = static_cast<T *>(static_cast<void *>(&bytes[push_constant_layout->offset]));
|
T *dst = static_cast<T *>(static_cast<void *>(&bytes[push_constant_layout->offset]));
|
||||||
if (layout_->storage_type_get() == StorageType::PUSH_CONSTANTS || array_size == 0) {
|
const bool is_tightly_std140_packed = (comp_len % 4) == 0;
|
||||||
|
if (layout_->storage_type_get() == StorageType::PUSH_CONSTANTS || array_size == 0 ||
|
||||||
|
is_tightly_std140_packed) {
|
||||||
BLI_assert_msg(push_constant_layout->offset + comp_len * array_size * sizeof(T) <=
|
BLI_assert_msg(push_constant_layout->offset + comp_len * array_size * sizeof(T) <=
|
||||||
layout_->size_in_bytes(),
|
layout_->size_in_bytes(),
|
||||||
"Tried to write outside the push constant allocated memory.");
|
"Tried to write outside the push constant allocated memory.");
|
||||||
|
|
Loading…
Reference in New Issue