Vulkan-Hpp
PhysicalDeviceProperties.cpp
Go to the documentation of this file.
1 // Copyright(c) 2019, NVIDIA CORPORATION. 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 // VulkanHpp Samples : PhysicalDeviceProperties
16 // Get properties per physical device.
17 
18 #include "../utils/utils.hpp"
19 
20 #include <iomanip>
21 #include <sstream>
22 #include <vector>
24 
25 static char const * AppName = "PhysicalDeviceProperties";
26 static char const * EngineName = "Vulkan.hpp";
27 
28 std::string decodeAPIVersion( uint32_t apiVersion )
29 {
30  return std::to_string( VK_VERSION_MAJOR( apiVersion ) ) + "." + std::to_string( VK_VERSION_MINOR( apiVersion ) ) + "." +
31  std::to_string( VK_VERSION_PATCH( apiVersion ) );
32 }
33 
34 std::string decodeDriverVersion( uint32_t driverVersion, uint32_t vendorID )
35 {
36  switch ( vendorID )
37  {
38  case 4318:
39  return std::to_string( ( driverVersion >> 22 ) & 0x3FF ) + "." + std::to_string( ( driverVersion >> 14 ) & 0xFF ) + "." +
40  std::to_string( ( driverVersion >> 6 ) & 0xFF ) + "." + std::to_string( driverVersion & 0x3F );
41  case 0x8086: return std::to_string( ( driverVersion >> 14 ) & 0x3FFFF ) + "." + std::to_string( ( driverVersion & 0x3FFF ) );
42  default: return decodeAPIVersion( driverVersion );
43  }
44 }
45 
46 std::string decodeVendorID( uint32_t vendorID )
47 {
48  // below 0x10000 are the PCI vendor IDs (https://pcisig.com/membership/member-companies)
49  if ( vendorID < 0x10000 )
50  {
51  switch ( vendorID )
52  {
53  case 0x1022: return "Advanced Micro Devices";
54  case 0x10DE: return "NVidia Corporation";
55  case 0x8086: return "Intel Corporation";
56  default: return std::to_string( vendorID );
57  }
58  }
59  else
60  {
61  // above 0x10000 should be vkVendorIDs
62  return vk::to_string( vk::VendorId( vendorID ) );
63  }
64 }
65 
66 namespace vk
67 {
68  namespace su
69  {
70  struct LUID
71  {
72  public:
73  LUID( uint8_t const data[VK_LUID_SIZE] )
74  {
75  memcpy( m_data, data, VK_LUID_SIZE * sizeof( uint8_t ) );
76  }
77 
78  uint8_t m_data[VK_LUID_SIZE];
79  };
80 
81  std::ostream & operator<<( std::ostream & os, LUID const & uuid )
82  {
83  os << std::setfill( '0' ) << std::hex;
84  for ( uint32_t j = 0; j < VK_LUID_SIZE; ++j )
85  {
86  os << std::setw( 2 ) << static_cast<uint32_t>( uuid.m_data[j] );
87  if ( j == 3 || j == 5 )
88  {
89  std::cout << '-';
90  }
91  }
92  os << std::setfill( ' ' ) << std::dec;
93  return os;
94  }
95  } // namespace su
96 } // namespace vk
97 
98 int main( int /*argc*/, char ** /*argv*/ )
99 {
100  try
101  {
102  vk::Instance instance = vk::su::createInstance( AppName, EngineName, {}, {}, VK_API_VERSION_1_1 );
103 #if !defined( NDEBUG )
105 #endif
106 
107  // enumerate the physicalDevices
108  std::vector<vk::PhysicalDevice> physicalDevices = instance.enumeratePhysicalDevices();
109 
110  /* VULKAN_KEY_START */
111 
112  std::cout << std::boolalpha;
113  for ( size_t i = 0; i < physicalDevices.size(); i++ )
114  {
115  // some properties are only valid, if a corresponding extension is available!
116  std::vector<vk::ExtensionProperties> extensionProperties = physicalDevices[i].enumerateDeviceExtensionProperties();
117 
118  std::cout << "PhysicalDevice " << i << "\n";
119  auto properties2 = physicalDevices[i]
120  .getProperties2<vk::PhysicalDeviceProperties2,
155  vk::PhysicalDeviceProperties const & properties = properties2.get<vk::PhysicalDeviceProperties2>().properties;
156  std::cout << std::string( "\t" ) << "Properties:\n";
157  std::cout << std::string( "\t\t" ) << "apiVersion = " << decodeAPIVersion( properties.apiVersion ) << "\n";
158  std::cout << std::string( "\t\t" ) << "driverVersion = " << decodeDriverVersion( properties.driverVersion, properties.vendorID ) << "\n";
159  std::cout << std::string( "\t\t" ) << "vendorID = " << decodeVendorID( properties.vendorID ) << "\n";
160  std::cout << std::string( "\t\t" ) << "deviceID = " << properties.deviceID << "\n";
161  std::cout << std::string( "\t\t" ) << "deviceType = " << vk::to_string( properties.deviceType ) << "\n";
162  std::cout << std::string( "\t\t" ) << "deviceName = " << properties.deviceName << "\n";
163  std::cout << std::string( "\t\t" ) << "pipelineCacheUUID = " << vk::su::UUID( properties.pipelineCacheUUID ) << "\n";
164  std::cout << std::string( "\t\t" ) << "limits:\n";
165  std::cout << std::string( "\t\t\t" ) << "bufferImageGranularity = " << properties.limits.bufferImageGranularity << "\n";
166  std::cout << std::string( "\t\t\t" ) << "discreteQueuePriorities = " << properties.limits.discreteQueuePriorities << "\n";
167  std::cout << std::string( "\t\t\t" )
168  << "framebufferColorSampleCounts = " << vk::to_string( properties.limits.framebufferColorSampleCounts ) << "\n";
169  std::cout << std::string( "\t\t\t" )
170  << "framebufferDepthSampleCounts = " << vk::to_string( properties.limits.framebufferDepthSampleCounts ) << "\n";
171  std::cout << std::string( "\t\t\t" )
172  << "framebufferNoAttachmentsSampleCounts = " << vk::to_string( properties.limits.framebufferNoAttachmentsSampleCounts ) << "\n";
173  std::cout << std::string( "\t\t\t" )
174  << "framebufferStencilSampleCounts = " << vk::to_string( properties.limits.framebufferStencilSampleCounts ) << "\n";
175  std::cout << std::string( "\t\t\t" ) << "lineWidthGranularity = " << properties.limits.lineWidthGranularity << "\n";
176  std::cout << std::string( "\t\t\t" ) << "lineWidthRange = "
177  << "[" << properties.limits.lineWidthRange[0] << ", " << properties.limits.lineWidthRange[1] << "]"
178  << "\n";
179  std::cout << std::string( "\t\t\t" ) << "maxBoundDescriptorSets = " << properties.limits.maxBoundDescriptorSets << "\n";
180  std::cout << std::string( "\t\t\t" ) << "maxClipDistances = " << properties.limits.maxClipDistances << "\n";
181  std::cout << std::string( "\t\t\t" ) << "maxColorAttachments = " << properties.limits.maxColorAttachments << "\n";
182  std::cout << std::string( "\t\t\t" ) << "maxCombinedClipAndCullDistances = " << properties.limits.maxCombinedClipAndCullDistances << "\n";
183  std::cout << std::string( "\t\t\t" ) << "maxComputeSharedMemorySize = " << properties.limits.maxComputeSharedMemorySize << "\n";
184  std::cout << std::string( "\t\t\t" ) << "maxComputeWorkGroupCount = "
185  << "[" << properties.limits.maxComputeWorkGroupCount[0] << ", " << properties.limits.maxComputeWorkGroupCount[1] << ", "
186  << properties.limits.maxComputeWorkGroupCount[2] << "]"
187  << "\n";
188  std::cout << std::string( "\t\t\t" ) << "maxComputeWorkGroupInvocations = " << properties.limits.maxComputeWorkGroupInvocations << "\n";
189  std::cout << std::string( "\t\t\t" ) << "maxComputeWorkGroupSize = "
190  << "[" << properties.limits.maxComputeWorkGroupSize[0] << ", " << properties.limits.maxComputeWorkGroupSize[1] << ", "
191  << properties.limits.maxComputeWorkGroupSize[2] << "]"
192  << "\n";
193  std::cout << std::string( "\t\t\t" ) << "maxCullDistances = " << properties.limits.maxCullDistances << "\n";
194  std::cout << std::string( "\t\t\t" ) << "maxDescriptorSetInputAttachments = " << properties.limits.maxDescriptorSetInputAttachments
195  << "\n";
196  std::cout << std::string( "\t\t\t" ) << "maxDescriptorSetSampledImages = " << properties.limits.maxDescriptorSetSampledImages << "\n";
197  std::cout << std::string( "\t\t\t" ) << "maxDescriptorSetSamplers = " << properties.limits.maxDescriptorSetSamplers << "\n";
198  std::cout << std::string( "\t\t\t" ) << "maxDescriptorSetStorageBuffers = " << properties.limits.maxDescriptorSetStorageBuffers << "\n";
199  std::cout << std::string( "\t\t\t" ) << "maxDescriptorSetStorageBuffersDynamic = " << properties.limits.maxDescriptorSetStorageBuffersDynamic
200  << "\n";
201  std::cout << std::string( "\t\t\t" ) << "maxDescriptorSetStorageImages = " << properties.limits.maxDescriptorSetStorageImages << "\n";
202  std::cout << std::string( "\t\t\t" ) << "maxDescriptorSetUniformBuffers = " << properties.limits.maxDescriptorSetUniformBuffers << "\n";
203  std::cout << std::string( "\t\t\t" ) << "maxDescriptorSetUniformBuffersDynamic = " << properties.limits.maxDescriptorSetUniformBuffersDynamic
204  << "\n";
205  std::cout << std::string( "\t\t\t" ) << "maxDrawIndexedIndexValue = " << properties.limits.maxDrawIndexedIndexValue << "\n";
206  std::cout << std::string( "\t\t\t" ) << "maxDrawIndirectCount = " << properties.limits.maxDrawIndirectCount << "\n";
207  std::cout << std::string( "\t\t\t" ) << "maxFragmentCombinedOutputResources = " << properties.limits.maxFragmentCombinedOutputResources
208  << "\n";
209  std::cout << std::string( "\t\t\t" ) << "maxFragmentDualSrcAttachments = " << properties.limits.maxFragmentDualSrcAttachments << "\n";
210  std::cout << std::string( "\t\t\t" ) << "maxFragmentInputComponents = " << properties.limits.maxFragmentInputComponents << "\n";
211  std::cout << std::string( "\t\t\t" ) << "maxFragmentOutputAttachments = " << properties.limits.maxFragmentOutputAttachments << "\n";
212  std::cout << std::string( "\t\t\t" ) << "maxFramebufferHeight = " << properties.limits.maxFramebufferHeight << "\n";
213  std::cout << std::string( "\t\t\t" ) << "maxFramebufferLayers = " << properties.limits.maxFramebufferLayers << "\n";
214  std::cout << std::string( "\t\t\t" ) << "maxFramebufferWidth = " << properties.limits.maxFramebufferWidth << "\n";
215  std::cout << std::string( "\t\t\t" ) << "maxGeometryInputComponents = " << properties.limits.maxGeometryInputComponents << "\n";
216  std::cout << std::string( "\t\t\t" ) << "maxGeometryOutputComponents = " << properties.limits.maxGeometryOutputComponents << "\n";
217  std::cout << std::string( "\t\t\t" ) << "maxGeometryOutputVertices = " << properties.limits.maxGeometryOutputVertices << "\n";
218  std::cout << std::string( "\t\t\t" ) << "maxGeometryShaderInvocations = " << properties.limits.maxGeometryShaderInvocations << "\n";
219  std::cout << std::string( "\t\t\t" ) << "maxGeometryTotalOutputComponents = " << properties.limits.maxGeometryTotalOutputComponents
220  << "\n";
221  std::cout << std::string( "\t\t\t" ) << "maxImageArrayLayers = " << properties.limits.maxImageArrayLayers << "\n";
222  std::cout << std::string( "\t\t\t" ) << "maxImageDimension1D = " << properties.limits.maxImageDimension1D << "\n";
223  std::cout << std::string( "\t\t\t" ) << "maxImageDimension2D = " << properties.limits.maxImageDimension2D << "\n";
224  std::cout << std::string( "\t\t\t" ) << "maxImageDimension3D = " << properties.limits.maxImageDimension3D << "\n";
225  std::cout << std::string( "\t\t\t" ) << "maxImageDimensionCube = " << properties.limits.maxImageDimensionCube << "\n";
226  std::cout << std::string( "\t\t\t" ) << "maxInterpolationOffset = " << properties.limits.maxInterpolationOffset << "\n";
227  std::cout << std::string( "\t\t\t" ) << "maxMemoryAllocationCount = " << properties.limits.maxMemoryAllocationCount << "\n";
228  std::cout << std::string( "\t\t\t" ) << "maxPerStageDescriptorInputAttachments = " << properties.limits.maxPerStageDescriptorInputAttachments
229  << "\n";
230  std::cout << std::string( "\t\t\t" ) << "maxPerStageDescriptorSampledImages = " << properties.limits.maxPerStageDescriptorSampledImages
231  << "\n";
232  std::cout << std::string( "\t\t\t" ) << "maxPerStageDescriptorSamplers = " << properties.limits.maxPerStageDescriptorSamplers << "\n";
233  std::cout << std::string( "\t\t\t" ) << "maxPerStageDescriptorStorageBuffers = " << properties.limits.maxPerStageDescriptorStorageBuffers
234  << "\n";
235  std::cout << std::string( "\t\t\t" ) << "maxPerStageDescriptorStorageImages = " << properties.limits.maxPerStageDescriptorStorageImages
236  << "\n";
237  std::cout << std::string( "\t\t\t" ) << "maxPerStageDescriptorUniformBuffers = " << properties.limits.maxPerStageDescriptorUniformBuffers
238  << "\n";
239  std::cout << std::string( "\t\t\t" ) << "maxPerStageResources = " << properties.limits.maxPerStageResources << "\n";
240  std::cout << std::string( "\t\t\t" ) << "maxPushConstantsSize = " << properties.limits.maxPushConstantsSize << "\n";
241  std::cout << std::string( "\t\t\t" ) << "maxSampleMaskWords = " << properties.limits.maxSampleMaskWords << "\n";
242  std::cout << std::string( "\t\t\t" ) << "maxSamplerAllocationCount = " << properties.limits.maxSamplerAllocationCount << "\n";
243  std::cout << std::string( "\t\t\t" ) << "maxSamplerAnisotropy = " << properties.limits.maxSamplerAnisotropy << "\n";
244  std::cout << std::string( "\t\t\t" ) << "maxSamplerLodBias = " << properties.limits.maxSamplerLodBias << "\n";
245  std::cout << std::string( "\t\t\t" ) << "maxStorageBufferRange = " << properties.limits.maxStorageBufferRange << "\n";
246  std::cout << std::string( "\t\t\t" )
247  << "maxTessellationControlPerPatchOutputComponents = " << properties.limits.maxTessellationControlPerPatchOutputComponents << "\n";
248  std::cout << std::string( "\t\t\t" )
249  << "maxTessellationControlPerVertexInputComponents = " << properties.limits.maxTessellationControlPerVertexInputComponents << "\n";
250  std::cout << std::string( "\t\t\t" )
251  << "maxTessellationControlPerVertexOutputComponents = " << properties.limits.maxTessellationControlPerVertexOutputComponents << "\n";
252  std::cout << std::string( "\t\t\t" )
253  << "maxTessellationControlTotalOutputComponents = " << properties.limits.maxTessellationControlTotalOutputComponents << "\n";
254  std::cout << std::string( "\t\t\t" ) << "maxTessellationEvaluationInputComponents = " << properties.limits.maxTessellationEvaluationInputComponents
255  << "\n";
256  std::cout << std::string( "\t\t\t" )
257  << "maxTessellationEvaluationOutputComponents = " << properties.limits.maxTessellationEvaluationOutputComponents << "\n";
258  std::cout << std::string( "\t\t\t" ) << "maxTessellationGenerationLevel = " << properties.limits.maxTessellationGenerationLevel << "\n";
259  std::cout << std::string( "\t\t\t" ) << "maxTessellationPatchSize = " << properties.limits.maxTessellationPatchSize << "\n";
260  std::cout << std::string( "\t\t\t" ) << "maxTexelBufferElements = " << properties.limits.maxTexelBufferElements << "\n";
261  std::cout << std::string( "\t\t\t" ) << "maxTexelGatherOffset = " << properties.limits.maxTexelGatherOffset << "\n";
262  std::cout << std::string( "\t\t\t" ) << "maxTexelOffset = " << properties.limits.maxTexelOffset << "\n";
263  std::cout << std::string( "\t\t\t" ) << "maxUniformBufferRange = " << properties.limits.maxUniformBufferRange << "\n";
264  std::cout << std::string( "\t\t\t" ) << "maxVertexInputAttributeOffset = " << properties.limits.maxVertexInputAttributeOffset << "\n";
265  std::cout << std::string( "\t\t\t" ) << "maxVertexInputAttributes = " << properties.limits.maxVertexInputAttributes << "\n";
266  std::cout << std::string( "\t\t\t" ) << "maxVertexInputBindings = " << properties.limits.maxVertexInputBindings << "\n";
267  std::cout << std::string( "\t\t\t" ) << "maxVertexInputBindingStride = " << properties.limits.maxVertexInputBindingStride << "\n";
268  std::cout << std::string( "\t\t\t" ) << "maxVertexOutputComponents = " << properties.limits.maxVertexOutputComponents << "\n";
269  std::cout << std::string( "\t\t\t" ) << "maxViewportDimensions = "
270  << "[" << properties.limits.maxViewportDimensions[0] << ", " << properties.limits.maxViewportDimensions[1] << "]"
271  << "\n";
272  std::cout << std::string( "\t\t\t" ) << "maxViewports = " << properties.limits.maxViewports << "\n";
273  std::cout << std::string( "\t\t\t" ) << "minInterpolationOffset = " << properties.limits.minInterpolationOffset << "\n";
274  std::cout << std::string( "\t\t\t" ) << "minMemoryMapAlignment = " << properties.limits.minMemoryMapAlignment << "\n";
275  std::cout << std::string( "\t\t\t" ) << "minStorageBufferOffsetAlignment = " << properties.limits.minStorageBufferOffsetAlignment << "\n";
276  std::cout << std::string( "\t\t\t" ) << "minTexelBufferOffsetAlignment = " << properties.limits.minTexelBufferOffsetAlignment << "\n";
277  std::cout << std::string( "\t\t\t" ) << "minTexelGatherOffset = " << properties.limits.minTexelGatherOffset << "\n";
278  std::cout << std::string( "\t\t\t" ) << "minTexelOffset = " << properties.limits.minTexelOffset << "\n";
279  std::cout << std::string( "\t\t\t" ) << "minUniformBufferOffsetAlignment = " << properties.limits.minUniformBufferOffsetAlignment << "\n";
280  std::cout << std::string( "\t\t\t" ) << "mipmapPrecisionBits = " << properties.limits.mipmapPrecisionBits << "\n";
281  std::cout << std::string( "\t\t\t" ) << "nonCoherentAtomSize = " << properties.limits.nonCoherentAtomSize << "\n";
282  std::cout << std::string( "\t\t\t" ) << "optimalBufferCopyOffsetAlignment = " << properties.limits.optimalBufferCopyOffsetAlignment
283  << "\n";
284  std::cout << std::string( "\t\t\t" ) << "optimalBufferCopyRowPitchAlignment = " << properties.limits.optimalBufferCopyRowPitchAlignment
285  << "\n";
286  std::cout << std::string( "\t\t\t" ) << "pointSizeGranularity = " << properties.limits.pointSizeGranularity << "\n";
287  std::cout << std::string( "\t\t\t" ) << "pointSizeRange = "
288  << "[" << properties.limits.pointSizeRange[0] << ", " << properties.limits.pointSizeRange[1] << "]"
289  << "\n";
290  std::cout << std::string( "\t\t\t" )
291  << "sampledImageColorSampleCounts = " << vk::to_string( properties.limits.sampledImageColorSampleCounts ) << "\n";
292  std::cout << std::string( "\t\t\t" )
293  << "sampledImageDepthSampleCounts = " << vk::to_string( properties.limits.sampledImageDepthSampleCounts ) << "\n";
294  std::cout << std::string( "\t\t\t" )
295  << "sampledImageIntegerSampleCounts = " << vk::to_string( properties.limits.sampledImageIntegerSampleCounts ) << "\n";
296  std::cout << std::string( "\t\t\t" )
297  << "sampledImageStencilSampleCounts = " << vk::to_string( properties.limits.sampledImageStencilSampleCounts ) << "\n";
298  std::cout << std::string( "\t\t\t" ) << "sparseAddressSpaceSize = " << properties.limits.sparseAddressSpaceSize << "\n";
299  std::cout << std::string( "\t\t\t" ) << "standardSampleLocations = " << !!properties.limits.standardSampleLocations << "\n";
300  std::cout << std::string( "\t\t\t" )
301  << "storageImageSampleCounts = " << vk::to_string( properties.limits.storageImageSampleCounts ) << "\n";
302  std::cout << std::string( "\t\t\t" ) << "strictLines = " << !!properties.limits.strictLines << "\n";
303  std::cout << std::string( "\t\t\t" ) << "subPixelInterpolationOffsetBits = " << properties.limits.subPixelInterpolationOffsetBits << "\n";
304  std::cout << std::string( "\t\t\t" ) << "subPixelPrecisionBits = " << properties.limits.subPixelPrecisionBits << "\n";
305  std::cout << std::string( "\t\t\t" ) << "subTexelPrecisionBits = " << properties.limits.subTexelPrecisionBits << "\n";
306  std::cout << std::string( "\t\t\t" ) << "timestampComputeAndGraphics = " << !!properties.limits.timestampComputeAndGraphics << "\n";
307  std::cout << std::string( "\t\t\t" ) << "timestampPeriod = " << properties.limits.timestampPeriod << "\n";
308  std::cout << std::string( "\t\t\t" ) << "viewportBoundsRange = "
309  << "[" << properties.limits.viewportBoundsRange[0] << ", " << properties.limits.viewportBoundsRange[1] << "]"
310  << "\n";
311  std::cout << std::string( "\t\t\t" ) << "viewportSubPixelBits = " << properties.limits.viewportSubPixelBits << "\n";
312  std::cout << std::string( "\t\t" ) << "sparseProperties:\n";
313  std::cout << std::string( "\t\t\t" ) << "residencyAlignedMipSize = " << !!properties.sparseProperties.residencyAlignedMipSize << "\n";
314  std::cout << std::string( "\t\t\t" ) << "residencyNonResidentStrict = " << !!properties.sparseProperties.residencyNonResidentStrict
315  << "\n";
316  std::cout << std::string( "\t\t\t" ) << "residencyStandard2DBlockShape = " << !!properties.sparseProperties.residencyStandard2DBlockShape
317  << "\n";
318  std::cout << std::string( "\t\t\t" )
319  << "residencyStandard2DMultisampleBlockShape = " << !!properties.sparseProperties.residencyStandard2DMultisampleBlockShape << "\n";
320  std::cout << std::string( "\t\t\t" ) << "residencyStandard3DBlockShape = " << !!properties.sparseProperties.residencyStandard3DBlockShape
321  << "\n";
322  std::cout << "\n";
323 
324  if ( vk::su::contains( extensionProperties, "VK_EXT_blend_operation_advanced" ) )
325  {
326  vk::PhysicalDeviceBlendOperationAdvancedPropertiesEXT const & blendOperationAdvancedProperties =
328  std::cout << std::string( "\t" ) << "BlendOperationAdvancedProperties:\n";
329  std::cout << std::string( "\t\t" ) << "advancedBlendAllOperations = " << !!blendOperationAdvancedProperties.advancedBlendAllOperations
330  << "\n";
331  std::cout << std::string( "\t\t" ) << "advancedBlendCorrelatedOverlap = " << !!blendOperationAdvancedProperties.advancedBlendCorrelatedOverlap
332  << "\n";
333  std::cout << std::string( "\t\t" ) << "advancedBlendIndependentBlend = " << !!blendOperationAdvancedProperties.advancedBlendIndependentBlend
334  << "\n";
335  std::cout << std::string( "\t\t" ) << "advancedBlendMaxColorAttachments = " << blendOperationAdvancedProperties.advancedBlendMaxColorAttachments
336  << "\n";
337  std::cout << std::string( "\t\t" )
338  << "advancedBlendNonPremultipliedDstColor = " << !!blendOperationAdvancedProperties.advancedBlendNonPremultipliedDstColor << "\n";
339  std::cout << std::string( "\t\t" )
340  << "advancedBlendNonPremultipliedSrcColor = " << !!blendOperationAdvancedProperties.advancedBlendNonPremultipliedSrcColor << "\n";
341  std::cout << "\n";
342  }
343 
344  if ( vk::su::contains( extensionProperties, "VK_EXT_conservative_rasterization" ) )
345  {
346  vk::PhysicalDeviceConservativeRasterizationPropertiesEXT const & conservativeRasterizationProperties =
348  std::cout << std::string( "\t" ) << "ConservativeRasterizationProperties:\n";
349  std::cout << std::string( "\t\t" )
350  << "conservativePointAndLineRasterization = " << !!conservativeRasterizationProperties.conservativePointAndLineRasterization << "\n";
351  std::cout << std::string( "\t\t" )
352  << "conservativeRasterizationPostDepthCoverage = " << !!conservativeRasterizationProperties.conservativeRasterizationPostDepthCoverage
353  << "\n";
354  std::cout << std::string( "\t\t" )
355  << "degenerateLinesRasterized = " << !!conservativeRasterizationProperties.degenerateLinesRasterized << "\n";
356  std::cout << std::string( "\t\t" )
357  << "degenerateTrianglesRasterized = " << !!conservativeRasterizationProperties.degenerateTrianglesRasterized << "\n";
358  std::cout << std::string( "\t\t" )
359  << "extraPrimitiveOverestimationSizeGranularity = " << conservativeRasterizationProperties.extraPrimitiveOverestimationSizeGranularity
360  << "\n";
361  std::cout << std::string( "\t\t" )
362  << "fullyCoveredFragmentShaderInputVariable = " << !!conservativeRasterizationProperties.fullyCoveredFragmentShaderInputVariable << "\n";
363  std::cout << std::string( "\t\t" )
364  << "maxExtraPrimitiveOverestimationSize = " << conservativeRasterizationProperties.maxExtraPrimitiveOverestimationSize << "\n";
365  std::cout << std::string( "\t\t" )
366  << "primitiveOverestimationSize = " << conservativeRasterizationProperties.primitiveOverestimationSize << "\n";
367  std::cout << std::string( "\t\t" ) << "primitiveUnderestimation = " << !!conservativeRasterizationProperties.primitiveUnderestimation
368  << "\n";
369  std::cout << "\n";
370  }
371 
372  if ( vk::su::contains( extensionProperties, "VK_NV_cooperative_matrix" ) )
373  {
374  vk::PhysicalDeviceCooperativeMatrixPropertiesNV const & cooperativeMatrixProperties =
376  std::cout << std::string( "\t" ) << "CooperativeMatrixProperties:\n";
377  std::cout << std::string( "\t\t" )
378  << "cooperativeMatrixSupportedStages = " << vk::to_string( cooperativeMatrixProperties.cooperativeMatrixSupportedStages ) << "\n";
379  std::cout << "\n";
380  }
381 
382  if ( vk::su::contains( extensionProperties, "VK_KHR_depth_stencil_resolve" ) )
383  {
384  vk::PhysicalDeviceDepthStencilResolvePropertiesKHR const & depthStencilResolveProperties =
386  std::cout << std::string( "\t" ) << "DepthStencilResolveProperties:\n";
387  std::cout << std::string( "\t\t" ) << "independentResolve = " << !!depthStencilResolveProperties.independentResolve << "\n";
388  std::cout << std::string( "\t\t" ) << "independentResolveNone = " << !!depthStencilResolveProperties.independentResolveNone << "\n";
389  std::cout << std::string( "\t\t" ) << "supportedDepthResolveModes = " << vk::to_string( depthStencilResolveProperties.supportedDepthResolveModes )
390  << "\n";
391  std::cout << std::string( "\t\t" ) << "supportedStencilResolveModes = " << vk::to_string( depthStencilResolveProperties.supportedStencilResolveModes )
392  << "\n";
393  std::cout << "\n";
394  }
395 
396  if ( vk::su::contains( extensionProperties, "VK_EXT_descriptor_indexing" ) )
397  {
398  vk::PhysicalDeviceDescriptorIndexingPropertiesEXT const & descriptorIndexingProperties =
400  std::cout << std::string( "\t" ) << "DescriptorIndexingProperties:\n";
401  std::cout << std::string( "\t\t" )
402  << "maxDescriptorSetUpdateAfterBindInputAttachments = " << descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindInputAttachments
403  << "\n";
404  std::cout << std::string( "\t\t" )
405  << "maxDescriptorSetUpdateAfterBindSampledImages = " << descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindSampledImages
406  << "\n";
407  std::cout << std::string( "\t\t" )
408  << "maxDescriptorSetUpdateAfterBindSamplers = " << descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindSamplers << "\n";
409  std::cout << std::string( "\t\t" )
410  << "maxDescriptorSetUpdateAfterBindStorageBuffers = " << descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageBuffers
411  << "\n";
412  std::cout << std::string( "\t\t" ) << "maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = "
413  << descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic << "\n";
414  std::cout << std::string( "\t\t" )
415  << "maxDescriptorSetUpdateAfterBindStorageImages = " << descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageImages
416  << "\n";
417  std::cout << std::string( "\t\t" )
418  << "maxDescriptorSetUpdateAfterBindUniformBuffers = " << descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindUniformBuffers
419  << "\n";
420  std::cout << std::string( "\t\t" ) << "maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = "
421  << descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic << "\n";
422  std::cout << std::string( "\t\t" ) << "maxPerStageDescriptorUpdateAfterBindInputAttachments = "
423  << descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindInputAttachments << "\n";
424  std::cout << std::string( "\t\t" ) << "maxPerStageDescriptorUpdateAfterBindSampledImages = "
425  << descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindSampledImages << "\n";
426  std::cout << std::string( "\t\t" )
427  << "maxPerStageDescriptorUpdateAfterBindSamplers = " << descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindSamplers
428  << "\n";
429  std::cout << std::string( "\t\t" ) << "maxPerStageDescriptorUpdateAfterBindStorageBuffers = "
430  << descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindStorageBuffers << "\n";
431  std::cout << std::string( "\t\t" ) << "maxPerStageDescriptorUpdateAfterBindStorageImages = "
432  << descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindStorageImages << "\n";
433  std::cout << std::string( "\t\t" ) << "maxPerStageDescriptorUpdateAfterBindUniformBuffers = "
434  << descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindUniformBuffers << "\n";
435  std::cout << std::string( "\t\t" )
436  << "maxPerStageUpdateAfterBindResources = " << descriptorIndexingProperties.maxPerStageUpdateAfterBindResources << "\n";
437  std::cout << std::string( "\t\t" )
438  << "maxUpdateAfterBindDescriptorsInAllPools = " << descriptorIndexingProperties.maxUpdateAfterBindDescriptorsInAllPools << "\n";
439  std::cout << std::string( "\t\t" )
440  << "quadDivergentImplicitLod = " << !!descriptorIndexingProperties.quadDivergentImplicitLod << "\n";
441  std::cout << std::string( "\t\t" )
442  << "robustBufferAccessUpdateAfterBind = " << !!descriptorIndexingProperties.robustBufferAccessUpdateAfterBind << "\n";
443  std::cout << std::string( "\t\t" ) << "shaderInputAttachmentArrayNonUniformIndexingNative = "
444  << !!descriptorIndexingProperties.shaderInputAttachmentArrayNonUniformIndexingNative << "\n";
445  std::cout << std::string( "\t\t" ) << "shaderSampledImageArrayNonUniformIndexingNative = "
446  << !!descriptorIndexingProperties.shaderSampledImageArrayNonUniformIndexingNative << "\n";
447  std::cout << std::string( "\t\t" ) << "shaderStorageBufferArrayNonUniformIndexingNative = "
448  << !!descriptorIndexingProperties.shaderStorageBufferArrayNonUniformIndexingNative << "\n";
449  std::cout << std::string( "\t\t" ) << "shaderStorageImageArrayNonUniformIndexingNative = "
450  << !!descriptorIndexingProperties.shaderStorageImageArrayNonUniformIndexingNative << "\n";
451  std::cout << std::string( "\t\t" ) << "shaderUniformBufferArrayNonUniformIndexingNative = "
452  << !!descriptorIndexingProperties.shaderUniformBufferArrayNonUniformIndexingNative << "\n";
453  std::cout << "\n";
454  }
455 
456  if ( vk::su::contains( extensionProperties, "VK_EXT_discard_rectangles" ) )
457  {
458  vk::PhysicalDeviceDiscardRectanglePropertiesEXT const & discardRectangleProperties = properties2.get<vk::PhysicalDeviceDiscardRectanglePropertiesEXT>();
459  std::cout << std::string( "\t" ) << "DiscardRectangleProperties:\n";
460  std::cout << std::string( "\t\t" ) << "maxDiscardRectangles = " << discardRectangleProperties.maxDiscardRectangles << "\n";
461  std::cout << "\n";
462  }
463 
464  if ( vk::su::contains( extensionProperties, "VK_KHR_driver_properties" ) )
465  {
466  vk::PhysicalDeviceDriverPropertiesKHR const & driverProperties = properties2.get<vk::PhysicalDeviceDriverPropertiesKHR>();
467  std::cout << std::string( "\t" ) << "DriverProperties:\n";
468  std::cout << std::string( "\t\t" ) << "driverID = " << vk::to_string( driverProperties.driverID ) << "\n";
469  std::cout << std::string( "\t\t" ) << "driverName = " << driverProperties.driverName << "\n";
470  std::cout << std::string( "\t\t" ) << "driverInfo = " << driverProperties.driverInfo << "\n";
471  std::cout << std::string( "\t\t" ) << "conformanceVersion = " << static_cast<uint32_t>( driverProperties.conformanceVersion.major ) << "."
472  << static_cast<uint32_t>( driverProperties.conformanceVersion.minor ) << "."
473  << static_cast<uint32_t>( driverProperties.conformanceVersion.subminor ) << "."
474  << static_cast<uint32_t>( driverProperties.conformanceVersion.patch ) << std::dec << "\n";
475  std::cout << "\n";
476  }
477 
478  if ( vk::su::contains( extensionProperties, "VK_EXT_external_memory_host" ) )
479  {
480  vk::PhysicalDeviceExternalMemoryHostPropertiesEXT const & externalMemoryHostProperties =
482  std::cout << std::string( "\t" ) << "ExternalMemoryHostProperties:\n";
483  std::cout << std::string( "\t\t" ) << "minImportedHostPointerAlignment = " << externalMemoryHostProperties.minImportedHostPointerAlignment << "\n";
484  std::cout << "\n";
485  }
486 
487  if ( vk::su::contains( extensionProperties, "VK_KHR_shader_float_controls" ) )
488  {
489  vk::PhysicalDeviceFloatControlsPropertiesKHR const & floatControlsProperties = properties2.get<vk::PhysicalDeviceFloatControlsPropertiesKHR>();
490  std::cout << std::string( "\t" ) << "FloatControlsProperties:\n";
491  std::cout << std::string( "\t\t" ) << "denormBehaviorIndependence = " << vk::to_string( floatControlsProperties.denormBehaviorIndependence )
492  << "\n";
493  std::cout << std::string( "\t\t" ) << "roundingModeIndependence = " << vk::to_string( floatControlsProperties.roundingModeIndependence )
494  << "\n";
495  std::cout << std::string( "\t\t" ) << "shaderDenormFlushToZeroFloat16 = " << !!floatControlsProperties.shaderDenormFlushToZeroFloat16 << "\n";
496  std::cout << std::string( "\t\t" ) << "shaderDenormFlushToZeroFloat32 = " << !!floatControlsProperties.shaderDenormFlushToZeroFloat32 << "\n";
497  std::cout << std::string( "\t\t" ) << "shaderDenormFlushToZeroFloat64 = " << !!floatControlsProperties.shaderDenormFlushToZeroFloat64 << "\n";
498  std::cout << std::string( "\t\t" ) << "shaderDenormPreserveFloat16 = " << !!floatControlsProperties.shaderDenormPreserveFloat16 << "\n";
499  std::cout << std::string( "\t\t" ) << "shaderDenormPreserveFloat32 = " << !!floatControlsProperties.shaderDenormPreserveFloat32 << "\n";
500  std::cout << std::string( "\t\t" ) << "shaderDenormPreserveFloat64 = " << !!floatControlsProperties.shaderDenormPreserveFloat64 << "\n";
501  std::cout << std::string( "\t\t" ) << "shaderRoundingModeRTEFloat16 = " << !!floatControlsProperties.shaderRoundingModeRTEFloat16 << "\n";
502  std::cout << std::string( "\t\t" ) << "shaderRoundingModeRTEFloat32 = " << !!floatControlsProperties.shaderRoundingModeRTEFloat32 << "\n";
503  std::cout << std::string( "\t\t" ) << "shaderRoundingModeRTEFloat64 = " << !!floatControlsProperties.shaderRoundingModeRTEFloat64 << "\n";
504  std::cout << std::string( "\t\t" ) << "shaderRoundingModeRTZFloat16 = " << !!floatControlsProperties.shaderRoundingModeRTZFloat16 << "\n";
505  std::cout << std::string( "\t\t" ) << "shaderRoundingModeRTZFloat32 = " << !!floatControlsProperties.shaderRoundingModeRTZFloat32 << "\n";
506  std::cout << std::string( "\t\t" ) << "shaderRoundingModeRTZFloat64 = " << !!floatControlsProperties.shaderRoundingModeRTZFloat64 << "\n";
507  std::cout << std::string( "\t\t" ) << "shaderSignedZeroInfNanPreserveFloat16 = " << !!floatControlsProperties.shaderSignedZeroInfNanPreserveFloat16
508  << "\n";
509  std::cout << std::string( "\t\t" ) << "shaderSignedZeroInfNanPreserveFloat32 = " << !!floatControlsProperties.shaderSignedZeroInfNanPreserveFloat32
510  << "\n";
511  std::cout << std::string( "\t\t" ) << "shaderSignedZeroInfNanPreserveFloat64 = " << !!floatControlsProperties.shaderSignedZeroInfNanPreserveFloat64
512  << "\n";
513  std::cout << "\n";
514  }
515 
516  if ( vk::su::contains( extensionProperties, "VK_EXT_fragment_density_map" ) )
517  {
518  vk::PhysicalDeviceFragmentDensityMapPropertiesEXT const & fragmentDensityMapProperties =
520  std::cout << std::string( "\t" ) << "FragmentDensityProperties:\n";
521  std::cout << std::string( "\t\t" ) << "fragmentDensityInvocations = " << !!fragmentDensityMapProperties.fragmentDensityInvocations << "\n";
522  std::cout << std::string( "\t\t" ) << "maxFragmentDensityTexelSize = " << fragmentDensityMapProperties.maxFragmentDensityTexelSize.width << " x "
523  << fragmentDensityMapProperties.maxFragmentDensityTexelSize.height << "\n";
524  std::cout << std::string( "\t\t" ) << "minFragmentDensityTexelSize = " << fragmentDensityMapProperties.minFragmentDensityTexelSize.width << " x "
525  << fragmentDensityMapProperties.minFragmentDensityTexelSize.height << "\n";
526  std::cout << "\n";
527  }
528 
529  vk::PhysicalDeviceIDProperties const & idProperties = properties2.get<vk::PhysicalDeviceIDProperties>();
530  std::cout << std::string( "\t" ) << "IDProperties:\n";
531  std::cout << std::string( "\t\t" ) << "deviceUUID = " << vk::su::UUID( idProperties.deviceUUID ) << "\n";
532  std::cout << std::string( "\t\t" ) << "driverUUID = " << vk::su::UUID( idProperties.driverUUID ) << "\n";
533  std::cout << std::string( "\t\t" ) << "deviceLUID = " << vk::su::LUID( idProperties.deviceLUID ) << "\n";
534  std::cout << std::string( "\t\t" ) << "deviceNodeMask = " << std::hex << idProperties.deviceNodeMask << std::dec << "\n";
535  std::cout << std::string( "\t\t" ) << "deviceLUIDValid = " << !!idProperties.deviceLUIDValid << "\n";
536  std::cout << "\n";
537 
538  if ( vk::su::contains( extensionProperties, "VK_EXT_inline_uniform_block" ) )
539  {
540  vk::PhysicalDeviceInlineUniformBlockPropertiesEXT const & inlineUniformBlockProperties =
542  std::cout << std::string( "\t" ) << "InlineUniformBlockProperties:\n";
543  std::cout << std::string( "\t\t" )
544  << "maxDescriptorSetInlineUniformBlocks = " << inlineUniformBlockProperties.maxDescriptorSetInlineUniformBlocks << "\n";
545  std::cout << std::string( "\t\t" ) << "maxDescriptorSetUpdateAfterBindInlineUniformBlocks = "
546  << inlineUniformBlockProperties.maxDescriptorSetUpdateAfterBindInlineUniformBlocks << "\n";
547  std::cout << std::string( "\t\t" )
548  << "maxInlineUniformBlockSize = " << inlineUniformBlockProperties.maxInlineUniformBlockSize << "\n";
549  std::cout << std::string( "\t\t" )
550  << "maxPerStageDescriptorInlineUniformBlocks = " << inlineUniformBlockProperties.maxPerStageDescriptorInlineUniformBlocks
551  << "\n";
552  std::cout << std::string( "\t\t" ) << "maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = "
553  << inlineUniformBlockProperties.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks << "\n";
554  std::cout << "\n";
555  }
556 
557  if ( vk::su::contains( extensionProperties, "VK_EXT_line_rasterization" ) )
558  {
559  vk::PhysicalDeviceLineRasterizationPropertiesEXT const & lineRasterizationProperties =
561  std::cout << std::string( "\t" ) << "LineRasterizationProperties:\n";
562  std::cout << std::string( "\t\t" ) << "lineSubPixelPrecisionBits = " << lineRasterizationProperties.lineSubPixelPrecisionBits << "\n";
563  std::cout << "\n";
564  }
565 
566  vk::PhysicalDeviceMaintenance3Properties const & maintenance3Properties = properties2.get<vk::PhysicalDeviceMaintenance3Properties>();
567  std::cout << std::string( "\t" ) << "Maintenance3Properties:\n";
568  std::cout << std::string( "\t\t" ) << "maxMemoryAllocationSize = " << maintenance3Properties.maxMemoryAllocationSize << "\n";
569  std::cout << std::string( "\t\t" ) << "maxPerSetDescriptors = " << maintenance3Properties.maxPerSetDescriptors << "\n";
570  std::cout << "\n";
571 
572  if ( vk::su::contains( extensionProperties, "VK_NV_mesh_shader" ) )
573  {
574  vk::PhysicalDeviceMeshShaderPropertiesNV const & meshShaderProperties = properties2.get<vk::PhysicalDeviceMeshShaderPropertiesNV>();
575  std::cout << std::string( "\t" ) << "MeshShaderProperties:\n";
576  std::cout << std::string( "\t\t" ) << "maxDrawMeshTasksCount = " << meshShaderProperties.maxDrawMeshTasksCount << "\n";
577  std::cout << std::string( "\t\t" ) << "maxMeshMultiviewViewCount = " << meshShaderProperties.maxMeshMultiviewViewCount << "\n";
578  std::cout << std::string( "\t\t" ) << "maxMeshOutputPrimitives = " << meshShaderProperties.maxMeshOutputPrimitives << "\n";
579  std::cout << std::string( "\t\t" ) << "maxMeshOutputVertices = " << meshShaderProperties.maxMeshOutputVertices << "\n";
580  std::cout << std::string( "\t\t" ) << "maxMeshTotalMemorySize = " << meshShaderProperties.maxMeshTotalMemorySize << "\n";
581  std::cout << std::string( "\t\t" ) << "maxMeshWorkGroupInvocations = " << meshShaderProperties.maxMeshWorkGroupInvocations << "\n";
582  std::cout << std::string( "\t\t" ) << "maxMeshWorkGroupSize = "
583  << "[" << meshShaderProperties.maxMeshWorkGroupSize[0] << ", " << meshShaderProperties.maxMeshWorkGroupSize[1] << ", "
584  << meshShaderProperties.maxMeshWorkGroupSize[2] << "]"
585  << "\n";
586  std::cout << std::string( "\t\t" ) << "maxTaskOutputCount = " << meshShaderProperties.maxTaskOutputCount << "\n";
587  std::cout << std::string( "\t\t" ) << "maxTaskTotalMemorySize = " << meshShaderProperties.maxTaskTotalMemorySize << "\n";
588  std::cout << std::string( "\t\t" ) << "maxTaskWorkGroupInvocations = " << meshShaderProperties.maxTaskWorkGroupInvocations << "\n";
589  std::cout << std::string( "\t\t" ) << "maxTaskWorkGroupSize = "
590  << "[" << meshShaderProperties.maxTaskWorkGroupSize[0] << ", " << meshShaderProperties.maxTaskWorkGroupSize[1] << ", "
591  << meshShaderProperties.maxTaskWorkGroupSize[2] << "]"
592  << "\n";
593  std::cout << std::string( "\t\t" ) << "meshOutputPerPrimitiveGranularity = " << meshShaderProperties.meshOutputPerPrimitiveGranularity << "\n";
594  std::cout << std::string( "\t\t" ) << "meshOutputPerVertexGranularity = " << meshShaderProperties.meshOutputPerVertexGranularity << "\n";
595  std::cout << "\n";
596  }
597 
598  if ( vk::su::contains( extensionProperties, "VK_NVX_multiview_per_view_attributes" ) )
599  {
600  vk::PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & multiviewPerViewAttributesProperties =
602  std::cout << std::string( "\t" ) << "MultiviewPerViewAttributesProperties:\n";
603  std::cout << std::string( "\t\t" ) << "perViewPositionAllComponents = " << !!multiviewPerViewAttributesProperties.perViewPositionAllComponents << "\n";
604  std::cout << "\n";
605  }
606 
607  vk::PhysicalDeviceMultiviewProperties const & multiviewProperties = properties2.get<vk::PhysicalDeviceMultiviewProperties>();
608  std::cout << std::string( "\t" ) << "MultiviewProperties:\n";
609  std::cout << std::string( "\t\t" ) << "maxMultiviewInstanceIndex = " << multiviewProperties.maxMultiviewInstanceIndex << "\n";
610  std::cout << std::string( "\t\t" ) << "maxMultiviewViewCount = " << multiviewProperties.maxMultiviewViewCount << "\n";
611  std::cout << "\n";
612 
613  if ( vk::su::contains( extensionProperties, "VK_EXT_pci_bus_info" ) )
614  {
615  vk::PhysicalDevicePCIBusInfoPropertiesEXT const & pciBusInfoProperties = properties2.get<vk::PhysicalDevicePCIBusInfoPropertiesEXT>();
616  std::cout << std::string( "\t" ) << "PCIBusInfoProperties:\n";
617  std::cout << std::string( "\t\t" ) << "pciDomain = " << pciBusInfoProperties.pciDomain << "\n";
618  std::cout << std::string( "\t\t" ) << "pciBus = " << pciBusInfoProperties.pciBus << "\n";
619  std::cout << std::string( "\t\t" ) << "pciDevice = " << pciBusInfoProperties.pciDevice << "\n";
620  std::cout << std::string( "\t\t" ) << "pciFunction = " << pciBusInfoProperties.pciFunction << "\n";
621  std::cout << "\n";
622  }
623 
624  if ( vk::su::contains( extensionProperties, "VK_KHR_maintenance2" ) )
625  {
626  vk::PhysicalDevicePointClippingProperties const & pointClippingProperties = properties2.get<vk::PhysicalDevicePointClippingProperties>();
627  std::cout << std::string( "\t" ) << "PointClippingProperties:\n";
628  std::cout << std::string( "\t\t" ) << "pointClippingBehavior = " << vk::to_string( pointClippingProperties.pointClippingBehavior ) << "\n";
629  std::cout << "\n";
630  }
631 
632  vk::PhysicalDeviceProtectedMemoryProperties const & protectedMemoryProperties = properties2.get<vk::PhysicalDeviceProtectedMemoryProperties>();
633  std::cout << std::string( "\t" ) << "ProtectedMemoryProperties:\n";
634  std::cout << std::string( "\t\t" ) << "protectedNoFault = " << !!protectedMemoryProperties.protectedNoFault << "\n";
635  std::cout << "\n";
636 
637  if ( vk::su::contains( extensionProperties, "VK_KHR_push_descriptor" ) )
638  {
639  vk::PhysicalDevicePushDescriptorPropertiesKHR const & pushDescriptorProperties = properties2.get<vk::PhysicalDevicePushDescriptorPropertiesKHR>();
640  std::cout << std::string( "\t" ) << "PushDescriptorProperties:\n";
641  std::cout << std::string( "\t\t" ) << "maxPushDescriptors = " << pushDescriptorProperties.maxPushDescriptors << "\n";
642  std::cout << "\n";
643  }
644 
645  if ( vk::su::contains( extensionProperties, "VK_NV_ray_tracing" ) )
646  {
647  vk::PhysicalDeviceRayTracingPropertiesNV const & rayTracingProperties = properties2.get<vk::PhysicalDeviceRayTracingPropertiesNV>();
648  std::cout << std::string( "\t" ) << "RayTracingProperties:\n";
649  std::cout << std::string( "\t\t" ) << "maxDescriptorSetAccelerationStructures = " << rayTracingProperties.maxDescriptorSetAccelerationStructures
650  << "\n";
651  std::cout << std::string( "\t\t" ) << "maxGeometryCount = " << rayTracingProperties.maxGeometryCount << "\n";
652  std::cout << std::string( "\t\t" ) << "maxInstanceCount = " << rayTracingProperties.maxInstanceCount << "\n";
653  std::cout << std::string( "\t\t" ) << "maxRecursionDepth = " << rayTracingProperties.maxRecursionDepth << "\n";
654  std::cout << std::string( "\t\t" ) << "maxShaderGroupStride = " << rayTracingProperties.maxShaderGroupStride << "\n";
655  std::cout << std::string( "\t\t" ) << "maxTriangleCount = " << rayTracingProperties.maxTriangleCount << "\n";
656  std::cout << std::string( "\t\t" ) << "shaderGroupBaseAlignment = " << rayTracingProperties.shaderGroupBaseAlignment << "\n";
657  std::cout << std::string( "\t\t" ) << "shaderGroupHandleSize = " << rayTracingProperties.shaderGroupHandleSize << "\n";
658  std::cout << "\n";
659  }
660 
661  if ( vk::su::contains( extensionProperties, "VK_EXT_sample_locations" ) )
662  {
663  vk::PhysicalDeviceSampleLocationsPropertiesEXT const & sampleLocationProperties = properties2.get<vk::PhysicalDeviceSampleLocationsPropertiesEXT>();
664  std::cout << std::string( "\t" ) << "SampleLocationProperties:\n";
665  std::cout << std::string( "\t\t" ) << "maxSampleLocationGridSize = " << sampleLocationProperties.maxSampleLocationGridSize.width << " x "
666  << sampleLocationProperties.maxSampleLocationGridSize.height << "\n";
667  std::cout << std::string( "\t\t" ) << "sampleLocationCoordinateRange = "
668  << "[" << sampleLocationProperties.sampleLocationCoordinateRange[0] << ", " << sampleLocationProperties.sampleLocationCoordinateRange[1]
669  << "]"
670  << "\n";
671  std::cout << std::string( "\t\t" ) << "sampleLocationSampleCounts = " << vk::to_string( sampleLocationProperties.sampleLocationSampleCounts )
672  << "\n";
673  std::cout << std::string( "\t\t" ) << "sampleLocationSubPixelBits = " << sampleLocationProperties.sampleLocationSubPixelBits << "\n";
674  std::cout << std::string( "\t\t" ) << "variableSampleLocations = " << !!sampleLocationProperties.variableSampleLocations << "\n";
675  std::cout << "\n";
676  }
677 
678  if ( vk::su::contains( extensionProperties, "VK_EXT_sampler_filter_minmax" ) )
679  {
680  vk::PhysicalDeviceSamplerFilterMinmaxPropertiesEXT const & samplerFilterMinmaxProperties =
682  std::cout << std::string( "\t" ) << "SamplerFilterMinmaxProperties:\n";
683  std::cout << std::string( "\t\t" ) << "filterMinmaxImageComponentMapping = " << !!samplerFilterMinmaxProperties.filterMinmaxImageComponentMapping
684  << "\n";
685  std::cout << std::string( "\t\t" ) << "filterMinmaxSingleComponentFormats = " << !!samplerFilterMinmaxProperties.filterMinmaxSingleComponentFormats
686  << "\n";
687  std::cout << "\n";
688  }
689 
690  if ( vk::su::contains( extensionProperties, "VK_AMD_shader_core_properties2" ) )
691  {
692  vk::PhysicalDeviceShaderCoreProperties2AMD const & shaderCoreProperties2 = properties2.get<vk::PhysicalDeviceShaderCoreProperties2AMD>();
693  std::cout << std::string( "\t" ) << "ShaderCoreProperties2:\n";
694  std::cout << std::string( "\t\t" ) << "activeComputeUnitCount = " << shaderCoreProperties2.activeComputeUnitCount << "\n";
695  std::cout << std::string( "\t\t" ) << "shaderCoreFeatures = " << vk::to_string( shaderCoreProperties2.shaderCoreFeatures ) << "\n";
696  std::cout << "\n";
697  }
698 
699  if ( vk::su::contains( extensionProperties, "VK_AMD_shader_core_properties2" ) )
700  {
701  vk::PhysicalDeviceShaderCorePropertiesAMD const & shaderCoreProperties = properties2.get<vk::PhysicalDeviceShaderCorePropertiesAMD>();
702  std::cout << std::string( "\t" ) << "ShaderCoreProperties:\n";
703  std::cout << std::string( "\t\t" ) << "computeUnitsPerShaderArray = " << shaderCoreProperties.computeUnitsPerShaderArray << "\n";
704  std::cout << std::string( "\t\t" ) << "maxSgprAllocation = " << shaderCoreProperties.maxSgprAllocation << "\n";
705  std::cout << std::string( "\t\t" ) << "maxVgprAllocation = " << shaderCoreProperties.maxVgprAllocation << "\n";
706  std::cout << std::string( "\t\t" ) << "minSgprAllocation = " << shaderCoreProperties.minSgprAllocation << "\n";
707  std::cout << std::string( "\t\t" ) << "minVgprAllocation = " << shaderCoreProperties.minVgprAllocation << "\n";
708  std::cout << std::string( "\t\t" ) << "sgprAllocationGranularity = " << shaderCoreProperties.sgprAllocationGranularity << "\n";
709  std::cout << std::string( "\t\t" ) << "sgprsPerSimd = " << shaderCoreProperties.sgprsPerSimd << "\n";
710  std::cout << std::string( "\t\t" ) << "shaderArraysPerEngineCount = " << shaderCoreProperties.shaderArraysPerEngineCount << "\n";
711  std::cout << std::string( "\t\t" ) << "shaderEngineCount = " << shaderCoreProperties.shaderEngineCount << "\n";
712  std::cout << std::string( "\t\t" ) << "simdPerComputeUnit = " << shaderCoreProperties.simdPerComputeUnit << "\n";
713  std::cout << std::string( "\t\t" ) << "vgprAllocationGranularity = " << shaderCoreProperties.vgprAllocationGranularity << "\n";
714  std::cout << std::string( "\t\t" ) << "vgprsPerSimd = " << shaderCoreProperties.vgprsPerSimd << "\n";
715  std::cout << std::string( "\t\t" ) << "wavefrontSize = " << shaderCoreProperties.wavefrontSize << "\n";
716  std::cout << std::string( "\t\t" ) << "wavefrontsPerSimd = " << shaderCoreProperties.wavefrontsPerSimd << "\n";
717  std::cout << "\n";
718  }
719 
720  if ( vk::su::contains( extensionProperties, "VK_NV_shader_sm_builtins" ) )
721  {
722  vk::PhysicalDeviceShaderSMBuiltinsPropertiesNV const & shaderSMBuiltinsProperties = properties2.get<vk::PhysicalDeviceShaderSMBuiltinsPropertiesNV>();
723  std::cout << std::string( "\t" ) << "ShaderSMBuiltinsProperties:\n";
724  std::cout << std::string( "\t\t" ) << "shaderSMCount = " << shaderSMBuiltinsProperties.shaderSMCount << "\n";
725  std::cout << std::string( "\t\t" ) << "shaderWarpsPerSM = " << shaderSMBuiltinsProperties.shaderWarpsPerSM << "\n";
726  std::cout << "\n";
727  }
728 
729  if ( vk::su::contains( extensionProperties, "VK_NV_shading_rate_image" ) )
730  {
731  vk::PhysicalDeviceShadingRateImagePropertiesNV const & shadingRageImageProperties = properties2.get<vk::PhysicalDeviceShadingRateImagePropertiesNV>();
732  std::cout << std::string( "\t" ) << "ShadingRateImageProperties:\n";
733  std::cout << std::string( "\t\t" ) << "shadingRateMaxCoarseSamples = " << shadingRageImageProperties.shadingRateMaxCoarseSamples << "\n";
734  std::cout << std::string( "\t\t" ) << "shadingRatePaletteSize = " << shadingRageImageProperties.shadingRatePaletteSize << "\n";
735  std::cout << std::string( "\t\t" ) << "shadingRatePaletteSize = "
736  << "[" << shadingRageImageProperties.shadingRateTexelSize.width << " x " << shadingRageImageProperties.shadingRateTexelSize.height << "]"
737  << "\n";
738  std::cout << "\n";
739  }
740 
741  vk::PhysicalDeviceSubgroupProperties const & subgroupProperties = properties2.get<vk::PhysicalDeviceSubgroupProperties>();
742  std::cout << std::string( "\t" ) << "SubgroupProperties:\n";
743  std::cout << std::string( "\t\t" ) << "quadOperationsInAllStages = " << !!subgroupProperties.quadOperationsInAllStages << "\n";
744  std::cout << std::string( "\t\t" ) << "subgroupSize = " << subgroupProperties.subgroupSize << "\n";
745  std::cout << std::string( "\t\t" ) << "supportedOperations = " << vk::to_string( subgroupProperties.supportedOperations ) << "\n";
746  std::cout << std::string( "\t\t" ) << "supportedStages = " << vk::to_string( subgroupProperties.supportedStages ) << "\n";
747  std::cout << "\n";
748 
749  if ( vk::su::contains( extensionProperties, "VK_EXT_subgroup_size_control" ) )
750  {
751  vk::PhysicalDeviceSubgroupSizeControlPropertiesEXT const & subgroupSizeControlProperties =
753  std::cout << std::string( "\t" ) << "SubgroupSizeControlProperties:\n";
754  std::cout << std::string( "\t\t" ) << "maxComputeWorkgroupSubgroups = " << subgroupSizeControlProperties.maxComputeWorkgroupSubgroups << "\n";
755  std::cout << std::string( "\t\t" ) << "maxSubgroupSize = " << subgroupSizeControlProperties.maxSubgroupSize << "\n";
756  std::cout << std::string( "\t\t" ) << "minSubgroupSize = " << subgroupSizeControlProperties.minSubgroupSize << "\n";
757  std::cout << std::string( "\t\t" ) << "requiredSubgroupSizeStages = " << vk::to_string( subgroupSizeControlProperties.requiredSubgroupSizeStages )
758  << "\n";
759  std::cout << "\n";
760  }
761 
762  if ( vk::su::contains( extensionProperties, "VK_KHR_timeline_semaphore" ) )
763  {
764  vk::PhysicalDeviceTimelineSemaphorePropertiesKHR const & timelineSemaphoreProperties =
766  std::cout << std::string( "\t" ) << "TimelineSemaphoreProperties:\n";
767  std::cout << std::string( "\t\t" ) << "maxTimelineSemaphoreValueDifference = " << timelineSemaphoreProperties.maxTimelineSemaphoreValueDifference
768  << "\n";
769  std::cout << "\n";
770  }
771 
772  if ( vk::su::contains( extensionProperties, "VK_EXT_texel_buffer_alignment" ) )
773  {
774  vk::PhysicalDeviceTexelBufferAlignmentPropertiesEXT const & texelBufferAlignmentProperties =
776  std::cout << std::string( "\t" ) << "TexelBufferAlignmentProperties:\n";
777  std::cout << std::string( "\t\t" )
778  << "storageTexelBufferOffsetAlignmentBytes = " << texelBufferAlignmentProperties.storageTexelBufferOffsetAlignmentBytes << "\n";
779  std::cout << std::string( "\t\t" )
780  << "storageTexelBufferOffsetSingleTexelAlignment = " << !!texelBufferAlignmentProperties.storageTexelBufferOffsetSingleTexelAlignment
781  << "\n";
782  std::cout << std::string( "\t\t" )
783  << "uniformTexelBufferOffsetAlignmentBytes = " << texelBufferAlignmentProperties.uniformTexelBufferOffsetAlignmentBytes << "\n";
784  std::cout << std::string( "\t\t" )
785  << "uniformTexelBufferOffsetSingleTexelAlignment = " << !!texelBufferAlignmentProperties.uniformTexelBufferOffsetSingleTexelAlignment
786  << "\n";
787  std::cout << "\n";
788  }
789 
790  if ( vk::su::contains( extensionProperties, "VK_EXT_transform_feedback" ) )
791  {
792  vk::PhysicalDeviceTransformFeedbackPropertiesEXT const & transformFeedbackProperties =
794  std::cout << std::string( "\t" ) << "TransformFeedbackProperties:\n";
795  std::cout << std::string( "\t\t" ) << "maxTransformFeedbackBufferDataSize = " << transformFeedbackProperties.maxTransformFeedbackBufferDataSize
796  << "\n";
797  std::cout << std::string( "\t\t" )
798  << "maxTransformFeedbackBufferDataStride = " << transformFeedbackProperties.maxTransformFeedbackBufferDataStride << "\n";
799  std::cout << std::string( "\t\t" ) << "maxTransformFeedbackBuffers = " << transformFeedbackProperties.maxTransformFeedbackBuffers
800  << "\n";
801  std::cout << std::string( "\t\t" ) << "maxTransformFeedbackBufferSize = " << transformFeedbackProperties.maxTransformFeedbackBufferSize
802  << "\n";
803  std::cout << std::string( "\t\t" ) << "maxTransformFeedbackStreamDataSize = " << transformFeedbackProperties.maxTransformFeedbackStreamDataSize
804  << "\n";
805  std::cout << std::string( "\t\t" ) << "maxTransformFeedbackStreams = " << transformFeedbackProperties.maxTransformFeedbackStreams
806  << "\n";
807  std::cout << std::string( "\t\t" ) << "transformFeedbackDraw = " << !!transformFeedbackProperties.transformFeedbackDraw << "\n";
808  std::cout << std::string( "\t\t" ) << "transformFeedbackQueries = " << !!transformFeedbackProperties.transformFeedbackQueries
809  << "\n";
810  std::cout << std::string( "\t\t" )
811  << "transformFeedbackRasterizationStreamSelect = " << !!transformFeedbackProperties.transformFeedbackRasterizationStreamSelect << "\n";
812  std::cout << std::string( "\t\t" )
813  << "transformFeedbackStreamsLinesTriangles = " << !!transformFeedbackProperties.transformFeedbackStreamsLinesTriangles << "\n";
814  std::cout << "\n";
815  }
816 
817  if ( vk::su::contains( extensionProperties, "VK_EXT_vertex_attribute_divisor" ) )
818  {
819  vk::PhysicalDeviceVertexAttributeDivisorPropertiesEXT const & vertexAttributeDivisorProperties =
821  std::cout << std::string( "\t" ) << "VertexAttributeDivisorProperties:\n";
822  std::cout << std::string( "\t\t" ) << "maxVertexAttribDivisor = " << vertexAttributeDivisorProperties.maxVertexAttribDivisor << "\n";
823  std::cout << "\n";
824  }
825  }
826 
827  /* VULKAN_KEY_END */
828 
829 #if !defined( NDEBUG )
830  instance.destroyDebugUtilsMessengerEXT( debugUtilsMessenger );
831 #endif
832  instance.destroy();
833  }
834  catch ( vk::SystemError & err )
835  {
836  std::cout << "vk::SystemError: " << err.what() << std::endl;
837  exit( -1 );
838  }
839  catch ( std::exception & err )
840  {
841  std::cout << "std::exception: " << err.what() << std::endl;
842  exit( -1 );
843  }
844  catch ( ... )
845  {
846  std::cout << "unknown error\n";
847  exit( -1 );
848  }
849  return 0;
850 }
std::string decodeVendorID(uint32_t vendorID)
int main(int, char **)
std::string decodeAPIVersion(uint32_t apiVersion)
std::string decodeDriverVersion(uint32_t driverVersion, uint32_t vendorID)
void cout(vk::SurfaceCapabilitiesKHR const &surfaceCapabilities)
VULKAN_HPP_NODISCARD Result createDebugUtilsMessengerEXT(const vk::DebugUtilsMessengerCreateInfoEXT *pCreateInfo, const vk::AllocationCallbacks *pAllocator, vk::DebugUtilsMessengerEXT *pMessenger, Dispatch const &d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT) const VULKAN_HPP_NOEXCEPT
void destroy(const vk::AllocationCallbacks *pAllocator, Dispatch const &d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT) const VULKAN_HPP_NOEXCEPT
VULKAN_HPP_NODISCARD Result enumeratePhysicalDevices(uint32_t *pPhysicalDeviceCount, vk::PhysicalDevice *pPhysicalDevices, Dispatch const &d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT) const VULKAN_HPP_NOEXCEPT
void destroyDebugUtilsMessengerEXT(vk::DebugUtilsMessengerEXT messenger, const vk::AllocationCallbacks *pAllocator, Dispatch const &d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT) const VULKAN_HPP_NOEXCEPT
virtual const char * what() const VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6206
vk::DebugUtilsMessengerCreateInfoEXT makeDebugUtilsMessengerCreateInfoEXT()
Definition: utils.cpp:1025
std::ostream & operator<<(std::ostream &os, LUID const &uuid)
vk::Instance createInstance(std::string const &appName, std::string const &engineName, std::vector< std::string > const &layers, std::vector< std::string > const &extensions, uint32_t apiVersion)
Definition: utils.cpp:279
bool contains(std::vector< vk::ExtensionProperties > const &extensionProperties, std::string const &extensionName)
Definition: utils.cpp:54
Definition: vulkan.cppm:23
PhysicalDeviceSubgroupSizeControlProperties PhysicalDeviceSubgroupSizeControlPropertiesEXT
VULKAN_HPP_INLINE std::string to_string(FormatFeatureFlags value)
PhysicalDeviceSamplerFilterMinmaxProperties PhysicalDeviceSamplerFilterMinmaxPropertiesEXT
PhysicalDeviceTexelBufferAlignmentProperties PhysicalDeviceTexelBufferAlignmentPropertiesEXT
PhysicalDeviceFloatControlsProperties PhysicalDeviceFloatControlsPropertiesKHR
PhysicalDeviceTimelineSemaphoreProperties PhysicalDeviceTimelineSemaphorePropertiesKHR
PhysicalDeviceDescriptorIndexingProperties PhysicalDeviceDescriptorIndexingPropertiesEXT
PhysicalDeviceInlineUniformBlockProperties PhysicalDeviceInlineUniformBlockPropertiesEXT
PhysicalDeviceDepthStencilResolveProperties PhysicalDeviceDepthStencilResolvePropertiesKHR
PhysicalDeviceDriverProperties PhysicalDeviceDriverPropertiesKHR
vk::ArrayWrapper1D< char, VK_MAX_DRIVER_INFO_SIZE > driverInfo
vk::ConformanceVersion conformanceVersion
vk::ArrayWrapper1D< char, VK_MAX_DRIVER_NAME_SIZE > driverName
vk::ShaderFloatControlsIndependence denormBehaviorIndependence
vk::ShaderFloatControlsIndependence roundingModeIndependence
vk::ArrayWrapper1D< uint8_t, VK_UUID_SIZE > deviceUUID
vk::ArrayWrapper1D< uint8_t, VK_UUID_SIZE > driverUUID
vk::ArrayWrapper1D< uint8_t, VK_LUID_SIZE > deviceLUID
vk::ArrayWrapper1D< uint32_t, 3 > maxTaskWorkGroupSize
vk::ArrayWrapper1D< uint32_t, 3 > maxMeshWorkGroupSize
vk::PointClippingBehavior pointClippingBehavior
vk::ArrayWrapper1D< float, 2 > sampleLocationCoordinateRange
vk::ShaderCorePropertiesFlagsAMD shaderCoreFeatures
vk::SubgroupFeatureFlags supportedOperations
LUID(uint8_t const data[VK_LUID_SIZE])
uint8_t m_data[VK_LUID_SIZE]
#define VK_LUID_SIZE
Definition: vulkan_core.h:4859
#define VK_VERSION_MAJOR(version)
Definition: vulkan_core.h:82
#define VK_VERSION_PATCH(version)
Definition: vulkan_core.h:88
#define VK_VERSION_MINOR(version)
Definition: vulkan_core.h:85
#define VK_API_VERSION_1_1
Definition: vulkan_core.h:4854