mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[vulkan] Ensure memory size is aligned
While the base of a memory object was aligned when calculating the memory block size, the top end was not, which could result in the memory block not getting enough bytes allocated to satisfy alignment requirements (eg, for flushing). While fixing that, I noticed the offsets of objects were not being aligned when binding, so that is fixed as well. Fixes Mr Fixit on my VersaPro.
This commit is contained in:
parent
8464d71264
commit
2c59a400e4
1 changed files with 3 additions and 2 deletions
|
@ -110,7 +110,7 @@ QFV_CreateResource (qfv_device_t *device, qfv_resource_t *resource)
|
|||
resource->name, obj->name, obj->type);
|
||||
}
|
||||
size = QFV_NextOffset (size, &req);
|
||||
size += req.size;
|
||||
size += QFV_NextOffset (req.size, &req);
|
||||
}
|
||||
VkMemoryPropertyFlags properties = resource->memory_properties;
|
||||
for (uint32_t type = 0; type < memprops->memoryTypeCount; type++) {
|
||||
|
@ -178,7 +178,8 @@ QFV_CreateResource (qfv_device_t *device, qfv_resource_t *resource)
|
|||
case qfv_res_image_view:
|
||||
break;
|
||||
}
|
||||
offset += req.size;
|
||||
offset = QFV_NextOffset (offset, &req);
|
||||
offset += QFV_NextOffset (req.size, &req);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < resource->num_objects; i++) {
|
||||
|
|
Loading…
Reference in a new issue