|
|
@ -1294,8 +1294,25 @@ VkResult add_transfer(
|
|
|
|
|
|
|
|
|
|
|
|
VkDeviceSize src_offset = 0;
|
|
|
|
VkDeviceSize src_offset = 0;
|
|
|
|
for(uint32_t i = 0; i < transfer->count; i++) {
|
|
|
|
for(uint32_t i = 0; i < transfer->count; i++) {
|
|
|
|
if(transfer->infos[i].buffer == buffer && transfer->infos[i].size == size && transfer->infos[i].offset == offset) {
|
|
|
|
/*
|
|
|
|
memcpy(transfer->mapped + src_offset, data, size);
|
|
|
|
|
|
|
|
|
|
|
|
Adding size 32 write to 0x4b000000004b at offset 0
|
|
|
|
|
|
|
|
size = 32, offset = 0, info->offset = 0
|
|
|
|
|
|
|
|
Adding size 8 write to 0x4b000000004b at offset 44
|
|
|
|
|
|
|
|
size = 8, offset = 44, info->offset = 0
|
|
|
|
|
|
|
|
Transferring 32 bytes: 90605F3D228D5A448B925AC4C8FA45429E195A42E0EE36C4E0CA214400B07F3F to 0x4b000000004b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VkDeviceSize diff = offset - transfer->infos[i].offset;
|
|
|
|
|
|
|
|
if(transfer->infos[i].buffer == buffer
|
|
|
|
|
|
|
|
&& transfer->infos[i].offset <= offset
|
|
|
|
|
|
|
|
&& transfer->infos[i].size >= (size + diff)) {
|
|
|
|
|
|
|
|
#ifdef DEBUG_GPU_TRANSFERS
|
|
|
|
|
|
|
|
fprintf(stderr, "Adding size %lld write to %p at offset %lld with diff %lld\n", size, buffer, src_offset + diff, diff);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
memcpy(transfer->mapped + src_offset + diff, data, size);
|
|
|
|
return VK_SUCCESS;
|
|
|
|
return VK_SUCCESS;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
src_offset += transfer->infos[i].size;
|
|
|
|
src_offset += transfer->infos[i].size;
|
|
|
|