[vulkan] Add resource memory offset to qfv_resobj_s

Its value on input is ignored. QFV_CreateResource writes the resource
object's offset relative to the beginning of the shared memory block.
Needed for the Draw overhaul.
This commit is contained in:
Bill Currie 2022-10-03 09:14:29 +09:00
parent c028e15943
commit c9e7810864
2 changed files with 4 additions and 0 deletions

View file

@ -21,6 +21,7 @@ typedef struct qfv_resobj_s {
VkDeviceSize size;
VkBufferUsageFlags usage;
VkBuffer buffer;
VkDeviceSize offset;
} buffer;
struct {
unsigned buffer;
@ -39,6 +40,7 @@ typedef struct qfv_resobj_s {
VkSampleCountFlags samples;
VkImageUsageFlags usage;
VkImage image;
VkDeviceSize offset;
} image;
struct {
unsigned image;

View file

@ -163,6 +163,7 @@ QFV_CreateResource (qfv_device_t *device, qfv_resource_t *resource)
__auto_type buffer = &obj->buffer;
QFV_BindBufferMemory (device, buffer->buffer,
resource->memory, offset);
buffer->offset = offset;
}
break;
case qfv_res_image:
@ -170,6 +171,7 @@ QFV_CreateResource (qfv_device_t *device, qfv_resource_t *resource)
__auto_type image = &obj->image;
QFV_BindImageMemory (device, image->image,
resource->memory, offset);
image->offset = offset;
}
break;
case qfv_res_buffer_view: