blob: b3a9a24c6b44af8e53b1ac3b5332d767ce482baf [file] [log] [blame]
Alexis Hetud73b8712018-09-21 15:14:43 -04001// Copyright 2018 The SwiftShader Authors. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// This file contains function definitions for extensions Vulkan 1.1
16// promoted into the core API. (See spec Appendix D: Core Revisions)
17
18// The current list of promoted extensions is:
19// VK_KHR_16bit_storage (no functions in this extension)
20// VK_KHR_bind_memory2
21// VK_KHR_dedicated_allocation (no functions in this extension)
22// VK_KHR_descriptor_update_template
23// VK_KHR_device_group
24// VK_KHR_device_group_creation
25// VK_KHR_external_fence (no functions in this extension)
26// VK_KHR_external_fence_capabilities
27// VK_KHR_external_memory (no functions in this extension)
28// VK_KHR_external_memory_capabilities
29// VK_KHR_external_semaphore (no functions in this extension)
30// VK_KHR_external_semaphore_capabilities
31// VK_KHR_get_memory_requirements2
32// VK_KHR_get_physical_device_properties2
33// VK_KHR_maintenance1
34// VK_KHR_maintenance2 (no functions in this extension)
35// VK_KHR_maintenance3
36// VK_KHR_multiview (no functions in this extension)
37// VK_KHR_relaxed_block_layout (no functions in this extension)
38// VK_KHR_sampler_ycbcr_conversion
39// VK_KHR_shader_draw_parameters (no functions in this extension)
40// VK_KHR_storage_buffer_storage_class (no functions in this extension)
41// VK_KHR_variable_pointers (no functions in this extension)
42
Antonio Maiorano42fd1592020-04-27 11:30:40 -040043#include "Vulkan/VulkanPlatform.hpp"
Alexis Hetud73b8712018-09-21 15:14:43 -040044
Ben Clayton2ed93ab2019-12-17 20:38:03 +000045extern "C" {
Alexis Hetud73b8712018-09-21 15:14:43 -040046
47// VK_KHR_bind_memory2
Ben Clayton2ed93ab2019-12-17 20:38:03 +000048VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos)
Alexis Hetud73b8712018-09-21 15:14:43 -040049{
50 return vkBindBufferMemory2(device, bindInfoCount, pBindInfos);
51}
52
Ben Clayton2ed93ab2019-12-17 20:38:03 +000053VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos)
Alexis Hetud73b8712018-09-21 15:14:43 -040054{
55 return vkBindImageMemory2(device, bindInfoCount, pBindInfos);
56}
57
58// VK_KHR_descriptor_update_template
Ben Clayton2ed93ab2019-12-17 20:38:03 +000059VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplate *pDescriptorUpdateTemplate)
Alexis Hetud73b8712018-09-21 15:14:43 -040060{
61 return vkCreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
62}
63
Ben Clayton2ed93ab2019-12-17 20:38:03 +000064VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator)
Alexis Hetud73b8712018-09-21 15:14:43 -040065{
66 vkDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator);
67}
68
Ben Clayton2ed93ab2019-12-17 20:38:03 +000069VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void *pData)
Alexis Hetud73b8712018-09-21 15:14:43 -040070{
71 vkUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData);
72}
73
74// VK_KHR_device_group
Ben Clayton2ed93ab2019-12-17 20:38:03 +000075VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags *pPeerMemoryFeatures)
Alexis Hetud73b8712018-09-21 15:14:43 -040076{
77 vkGetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
78}
79
80VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask)
81{
82 vkCmdSetDeviceMask(commandBuffer, deviceMask);
83}
84
85VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ)
86{
87 vkCmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
88}
89
90// VK_KHR_device_group_creation
Ben Clayton2ed93ab2019-12-17 20:38:03 +000091VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -040092{
93 return vkEnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
94}
95
96// VK_KHR_external_fence_capabilities
Ben Clayton2ed93ab2019-12-17 20:38:03 +000097VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -040098{
99 vkGetPhysicalDeviceExternalFenceProperties(physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
100}
101
102// VK_KHR_external_memory_capabilities
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000103VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -0400104{
105 vkGetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
106}
107
108// VK_KHR_external_semaphore_capabilities
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000109VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -0400110{
111 vkGetPhysicalDeviceExternalSemaphoreProperties(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
112}
113
114// VK_KHR_get_memory_requirements2
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000115VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements)
Alexis Hetud73b8712018-09-21 15:14:43 -0400116{
117 vkGetImageMemoryRequirements2(device, pInfo, pMemoryRequirements);
118}
119
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000120VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2 *pInfo, VkMemoryRequirements2 *pMemoryRequirements)
Alexis Hetud73b8712018-09-21 15:14:43 -0400121{
122 vkGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements);
123}
124
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000125VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements)
Alexis Hetud73b8712018-09-21 15:14:43 -0400126{
127 vkGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
128}
129
130// VK_KHR_get_physical_device_properties2
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000131VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures)
Alexis Hetud73b8712018-09-21 15:14:43 -0400132{
133 vkGetPhysicalDeviceFeatures2(physicalDevice, pFeatures);
134}
135
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000136VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -0400137{
138 vkGetPhysicalDeviceProperties2(physicalDevice, pProperties);
139}
140
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000141VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 *pFormatProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -0400142{
143 vkGetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties);
144}
145
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000146VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -0400147{
148 return vkGetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo, pImageFormatProperties);
149}
150
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000151VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2 *pQueueFamilyProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -0400152{
153 vkGetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
154}
155
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000156VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 *pMemoryProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -0400157{
158 vkGetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties);
159}
160
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000161VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2 *pProperties)
Alexis Hetud73b8712018-09-21 15:14:43 -0400162{
163 vkGetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, pProperties);
164}
165
166// VK_KHR_maintenance1
167VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags)
168{
169 vkTrimCommandPool(device, commandPool, flags);
170}
171
172// VK_KHR_maintenance3
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000173VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport)
Alexis Hetud73b8712018-09-21 15:14:43 -0400174{
175 vkGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport);
176}
177
178// VK_KHR_sampler_ycbcr_conversion
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000179VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion)
Alexis Hetud73b8712018-09-21 15:14:43 -0400180{
181 return vkCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion);
182}
183
Ben Clayton2ed93ab2019-12-17 20:38:03 +0000184VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks *pAllocator)
Alexis Hetud73b8712018-09-21 15:14:43 -0400185{
186 vkDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator);
187}
Alexis Hetud73b8712018-09-21 15:14:43 -0400188}