Fixed bug by passing size of bytes instead of size of array
This commit is contained in:
parent
8d04b51cbf
commit
03c697ba11
1 changed files with 2 additions and 9 deletions
11
src/main.cpp
11
src/main.cpp
|
|
@ -106,14 +106,6 @@ class VulkanCompute
|
|||
|
||||
*aMemory = this->mDevice.allocateMemory(memoryAllocateInfo);
|
||||
|
||||
if (data != nullptr) {
|
||||
vk::DeviceSize offset = 0;
|
||||
void* mapped = this->mDevice.mapMemory(
|
||||
*aMemory, offset, aSize, {});
|
||||
memcpy(mapped, data, aSize);
|
||||
this->mDevice.unmapMemory(*aMemory);
|
||||
}
|
||||
|
||||
this->mDevice.bindBufferMemory(*aBuffer, *aMemory, 0);
|
||||
}
|
||||
|
||||
|
|
@ -292,7 +284,8 @@ class VulkanCompute
|
|||
*/
|
||||
{
|
||||
void* mapped = this->mDevice.mapMemory(
|
||||
hostMemory, 0, VK_WHOLE_SIZE, {});
|
||||
hostMemory, 0, bufferSize, {});
|
||||
memcpy(mapped, computeInput.data(), bufferSize);
|
||||
vk::MappedMemoryRange mappedRange(hostMemory, 0, VK_WHOLE_SIZE);
|
||||
this->mDevice.flushMappedMemoryRanges(1, &mappedRange);
|
||||
this->mDevice.unmapMemory(hostMemory);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue