mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
v3dv: implement vkBindImageMemory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
parent
e06831454a
commit
16ec12b740
2 changed files with 27 additions and 0 deletions
|
|
@ -1275,3 +1275,27 @@ v3dv_GetImageMemoryRequirements(VkDevice _device,
|
|||
pMemoryRequirements->alignment = image->alignment;
|
||||
pMemoryRequirements->memoryTypeBits = 0x3; /* Both memory types */
|
||||
}
|
||||
|
||||
VkResult
|
||||
v3dv_BindImageMemory(VkDevice _device,
|
||||
VkImage _image,
|
||||
VkDeviceMemory _memory,
|
||||
VkDeviceSize memoryOffset)
|
||||
{
|
||||
V3DV_FROM_HANDLE(v3dv_device_memory, mem, _memory);
|
||||
V3DV_FROM_HANDLE(v3dv_image, image, _image);
|
||||
|
||||
/* Valid usage:
|
||||
*
|
||||
* "memoryOffset must be an integer multiple of the alignment member of
|
||||
* the VkMemoryRequirements structure returned from a call to
|
||||
* vkGetImageMemoryRequirements with image"
|
||||
*/
|
||||
assert(memoryOffset % image->alignment == 0);
|
||||
assert(memoryOffset < mem->size);
|
||||
|
||||
image->mem = mem;
|
||||
image->mem_offset = memoryOffset;
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,6 +273,9 @@ struct v3dv_image {
|
|||
uint32_t size; /* Total size in bytes */
|
||||
uint32_t cube_map_stride;
|
||||
uint32_t alignment;
|
||||
|
||||
struct v3dv_device_memory *mem;
|
||||
VkDeviceSize mem_offset;
|
||||
};
|
||||
|
||||
struct v3dv_shader_module {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue