diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2021-01-24 14:49:57 -0600 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-02-01 18:54:24 +0000 |
commit | ac6be0ef223fcf0d17f4937274146c43bc996b0d (patch) | |
tree | 0bf2a07b4be7d87fc0d8da6884ff1982206f59a3 /src/intel | |
parent | f51155a349186ebf567218eba11e65be2cfb214c (diff) |
vulkan,anv: Move a bunch of trivial wrappers to common code
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 100 | ||||
-rw-r--r-- | src/intel/vulkan/anv_image.c | 23 |
2 files changed, 0 insertions, 123 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 42024f869b3..a931727a656 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2479,26 +2479,6 @@ anv_device_init_trivial_batch(struct anv_device *device) return VK_SUCCESS; } -VkResult anv_EnumerateDeviceExtensionProperties( - VkPhysicalDevice physicalDevice, - const char* pLayerName, - uint32_t* pPropertyCount, - VkExtensionProperties* pProperties) -{ - ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); - VK_OUTARRAY_MAKE(out, pProperties, pPropertyCount); - - for (int i = 0; i < VK_DEVICE_EXTENSION_COUNT; i++) { - if (device->vk.supported_extensions.extensions[i]) { - vk_outarray_append(&out, prop) { - *prop = vk_device_extensions[i]; - } - } - } - - return vk_outarray_status(&out); -} - static int vk_priority_to_gen(int priority) { @@ -3158,37 +3138,6 @@ VkResult anv_EnumerateInstanceLayerProperties( return vk_error(VK_ERROR_LAYER_NOT_PRESENT); } -VkResult anv_EnumerateDeviceLayerProperties( - VkPhysicalDevice physicalDevice, - uint32_t* pPropertyCount, - VkLayerProperties* pProperties) -{ - if (pProperties == NULL) { - *pPropertyCount = 0; - return VK_SUCCESS; - } - - /* None supported at this time */ - return vk_error(VK_ERROR_LAYER_NOT_PRESENT); -} - -void anv_GetDeviceQueue( - VkDevice _device, - uint32_t queueFamilyIndex, - uint32_t queueIndex, - VkQueue* pQueue) -{ - const VkDeviceQueueInfo2 info = { - .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2, - .pNext = NULL, - .flags = 0, - .queueFamilyIndex = queueFamilyIndex, - .queueIndex = queueIndex, - }; - - anv_GetDeviceQueue2(_device, &info, pQueue); -} - void anv_GetDeviceQueue2( VkDevice _device, const VkDeviceQueueInfo2* pQueueInfo, @@ -3947,22 +3896,6 @@ VkResult anv_InvalidateMappedMemoryRanges( return VK_SUCCESS; } -void anv_GetBufferMemoryRequirements( - VkDevice device, - VkBuffer buffer, - VkMemoryRequirements* pMemoryRequirements) -{ - VkBufferMemoryRequirementsInfo2 info = { - .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, - .buffer = buffer, - }; - VkMemoryRequirements2 reqs = { - .sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - }; - anv_GetBufferMemoryRequirements2(device, &info, &reqs); - *pMemoryRequirements = reqs.memoryRequirements; -} - void anv_GetBufferMemoryRequirements2( VkDevice _device, const VkBufferMemoryRequirementsInfo2* pInfo, @@ -4017,22 +3950,6 @@ void anv_GetBufferMemoryRequirements2( } } -void anv_GetImageMemoryRequirements( - VkDevice device, - VkImage image, - VkMemoryRequirements* pMemoryRequirements) -{ - VkImageMemoryRequirementsInfo2 info = { - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, - .image = image, - }; - VkMemoryRequirements2 reqs = { - .sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - }; - anv_GetImageMemoryRequirements2(device, &info, &reqs); - *pMemoryRequirements = reqs.memoryRequirements; -} - void anv_GetImageMemoryRequirements2( VkDevice _device, const VkImageMemoryRequirementsInfo2* pInfo, @@ -4161,23 +4078,6 @@ anv_bind_buffer_memory(const VkBindBufferMemoryInfo *pBindInfo) } } -VkResult anv_BindBufferMemory( - VkDevice device, - VkBuffer buffer, - VkDeviceMemory memory, - VkDeviceSize memoryOffset) -{ - anv_bind_buffer_memory( - &(VkBindBufferMemoryInfo) { - .sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, - .buffer = buffer, - .memory = memory, - .memoryOffset = memoryOffset, - }); - - return VK_SUCCESS; -} - VkResult anv_BindBufferMemory2( VkDevice device, uint32_t bindInfoCount, diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index cd46d68e106..d5f4505fb29 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -1089,29 +1089,6 @@ resolve_ahw_image(struct anv_device *device, #endif } -VkResult anv_BindImageMemory( - VkDevice _device, - VkImage _image, - VkDeviceMemory _memory, - VkDeviceSize memoryOffset) -{ - ANV_FROM_HANDLE(anv_device, device, _device); - ANV_FROM_HANDLE(anv_device_memory, mem, _memory); - ANV_FROM_HANDLE(anv_image, image, _image); - - if (mem->ahw) - resolve_ahw_image(device, image, mem); - - uint32_t aspect_bit; - anv_foreach_image_aspect_bit(aspect_bit, image, image->aspects) { - uint32_t plane = - anv_image_aspect_to_plane(image->aspects, 1UL << aspect_bit); - anv_image_bind_memory_plane(device, image, plane, mem, memoryOffset); - } - - return VK_SUCCESS; -} - VkResult anv_BindImageMemory2( VkDevice _device, uint32_t bindInfoCount, |