Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

454 linhas
26 KiB

  1. unit uvkuUtils;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils,
  6. Vulkan;
  7. type
  8. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. TvkuException = class(Exception);
  10. TvkuErrorException = class(TvkuException)
  11. private
  12. fError: TVkResult;
  13. public
  14. property Error: TVkResult read fError;
  15. constructor Create(const msg: string; const aError: TVkResult);
  16. end;
  17. function vkuMakeString(const aFeatures: TVkPhysicalDeviceFeatures; const aSeperator: String = sLineBreak): String;
  18. function vkuMakeString(const aProperties: TVkPhysicalDeviceProperties; const aPrintLimits, aPrintSparseProps: Boolean): String;
  19. function vkuMakeString(const aMemoryProperties: TVkPhysicalDeviceMemoryProperties): String;
  20. implementation
  21. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  22. //TvkuErrorException//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  23. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  24. constructor TvkuErrorException.Create(const msg: string; const aError: TVkResult);
  25. begin
  26. inherited Create(msg);
  27. fError := aError;
  28. end;
  29. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  30. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  31. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  32. function vkuMakeString(const aFeatures: TVkPhysicalDeviceFeatures; const aSeperator: String): String;
  33. procedure AddToResult(const b: VkBool32; const aName: String);
  34. begin
  35. if (b = 0) then
  36. exit;
  37. if (result <> '') then
  38. result := result + aSeperator;
  39. result := result + aName;
  40. end;
  41. begin
  42. result := '';
  43. AddToResult(aFeatures.robustBufferAccess, 'RobustBufferAccess');
  44. AddToResult(aFeatures.fullDrawIndexUint32, 'FullDrawIndexUint32');
  45. AddToResult(aFeatures.imageCubeArray, 'ImageCubeArray');
  46. AddToResult(aFeatures.independentBlend, 'IndependentBlend');
  47. AddToResult(aFeatures.geometryShader, 'GeometryShader');
  48. AddToResult(aFeatures.tessellationShader, 'TessellationShader');
  49. AddToResult(aFeatures.sampleRateShading, 'SampleRateShading');
  50. AddToResult(aFeatures.dualSrcBlend, 'DualSrcBlend');
  51. AddToResult(aFeatures.logicOp, 'LogicOp');
  52. AddToResult(aFeatures.multiDrawIndirect, 'MultiDrawIndirect');
  53. AddToResult(aFeatures.drawIndirectFirstInstance, 'DrawIndirectFirstInstance');
  54. AddToResult(aFeatures.depthClamp, 'DepthClamp');
  55. AddToResult(aFeatures.depthBiasClamp, 'DepthBiasClamp');
  56. AddToResult(aFeatures.fillModeNonSolid, 'FillModeNonSolid');
  57. AddToResult(aFeatures.depthBounds, 'DepthBounds');
  58. AddToResult(aFeatures.wideLines, 'WideLines');
  59. AddToResult(aFeatures.largePoints, 'LargePoints');
  60. AddToResult(aFeatures.alphaToOne, 'AlphaToOne');
  61. AddToResult(aFeatures.multiViewport, 'MultiViewport');
  62. AddToResult(aFeatures.samplerAnisotropy, 'SamplerAnisotropy');
  63. AddToResult(aFeatures.textureCompressionETC2, 'TextureCompressionETC2');
  64. AddToResult(aFeatures.textureCompressionASTC_LDR, 'TextureCompressionASTC_LDR');
  65. AddToResult(aFeatures.textureCompressionBC, 'TextureCompressionBC');
  66. AddToResult(aFeatures.occlusionQueryPrecise, 'OcclusionQueryPrecise');
  67. AddToResult(aFeatures.pipelineStatisticsQuery, 'PipelineStatisticsQuery');
  68. AddToResult(aFeatures.vertexPipelineStoresAndAtomics, 'VertexPipelineStoresAndAtomics');
  69. AddToResult(aFeatures.fragmentStoresAndAtomics, 'FragmentStoresAndAtomics');
  70. AddToResult(aFeatures.shaderTessellationAndGeometryPointSize, 'ShaderTessellationAndGeometryPointSize');
  71. AddToResult(aFeatures.shaderImageGatherExtended, 'ShaderImageGatherExtended');
  72. AddToResult(aFeatures.shaderStorageImageExtendedFormats, 'ShaderStorageImageExtendedFormats');
  73. AddToResult(aFeatures.shaderStorageImageMultisample, 'ShaderStorageImageMultisample');
  74. AddToResult(aFeatures.shaderStorageImageReadWithoutFormat, 'ShaderStorageImageReadWithoutFormat');
  75. AddToResult(aFeatures.shaderStorageImageWriteWithoutFormat, 'ShaderStorageImageWriteWithoutFormat');
  76. AddToResult(aFeatures.shaderUniformBufferArrayDynamicIndexing, 'ShaderUniformBufferArrayDynamicIndexing');
  77. AddToResult(aFeatures.shaderSampledImageArrayDynamicIndexing, 'ShaderSampledImageArrayDynamicIndexing');
  78. AddToResult(aFeatures.shaderStorageBufferArrayDynamicIndexing, 'ShaderStorageBufferArrayDynamicIndexing');
  79. AddToResult(aFeatures.shaderStorageImageArrayDynamicIndexing, 'ShaderStorageImageArrayDynamicIndexing');
  80. AddToResult(aFeatures.shaderClipDistance, 'ShaderClipDistance');
  81. AddToResult(aFeatures.shaderCullDistance, 'ShaderCullDistance');
  82. AddToResult(aFeatures.shaderFloat64, 'ShaderFloat64');
  83. AddToResult(aFeatures.shaderInt64, 'ShaderInt64');
  84. AddToResult(aFeatures.shaderInt16, 'ShaderInt16');
  85. AddToResult(aFeatures.shaderResourceResidency, 'ShaderResourceResidency');
  86. AddToResult(aFeatures.shaderResourceMinLod, 'ShaderResourceMinLod');
  87. AddToResult(aFeatures.sparseBinding, 'SparseBinding');
  88. AddToResult(aFeatures.sparseResidencyBuffer, 'SparseResidencyBuffer');
  89. AddToResult(aFeatures.sparseResidencyImage2D, 'SparseResidencyImage2D');
  90. AddToResult(aFeatures.sparseResidencyImage3D, 'SparseResidencyImage3D');
  91. AddToResult(aFeatures.sparseResidency2Samples, 'SparseResidency2Samples');
  92. AddToResult(aFeatures.sparseResidency4Samples, 'SparseResidency4Samples');
  93. AddToResult(aFeatures.sparseResidency8Samples, 'SparseResidency8Samples');
  94. AddToResult(aFeatures.sparseResidency16Samples, 'SparseResidency16Samples');
  95. AddToResult(aFeatures.sparseResidencyAliased, 'SparseResidencyAliased');
  96. AddToResult(aFeatures.variableMultisampleRate, 'VariableMultisampleRate');
  97. AddToResult(aFeatures.inheritedQueries, 'InheritedQueries');
  98. end;
  99. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  100. function vkuMakeString(const aProperties: TVkPhysicalDeviceProperties; const aPrintLimits,
  101. aPrintSparseProps: Boolean): String;
  102. function UUIDtoStr: String;
  103. var i: Integer;
  104. begin
  105. result := '';
  106. for i := low(aProperties.pipelineCacheUUID) to High(aProperties.pipelineCacheUUID) do begin
  107. if (result <> '') then
  108. result := result + ':';
  109. result := result + IntToHex(aProperties.pipelineCacheUUID[i], 2);
  110. end;
  111. end;
  112. function toString(const i: Int64): String;
  113. begin
  114. result := IntToStr(i);
  115. end;
  116. function toString(const e: Extended): String;
  117. begin
  118. result := Format('%.3f', [e]);
  119. end;
  120. function toString(const arr: array of VkUint32): String;
  121. var i: Integer;
  122. begin
  123. result := '';
  124. for i := low(arr) to high(arr) do begin
  125. if (i <> low(arr)) then
  126. result := result + '; ';
  127. result := result + toString(arr[i]);
  128. end;
  129. end;
  130. function toString(const arr: array of VkFloat): String;
  131. var i: Integer;
  132. begin
  133. result := '';
  134. for i := low(arr) to high(arr) do begin
  135. if (i <> low(arr)) then
  136. result := result + '; ';
  137. result := result + toString(arr[i]);
  138. end;
  139. end;
  140. function toString(const aType: TVkPhysicalDeviceType): String;
  141. begin
  142. case aType of
  143. VK_PHYSICAL_DEVICE_TYPE_OTHER: result := 'Other';
  144. VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU: result := 'IntegratedGPU';
  145. VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU: result := 'DiscreteGPU';
  146. VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU: result := 'VirtualGPU';
  147. VK_PHYSICAL_DEVICE_TYPE_CPU: result := 'CPU';
  148. else
  149. result := 'Unknown';
  150. end;
  151. end;
  152. function toString(const aChar: PVkChar): String;
  153. begin
  154. result := String(aChar);
  155. end;
  156. begin
  157. result := Format(
  158. 'ApiVersion: %x (v%d.%d.%d)' + sLineBreak +
  159. 'DriverVersion: %s' + sLineBreak +
  160. 'VendorID: %s' + sLineBreak +
  161. 'DeviceID: %s' + sLineBreak +
  162. 'DeviceType: %s' + sLineBreak +
  163. 'deviceName: %s' + sLineBreak +
  164. 'PipelineCacheUUID: %s' + sLineBreak
  165. ,[
  166. aProperties.apiVersion, vkGetVersionMajor(aProperties.apiVersion), vkGetVersionMinor(aProperties.apiVersion), vkgetVersionPatch(aProperties.apiVersion),
  167. toString(aProperties.driverVersion),
  168. toString(aProperties.vendorID),
  169. toString(aProperties.deviceID),
  170. toString(aProperties.deviceType),
  171. toString(@aProperties.deviceName[0]),
  172. UUIDtoStr
  173. ]);
  174. if aPrintLimits then begin
  175. result := result + Format(
  176. 'Limits:' + sLineBreak +
  177. ' MaxImageDimension1D: %s' + sLineBreak +
  178. ' MaxImageDimension2D: %s' + sLineBreak +
  179. ' MaxImageDimension3D: %s' + sLineBreak +
  180. ' MaxImageDimensionCube: %s' + sLineBreak +
  181. ' MaxImageArrayLayers: %s' + sLineBreak +
  182. ' MaxTexelBufferElements: %s' + sLineBreak +
  183. ' MaxUniformBufferRange: %s' + sLineBreak +
  184. ' MaxStorageBufferRange: %s' + sLineBreak +
  185. ' MaxPushConstantsSize: %s' + sLineBreak +
  186. ' MaxMemoryAllocationCount: %s' + sLineBreak +
  187. ' MaxSamplerAllocationCount: %s' + sLineBreak +
  188. ' BufferImageGranularity: %s' + sLineBreak +
  189. ' SparseAddressSpaceSize: %s' + sLineBreak +
  190. ' MaxBoundDescriptorSets: %s' + sLineBreak +
  191. ' MaxPerStageDescriptorSamplers: %s' + sLineBreak +
  192. ' MaxPerStageDescriptorUniformBuffers: %s' + sLineBreak +
  193. ' MaxPerStageDescriptorStorageBuffers: %s' + sLineBreak +
  194. ' MaxPerStageDescriptorSampledImages: %s' + sLineBreak +
  195. ' MaxPerStageDescriptorStorageImages: %s' + sLineBreak +
  196. ' MaxPerStageDescriptorInputAttachments: %s' + sLineBreak +
  197. ' MaxPerStageResources: %s' + sLineBreak +
  198. ' MaxDescriptorSetSamplers: %s' + sLineBreak +
  199. ' MaxDescriptorSetUniformBuffers: %s' + sLineBreak +
  200. ' MaxDescriptorSetUniformBuffersDynamic: %s' + sLineBreak +
  201. ' MaxDescriptorSetStorageBuffers: %s' + sLineBreak +
  202. ' MaxDescriptorSetStorageBuffersDynamic: %s' + sLineBreak +
  203. ' MaxDescriptorSetSampledImages: %s' + sLineBreak +
  204. ' MaxDescriptorSetStorageImages: %s' + sLineBreak +
  205. ' MaxDescriptorSetInputAttachments: %s' + sLineBreak +
  206. ' MaxVertexInputAttributes: %s' + sLineBreak +
  207. ' MaxVertexInputBindings: %s' + sLineBreak +
  208. ' MaxVertexInputAttributeOffset: %s' + sLineBreak +
  209. ' MaxVertexInputBindingStride: %s' + sLineBreak +
  210. ' MaxVertexOutputComponents: %s' + sLineBreak +
  211. ' MaxTessellationGenerationLevel: %s' + sLineBreak +
  212. ' MaxTessellationPatchSize: %s' + sLineBreak +
  213. ' MaxTessellationControlPerVertexInputComponents: %s' + sLineBreak +
  214. ' MaxTessellationControlPerVertexOutputComponents: %s' + sLineBreak +
  215. ' MaxTessellationControlPerPatchOutputComponents: %s' + sLineBreak +
  216. ' MaxTessellationControlTotalOutputComponents: %s' + sLineBreak +
  217. ' MaxTessellationEvaluationInputComponents: %s' + sLineBreak +
  218. ' MaxTessellationEvaluationOutputComponents: %s' + sLineBreak +
  219. ' MaxGeometryShaderInvocations: %s' + sLineBreak +
  220. ' MaxGeometryInputComponents: %s' + sLineBreak +
  221. ' MaxGeometryOutputComponents: %s' + sLineBreak +
  222. ' MaxGeometryOutputVertices: %s' + sLineBreak +
  223. ' MaxGeometryTotalOutputComponents: %s' + sLineBreak +
  224. ' MaxFragmentInputComponents: %s' + sLineBreak +
  225. ' MaxFragmentOutputAttachments: %s' + sLineBreak +
  226. ' MaxFragmentDualSrcAttachments: %s' + sLineBreak +
  227. ' MaxFragmentCombinedOutputResources: %s' + sLineBreak +
  228. ' MaxComputeSharedMemorySize: %s' + sLineBreak +
  229. ' MaxComputeWorkGroupCount: %s' + sLineBreak +
  230. ' MaxComputeWorkGroupInvocations: %s' + sLineBreak +
  231. ' MaxComputeWorkGroupSize: %s' + sLineBreak +
  232. ' SubPixelPrecisionBits: %s' + sLineBreak +
  233. ' SubTexelPrecisionBits: %s' + sLineBreak +
  234. ' MipmapPrecisionBits: %s' + sLineBreak +
  235. ' MaxDrawIndexedIndexValue: %s' + sLineBreak +
  236. ' MaxDrawIndirectCount: %s' + sLineBreak +
  237. ' MaxSamplerLodBias: %s' + sLineBreak +
  238. ' MaxSamplerAnisotropy: %s' + sLineBreak +
  239. ' MaxViewports: %s' + sLineBreak +
  240. ' MaxViewportDimensions: %s' + sLineBreak +
  241. ' ViewportBoundsRange: %s' + sLineBreak +
  242. ' ViewportSubPixelBits: %s' + sLineBreak +
  243. ' MinMemoryMapAlignment: %s' + sLineBreak +
  244. ' MinTexelBufferOffsetAlignment: %s' + sLineBreak +
  245. ' MinUniformBufferOffsetAlignment: %s' + sLineBreak +
  246. ' MinStorageBufferOffsetAlignment: %s' + sLineBreak +
  247. ' MinTexelOffset: %s' + sLineBreak +
  248. ' MaxTexelOffset: %s' + sLineBreak +
  249. ' MinTexelGatherOffset: %s' + sLineBreak +
  250. ' MaxTexelGatherOffset: %s' + sLineBreak +
  251. ' MinInterpolationOffset: %s' + sLineBreak +
  252. ' MaxInterpolationOffset: %s' + sLineBreak +
  253. ' SubPixelInterpolationOffsetBits: %s' + sLineBreak +
  254. ' MaxFramebufferWidth: %s' + sLineBreak +
  255. ' MaxFramebufferHeight: %s' + sLineBreak +
  256. ' MaxFramebufferLayers: %s' + sLineBreak +
  257. ' FramebufferColorSampleCounts: %s' + sLineBreak +
  258. ' FramebufferDepthSampleCounts: %s' + sLineBreak +
  259. ' FramebufferStencilSampleCounts: %s' + sLineBreak +
  260. ' FramebufferNoAttachmentsSampleCounts: %s' + sLineBreak +
  261. ' MaxColorAttachments: %s' + sLineBreak +
  262. ' SampledImageColorSampleCounts: %s' + sLineBreak +
  263. ' SampledImageIntegerSampleCounts: %s' + sLineBreak +
  264. ' SampledImageDepthSampleCounts: %s' + sLineBreak +
  265. ' SampledImageStencilSampleCounts: %s' + sLineBreak +
  266. ' StorageImageSampleCounts: %s' + sLineBreak +
  267. ' MaxSampleMaskWords: %s' + sLineBreak +
  268. ' TimestampComputeAndGraphics: %s' + sLineBreak +
  269. ' TimestampPeriod: %s' + sLineBreak +
  270. ' MaxClipDistances: %s' + sLineBreak +
  271. ' MaxCullDistances: %s' + sLineBreak +
  272. ' MaxCombinedClipAndCullDistances: %s' + sLineBreak +
  273. ' DiscreteQueuePriorities: %s' + sLineBreak +
  274. ' PointSizeRange: %s' + sLineBreak +
  275. ' LineWidthRange: %s' + sLineBreak +
  276. ' PointSizeGranularity: %s' + sLineBreak +
  277. ' LineWidthGranularity: %s' + sLineBreak +
  278. ' StrictLines: %s' + sLineBreak +
  279. ' StandardSampleLocations: %s' + sLineBreak +
  280. ' OptimalBufferCopyOffsetAlignment: %s' + sLineBreak +
  281. ' OptimalBufferCopyRowPitchAlignment: %s' + sLineBreak +
  282. ' NonCoherentAtomSize: %s' + sLineBreak
  283. ,[
  284. toString(aProperties.limits.maxImageDimension1D),
  285. toString(aProperties.limits.maxImageDimension2D),
  286. toString(aProperties.limits.maxImageDimension3D),
  287. toString(aProperties.limits.maxImageDimensionCube),
  288. toString(aProperties.limits.maxImageArrayLayers),
  289. toString(aProperties.limits.maxTexelBufferElements),
  290. toString(aProperties.limits.maxUniformBufferRange),
  291. toString(aProperties.limits.maxStorageBufferRange),
  292. toString(aProperties.limits.maxPushConstantsSize),
  293. toString(aProperties.limits.maxMemoryAllocationCount),
  294. toString(aProperties.limits.maxSamplerAllocationCount),
  295. toString(aProperties.limits.bufferImageGranularity),
  296. toString(aProperties.limits.sparseAddressSpaceSize),
  297. toString(aProperties.limits.maxBoundDescriptorSets),
  298. toString(aProperties.limits.maxPerStageDescriptorSamplers),
  299. toString(aProperties.limits.maxPerStageDescriptorUniformBuffers),
  300. toString(aProperties.limits.maxPerStageDescriptorStorageBuffers),
  301. toString(aProperties.limits.maxPerStageDescriptorSampledImages),
  302. toString(aProperties.limits.maxPerStageDescriptorStorageImages),
  303. toString(aProperties.limits.maxPerStageDescriptorInputAttachments),
  304. toString(aProperties.limits.maxPerStageResources),
  305. toString(aProperties.limits.maxDescriptorSetSamplers),
  306. toString(aProperties.limits.maxDescriptorSetUniformBuffers),
  307. toString(aProperties.limits.maxDescriptorSetUniformBuffersDynamic),
  308. toString(aProperties.limits.maxDescriptorSetStorageBuffers),
  309. toString(aProperties.limits.maxDescriptorSetStorageBuffersDynamic),
  310. toString(aProperties.limits.maxDescriptorSetSampledImages),
  311. toString(aProperties.limits.maxDescriptorSetStorageImages),
  312. toString(aProperties.limits.maxDescriptorSetInputAttachments),
  313. toString(aProperties.limits.maxVertexInputAttributes),
  314. toString(aProperties.limits.maxVertexInputBindings),
  315. toString(aProperties.limits.maxVertexInputAttributeOffset),
  316. toString(aProperties.limits.maxVertexInputBindingStride),
  317. toString(aProperties.limits.maxVertexOutputComponents),
  318. toString(aProperties.limits.maxTessellationGenerationLevel),
  319. toString(aProperties.limits.maxTessellationPatchSize),
  320. toString(aProperties.limits.maxTessellationControlPerVertexInputComponents),
  321. toString(aProperties.limits.maxTessellationControlPerVertexOutputComponents),
  322. toString(aProperties.limits.maxTessellationControlPerPatchOutputComponents),
  323. toString(aProperties.limits.maxTessellationControlTotalOutputComponents),
  324. toString(aProperties.limits.maxTessellationEvaluationInputComponents),
  325. toString(aProperties.limits.maxTessellationEvaluationOutputComponents),
  326. toString(aProperties.limits.maxGeometryShaderInvocations),
  327. toString(aProperties.limits.maxGeometryInputComponents),
  328. toString(aProperties.limits.maxGeometryOutputComponents),
  329. toString(aProperties.limits.maxGeometryOutputVertices),
  330. toString(aProperties.limits.maxGeometryTotalOutputComponents),
  331. toString(aProperties.limits.maxFragmentInputComponents),
  332. toString(aProperties.limits.maxFragmentOutputAttachments),
  333. toString(aProperties.limits.maxFragmentDualSrcAttachments),
  334. toString(aProperties.limits.maxFragmentCombinedOutputResources),
  335. toString(aProperties.limits.maxComputeSharedMemorySize),
  336. toString(aProperties.limits.maxComputeWorkGroupCount),
  337. toString(aProperties.limits.maxComputeWorkGroupInvocations),
  338. toString(aProperties.limits.maxComputeWorkGroupSize),
  339. toString(aProperties.limits.subPixelPrecisionBits),
  340. toString(aProperties.limits.subTexelPrecisionBits),
  341. toString(aProperties.limits.mipmapPrecisionBits),
  342. toString(aProperties.limits.maxDrawIndexedIndexValue),
  343. toString(aProperties.limits.maxDrawIndirectCount),
  344. toString(aProperties.limits.maxSamplerLodBias),
  345. toString(aProperties.limits.maxSamplerAnisotropy),
  346. toString(aProperties.limits.maxViewports),
  347. toString(aProperties.limits.maxViewportDimensions),
  348. toString(aProperties.limits.viewportBoundsRange),
  349. toString(aProperties.limits.viewportSubPixelBits),
  350. toString(aProperties.limits.minMemoryMapAlignment),
  351. toString(aProperties.limits.minTexelBufferOffsetAlignment),
  352. toString(aProperties.limits.minUniformBufferOffsetAlignment),
  353. toString(aProperties.limits.minStorageBufferOffsetAlignment),
  354. toString(aProperties.limits.minTexelOffset),
  355. toString(aProperties.limits.maxTexelOffset),
  356. toString(aProperties.limits.minTexelGatherOffset),
  357. toString(aProperties.limits.maxTexelGatherOffset),
  358. toString(aProperties.limits.minInterpolationOffset),
  359. toString(aProperties.limits.maxInterpolationOffset),
  360. toString(aProperties.limits.subPixelInterpolationOffsetBits),
  361. toString(aProperties.limits.maxFramebufferWidth),
  362. toString(aProperties.limits.maxFramebufferHeight),
  363. toString(aProperties.limits.maxFramebufferLayers),
  364. toString(aProperties.limits.framebufferColorSampleCounts),
  365. toString(aProperties.limits.framebufferDepthSampleCounts),
  366. toString(aProperties.limits.framebufferStencilSampleCounts),
  367. toString(aProperties.limits.framebufferNoAttachmentsSampleCounts),
  368. toString(aProperties.limits.maxColorAttachments),
  369. toString(aProperties.limits.sampledImageColorSampleCounts),
  370. toString(aProperties.limits.sampledImageIntegerSampleCounts),
  371. toString(aProperties.limits.sampledImageDepthSampleCounts),
  372. toString(aProperties.limits.sampledImageStencilSampleCounts),
  373. toString(aProperties.limits.storageImageSampleCounts),
  374. toString(aProperties.limits.maxSampleMaskWords),
  375. toString(aProperties.limits.timestampComputeAndGraphics),
  376. toString(aProperties.limits.timestampPeriod),
  377. toString(aProperties.limits.maxClipDistances),
  378. toString(aProperties.limits.maxCullDistances),
  379. toString(aProperties.limits.maxCombinedClipAndCullDistances),
  380. toString(aProperties.limits.discreteQueuePriorities),
  381. toString(aProperties.limits.pointSizeRange),
  382. toString(aProperties.limits.lineWidthRange),
  383. toString(aProperties.limits.pointSizeGranularity),
  384. toString(aProperties.limits.lineWidthGranularity),
  385. toString(aProperties.limits.strictLines),
  386. toString(aProperties.limits.standardSampleLocations),
  387. toString(aProperties.limits.optimalBufferCopyOffsetAlignment),
  388. toString(aProperties.limits.optimalBufferCopyRowPitchAlignment),
  389. toString(aProperties.limits.nonCoherentAtomSize)
  390. ]);
  391. end;
  392. if aPrintSparseProps then begin
  393. result := result + Format(
  394. 'SparseProperties:' + sLineBreak +
  395. ' ResidencyStandard2DBlockShape: %s' + sLineBreak +
  396. ' ResidencyStandard2DMultisampleBlockShape: %s' + sLineBreak +
  397. ' ResidencyStandard3DBlockShape: %s' + sLineBreak +
  398. ' ResidencyAlignedMipSize: %s' + sLineBreak +
  399. ' ResidencyNonResidentStrict: %s' + sLineBreak,
  400. [
  401. toString(aProperties.sparseProperties.residencyStandard2DBlockShape),
  402. toString(aProperties.sparseProperties.residencyStandard2DMultisampleBlockShape),
  403. toString(aProperties.sparseProperties.residencyStandard3DBlockShape),
  404. toString(aProperties.sparseProperties.residencyAlignedMipSize),
  405. toString(aProperties.sparseProperties.residencyNonResidentStrict)
  406. ]);
  407. end;
  408. end;
  409. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  410. function vkuMakeString(const aMemoryProperties: TVkPhysicalDeviceMemoryProperties): String;
  411. var i: Integer;
  412. begin
  413. result := 'Types:' + sLineBreak;
  414. for i := 0 to aMemoryProperties.memoryTypeCount-1 do begin
  415. result := result + Format(
  416. ' Type %d:' + sLineBreak +
  417. ' PropertyFlags: 0x%.16X' + sLineBreak +
  418. ' HeapIndex: %d (0x%2:.16X)' + sLineBreak,
  419. [i, aMemoryProperties.memoryTypes[i].propertyFlags, aMemoryProperties.memoryTypes[i].heapIndex]);
  420. end;
  421. result := result + 'Heaps:' + sLineBreak;
  422. for i := 0 to aMemoryProperties.memoryHeapCount-1 do begin
  423. result := result + Format(
  424. ' Heap %d:' + sLineBreak +
  425. ' Size: %d (0x%1:.16X)' + sLineBreak +
  426. ' Flags: 0x%.16X' + sLineBreak,
  427. [i, aMemoryProperties.memoryHeaps[i].size, aMemoryProperties.memoryHeaps[i].flags]);
  428. end;
  429. end;
  430. end.