mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-01 06:04:12 +08:00
vulkan/runtime: move common buffer related entrypoints to vk_buffer.c
Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>
This commit is contained in:
parent
3b55d4a6b7
commit
10a4412966
@ -23,6 +23,7 @@
|
||||
|
||||
#include "vk_buffer.h"
|
||||
|
||||
#include "vk_common_entrypoints.h"
|
||||
#include "vk_alloc.h"
|
||||
#include "vk_device.h"
|
||||
|
||||
@ -71,3 +72,40 @@ vk_buffer_destroy(struct vk_device *device,
|
||||
{
|
||||
vk_object_free(device, alloc, buffer);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
vk_common_GetBufferMemoryRequirements(VkDevice _device,
|
||||
VkBuffer buffer,
|
||||
VkMemoryRequirements *pMemoryRequirements)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_device, device, _device);
|
||||
|
||||
VkBufferMemoryRequirementsInfo2 info = {
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
|
||||
.buffer = buffer,
|
||||
};
|
||||
VkMemoryRequirements2 reqs = {
|
||||
.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
|
||||
};
|
||||
device->dispatch_table.GetBufferMemoryRequirements2(_device, &info, &reqs);
|
||||
|
||||
*pMemoryRequirements = reqs.memoryRequirements;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
vk_common_BindBufferMemory(VkDevice _device,
|
||||
VkBuffer buffer,
|
||||
VkDeviceMemory memory,
|
||||
VkDeviceSize memoryOffset)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_device, device, _device);
|
||||
|
||||
VkBindBufferMemoryInfo bind = {
|
||||
.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO,
|
||||
.buffer = buffer,
|
||||
.memory = memory,
|
||||
.memoryOffset = memoryOffset,
|
||||
};
|
||||
|
||||
return device->dispatch_table.BindBufferMemory2(_device, 1, &bind);
|
||||
}
|
@ -443,43 +443,6 @@ vk_common_GetDeviceGroupPeerMemoryFeatures(
|
||||
VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT;
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
vk_common_GetBufferMemoryRequirements(VkDevice _device,
|
||||
VkBuffer buffer,
|
||||
VkMemoryRequirements *pMemoryRequirements)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_device, device, _device);
|
||||
|
||||
VkBufferMemoryRequirementsInfo2 info = {
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
|
||||
.buffer = buffer,
|
||||
};
|
||||
VkMemoryRequirements2 reqs = {
|
||||
.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
|
||||
};
|
||||
device->dispatch_table.GetBufferMemoryRequirements2(_device, &info, &reqs);
|
||||
|
||||
*pMemoryRequirements = reqs.memoryRequirements;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
vk_common_BindBufferMemory(VkDevice _device,
|
||||
VkBuffer buffer,
|
||||
VkDeviceMemory memory,
|
||||
VkDeviceSize memoryOffset)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_device, device, _device);
|
||||
|
||||
VkBindBufferMemoryInfo bind = {
|
||||
.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO,
|
||||
.buffer = buffer,
|
||||
.memory = memory,
|
||||
.memoryOffset = memoryOffset,
|
||||
};
|
||||
|
||||
return device->dispatch_table.BindBufferMemory2(_device, 1, &bind);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
vk_common_GetImageMemoryRequirements(VkDevice _device,
|
||||
VkImage image,
|
||||
|
Loading…
Reference in New Issue
Block a user