Updated push const to validate same size params
Signed-off-by: Alejandro Saucedo <axsauze@gmail.com>
This commit is contained in:
parent
ac0f30191b
commit
5ed2691301
2 changed files with 12 additions and 10 deletions
|
|
@ -1248,6 +1248,12 @@ class Algorithm
|
|||
{
|
||||
uint32_t memorySize = sizeof(decltype(pushConstants.back()));
|
||||
uint32_t size = pushConstants.size();
|
||||
|
||||
this->setPushConstants(pushConstants.data(), size, memorySize);
|
||||
}
|
||||
|
||||
void setPushConstants(void* data, uint32_t size, uint32_t memorySize) {
|
||||
|
||||
uint32_t totalSize = memorySize * size;
|
||||
uint32_t previousTotalSize = this->mPushConstantsDataTypeMemorySize * this->mPushConstantsSize;
|
||||
|
||||
|
|
@ -1262,11 +1268,6 @@ class Algorithm
|
|||
free(this->mPushConstantsData);
|
||||
}
|
||||
|
||||
this->setPushConstants(pushConstants.data(), size, memorySize);
|
||||
}
|
||||
|
||||
void setPushConstants(void* data, uint32_t size, uint32_t memorySize) {
|
||||
uint32_t totalSize = size * memorySize;
|
||||
this->mPushConstantsData = malloc(totalSize);
|
||||
memcpy(this->mPushConstantsData, data, totalSize);
|
||||
this->mPushConstantsDataTypeMemorySize = memorySize;
|
||||
|
|
|
|||
|
|
@ -185,6 +185,12 @@ class Algorithm
|
|||
{
|
||||
uint32_t memorySize = sizeof(decltype(pushConstants.back()));
|
||||
uint32_t size = pushConstants.size();
|
||||
|
||||
this->setPushConstants(pushConstants.data(), size, memorySize);
|
||||
}
|
||||
|
||||
void setPushConstants(void* data, uint32_t size, uint32_t memorySize) {
|
||||
|
||||
uint32_t totalSize = memorySize * size;
|
||||
uint32_t previousTotalSize = this->mPushConstantsDataTypeMemorySize * this->mPushConstantsSize;
|
||||
|
||||
|
|
@ -199,11 +205,6 @@ class Algorithm
|
|||
free(this->mPushConstantsData);
|
||||
}
|
||||
|
||||
this->setPushConstants(pushConstants.data(), size, memorySize);
|
||||
}
|
||||
|
||||
void setPushConstants(void* data, uint32_t size, uint32_t memorySize) {
|
||||
uint32_t totalSize = size * memorySize;
|
||||
this->mPushConstantsData = malloc(totalSize);
|
||||
memcpy(this->mPushConstantsData, data, totalSize);
|
||||
this->mPushConstantsDataTypeMemorySize = memorySize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue