mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-25 22:01:33 +00:00
[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:
parent
c028e15943
commit
c9e7810864
2 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue