/ appendices / VK_KHR_get_physical_device_properties2.txt
VK_KHR_get_physical_device_properties2.txt
  1  // Copyright (c) 2016-2019 Khronos Group. This work is licensed under a
  2  // Creative Commons Attribution 4.0 International License; see
  3  // http://creativecommons.org/licenses/by/4.0/
  4  
  5  include::meta/VK_KHR_get_physical_device_properties2.txt[]
  6  
  7  *Last Modified Date*::
  8      2017-09-05
  9  *IP Status*::
 10      No known IP claims.
 11  *Interactions and External Dependencies*::
 12    - Promoted to Vulkan 1.1 Core
 13  *Contributors*::
 14    - Jeff Bolz, NVIDIA
 15    - Ian Elliott, Google
 16  
 17  This extension provides new entry points to query device features, device
 18  properties, and format properties in a way that can be easily extended by
 19  other extensions, without introducing any further entry points.
 20  The Vulkan 1.0 feature/limit/formatproperty structures do not include
 21  ptext:sType/ptext:pNext members.
 22  This extension wraps them in new structures with ptext:sType/ptext:pNext
 23  members, so an application can query a chain of feature/limit/formatproperty
 24  structures by constructing the chain and letting the implementation fill
 25  them in.
 26  A new command is added for each ftext:vkGetPhysicalDevice* command in core
 27  Vulkan 1.0.
 28  The new feature structure (and a chain of extension structures) can also be
 29  passed in to device creation to enable features.
 30  
 31  This extension also allows applications to use the physical-device
 32  components of device extensions before flink:vkCreateDevice is called.
 33  
 34  === New Object Types
 35  
 36  None.
 37  
 38  === New Enum Constants
 39  
 40    * Extending elink:VkStructureType:
 41    ** ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR
 42    ** ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR
 43    ** ename:VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR
 44    ** ename:VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR
 45    ** ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR
 46    ** ename:VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR
 47    ** ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR
 48    ** ename:VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR
 49    ** ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR
 50  
 51  === New Enums
 52  
 53  None.
 54  
 55  === New Structures
 56  
 57    * slink:VkPhysicalDeviceFeatures2KHR
 58    * slink:VkPhysicalDeviceProperties2KHR
 59    * slink:VkFormatProperties2KHR
 60    * slink:VkImageFormatProperties2KHR
 61    * slink:VkPhysicalDeviceImageFormatInfo2KHR
 62    * slink:VkQueueFamilyProperties2KHR
 63    * slink:VkPhysicalDeviceMemoryProperties2KHR
 64    * slink:VkSparseImageFormatProperties2KHR
 65    * slink:VkPhysicalDeviceSparseImageFormatInfo2KHR
 66  
 67  === New Functions
 68  
 69    * flink:vkGetPhysicalDeviceFeatures2KHR
 70    * flink:vkGetPhysicalDeviceProperties2KHR
 71    * flink:vkGetPhysicalDeviceFormatProperties2KHR
 72    * flink:vkGetPhysicalDeviceImageFormatProperties2KHR
 73    * flink:vkGetPhysicalDeviceQueueFamilyProperties2KHR
 74    * flink:vkGetPhysicalDeviceMemoryProperties2KHR
 75    * flink:vkGetPhysicalDeviceSparseImageFormatProperties2KHR
 76  
 77  === Promotion to Vulkan 1.1
 78  
 79  All functionality in this extension is included in core Vulkan 1.1, with the
 80  KHR suffix omitted.
 81  The original type, enum and command names are still available as aliases of
 82  the core functionality.
 83  
 84  === Issues
 85  
 86  None.
 87  
 88  === Examples
 89  
 90  [source,c++]
 91  ----------------------------------------
 92  
 93      // Get features with a hypothetical future extension.
 94      VkHypotheticalExtensionFeaturesKHR hypotheticalFeatures =
 95      {
 96          VK_STRUCTURE_TYPE_HYPOTHETICAL_FEATURES_KHR,                            // sType
 97          NULL,                                                                   // pNext
 98      };
 99  
100      VkPhysicalDeviceFeatures2KHR features =
101      {
102          VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR,                       // sType
103          &hypotheticalFeatures,                                                  // pNext
104      };
105  
106      // After this call, features and hypotheticalFeatures have been filled out.
107      vkGetPhysicalDeviceFeatures2KHR(physicalDevice, &features);
108  
109      // Properties/limits can be chained and queried similarly.
110  
111      // Enable some features:
112      VkHypotheticalExtensionFeaturesKHR enabledHypotheticalFeatures =
113      {
114          VK_STRUCTURE_TYPE_HYPOTHETICAL_FEATURES_KHR,                            // sType
115          NULL,                                                                   // pNext
116      };
117  
118      VkPhysicalDeviceFeatures2KHR enabledFeatures =
119      {
120          VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR,                       // sType
121          &enabledHypotheticalFeatures,                                           // pNext
122      };
123  
124      enabledFeatures.features.xyz = VK_TRUE;
125      enabledHypotheticalFeatures.abc = VK_TRUE;
126  
127      VkDeviceCreateInfo deviceCreateInfo =
128      {
129          VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,                                   // sType
130          &enabledFeatures,                                                       // pNext
131          ...
132          NULL,                                                                   // pEnabledFeatures
133      }
134  
135      VkDevice device;
136      vkCreateDevice(physicalDevice, &deviceCreateInfo, NULL, &device);
137  
138  ----------------------------------------
139  
140  === Version History
141  
142   * Revision 1, 2016-09-12 (Jeff Bolz)
143     - Internal revisions
144  
145   * Revision 2, 2016-11-02 (Ian Elliott)
146     - Added ability for applications to use the physical-device components of
147       device extensions before vkCreateDevice is called.