mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
venus: Use trivial common entrypoints
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15613>
This commit is contained in:
parent
87b65af43e
commit
a8c7e8fef8
4 changed files with 0 additions and 201 deletions
|
|
@ -375,16 +375,6 @@ vn_GetBufferOpaqueCaptureAddress(VkDevice device,
|
|||
pInfo);
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetBufferMemoryRequirements(VkDevice device,
|
||||
VkBuffer buffer,
|
||||
VkMemoryRequirements *pMemoryRequirements)
|
||||
{
|
||||
const struct vn_buffer *buf = vn_buffer_from_handle(buffer);
|
||||
|
||||
*pMemoryRequirements = buf->requirements.memory.memoryRequirements;
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetBufferMemoryRequirements2(VkDevice device,
|
||||
const VkBufferMemoryRequirementsInfo2 *pInfo,
|
||||
|
|
@ -416,26 +406,6 @@ vn_GetBufferMemoryRequirements2(VkDevice device,
|
|||
}
|
||||
}
|
||||
|
||||
VkResult
|
||||
vn_BindBufferMemory(VkDevice device,
|
||||
VkBuffer buffer,
|
||||
VkDeviceMemory memory,
|
||||
VkDeviceSize memoryOffset)
|
||||
{
|
||||
struct vn_device *dev = vn_device_from_handle(device);
|
||||
struct vn_device_memory *mem = vn_device_memory_from_handle(memory);
|
||||
|
||||
if (mem->base_memory) {
|
||||
memory = vn_device_memory_to_handle(mem->base_memory);
|
||||
memoryOffset += mem->base_offset;
|
||||
}
|
||||
|
||||
vn_async_vkBindBufferMemory(dev->instance, device, buffer, memory,
|
||||
memoryOffset);
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
vn_BindBufferMemory2(VkDevice device,
|
||||
uint32_t bindInfoCount,
|
||||
|
|
|
|||
|
|
@ -359,31 +359,6 @@ vn_DestroyImage(VkDevice device,
|
|||
vk_free(alloc, img);
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetImageMemoryRequirements(VkDevice device,
|
||||
VkImage image,
|
||||
VkMemoryRequirements *pMemoryRequirements)
|
||||
{
|
||||
const struct vn_image *img = vn_image_from_handle(image);
|
||||
|
||||
*pMemoryRequirements = img->requirements[0].memory.memoryRequirements;
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetImageSparseMemoryRequirements(
|
||||
VkDevice device,
|
||||
VkImage image,
|
||||
uint32_t *pSparseMemoryRequirementCount,
|
||||
VkSparseImageMemoryRequirements *pSparseMemoryRequirements)
|
||||
{
|
||||
struct vn_device *dev = vn_device_from_handle(device);
|
||||
|
||||
/* TODO per-device cache */
|
||||
vn_call_vkGetImageSparseMemoryRequirements(dev->instance, device, image,
|
||||
pSparseMemoryRequirementCount,
|
||||
pSparseMemoryRequirements);
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetImageMemoryRequirements2(VkDevice device,
|
||||
const VkImageMemoryRequirementsInfo2 *pInfo,
|
||||
|
|
@ -455,30 +430,6 @@ vn_image_bind_wsi_memory(struct vn_image *img, struct vn_device_memory *mem)
|
|||
img->wsi.memory = mem;
|
||||
}
|
||||
|
||||
VkResult
|
||||
vn_BindImageMemory(VkDevice device,
|
||||
VkImage image,
|
||||
VkDeviceMemory memory,
|
||||
VkDeviceSize memoryOffset)
|
||||
{
|
||||
struct vn_device *dev = vn_device_from_handle(device);
|
||||
struct vn_image *img = vn_image_from_handle(image);
|
||||
struct vn_device_memory *mem = vn_device_memory_from_handle(memory);
|
||||
|
||||
if (img->wsi.is_wsi)
|
||||
vn_image_bind_wsi_memory(img, mem);
|
||||
|
||||
if (mem->base_memory) {
|
||||
memory = vn_device_memory_to_handle(mem->base_memory);
|
||||
memoryOffset += mem->base_offset;
|
||||
}
|
||||
|
||||
vn_async_vkBindImageMemory(dev->instance, device, image, memory,
|
||||
memoryOffset);
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
vn_BindImageMemory2(VkDevice device,
|
||||
uint32_t bindInfoCount,
|
||||
|
|
|
|||
|
|
@ -1495,46 +1495,6 @@ vn_EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceFeatures *pFeatures)
|
||||
{
|
||||
struct vn_physical_device *physical_dev =
|
||||
vn_physical_device_from_handle(physicalDevice);
|
||||
|
||||
*pFeatures = physical_dev->features.vulkan_1_0;
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceProperties *pProperties)
|
||||
{
|
||||
struct vn_physical_device *physical_dev =
|
||||
vn_physical_device_from_handle(physicalDevice);
|
||||
|
||||
*pProperties = physical_dev->properties.vulkan_1_0;
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetPhysicalDeviceQueueFamilyProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t *pQueueFamilyPropertyCount,
|
||||
VkQueueFamilyProperties *pQueueFamilyProperties)
|
||||
{
|
||||
struct vn_physical_device *physical_dev =
|
||||
vn_physical_device_from_handle(physicalDevice);
|
||||
|
||||
VK_OUTARRAY_MAKE_TYPED(VkQueueFamilyProperties, out,
|
||||
pQueueFamilyProperties,
|
||||
pQueueFamilyPropertyCount);
|
||||
for (uint32_t i = 0; i < physical_dev->queue_family_count; i++) {
|
||||
vk_outarray_append_typed(VkQueueFamilyProperties, &out, props) {
|
||||
*props =
|
||||
physical_dev->queue_family_properties[i].queueFamilyProperties;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetPhysicalDeviceMemoryProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
|
|
@ -1567,69 +1527,6 @@ vn_physical_device_add_format_properties(
|
|||
simple_mtx_unlock(&physical_dev->format_update_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice,
|
||||
VkFormat format,
|
||||
VkFormatProperties *pFormatProperties)
|
||||
{
|
||||
struct vn_physical_device *physical_dev =
|
||||
vn_physical_device_from_handle(physicalDevice);
|
||||
struct vn_format_properties_entry *entry =
|
||||
vn_physical_device_get_format_properties(physical_dev, format);
|
||||
|
||||
if (entry->valid) {
|
||||
*pFormatProperties = entry->properties;
|
||||
return;
|
||||
}
|
||||
|
||||
vn_call_vkGetPhysicalDeviceFormatProperties(
|
||||
physical_dev->instance, physicalDevice, format, pFormatProperties);
|
||||
|
||||
vn_physical_device_add_format_properties(physical_dev, entry,
|
||||
pFormatProperties);
|
||||
}
|
||||
|
||||
VkResult
|
||||
vn_GetPhysicalDeviceImageFormatProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkFormat format,
|
||||
VkImageType type,
|
||||
VkImageTiling tiling,
|
||||
VkImageUsageFlags usage,
|
||||
VkImageCreateFlags flags,
|
||||
VkImageFormatProperties *pImageFormatProperties)
|
||||
{
|
||||
struct vn_physical_device *physical_dev =
|
||||
vn_physical_device_from_handle(physicalDevice);
|
||||
|
||||
/* TODO per-device cache */
|
||||
VkResult result = vn_call_vkGetPhysicalDeviceImageFormatProperties(
|
||||
physical_dev->instance, physicalDevice, format, type, tiling, usage,
|
||||
flags, pImageFormatProperties);
|
||||
|
||||
return vn_result(physical_dev->instance, result);
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetPhysicalDeviceSparseImageFormatProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkFormat format,
|
||||
VkImageType type,
|
||||
uint32_t samples,
|
||||
VkImageUsageFlags usage,
|
||||
VkImageTiling tiling,
|
||||
uint32_t *pPropertyCount,
|
||||
VkSparseImageFormatProperties *pProperties)
|
||||
{
|
||||
struct vn_physical_device *physical_dev =
|
||||
vn_physical_device_from_handle(physicalDevice);
|
||||
|
||||
/* TODO per-device cache */
|
||||
vn_call_vkGetPhysicalDeviceSparseImageFormatProperties(
|
||||
physical_dev->instance, physicalDevice, format, type, samples, usage,
|
||||
tiling, pPropertyCount, pProperties);
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceFeatures2 *pFeatures)
|
||||
|
|
|
|||
|
|
@ -23,25 +23,6 @@
|
|||
|
||||
/* queue commands */
|
||||
|
||||
void
|
||||
vn_GetDeviceQueue(VkDevice device,
|
||||
uint32_t queueFamilyIndex,
|
||||
uint32_t queueIndex,
|
||||
VkQueue *pQueue)
|
||||
{
|
||||
struct vn_device *dev = vn_device_from_handle(device);
|
||||
|
||||
for (uint32_t i = 0; i < dev->queue_count; i++) {
|
||||
struct vn_queue *queue = &dev->queues[i];
|
||||
if (queue->family == queueFamilyIndex && queue->index == queueIndex) {
|
||||
assert(!queue->flags);
|
||||
*pQueue = vn_queue_to_handle(queue);
|
||||
return;
|
||||
}
|
||||
}
|
||||
unreachable("bad queue family/index");
|
||||
}
|
||||
|
||||
void
|
||||
vn_GetDeviceQueue2(VkDevice device,
|
||||
const VkDeviceQueueInfo2 *pQueueInfo,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue