1 /*-------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
5 * Copyright (c) 2015 Google Inc.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief Api Feature Query tests
22 *//*--------------------------------------------------------------------*/
24 #include "vktApiFeatureInfo.hpp"
26 #include "vktTestCaseUtil.hpp"
27 #include "vktTestGroupUtil.hpp"
28 #include "vktCustomInstancesDevices.hpp"
30 #include "vkPlatform.hpp"
31 #include "vkStrUtil.hpp"
33 #include "vkRefUtil.hpp"
34 #include "vkDeviceUtil.hpp"
35 #include "vkQueryUtil.hpp"
36 #include "vkImageUtil.hpp"
37 #include "vkApiVersion.hpp"
39 #include "tcuTestLog.hpp"
40 #include "tcuFormatUtil.hpp"
41 #include "tcuTextureUtil.hpp"
42 #include "tcuResultCollector.hpp"
43 #include "tcuCommandLine.hpp"
45 #include "deUniquePtr.hpp"
47 #include "deStringUtil.hpp"
48 #include "deSTLUtil.hpp"
64 #include "vkApiExtensionDependencyInfo.inl"
71 using tcu::ScopedLogSection;
73 const deUint32 DEUINT32_MAX = std::numeric_limits<deUint32>::max();
77 GUARD_SIZE = 0x20, //!< Number of bytes to check
78 GUARD_VALUE = 0xcd, //!< Data pattern
81 static const VkDeviceSize MINIMUM_REQUIRED_IMAGE_RESOURCE_SIZE = (1LLU<<31); //!< Minimum value for VkImageFormatProperties::maxResourceSize (2GiB)
85 LIMIT_FORMAT_SIGNED_INT,
86 LIMIT_FORMAT_UNSIGNED_INT,
88 LIMIT_FORMAT_DEVICE_SIZE,
103 #define LIMIT(_X_) DE_OFFSET_OF(VkPhysicalDeviceLimits, _X_), (const char*)(#_X_)
104 #define FEATURE(_X_) DE_OFFSET_OF(VkPhysicalDeviceFeatures, _X_)
106 bool validateFeatureLimits(VkPhysicalDeviceProperties* properties, VkPhysicalDeviceFeatures* features, TestLog& log)
108 bool limitsOk = true;
109 VkPhysicalDeviceLimits* limits = &properties->limits;
110 deUint32 shaderStages = 3;
111 deUint32 maxPerStageResourcesMin = deMin32(128, limits->maxPerStageDescriptorUniformBuffers +
112 limits->maxPerStageDescriptorStorageBuffers +
113 limits->maxPerStageDescriptorSampledImages +
114 limits->maxPerStageDescriptorStorageImages +
115 limits->maxPerStageDescriptorInputAttachments +
116 limits->maxColorAttachments);
118 if (features->tessellationShader)
123 if (features->geometryShader)
128 struct FeatureLimitTable
132 deUint32 uintVal; //!< Format is UNSIGNED_INT
133 deInt32 intVal; //!< Format is SIGNED_INT
134 deUint64 deviceSizeVal; //!< Format is DEVICE_SIZE
135 float floatVal; //!< Format is FLOAT
138 deInt32 unsuppTableNdx;
140 } featureLimitTable[] = //!< Based on 1.0.28 Vulkan spec
142 { LIMIT(maxImageDimension1D), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
143 { LIMIT(maxImageDimension2D), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
144 { LIMIT(maxImageDimension3D), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
145 { LIMIT(maxImageDimensionCube), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
146 { LIMIT(maxImageArrayLayers), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
147 { LIMIT(maxTexelBufferElements), 65536, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
148 { LIMIT(maxUniformBufferRange), 16384, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
149 { LIMIT(maxStorageBufferRange), 134217728, 0, 0, 0, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
150 { LIMIT(maxPushConstantsSize), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
151 { LIMIT(maxMemoryAllocationCount), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
152 { LIMIT(maxSamplerAllocationCount), 4000, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
153 { LIMIT(bufferImageGranularity), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1, false },
154 { LIMIT(bufferImageGranularity), 0, 0, 131072, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1, false },
155 { LIMIT(sparseAddressSpaceSize), 0, 0, 2UL*1024*1024*1024, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1, false },
156 { LIMIT(maxBoundDescriptorSets), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
157 { LIMIT(maxPerStageDescriptorSamplers), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
158 { LIMIT(maxPerStageDescriptorUniformBuffers), 12, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
159 { LIMIT(maxPerStageDescriptorStorageBuffers), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
160 { LIMIT(maxPerStageDescriptorSampledImages), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
161 { LIMIT(maxPerStageDescriptorStorageImages), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
162 { LIMIT(maxPerStageDescriptorInputAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
163 { LIMIT(maxPerStageResources), maxPerStageResourcesMin, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
164 { LIMIT(maxDescriptorSetSamplers), shaderStages * 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
165 { LIMIT(maxDescriptorSetUniformBuffers), shaderStages * 12, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
166 { LIMIT(maxDescriptorSetUniformBuffersDynamic), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
167 { LIMIT(maxDescriptorSetStorageBuffers), shaderStages * 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
168 { LIMIT(maxDescriptorSetStorageBuffersDynamic), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
169 { LIMIT(maxDescriptorSetSampledImages), shaderStages * 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
170 { LIMIT(maxDescriptorSetStorageImages), shaderStages * 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
171 { LIMIT(maxDescriptorSetInputAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
172 { LIMIT(maxVertexInputAttributes), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
173 { LIMIT(maxVertexInputBindings), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
174 { LIMIT(maxVertexInputAttributeOffset), 2047, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
175 { LIMIT(maxVertexInputBindingStride), 2048, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
176 { LIMIT(maxVertexOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
177 { LIMIT(maxTessellationGenerationLevel), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
178 { LIMIT(maxTessellationPatchSize), 32, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
179 { LIMIT(maxTessellationControlPerVertexInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
180 { LIMIT(maxTessellationControlPerVertexOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
181 { LIMIT(maxTessellationControlPerPatchOutputComponents), 120, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
182 { LIMIT(maxTessellationControlTotalOutputComponents), 2048, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
183 { LIMIT(maxTessellationEvaluationInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
184 { LIMIT(maxTessellationEvaluationOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
185 { LIMIT(maxGeometryShaderInvocations), 32, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
186 { LIMIT(maxGeometryInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
187 { LIMIT(maxGeometryOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
188 { LIMIT(maxGeometryOutputVertices), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
189 { LIMIT(maxGeometryTotalOutputComponents), 1024, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
190 { LIMIT(maxFragmentInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
191 { LIMIT(maxFragmentOutputAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
192 { LIMIT(maxFragmentDualSrcAttachments), 1, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
193 { LIMIT(maxFragmentCombinedOutputResources), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
194 { LIMIT(maxComputeSharedMemorySize), 16384, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
195 { LIMIT(maxComputeWorkGroupCount[0]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
196 { LIMIT(maxComputeWorkGroupCount[1]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
197 { LIMIT(maxComputeWorkGroupCount[2]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
198 { LIMIT(maxComputeWorkGroupInvocations), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
199 { LIMIT(maxComputeWorkGroupSize[0]), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
200 { LIMIT(maxComputeWorkGroupSize[1]), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
201 { LIMIT(maxComputeWorkGroupSize[2]), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
202 { LIMIT(subPixelPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
203 { LIMIT(subTexelPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
204 { LIMIT(mipmapPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
205 { LIMIT(maxDrawIndexedIndexValue), (deUint32)~0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
206 { LIMIT(maxDrawIndirectCount), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
207 { LIMIT(maxSamplerLodBias), 0, 0, 0, 2.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1, false },
208 { LIMIT(maxSamplerAnisotropy), 0, 0, 0, 16.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1, false },
209 { LIMIT(maxViewports), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
210 { LIMIT(maxViewportDimensions[0]), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
211 { LIMIT(maxViewportDimensions[1]), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1, false },
212 { LIMIT(viewportBoundsRange[0]), 0, 0, 0, -8192.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1, false },
213 { LIMIT(viewportBoundsRange[1]), 0, 0, 0, 8191.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1, false },
214 { LIMIT(viewportSubPixelBits), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
215 { LIMIT(minMemoryMapAlignment), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
216 { LIMIT(minTexelBufferOffsetAlignment), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1, true },
217 { LIMIT(minTexelBufferOffsetAlignment), 0, 0, 256, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1, true },
218 { LIMIT(minUniformBufferOffsetAlignment), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1, true },
219 { LIMIT(minUniformBufferOffsetAlignment), 0, 0, 256, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1, true },
220 { LIMIT(minStorageBufferOffsetAlignment), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1, true },
221 { LIMIT(minStorageBufferOffsetAlignment), 0, 0, 256, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1, true },
222 { LIMIT(minTexelOffset), 0, -8, 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MAX, -1, false },
223 { LIMIT(maxTexelOffset), 7, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
224 { LIMIT(minTexelGatherOffset), 0, -8, 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MAX, -1, false },
225 { LIMIT(maxTexelGatherOffset), 7, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
226 { LIMIT(minInterpolationOffset), 0, 0, 0, -0.5f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1, false },
227 { LIMIT(maxInterpolationOffset), 0, 0, 0, 0.5f - (1.0f/deFloatPow(2.0f, (float)limits->subPixelInterpolationOffsetBits)), LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1, false },
228 { LIMIT(subPixelInterpolationOffsetBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
229 { LIMIT(maxFramebufferWidth), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
230 { LIMIT(maxFramebufferHeight), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
231 { LIMIT(maxFramebufferLayers), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
232 { LIMIT(framebufferColorSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
233 { LIMIT(framebufferDepthSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
234 { LIMIT(framebufferStencilSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
235 { LIMIT(framebufferNoAttachmentsSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
236 { LIMIT(maxColorAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
237 { LIMIT(sampledImageColorSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
238 { LIMIT(sampledImageIntegerSampleCounts), VK_SAMPLE_COUNT_1_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
239 { LIMIT(sampledImageDepthSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
240 { LIMIT(sampledImageStencilSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
241 { LIMIT(storageImageSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1, false },
242 { LIMIT(maxSampleMaskWords), 1, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
243 { LIMIT(timestampComputeAndGraphics), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE, -1, false },
244 { LIMIT(timestampPeriod), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE, -1, false },
245 { LIMIT(maxClipDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
246 { LIMIT(maxCullDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
247 { LIMIT(maxCombinedClipAndCullDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
248 { LIMIT(discreteQueuePriorities), 2, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1, false },
249 { LIMIT(pointSizeRange[0]), 0, 0, 0, 0.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1, false },
250 { LIMIT(pointSizeRange[0]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1, false },
251 { LIMIT(pointSizeRange[1]), 0, 0, 0, 64.0f - limits->pointSizeGranularity , LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1, false },
252 { LIMIT(lineWidthRange[0]), 0, 0, 0, 0.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1, false },
253 { LIMIT(lineWidthRange[0]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1, false },
254 { LIMIT(lineWidthRange[1]), 0, 0, 0, 8.0f - limits->lineWidthGranularity, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1, false },
255 { LIMIT(pointSizeGranularity), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1, false },
256 { LIMIT(lineWidthGranularity), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1, false },
257 { LIMIT(strictLines), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE, -1, false },
258 { LIMIT(standardSampleLocations), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE, -1, false },
259 { LIMIT(optimalBufferCopyOffsetAlignment), 0, 0, 0, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_NONE, -1, true },
260 { LIMIT(optimalBufferCopyRowPitchAlignment), 0, 0, 0, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_NONE, -1, true },
261 { LIMIT(nonCoherentAtomSize), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1, true },
262 { LIMIT(nonCoherentAtomSize), 0, 0, 256, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1, true },
265 const struct UnsupportedFeatureLimitTable
267 deUint32 limitOffset;
269 deUint32 featureOffset;
270 deUint32 uintVal; //!< Format is UNSIGNED_INT
271 deInt32 intVal; //!< Format is SIGNED_INT
272 deUint64 deviceSizeVal; //!< Format is DEVICE_SIZE
273 float floatVal; //!< Format is FLOAT
274 } unsupportedFeatureTable[] =
276 { LIMIT(sparseAddressSpaceSize), FEATURE(sparseBinding), 0, 0, 0, 0.0f },
277 { LIMIT(maxTessellationGenerationLevel), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
278 { LIMIT(maxTessellationPatchSize), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
279 { LIMIT(maxTessellationControlPerVertexInputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
280 { LIMIT(maxTessellationControlPerVertexOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
281 { LIMIT(maxTessellationControlPerPatchOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
282 { LIMIT(maxTessellationControlTotalOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
283 { LIMIT(maxTessellationEvaluationInputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
284 { LIMIT(maxTessellationEvaluationOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
285 { LIMIT(maxGeometryShaderInvocations), FEATURE(geometryShader), 0, 0, 0, 0.0f },
286 { LIMIT(maxGeometryInputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
287 { LIMIT(maxGeometryOutputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
288 { LIMIT(maxGeometryOutputVertices), FEATURE(geometryShader), 0, 0, 0, 0.0f },
289 { LIMIT(maxGeometryTotalOutputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
290 { LIMIT(maxFragmentDualSrcAttachments), FEATURE(dualSrcBlend), 0, 0, 0, 0.0f },
291 { LIMIT(maxDrawIndexedIndexValue), FEATURE(fullDrawIndexUint32), (1<<24)-1, 0, 0, 0.0f },
292 { LIMIT(maxDrawIndirectCount), FEATURE(multiDrawIndirect), 1, 0, 0, 0.0f },
293 { LIMIT(maxSamplerAnisotropy), FEATURE(samplerAnisotropy), 1, 0, 0, 0.0f },
294 { LIMIT(maxViewports), FEATURE(multiViewport), 1, 0, 0, 0.0f },
295 { LIMIT(minTexelGatherOffset), FEATURE(shaderImageGatherExtended), 0, 0, 0, 0.0f },
296 { LIMIT(maxTexelGatherOffset), FEATURE(shaderImageGatherExtended), 0, 0, 0, 0.0f },
297 { LIMIT(minInterpolationOffset), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
298 { LIMIT(maxInterpolationOffset), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
299 { LIMIT(subPixelInterpolationOffsetBits), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
300 { LIMIT(storageImageSampleCounts), FEATURE(shaderStorageImageMultisample), VK_SAMPLE_COUNT_1_BIT, 0, 0, 0.0f },
301 { LIMIT(maxClipDistances), FEATURE(shaderClipDistance), 0, 0, 0, 0.0f },
302 { LIMIT(maxCullDistances), FEATURE(shaderCullDistance), 0, 0, 0, 0.0f },
303 { LIMIT(maxCombinedClipAndCullDistances), FEATURE(shaderClipDistance), 0, 0, 0, 0.0f },
304 { LIMIT(pointSizeRange[0]), FEATURE(largePoints), 0, 0, 0, 1.0f },
305 { LIMIT(pointSizeRange[1]), FEATURE(largePoints), 0, 0, 0, 1.0f },
306 { LIMIT(lineWidthRange[0]), FEATURE(wideLines), 0, 0, 0, 1.0f },
307 { LIMIT(lineWidthRange[1]), FEATURE(wideLines), 0, 0, 0, 1.0f },
308 { LIMIT(pointSizeGranularity), FEATURE(largePoints), 0, 0, 0, 0.0f },
309 { LIMIT(lineWidthGranularity), FEATURE(wideLines), 0, 0, 0, 0.0f }
312 log << TestLog::Message << *limits << TestLog::EndMessage;
314 //!< First build a map from limit to unsupported table index
315 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
317 for (deUint32 unsuppNdx = 0; unsuppNdx < DE_LENGTH_OF_ARRAY(unsupportedFeatureTable); unsuppNdx++)
319 if (unsupportedFeatureTable[unsuppNdx].limitOffset == featureLimitTable[ndx].offset)
321 featureLimitTable[ndx].unsuppTableNdx = unsuppNdx;
327 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
329 switch (featureLimitTable[ndx].format)
331 case LIMIT_FORMAT_UNSIGNED_INT:
333 deUint32 limitToCheck = featureLimitTable[ndx].uintVal;
334 if (featureLimitTable[ndx].unsuppTableNdx != -1)
336 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
337 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].uintVal;
340 if (featureLimitTable[ndx].pot)
342 if (!deIntIsPow2(*((deUint32*)((deUint8*)limits + featureLimitTable[ndx].offset))))
344 log << TestLog::Message << "limit Validation failed " << featureLimitTable[ndx].name
345 << " is not a power of two." << TestLog::EndMessage;
350 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
352 if (*((deUint32*)((deUint8*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
354 log << TestLog::Message << "limit Validation failed " << featureLimitTable[ndx].name
355 << " not valid-limit type MIN - actual is "
356 << *((deUint32*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
360 else if (featureLimitTable[ndx].type == LIMIT_TYPE_MAX)
362 if (*((deUint32*)((deUint8*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
364 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
365 << " not valid-limit type MAX - actual is "
366 << *((deUint32*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
373 case LIMIT_FORMAT_FLOAT:
375 float limitToCheck = featureLimitTable[ndx].floatVal;
376 if (featureLimitTable[ndx].unsuppTableNdx != -1)
378 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
379 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].floatVal;
382 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
384 if (*((float*)((deUint8*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
386 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
387 << " not valid-limit type MIN - actual is "
388 << *((float*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
392 else if (featureLimitTable[ndx].type == LIMIT_TYPE_MAX)
394 if (*((float*)((deUint8*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
396 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
397 << " not valid-limit type MAX actual is "
398 << *((float*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
405 case LIMIT_FORMAT_SIGNED_INT:
407 deInt32 limitToCheck = featureLimitTable[ndx].intVal;
408 if (featureLimitTable[ndx].unsuppTableNdx != -1)
410 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
411 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].intVal;
413 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
415 if (*((deInt32*)((deUint8*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
417 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
418 << " not valid-limit type MIN actual is "
419 << *((deInt32*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
423 else if (featureLimitTable[ndx].type == LIMIT_TYPE_MAX)
425 if (*((deInt32*)((deUint8*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
427 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
428 << " not valid-limit type MAX actual is "
429 << *((deInt32*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
436 case LIMIT_FORMAT_DEVICE_SIZE:
438 deUint64 limitToCheck = featureLimitTable[ndx].deviceSizeVal;
439 if (featureLimitTable[ndx].unsuppTableNdx != -1)
441 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
442 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].deviceSizeVal;
445 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
447 if (*((deUint64*)((deUint8*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
449 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
450 << " not valid-limit type MIN actual is "
451 << *((deUint64*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
455 else if (featureLimitTable[ndx].type == LIMIT_TYPE_MAX)
457 if (*((deUint64*)((deUint8*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
459 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
460 << " not valid-limit type MAX actual is "
461 << *((deUint64*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
468 case LIMIT_FORMAT_BITMASK:
470 deUint32 limitToCheck = featureLimitTable[ndx].uintVal;
471 if (featureLimitTable[ndx].unsuppTableNdx != -1)
473 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
474 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].uintVal;
477 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
479 if ((*((deUint32*)((deUint8*)limits+featureLimitTable[ndx].offset)) & limitToCheck) != limitToCheck)
481 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
482 << " not valid-limit type bitmask actual is "
483 << *((deUint64*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
496 if (limits->maxFramebufferWidth > limits->maxViewportDimensions[0] ||
497 limits->maxFramebufferHeight > limits->maxViewportDimensions[1])
499 log << TestLog::Message << "limit validation failed, maxFramebufferDimension of "
500 << "[" << limits->maxFramebufferWidth << ", " << limits->maxFramebufferHeight << "] "
501 << "is larger than maxViewportDimension of "
502 << "[" << limits->maxViewportDimensions[0] << ", " << limits->maxViewportDimensions[1] << "]" << TestLog::EndMessage;
506 if (limits->viewportBoundsRange[0] > float(-2 * limits->maxViewportDimensions[0]))
508 log << TestLog::Message << "limit validation failed, viewPortBoundsRange[0] of " << limits->viewportBoundsRange[0]
509 << "is larger than -2*maxViewportDimension[0] of " << -2*limits->maxViewportDimensions[0] << TestLog::EndMessage;
513 if (limits->viewportBoundsRange[1] < float(2 * limits->maxViewportDimensions[1] - 1))
515 log << TestLog::Message << "limit validation failed, viewportBoundsRange[1] of " << limits->viewportBoundsRange[1]
516 << "is less than 2*maxViewportDimension[1] of " << 2*limits->maxViewportDimensions[1] << TestLog::EndMessage;
523 template<deUint32 MAJOR, deUint32 MINOR>
524 void checkApiVersionSupport(Context& context)
526 if (!context.contextSupports(vk::ApiVersion(MAJOR, MINOR, 0)))
527 TCU_THROW(NotSupportedError, std::string("At least Vulkan ") + std::to_string(MAJOR) + "." + std::to_string(MINOR) + " required to run test");
530 typedef struct FeatureLimitTableItem_
533 const char* condName;
536 deUint32 uintVal; //!< Format is UNSIGNED_INT
537 deInt32 intVal; //!< Format is SIGNED_INT
538 deUint64 deviceSizeVal; //!< Format is DEVICE_SIZE
539 float floatVal; //!< Format is FLOAT
542 } FeatureLimitTableItem;
545 bool validateNumericLimit (const T limitToCheck, const T reportedValue, const LimitType limitType, const char* limitName, TestLog& log)
547 if (limitType == LIMIT_TYPE_MIN)
549 if (reportedValue < limitToCheck)
551 log << TestLog::Message << "Limit validation failed " << limitName
552 << " reported value is " << reportedValue
553 << " expected MIN " << limitToCheck
554 << TestLog::EndMessage;
559 log << TestLog::Message << limitName
560 << "=" << reportedValue
561 << " (>=" << limitToCheck << ")"
562 << TestLog::EndMessage;
564 else if (limitType == LIMIT_TYPE_MAX)
566 if (reportedValue > limitToCheck)
568 log << TestLog::Message << "Limit validation failed " << limitName
569 << " reported value is " << reportedValue
570 << " expected MAX " << limitToCheck
571 << TestLog::EndMessage;
576 log << TestLog::Message << limitName
577 << "=" << reportedValue
578 << " (<=" << limitToCheck << ")"
579 << TestLog::EndMessage;
586 bool validateBitmaskLimit (const T limitToCheck, const T reportedValue, const LimitType limitType, const char* limitName, TestLog& log)
588 if (limitType == LIMIT_TYPE_MIN)
590 if ((reportedValue & limitToCheck) != limitToCheck)
592 log << TestLog::Message << "Limit validation failed " << limitName
593 << " reported value is " << reportedValue
594 << " expected MIN " << limitToCheck
595 << TestLog::EndMessage;
600 log << TestLog::Message << limitName
601 << "=" << tcu::toHex(reportedValue)
602 << " (contains " << tcu::toHex(limitToCheck) << ")"
603 << TestLog::EndMessage;
609 bool validateLimit (FeatureLimitTableItem limit, TestLog& log)
611 if (*((VkBool32*)limit.cond) == DE_FALSE)
613 log << TestLog::Message
614 << "Limit validation skipped '" << limit.name << "' due to "
615 << limit.condName << " == false'"
616 << TestLog::EndMessage;
621 switch (limit.format)
623 case LIMIT_FORMAT_UNSIGNED_INT:
625 const deUint32 limitToCheck = limit.uintVal;
626 const deUint32 reportedValue = *(deUint32*)limit.ptr;
628 return validateNumericLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
631 case LIMIT_FORMAT_FLOAT:
633 const float limitToCheck = limit.floatVal;
634 const float reportedValue = *(float*)limit.ptr;
636 return validateNumericLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
639 case LIMIT_FORMAT_SIGNED_INT:
641 const deInt32 limitToCheck = limit.intVal;
642 const deInt32 reportedValue = *(deInt32*)limit.ptr;
644 return validateNumericLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
647 case LIMIT_FORMAT_DEVICE_SIZE:
649 const deUint64 limitToCheck = limit.deviceSizeVal;
650 const deUint64 reportedValue = *(deUint64*)limit.ptr;
652 return validateNumericLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
655 case LIMIT_FORMAT_BITMASK:
657 const deUint32 limitToCheck = limit.uintVal;
658 const deUint32 reportedValue = *(deUint32*)limit.ptr;
660 return validateBitmaskLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
664 TCU_THROW(InternalError, "Unknown LimitFormat specified");
671 #define PN(_X_) &(_X_), (const char*)(#_X_)
674 #define LIM_MIN_UINT32(X) deUint32(X), 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN
675 #define LIM_MAX_UINT32(X) deUint32(X), 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MAX
676 #define LIM_NONE_UINT32 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE
677 #define LIM_MIN_INT32(X) 0, deInt32(X), 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MIN
678 #define LIM_MAX_INT32(X) 0, deInt32(X), 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MAX
679 #define LIM_NONE_INT32 0, 0, 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_NONE
680 #define LIM_MIN_DEVSIZE(X) 0, 0, VkDeviceSize(X), 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN
681 #define LIM_MAX_DEVSIZE(X) 0, 0, VkDeviceSize(X), 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX
682 #define LIM_NONE_DEVSIZE 0, 0, 0, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_NONE
683 #define LIM_MIN_FLOAT(X) 0, 0, 0, float(X), LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN
684 #define LIM_MAX_FLOAT(X) 0, 0, 0, float(X), LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX
685 #define LIM_NONE_FLOAT 0, 0, 0, 0.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_NONE
686 #define LIM_MIN_BITI32(X) deUint32(X), 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN
687 #define LIM_MAX_BITI32(X) deUint32(X), 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MAX
688 #define LIM_NONE_BITI32 0, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_NONE
690 tcu::TestStatus validateLimits12 (Context& context)
692 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
693 const InstanceInterface& vki = context.getInstanceInterface();
694 TestLog& log = context.getTestContext().getLog();
695 bool limitsOk = true;
697 const VkPhysicalDeviceFeatures2& features2 = context.getDeviceFeatures2();
698 const VkPhysicalDeviceFeatures& features = features2.features;
699 const VkPhysicalDeviceVulkan12Features features12 = getPhysicalDeviceVulkan12Features(vki, physicalDevice);
701 const VkPhysicalDeviceProperties2& properties2 = context.getDeviceProperties2();
702 const VkPhysicalDeviceVulkan12Properties vulkan12Properties = getPhysicalDeviceVulkan12Properties(vki, physicalDevice);
703 const VkPhysicalDeviceVulkan11Properties vulkan11Properties = getPhysicalDeviceVulkan11Properties(vki, physicalDevice);
704 const VkPhysicalDeviceLimits& limits = properties2.properties.limits;
706 const VkBool32 checkAlways = VK_TRUE;
707 const VkBool32 checkVulkan12Limit = VK_TRUE;
709 deUint32 shaderStages = 3;
710 deUint32 maxPerStageResourcesMin = deMin32(128, limits.maxPerStageDescriptorUniformBuffers +
711 limits.maxPerStageDescriptorStorageBuffers +
712 limits.maxPerStageDescriptorSampledImages +
713 limits.maxPerStageDescriptorStorageImages +
714 limits.maxPerStageDescriptorInputAttachments +
715 limits.maxColorAttachments);
717 if (features.tessellationShader)
722 if (features.geometryShader)
727 FeatureLimitTableItem featureLimitTable[] =
729 { PN(checkAlways), PN(limits.maxImageDimension1D), LIM_MIN_UINT32(4096) },
730 { PN(checkAlways), PN(limits.maxImageDimension2D), LIM_MIN_UINT32(4096) },
731 { PN(checkAlways), PN(limits.maxImageDimension3D), LIM_MIN_UINT32(256) },
732 { PN(checkAlways), PN(limits.maxImageDimensionCube), LIM_MIN_UINT32(4096) },
733 { PN(checkAlways), PN(limits.maxImageArrayLayers), LIM_MIN_UINT32(256) },
734 { PN(checkAlways), PN(limits.maxTexelBufferElements), LIM_MIN_UINT32(65536) },
735 { PN(checkAlways), PN(limits.maxUniformBufferRange), LIM_MIN_UINT32(16384) },
736 { PN(checkAlways), PN(limits.maxStorageBufferRange), LIM_MIN_UINT32((1<<27)) },
737 { PN(checkAlways), PN(limits.maxPushConstantsSize), LIM_MIN_UINT32(128) },
738 { PN(checkAlways), PN(limits.maxMemoryAllocationCount), LIM_MIN_UINT32(4096) },
739 { PN(checkAlways), PN(limits.maxSamplerAllocationCount), LIM_MIN_UINT32(4000) },
740 { PN(checkAlways), PN(limits.bufferImageGranularity), LIM_MIN_DEVSIZE(1) },
741 { PN(checkAlways), PN(limits.bufferImageGranularity), LIM_MAX_DEVSIZE(131072) },
742 { PN(features.sparseBinding), PN(limits.sparseAddressSpaceSize), LIM_MIN_DEVSIZE((1ull<<31)) },
743 { PN(checkAlways), PN(limits.maxBoundDescriptorSets), LIM_MIN_UINT32(4) },
744 { PN(checkAlways), PN(limits.maxPerStageDescriptorSamplers), LIM_MIN_UINT32(16) },
745 { PN(checkAlways), PN(limits.maxPerStageDescriptorUniformBuffers), LIM_MIN_UINT32(12) },
746 { PN(checkAlways), PN(limits.maxPerStageDescriptorStorageBuffers), LIM_MIN_UINT32(4) },
747 { PN(checkAlways), PN(limits.maxPerStageDescriptorSampledImages), LIM_MIN_UINT32(16) },
748 { PN(checkAlways), PN(limits.maxPerStageDescriptorStorageImages), LIM_MIN_UINT32(4) },
749 { PN(checkAlways), PN(limits.maxPerStageDescriptorInputAttachments), LIM_MIN_UINT32(4) },
750 { PN(checkAlways), PN(limits.maxPerStageResources), LIM_MIN_UINT32(maxPerStageResourcesMin) },
751 { PN(checkAlways), PN(limits.maxDescriptorSetSamplers), LIM_MIN_UINT32(shaderStages * 16) },
752 { PN(checkAlways), PN(limits.maxDescriptorSetUniformBuffers), LIM_MIN_UINT32(shaderStages * 12) },
753 { PN(checkAlways), PN(limits.maxDescriptorSetUniformBuffersDynamic), LIM_MIN_UINT32(8) },
754 { PN(checkAlways), PN(limits.maxDescriptorSetStorageBuffers), LIM_MIN_UINT32(shaderStages * 4) },
755 { PN(checkAlways), PN(limits.maxDescriptorSetStorageBuffersDynamic), LIM_MIN_UINT32(4) },
756 { PN(checkAlways), PN(limits.maxDescriptorSetSampledImages), LIM_MIN_UINT32(shaderStages * 16) },
757 { PN(checkAlways), PN(limits.maxDescriptorSetStorageImages), LIM_MIN_UINT32(shaderStages * 4) },
758 { PN(checkAlways), PN(limits.maxDescriptorSetInputAttachments), LIM_MIN_UINT32(4) },
759 { PN(checkAlways), PN(limits.maxVertexInputAttributes), LIM_MIN_UINT32(16) },
760 { PN(checkAlways), PN(limits.maxVertexInputBindings), LIM_MIN_UINT32(16) },
761 { PN(checkAlways), PN(limits.maxVertexInputAttributeOffset), LIM_MIN_UINT32(2047) },
762 { PN(checkAlways), PN(limits.maxVertexInputBindingStride), LIM_MIN_UINT32(2048) },
763 { PN(checkAlways), PN(limits.maxVertexOutputComponents), LIM_MIN_UINT32(64) },
764 { PN(features.tessellationShader), PN(limits.maxTessellationGenerationLevel), LIM_MIN_UINT32(64) },
765 { PN(features.tessellationShader), PN(limits.maxTessellationPatchSize), LIM_MIN_UINT32(32) },
766 { PN(features.tessellationShader), PN(limits.maxTessellationControlPerVertexInputComponents), LIM_MIN_UINT32(64) },
767 { PN(features.tessellationShader), PN(limits.maxTessellationControlPerVertexOutputComponents), LIM_MIN_UINT32(64) },
768 { PN(features.tessellationShader), PN(limits.maxTessellationControlPerPatchOutputComponents), LIM_MIN_UINT32(120) },
769 { PN(features.tessellationShader), PN(limits.maxTessellationControlTotalOutputComponents), LIM_MIN_UINT32(2048) },
770 { PN(features.tessellationShader), PN(limits.maxTessellationEvaluationInputComponents), LIM_MIN_UINT32(64) },
771 { PN(features.tessellationShader), PN(limits.maxTessellationEvaluationOutputComponents), LIM_MIN_UINT32(64) },
772 { PN(features.geometryShader), PN(limits.maxGeometryShaderInvocations), LIM_MIN_UINT32(32) },
773 { PN(features.geometryShader), PN(limits.maxGeometryInputComponents), LIM_MIN_UINT32(64) },
774 { PN(features.geometryShader), PN(limits.maxGeometryOutputComponents), LIM_MIN_UINT32(64) },
775 { PN(features.geometryShader), PN(limits.maxGeometryOutputVertices), LIM_MIN_UINT32(256) },
776 { PN(features.geometryShader), PN(limits.maxGeometryTotalOutputComponents), LIM_MIN_UINT32(1024) },
777 { PN(checkAlways), PN(limits.maxFragmentInputComponents), LIM_MIN_UINT32(64) },
778 { PN(checkAlways), PN(limits.maxFragmentOutputAttachments), LIM_MIN_UINT32(4) },
779 { PN(features.dualSrcBlend), PN(limits.maxFragmentDualSrcAttachments), LIM_MIN_UINT32(1) },
780 { PN(checkAlways), PN(limits.maxFragmentCombinedOutputResources), LIM_MIN_UINT32(4) },
781 { PN(checkAlways), PN(limits.maxComputeSharedMemorySize), LIM_MIN_UINT32(16384) },
782 { PN(checkAlways), PN(limits.maxComputeWorkGroupCount[0]), LIM_MIN_UINT32(65535) },
783 { PN(checkAlways), PN(limits.maxComputeWorkGroupCount[1]), LIM_MIN_UINT32(65535) },
784 { PN(checkAlways), PN(limits.maxComputeWorkGroupCount[2]), LIM_MIN_UINT32(65535) },
785 { PN(checkAlways), PN(limits.maxComputeWorkGroupInvocations), LIM_MIN_UINT32(128) },
786 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[0]), LIM_MIN_UINT32(128) },
787 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[1]), LIM_MIN_UINT32(128) },
788 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[2]), LIM_MIN_UINT32(64) },
789 { PN(checkAlways), PN(limits.subPixelPrecisionBits), LIM_MIN_UINT32(4) },
790 { PN(checkAlways), PN(limits.subTexelPrecisionBits), LIM_MIN_UINT32(4) },
791 { PN(checkAlways), PN(limits.mipmapPrecisionBits), LIM_MIN_UINT32(4) },
792 { PN(features.fullDrawIndexUint32), PN(limits.maxDrawIndexedIndexValue), LIM_MIN_UINT32((deUint32)~0) },
793 { PN(features.multiDrawIndirect), PN(limits.maxDrawIndirectCount), LIM_MIN_UINT32(65535) },
794 { PN(checkAlways), PN(limits.maxSamplerLodBias), LIM_MIN_FLOAT(2.0f) },
795 { PN(features.samplerAnisotropy), PN(limits.maxSamplerAnisotropy), LIM_MIN_FLOAT(16.0f) },
796 { PN(features.multiViewport), PN(limits.maxViewports), LIM_MIN_UINT32(16) },
797 { PN(checkAlways), PN(limits.maxViewportDimensions[0]), LIM_MIN_UINT32(4096) },
798 { PN(checkAlways), PN(limits.maxViewportDimensions[1]), LIM_MIN_UINT32(4096) },
799 { PN(checkAlways), PN(limits.viewportBoundsRange[0]), LIM_MAX_FLOAT(-8192.0f) },
800 { PN(checkAlways), PN(limits.viewportBoundsRange[1]), LIM_MIN_FLOAT(8191.0f) },
801 { PN(checkAlways), PN(limits.viewportSubPixelBits), LIM_MIN_UINT32(0) },
802 { PN(checkAlways), PN(limits.minMemoryMapAlignment), LIM_MIN_UINT32(64) },
803 { PN(checkAlways), PN(limits.minTexelBufferOffsetAlignment), LIM_MIN_DEVSIZE(1) },
804 { PN(checkAlways), PN(limits.minTexelBufferOffsetAlignment), LIM_MAX_DEVSIZE(256) },
805 { PN(checkAlways), PN(limits.minUniformBufferOffsetAlignment), LIM_MIN_DEVSIZE(1) },
806 { PN(checkAlways), PN(limits.minUniformBufferOffsetAlignment), LIM_MAX_DEVSIZE(256) },
807 { PN(checkAlways), PN(limits.minStorageBufferOffsetAlignment), LIM_MIN_DEVSIZE(1) },
808 { PN(checkAlways), PN(limits.minStorageBufferOffsetAlignment), LIM_MAX_DEVSIZE(256) },
809 { PN(checkAlways), PN(limits.minTexelOffset), LIM_MAX_INT32(-8) },
810 { PN(checkAlways), PN(limits.maxTexelOffset), LIM_MIN_INT32(7) },
811 { PN(features.shaderImageGatherExtended), PN(limits.minTexelGatherOffset), LIM_MAX_INT32(-8) },
812 { PN(features.shaderImageGatherExtended), PN(limits.maxTexelGatherOffset), LIM_MIN_INT32(7) },
813 { PN(features.sampleRateShading), PN(limits.minInterpolationOffset), LIM_MAX_FLOAT(-0.5f) },
814 { PN(features.sampleRateShading), PN(limits.maxInterpolationOffset), LIM_MIN_FLOAT(0.5f - (1.0f/deFloatPow(2.0f, (float)limits.subPixelInterpolationOffsetBits))) },
815 { PN(features.sampleRateShading), PN(limits.subPixelInterpolationOffsetBits), LIM_MIN_UINT32(4) },
816 { PN(checkAlways), PN(limits.maxFramebufferWidth), LIM_MIN_UINT32(4096) },
817 { PN(checkAlways), PN(limits.maxFramebufferHeight), LIM_MIN_UINT32(4096) },
818 { PN(checkAlways), PN(limits.maxFramebufferLayers), LIM_MIN_UINT32(256) },
819 { PN(checkAlways), PN(limits.framebufferColorSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
820 { PN(checkVulkan12Limit), PN(vulkan12Properties.framebufferIntegerColorSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT) },
821 { PN(checkAlways), PN(limits.framebufferDepthSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
822 { PN(checkAlways), PN(limits.framebufferStencilSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
823 { PN(checkAlways), PN(limits.framebufferNoAttachmentsSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
824 { PN(checkAlways), PN(limits.maxColorAttachments), LIM_MIN_UINT32(4) },
825 { PN(checkAlways), PN(limits.sampledImageColorSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
826 { PN(checkAlways), PN(limits.sampledImageIntegerSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT) },
827 { PN(checkAlways), PN(limits.sampledImageDepthSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
828 { PN(checkAlways), PN(limits.sampledImageStencilSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
829 { PN(features.shaderStorageImageMultisample), PN(limits.storageImageSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
830 { PN(checkAlways), PN(limits.maxSampleMaskWords), LIM_MIN_UINT32(1) },
831 { PN(checkAlways), PN(limits.timestampComputeAndGraphics), LIM_NONE_UINT32 },
832 { PN(checkAlways), PN(limits.timestampPeriod), LIM_NONE_UINT32 },
833 { PN(features.shaderClipDistance), PN(limits.maxClipDistances), LIM_MIN_UINT32(8) },
834 { PN(features.shaderCullDistance), PN(limits.maxCullDistances), LIM_MIN_UINT32(8) },
835 { PN(features.shaderClipDistance), PN(limits.maxCombinedClipAndCullDistances), LIM_MIN_UINT32(8) },
836 { PN(checkAlways), PN(limits.discreteQueuePriorities), LIM_MIN_UINT32(2) },
837 { PN(features.largePoints), PN(limits.pointSizeRange[0]), LIM_MIN_FLOAT(0.0f) },
838 { PN(features.largePoints), PN(limits.pointSizeRange[0]), LIM_MAX_FLOAT(1.0f) },
839 { PN(features.largePoints), PN(limits.pointSizeRange[1]), LIM_MIN_FLOAT(64.0f - limits.pointSizeGranularity) },
840 { PN(features.wideLines), PN(limits.lineWidthRange[0]), LIM_MIN_FLOAT(0.0f) },
841 { PN(features.wideLines), PN(limits.lineWidthRange[0]), LIM_MAX_FLOAT(1.0f) },
842 { PN(features.wideLines), PN(limits.lineWidthRange[1]), LIM_MIN_FLOAT(8.0f - limits.lineWidthGranularity) },
843 { PN(features.largePoints), PN(limits.pointSizeGranularity), LIM_MIN_FLOAT(0.0f) },
844 { PN(features.largePoints), PN(limits.pointSizeGranularity), LIM_MAX_FLOAT(1.0f) },
845 { PN(features.wideLines), PN(limits.lineWidthGranularity), LIM_MIN_FLOAT(0.0f) },
846 { PN(features.wideLines), PN(limits.lineWidthGranularity), LIM_MAX_FLOAT(1.0f) },
847 { PN(checkAlways), PN(limits.strictLines), LIM_NONE_UINT32 },
848 { PN(checkAlways), PN(limits.standardSampleLocations), LIM_NONE_UINT32 },
849 { PN(checkAlways), PN(limits.optimalBufferCopyOffsetAlignment), LIM_NONE_DEVSIZE },
850 { PN(checkAlways), PN(limits.optimalBufferCopyRowPitchAlignment), LIM_NONE_DEVSIZE },
851 { PN(checkAlways), PN(limits.nonCoherentAtomSize), LIM_MIN_DEVSIZE(1) },
852 { PN(checkAlways), PN(limits.nonCoherentAtomSize), LIM_MAX_DEVSIZE(256) },
855 { PN(checkVulkan12Limit), PN(vulkan11Properties.maxMultiviewViewCount), LIM_MIN_UINT32(6) },
856 { PN(checkVulkan12Limit), PN(vulkan11Properties.maxMultiviewInstanceIndex), LIM_MIN_UINT32((1<<27) - 1) },
858 // VK_KHR_maintenance3
859 { PN(checkVulkan12Limit), PN(vulkan11Properties.maxPerSetDescriptors), LIM_MIN_UINT32(1024) },
860 { PN(checkVulkan12Limit), PN(vulkan11Properties.maxMemoryAllocationSize), LIM_MIN_DEVSIZE(1<<30) },
862 // VK_EXT_descriptor_indexing
863 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools), LIM_MIN_UINT32(500000) },
864 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers), LIM_MIN_UINT32(500000) },
865 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(12) },
866 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(500000) },
867 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages), LIM_MIN_UINT32(500000) },
868 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages), LIM_MIN_UINT32(500000) },
869 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments), LIM_MIN_UINT32(4) },
870 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageUpdateAfterBindResources), LIM_MIN_UINT32(500000) },
871 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers), LIM_MIN_UINT32(500000) },
872 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(shaderStages * 12) },
873 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), LIM_MIN_UINT32(8) },
874 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(500000) },
875 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), LIM_MIN_UINT32(4) },
876 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages), LIM_MIN_UINT32(500000) },
877 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages), LIM_MIN_UINT32(500000) },
878 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments), LIM_MIN_UINT32(4) },
879 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers), LIM_MIN_UINT32(limits.maxPerStageDescriptorSamplers) },
880 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(limits.maxPerStageDescriptorUniformBuffers) },
881 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageBuffers) },
882 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages), LIM_MIN_UINT32(limits.maxPerStageDescriptorSampledImages) },
883 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages), LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageImages) },
884 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments), LIM_MIN_UINT32(limits.maxPerStageDescriptorInputAttachments) },
885 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageUpdateAfterBindResources), LIM_MIN_UINT32(limits.maxPerStageResources) },
886 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers), LIM_MIN_UINT32(limits.maxDescriptorSetSamplers) },
887 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffers) },
888 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffersDynamic) },
889 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffers) },
890 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffersDynamic) },
891 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages), LIM_MIN_UINT32(limits.maxDescriptorSetSampledImages) },
892 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages), LIM_MIN_UINT32(limits.maxDescriptorSetStorageImages) },
893 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments), LIM_MIN_UINT32(limits.maxDescriptorSetInputAttachments) },
896 { PN(checkVulkan12Limit), PN(vulkan12Properties.maxTimelineSemaphoreValueDifference), LIM_MIN_DEVSIZE((1ull<<31) - 1) },
899 log << TestLog::Message << limits << TestLog::EndMessage;
901 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
902 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
904 if (limits.maxFramebufferWidth > limits.maxViewportDimensions[0] ||
905 limits.maxFramebufferHeight > limits.maxViewportDimensions[1])
907 log << TestLog::Message << "limit validation failed, maxFramebufferDimension of "
908 << "[" << limits.maxFramebufferWidth << ", " << limits.maxFramebufferHeight << "] "
909 << "is larger than maxViewportDimension of "
910 << "[" << limits.maxViewportDimensions[0] << ", " << limits.maxViewportDimensions[1] << "]" << TestLog::EndMessage;
914 if (limits.viewportBoundsRange[0] > float(-2 * limits.maxViewportDimensions[0]))
916 log << TestLog::Message << "limit validation failed, viewPortBoundsRange[0] of " << limits.viewportBoundsRange[0]
917 << "is larger than -2*maxViewportDimension[0] of " << -2*limits.maxViewportDimensions[0] << TestLog::EndMessage;
921 if (limits.viewportBoundsRange[1] < float(2 * limits.maxViewportDimensions[1] - 1))
923 log << TestLog::Message << "limit validation failed, viewportBoundsRange[1] of " << limits.viewportBoundsRange[1]
924 << "is less than 2*maxViewportDimension[1] of " << 2*limits.maxViewportDimensions[1] << TestLog::EndMessage;
929 return tcu::TestStatus::pass("pass");
931 return tcu::TestStatus::fail("fail");
934 void checkSupportKhrPushDescriptor (Context& context)
936 context.requireDeviceFunctionality("VK_KHR_push_descriptor");
939 tcu::TestStatus validateLimitsKhrPushDescriptor (Context& context)
941 const VkBool32 checkAlways = VK_TRUE;
942 const VkPhysicalDevicePushDescriptorPropertiesKHR& pushDescriptorPropertiesKHR = context.getPushDescriptorProperties();
943 TestLog& log = context.getTestContext().getLog();
944 bool limitsOk = true;
946 FeatureLimitTableItem featureLimitTable[] =
948 { PN(checkAlways), PN(pushDescriptorPropertiesKHR.maxPushDescriptors), LIM_MIN_UINT32(32) },
951 log << TestLog::Message << pushDescriptorPropertiesKHR << TestLog::EndMessage;
953 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
954 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
957 return tcu::TestStatus::pass("pass");
959 return tcu::TestStatus::fail("fail");
962 void checkSupportKhrMultiview (Context& context)
964 context.requireDeviceFunctionality("VK_KHR_multiview");
967 tcu::TestStatus validateLimitsKhrMultiview (Context& context)
969 const VkBool32 checkAlways = VK_TRUE;
970 const VkPhysicalDeviceMultiviewProperties& multiviewProperties = context.getMultiviewProperties();
971 TestLog& log = context.getTestContext().getLog();
972 bool limitsOk = true;
974 FeatureLimitTableItem featureLimitTable[] =
977 { PN(checkAlways), PN(multiviewProperties.maxMultiviewViewCount), LIM_MIN_UINT32(6) },
978 { PN(checkAlways), PN(multiviewProperties.maxMultiviewInstanceIndex), LIM_MIN_UINT32((1<<27) - 1) },
981 log << TestLog::Message << multiviewProperties << TestLog::EndMessage;
983 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
984 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
987 return tcu::TestStatus::pass("pass");
989 return tcu::TestStatus::fail("fail");
992 void checkSupportExtDiscardRectangles (Context& context)
994 context.requireDeviceFunctionality("VK_EXT_discard_rectangles");
997 tcu::TestStatus validateLimitsExtDiscardRectangles (Context& context)
999 const VkBool32 checkAlways = VK_TRUE;
1000 const VkPhysicalDeviceDiscardRectanglePropertiesEXT& discardRectanglePropertiesEXT = context.getDiscardRectanglePropertiesEXT();
1001 TestLog& log = context.getTestContext().getLog();
1002 bool limitsOk = true;
1004 FeatureLimitTableItem featureLimitTable[] =
1006 { PN(checkAlways), PN(discardRectanglePropertiesEXT.maxDiscardRectangles), LIM_MIN_UINT32(4) },
1009 log << TestLog::Message << discardRectanglePropertiesEXT << TestLog::EndMessage;
1011 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1012 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1015 return tcu::TestStatus::pass("pass");
1017 return tcu::TestStatus::fail("fail");
1020 void checkSupportExtSampleLocations (Context& context)
1022 context.requireDeviceFunctionality("VK_EXT_sample_locations");
1025 tcu::TestStatus validateLimitsExtSampleLocations (Context& context)
1027 const VkBool32 checkAlways = VK_TRUE;
1028 const VkPhysicalDeviceSampleLocationsPropertiesEXT& sampleLocationsPropertiesEXT = context.getSampleLocationsPropertiesEXT();
1029 TestLog& log = context.getTestContext().getLog();
1030 bool limitsOk = true;
1032 FeatureLimitTableItem featureLimitTable[] =
1034 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.sampleLocationSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_4_BIT) },
1035 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.maxSampleLocationGridSize.width), LIM_MIN_FLOAT(0.0f) },
1036 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.maxSampleLocationGridSize.height), LIM_MIN_FLOAT(0.0f) },
1037 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.sampleLocationCoordinateRange[0]), LIM_MAX_FLOAT(0.0f) },
1038 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.sampleLocationCoordinateRange[1]), LIM_MIN_FLOAT(0.9375f) },
1039 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.sampleLocationSubPixelBits), LIM_MIN_UINT32(4) },
1042 log << TestLog::Message << sampleLocationsPropertiesEXT << TestLog::EndMessage;
1044 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1045 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1048 return tcu::TestStatus::pass("pass");
1050 return tcu::TestStatus::fail("fail");
1053 void checkSupportExtExternalMemoryHost (Context& context)
1055 context.requireDeviceFunctionality("VK_EXT_external_memory_host");
1058 tcu::TestStatus validateLimitsExtExternalMemoryHost (Context& context)
1060 const VkBool32 checkAlways = VK_TRUE;
1061 const VkPhysicalDeviceExternalMemoryHostPropertiesEXT& externalMemoryHostPropertiesEXT = context.getExternalMemoryHostPropertiesEXT();
1062 TestLog& log = context.getTestContext().getLog();
1063 bool limitsOk = true;
1065 FeatureLimitTableItem featureLimitTable[] =
1067 { PN(checkAlways), PN(externalMemoryHostPropertiesEXT.minImportedHostPointerAlignment), LIM_MAX_DEVSIZE(65536) },
1070 log << TestLog::Message << externalMemoryHostPropertiesEXT << TestLog::EndMessage;
1072 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1073 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1076 return tcu::TestStatus::pass("pass");
1078 return tcu::TestStatus::fail("fail");
1081 void checkSupportExtBlendOperationAdvanced (Context& context)
1083 context.requireDeviceFunctionality("VK_EXT_blend_operation_advanced");
1086 tcu::TestStatus validateLimitsExtBlendOperationAdvanced (Context& context)
1088 const VkBool32 checkAlways = VK_TRUE;
1089 const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT& blendOperationAdvancedPropertiesEXT = context.getBlendOperationAdvancedPropertiesEXT();
1090 TestLog& log = context.getTestContext().getLog();
1091 bool limitsOk = true;
1093 FeatureLimitTableItem featureLimitTable[] =
1095 { PN(checkAlways), PN(blendOperationAdvancedPropertiesEXT.advancedBlendMaxColorAttachments), LIM_MIN_UINT32(1) },
1098 log << TestLog::Message << blendOperationAdvancedPropertiesEXT << TestLog::EndMessage;
1100 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1101 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1104 return tcu::TestStatus::pass("pass");
1106 return tcu::TestStatus::fail("fail");
1109 void checkSupportKhrMaintenance3 (Context& context)
1111 context.requireDeviceFunctionality("VK_KHR_maintenance3");
1114 void checkSupportKhrMaintenance4 (Context& context)
1116 context.requireDeviceFunctionality("VK_KHR_maintenance4");
1119 tcu::TestStatus validateLimitsKhrMaintenance3 (Context& context)
1121 const VkBool32 checkAlways = VK_TRUE;
1122 const VkPhysicalDeviceMaintenance3Properties& maintenance3Properties = context.getMaintenance3Properties();
1123 TestLog& log = context.getTestContext().getLog();
1124 bool limitsOk = true;
1126 FeatureLimitTableItem featureLimitTable[] =
1128 { PN(checkAlways), PN(maintenance3Properties.maxPerSetDescriptors), LIM_MIN_UINT32(1024) },
1129 { PN(checkAlways), PN(maintenance3Properties.maxMemoryAllocationSize), LIM_MIN_DEVSIZE(1<<30) },
1132 log << TestLog::Message << maintenance3Properties << TestLog::EndMessage;
1134 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1135 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1138 return tcu::TestStatus::pass("pass");
1140 return tcu::TestStatus::fail("fail");
1143 tcu::TestStatus validateLimitsKhrMaintenance4 (Context& context)
1145 const VkBool32 checkAlways = VK_TRUE;
1146 const VkPhysicalDeviceMaintenance4Properties& maintenance4Properties = context.getMaintenance4Properties();
1147 TestLog& log = context.getTestContext().getLog();
1148 bool limitsOk = true;
1150 FeatureLimitTableItem featureLimitTable[] =
1152 { PN(checkAlways), PN(maintenance4Properties.maxBufferSize), LIM_MIN_DEVSIZE(1<<30) },
1155 log << TestLog::Message << maintenance4Properties << TestLog::EndMessage;
1157 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1158 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1161 return tcu::TestStatus::pass("pass");
1163 return tcu::TestStatus::fail("fail");
1166 void checkSupportExtConservativeRasterization (Context& context)
1168 context.requireDeviceFunctionality("VK_EXT_conservative_rasterization");
1171 tcu::TestStatus validateLimitsExtConservativeRasterization (Context& context)
1173 const VkBool32 checkAlways = VK_TRUE;
1174 const VkPhysicalDeviceConservativeRasterizationPropertiesEXT& conservativeRasterizationPropertiesEXT = context.getConservativeRasterizationPropertiesEXT();
1175 TestLog& log = context.getTestContext().getLog();
1176 bool limitsOk = true;
1178 FeatureLimitTableItem featureLimitTable[] =
1180 { PN(checkAlways), PN(conservativeRasterizationPropertiesEXT.primitiveOverestimationSize), LIM_MIN_FLOAT(0.0f) },
1181 { PN(checkAlways), PN(conservativeRasterizationPropertiesEXT.maxExtraPrimitiveOverestimationSize), LIM_MIN_FLOAT(0.0f) },
1182 { PN(checkAlways), PN(conservativeRasterizationPropertiesEXT.extraPrimitiveOverestimationSizeGranularity), LIM_MIN_FLOAT(0.0f) },
1185 log << TestLog::Message << conservativeRasterizationPropertiesEXT << TestLog::EndMessage;
1187 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1188 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1191 return tcu::TestStatus::pass("pass");
1193 return tcu::TestStatus::fail("fail");
1196 void checkSupportExtDescriptorIndexing (Context& context)
1198 const std::string& requiredDeviceExtension = "VK_EXT_descriptor_indexing";
1199 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1200 const InstanceInterface& vki = context.getInstanceInterface();
1201 const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
1203 if (!isExtensionSupported(deviceExtensionProperties, RequiredExtension(requiredDeviceExtension)))
1204 TCU_THROW(NotSupportedError, requiredDeviceExtension + " is not supported");
1206 // Extension string is present, then extension is really supported and should have been added into chain in DefaultDevice properties and features
1209 tcu::TestStatus validateLimitsExtDescriptorIndexing (Context& context)
1211 const VkBool32 checkAlways = VK_TRUE;
1212 const VkPhysicalDeviceProperties2& properties2 = context.getDeviceProperties2();
1213 const VkPhysicalDeviceLimits& limits = properties2.properties.limits;
1214 const VkPhysicalDeviceDescriptorIndexingPropertiesEXT& descriptorIndexingPropertiesEXT = context.getDescriptorIndexingProperties();
1215 const VkPhysicalDeviceFeatures& features = context.getDeviceFeatures();
1216 const deUint32 tessellationShaderCount = (features.tessellationShader) ? 2 : 0;
1217 const deUint32 geometryShaderCount = (features.geometryShader) ? 1 : 0;
1218 const deUint32 shaderStages = 3 + tessellationShaderCount + geometryShaderCount;
1219 TestLog& log = context.getTestContext().getLog();
1220 bool limitsOk = true;
1222 FeatureLimitTableItem featureLimitTable[] =
1224 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxUpdateAfterBindDescriptorsInAllPools), LIM_MIN_UINT32(500000) },
1225 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSamplers), LIM_MIN_UINT32(500000) },
1226 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(12) },
1227 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(500000) },
1228 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSampledImages), LIM_MIN_UINT32(500000) },
1229 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageImages), LIM_MIN_UINT32(500000) },
1230 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInputAttachments), LIM_MIN_UINT32(4) },
1231 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageUpdateAfterBindResources), LIM_MIN_UINT32(500000) },
1232 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSamplers), LIM_MIN_UINT32(500000) },
1233 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(shaderStages * 12) },
1234 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), LIM_MIN_UINT32(8) },
1235 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(500000) },
1236 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), LIM_MIN_UINT32(4) },
1237 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSampledImages), LIM_MIN_UINT32(500000) },
1238 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageImages), LIM_MIN_UINT32(500000) },
1239 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindInputAttachments), LIM_MIN_UINT32(4) },
1240 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSamplers), LIM_MIN_UINT32(limits.maxPerStageDescriptorSamplers) },
1241 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(limits.maxPerStageDescriptorUniformBuffers) },
1242 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageBuffers) },
1243 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSampledImages), LIM_MIN_UINT32(limits.maxPerStageDescriptorSampledImages) },
1244 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageImages), LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageImages) },
1245 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInputAttachments), LIM_MIN_UINT32(limits.maxPerStageDescriptorInputAttachments) },
1246 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageUpdateAfterBindResources), LIM_MIN_UINT32(limits.maxPerStageResources) },
1247 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSamplers), LIM_MIN_UINT32(limits.maxDescriptorSetSamplers) },
1248 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffers) },
1249 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffersDynamic) },
1250 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffers) },
1251 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffersDynamic) },
1252 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSampledImages), LIM_MIN_UINT32(limits.maxDescriptorSetSampledImages) },
1253 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageImages), LIM_MIN_UINT32(limits.maxDescriptorSetStorageImages) },
1254 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindInputAttachments), LIM_MIN_UINT32(limits.maxDescriptorSetInputAttachments) },
1257 log << TestLog::Message << descriptorIndexingPropertiesEXT << TestLog::EndMessage;
1259 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1260 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1263 return tcu::TestStatus::pass("pass");
1265 return tcu::TestStatus::fail("fail");
1268 void checkSupportExtInlineUniformBlock (Context& context)
1270 context.requireDeviceFunctionality("VK_EXT_inline_uniform_block");
1273 tcu::TestStatus validateLimitsExtInlineUniformBlock (Context& context)
1275 const VkBool32 checkAlways = VK_TRUE;
1276 const VkPhysicalDeviceInlineUniformBlockProperties& inlineUniformBlockPropertiesEXT = context.getInlineUniformBlockProperties();
1277 TestLog& log = context.getTestContext().getLog();
1278 bool limitsOk = true;
1280 FeatureLimitTableItem featureLimitTable[] =
1282 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxInlineUniformBlockSize), LIM_MIN_UINT32(256) },
1283 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxPerStageDescriptorInlineUniformBlocks), LIM_MIN_UINT32(4) },
1284 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks), LIM_MIN_UINT32(4) },
1285 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxDescriptorSetInlineUniformBlocks), LIM_MIN_UINT32(4) },
1286 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxDescriptorSetUpdateAfterBindInlineUniformBlocks), LIM_MIN_UINT32(4) },
1289 log << TestLog::Message << inlineUniformBlockPropertiesEXT << TestLog::EndMessage;
1291 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1292 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1295 return tcu::TestStatus::pass("pass");
1297 return tcu::TestStatus::fail("fail");
1300 void checkSupportExtVertexAttributeDivisor (Context& context)
1302 context.requireDeviceFunctionality("VK_EXT_vertex_attribute_divisor");
1305 tcu::TestStatus validateLimitsExtVertexAttributeDivisor (Context& context)
1307 const VkBool32 checkAlways = VK_TRUE;
1308 const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT& vertexAttributeDivisorPropertiesEXT = context.getVertexAttributeDivisorPropertiesEXT();
1309 TestLog& log = context.getTestContext().getLog();
1310 bool limitsOk = true;
1312 FeatureLimitTableItem featureLimitTable[] =
1314 { PN(checkAlways), PN(vertexAttributeDivisorPropertiesEXT.maxVertexAttribDivisor), LIM_MIN_UINT32((1<<16) - 1) },
1317 log << TestLog::Message << vertexAttributeDivisorPropertiesEXT << TestLog::EndMessage;
1319 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1320 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1323 return tcu::TestStatus::pass("pass");
1325 return tcu::TestStatus::fail("fail");
1328 void checkSupportNvMeshShader (Context& context)
1330 const std::string& requiredDeviceExtension = "VK_NV_mesh_shader";
1331 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1332 const InstanceInterface& vki = context.getInstanceInterface();
1333 const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
1335 if (!isExtensionSupported(deviceExtensionProperties, RequiredExtension(requiredDeviceExtension)))
1336 TCU_THROW(NotSupportedError, requiredDeviceExtension + " is not supported");
1339 tcu::TestStatus validateLimitsNvMeshShader (Context& context)
1341 const VkBool32 checkAlways = VK_TRUE;
1342 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1343 const InstanceInterface& vki = context.getInstanceInterface();
1344 TestLog& log = context.getTestContext().getLog();
1345 bool limitsOk = true;
1346 VkPhysicalDeviceMeshShaderPropertiesNV meshShaderPropertiesNV = initVulkanStructure();
1347 VkPhysicalDeviceProperties2 properties2 = initVulkanStructure(&meshShaderPropertiesNV);
1349 vki.getPhysicalDeviceProperties2(physicalDevice, &properties2);
1351 FeatureLimitTableItem featureLimitTable[] =
1353 { PN(checkAlways), PN(meshShaderPropertiesNV.maxDrawMeshTasksCount), LIM_MIN_UINT32(deUint32((1ull<<16) - 1)) },
1354 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskWorkGroupInvocations), LIM_MIN_UINT32(32) },
1355 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[0]), LIM_MIN_UINT32(32) },
1356 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[1]), LIM_MIN_UINT32(1) },
1357 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[2]), LIM_MIN_UINT32(1) },
1358 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskTotalMemorySize), LIM_MIN_UINT32(16384) },
1359 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskOutputCount), LIM_MIN_UINT32((1<<16) - 1) },
1360 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshWorkGroupInvocations), LIM_MIN_UINT32(32) },
1361 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[0]), LIM_MIN_UINT32(32) },
1362 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[1]), LIM_MIN_UINT32(1) },
1363 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[2]), LIM_MIN_UINT32(1) },
1364 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshTotalMemorySize), LIM_MIN_UINT32(16384) },
1365 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshOutputVertices), LIM_MIN_UINT32(256) },
1366 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshOutputPrimitives), LIM_MIN_UINT32(256) },
1367 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshMultiviewViewCount), LIM_MIN_UINT32(1) },
1370 log << TestLog::Message << meshShaderPropertiesNV << TestLog::EndMessage;
1372 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1373 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1376 return tcu::TestStatus::pass("pass");
1378 return tcu::TestStatus::fail("fail");
1381 void checkSupportExtTransformFeedback (Context& context)
1383 context.requireDeviceFunctionality("VK_EXT_transform_feedback");
1386 tcu::TestStatus validateLimitsExtTransformFeedback (Context& context)
1388 const VkBool32 checkAlways = VK_TRUE;
1389 const VkPhysicalDeviceTransformFeedbackPropertiesEXT& transformFeedbackPropertiesEXT = context.getTransformFeedbackPropertiesEXT();
1390 TestLog& log = context.getTestContext().getLog();
1391 bool limitsOk = true;
1393 FeatureLimitTableItem featureLimitTable[] =
1395 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackStreams), LIM_MIN_UINT32(1) },
1396 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBuffers), LIM_MIN_UINT32(1) },
1397 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferSize), LIM_MIN_DEVSIZE(1ull<<27) },
1398 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackStreamDataSize), LIM_MIN_UINT32(512) },
1399 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferDataSize), LIM_MIN_UINT32(512) },
1400 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferDataStride), LIM_MIN_UINT32(512) },
1403 log << TestLog::Message << transformFeedbackPropertiesEXT << TestLog::EndMessage;
1405 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1406 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1409 return tcu::TestStatus::pass("pass");
1411 return tcu::TestStatus::fail("fail");
1414 void checkSupportExtFragmentDensityMap (Context& context)
1416 context.requireDeviceFunctionality("VK_EXT_fragment_density_map");
1419 tcu::TestStatus validateLimitsExtFragmentDensityMap (Context& context)
1421 const VkBool32 checkAlways = VK_TRUE;
1422 const VkPhysicalDeviceFragmentDensityMapPropertiesEXT& fragmentDensityMapPropertiesEXT = context.getFragmentDensityMapPropertiesEXT();
1423 TestLog& log = context.getTestContext().getLog();
1424 bool limitsOk = true;
1426 FeatureLimitTableItem featureLimitTable[] =
1428 { PN(checkAlways), PN(fragmentDensityMapPropertiesEXT.minFragmentDensityTexelSize.width), LIM_MIN_UINT32(1) },
1429 { PN(checkAlways), PN(fragmentDensityMapPropertiesEXT.minFragmentDensityTexelSize.height), LIM_MIN_UINT32(1) },
1430 { PN(checkAlways), PN(fragmentDensityMapPropertiesEXT.maxFragmentDensityTexelSize.width), LIM_MIN_UINT32(1) },
1431 { PN(checkAlways), PN(fragmentDensityMapPropertiesEXT.maxFragmentDensityTexelSize.height), LIM_MIN_UINT32(1) },
1434 log << TestLog::Message << fragmentDensityMapPropertiesEXT << TestLog::EndMessage;
1436 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1437 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1440 return tcu::TestStatus::pass("pass");
1442 return tcu::TestStatus::fail("fail");
1445 void checkSupportNvRayTracing (Context& context)
1447 const std::string& requiredDeviceExtension = "VK_NV_ray_tracing";
1448 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1449 const InstanceInterface& vki = context.getInstanceInterface();
1450 const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
1452 if (!isExtensionSupported(deviceExtensionProperties, RequiredExtension(requiredDeviceExtension)))
1453 TCU_THROW(NotSupportedError, requiredDeviceExtension + " is not supported");
1456 tcu::TestStatus validateLimitsNvRayTracing (Context& context)
1458 const VkBool32 checkAlways = VK_TRUE;
1459 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1460 const InstanceInterface& vki = context.getInstanceInterface();
1461 TestLog& log = context.getTestContext().getLog();
1462 bool limitsOk = true;
1463 VkPhysicalDeviceRayTracingPropertiesNV rayTracingPropertiesNV = initVulkanStructure();
1464 VkPhysicalDeviceProperties2 properties2 = initVulkanStructure(&rayTracingPropertiesNV);
1466 vki.getPhysicalDeviceProperties2(physicalDevice, &properties2);
1468 FeatureLimitTableItem featureLimitTable[] =
1470 { PN(checkAlways), PN(rayTracingPropertiesNV.shaderGroupHandleSize), LIM_MIN_UINT32(16) },
1471 { PN(checkAlways), PN(rayTracingPropertiesNV.maxRecursionDepth), LIM_MIN_UINT32(31) },
1472 { PN(checkAlways), PN(rayTracingPropertiesNV.shaderGroupBaseAlignment), LIM_MIN_UINT32(64) },
1473 { PN(checkAlways), PN(rayTracingPropertiesNV.maxGeometryCount), LIM_MIN_UINT32((1<<24) - 1) },
1474 { PN(checkAlways), PN(rayTracingPropertiesNV.maxInstanceCount), LIM_MIN_UINT32((1<<24) - 1) },
1475 { PN(checkAlways), PN(rayTracingPropertiesNV.maxTriangleCount), LIM_MIN_UINT32((1<<29) - 1) },
1476 { PN(checkAlways), PN(rayTracingPropertiesNV.maxDescriptorSetAccelerationStructures), LIM_MIN_UINT32(16) },
1479 log << TestLog::Message << rayTracingPropertiesNV << TestLog::EndMessage;
1481 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1482 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1485 return tcu::TestStatus::pass("pass");
1487 return tcu::TestStatus::fail("fail");
1490 void checkSupportKhrTimelineSemaphore (Context& context)
1492 context.requireDeviceFunctionality("VK_KHR_timeline_semaphore");
1495 tcu::TestStatus validateLimitsKhrTimelineSemaphore (Context& context)
1497 const VkBool32 checkAlways = VK_TRUE;
1498 const VkPhysicalDeviceTimelineSemaphorePropertiesKHR& timelineSemaphorePropertiesKHR = context.getTimelineSemaphoreProperties();
1499 bool limitsOk = true;
1500 TestLog& log = context.getTestContext().getLog();
1502 FeatureLimitTableItem featureLimitTable[] =
1504 { PN(checkAlways), PN(timelineSemaphorePropertiesKHR.maxTimelineSemaphoreValueDifference), LIM_MIN_DEVSIZE((1ull<<31) - 1) },
1507 log << TestLog::Message << timelineSemaphorePropertiesKHR << TestLog::EndMessage;
1509 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1510 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1513 return tcu::TestStatus::pass("pass");
1515 return tcu::TestStatus::fail("fail");
1518 void checkSupportExtLineRasterization (Context& context)
1520 context.requireDeviceFunctionality("VK_EXT_line_rasterization");
1523 tcu::TestStatus validateLimitsExtLineRasterization (Context& context)
1525 const VkBool32 checkAlways = VK_TRUE;
1526 const VkPhysicalDeviceLineRasterizationPropertiesEXT& lineRasterizationPropertiesEXT = context.getLineRasterizationPropertiesEXT();
1527 TestLog& log = context.getTestContext().getLog();
1528 bool limitsOk = true;
1530 FeatureLimitTableItem featureLimitTable[] =
1532 { PN(checkAlways), PN(lineRasterizationPropertiesEXT.lineSubPixelPrecisionBits), LIM_MIN_UINT32(4) },
1535 log << TestLog::Message << lineRasterizationPropertiesEXT << TestLog::EndMessage;
1537 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1538 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1541 return tcu::TestStatus::pass("pass");
1543 return tcu::TestStatus::fail("fail");
1546 tcu::TestStatus validateLimitsMaxInlineUniformTotalSize (Context& context)
1548 const VkBool32 checkAlways = VK_TRUE;
1549 const VkPhysicalDeviceVulkan13Properties& vulkan13Properties = context.getDeviceVulkan13Properties();
1550 bool limitsOk = true;
1551 TestLog& log = context.getTestContext().getLog();
1553 FeatureLimitTableItem featureLimitTable[] =
1555 { PN(checkAlways), PN(vulkan13Properties.maxInlineUniformTotalSize), LIM_MIN_DEVSIZE(256) },
1558 log << TestLog::Message << vulkan13Properties << TestLog::EndMessage;
1560 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1561 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1564 return tcu::TestStatus::pass("pass");
1566 return tcu::TestStatus::fail("fail");
1569 tcu::TestStatus validateRoadmap2022(Context& context)
1571 if (context.getUsedApiVersion() < VK_API_VERSION_1_3)
1572 TCU_THROW(NotSupportedError, "Profile not supported");
1574 const VkBool32 checkAlways = VK_TRUE;
1575 VkBool32 oneOrMoreChecksFailed = VK_FALSE;
1576 TestLog& log = context.getTestContext().getLog();
1578 auto vk10Features = context.getDeviceFeatures();
1579 auto vk11Features = context.getDeviceVulkan11Features();
1580 auto vk12Features = context.getDeviceVulkan12Features();
1582 const auto& vk10Properties = context.getDeviceProperties2();
1583 const auto& vk11Properties = context.getDeviceVulkan11Properties();
1584 const auto& vk12Properties = context.getDeviceVulkan12Properties();
1585 const auto& vk13Properties = context.getDeviceVulkan13Properties();
1586 const auto& limits = vk10Properties.properties.limits;
1588 #define ROADMAP_FEATURE_ITEM(STRUC, FIELD) { &(STRUC), &(STRUC.FIELD), #STRUC "." #FIELD }
1594 const char* fieldName;
1597 std::vector<FeatureTable> featureTable
1599 // Vulkan 1.0 Features
1600 ROADMAP_FEATURE_ITEM(vk10Features, fullDrawIndexUint32),
1601 ROADMAP_FEATURE_ITEM(vk10Features, imageCubeArray),
1602 ROADMAP_FEATURE_ITEM(vk10Features, independentBlend),
1603 ROADMAP_FEATURE_ITEM(vk10Features, sampleRateShading),
1604 ROADMAP_FEATURE_ITEM(vk10Features, drawIndirectFirstInstance),
1605 ROADMAP_FEATURE_ITEM(vk10Features, depthClamp),
1606 ROADMAP_FEATURE_ITEM(vk10Features, depthBiasClamp),
1607 ROADMAP_FEATURE_ITEM(vk10Features, samplerAnisotropy),
1608 ROADMAP_FEATURE_ITEM(vk10Features, occlusionQueryPrecise),
1609 ROADMAP_FEATURE_ITEM(vk10Features, fragmentStoresAndAtomics),
1610 ROADMAP_FEATURE_ITEM(vk10Features, shaderStorageImageExtendedFormats),
1611 ROADMAP_FEATURE_ITEM(vk10Features, shaderUniformBufferArrayDynamicIndexing),
1612 ROADMAP_FEATURE_ITEM(vk10Features, shaderSampledImageArrayDynamicIndexing),
1613 ROADMAP_FEATURE_ITEM(vk10Features, shaderStorageBufferArrayDynamicIndexing),
1614 ROADMAP_FEATURE_ITEM(vk10Features, shaderStorageImageArrayDynamicIndexing),
1616 // Vulkan 1.1 Features
1617 ROADMAP_FEATURE_ITEM(vk11Features, samplerYcbcrConversion),
1619 // Vulkan 1.2 Features
1620 ROADMAP_FEATURE_ITEM(vk12Features, samplerMirrorClampToEdge),
1621 ROADMAP_FEATURE_ITEM(vk12Features, descriptorIndexing),
1622 ROADMAP_FEATURE_ITEM(vk12Features, shaderUniformTexelBufferArrayDynamicIndexing),
1623 ROADMAP_FEATURE_ITEM(vk12Features, shaderStorageTexelBufferArrayDynamicIndexing),
1624 ROADMAP_FEATURE_ITEM(vk12Features, shaderUniformBufferArrayNonUniformIndexing),
1625 ROADMAP_FEATURE_ITEM(vk12Features, shaderSampledImageArrayNonUniformIndexing),
1626 ROADMAP_FEATURE_ITEM(vk12Features, shaderStorageBufferArrayNonUniformIndexing),
1627 ROADMAP_FEATURE_ITEM(vk12Features, shaderStorageImageArrayNonUniformIndexing),
1628 ROADMAP_FEATURE_ITEM(vk12Features, shaderUniformTexelBufferArrayNonUniformIndexing),
1629 ROADMAP_FEATURE_ITEM(vk12Features, shaderStorageTexelBufferArrayNonUniformIndexing),
1630 ROADMAP_FEATURE_ITEM(vk12Features, descriptorBindingSampledImageUpdateAfterBind),
1631 ROADMAP_FEATURE_ITEM(vk12Features, descriptorBindingStorageImageUpdateAfterBind),
1632 ROADMAP_FEATURE_ITEM(vk12Features, descriptorBindingStorageBufferUpdateAfterBind),
1633 ROADMAP_FEATURE_ITEM(vk12Features, descriptorBindingUniformTexelBufferUpdateAfterBind),
1634 ROADMAP_FEATURE_ITEM(vk12Features, descriptorBindingStorageTexelBufferUpdateAfterBind),
1635 ROADMAP_FEATURE_ITEM(vk12Features, descriptorBindingUpdateUnusedWhilePending),
1636 ROADMAP_FEATURE_ITEM(vk12Features, descriptorBindingPartiallyBound),
1637 ROADMAP_FEATURE_ITEM(vk12Features, descriptorBindingVariableDescriptorCount),
1638 ROADMAP_FEATURE_ITEM(vk12Features, runtimeDescriptorArray),
1639 ROADMAP_FEATURE_ITEM(vk12Features, scalarBlockLayout),
1642 for (FeatureTable& testedFeature : featureTable)
1644 if (!testedFeature.fieldPtr[0])
1646 log << TestLog::Message
1647 << "Feature " << testedFeature.fieldName << "is not supported"
1648 << TestLog::EndMessage;
1649 oneOrMoreChecksFailed = VK_TRUE;
1653 std::vector<FeatureLimitTableItem> featureLimitTable
1655 // Vulkan 1.0 limits
1656 { PN(checkAlways), PN(limits.maxImageDimension1D), LIM_MIN_UINT32(8192) },
1657 { PN(checkAlways), PN(limits.maxImageDimension2D), LIM_MIN_UINT32(8192) },
1658 { PN(checkAlways), PN(limits.maxImageDimensionCube), LIM_MIN_UINT32(8192) },
1659 { PN(checkAlways), PN(limits.maxImageArrayLayers), LIM_MIN_UINT32(2048) },
1660 { PN(checkAlways), PN(limits.maxUniformBufferRange), LIM_MIN_UINT32(65536) },
1661 { PN(checkAlways), PN(limits.bufferImageGranularity), LIM_MAX_DEVSIZE(4096) },
1662 { PN(checkAlways), PN(limits.maxPerStageDescriptorSamplers), LIM_MIN_UINT32(64) },
1663 { PN(checkAlways), PN(limits.maxPerStageDescriptorUniformBuffers), LIM_MIN_UINT32(15) },
1664 { PN(checkAlways), PN(limits.maxPerStageDescriptorStorageBuffers), LIM_MIN_UINT32(30) },
1665 { PN(checkAlways), PN(limits.maxPerStageDescriptorSampledImages), LIM_MIN_UINT32(200) },
1666 { PN(checkAlways), PN(limits.maxPerStageDescriptorStorageImages), LIM_MIN_UINT32(16) },
1667 { PN(checkAlways), PN(limits.maxPerStageResources), LIM_MIN_UINT32(200) },
1668 { PN(checkAlways), PN(limits.maxDescriptorSetSamplers), LIM_MIN_UINT32(576) },
1669 { PN(checkAlways), PN(limits.maxDescriptorSetUniformBuffers), LIM_MIN_UINT32(90) },
1670 { PN(checkAlways), PN(limits.maxDescriptorSetStorageBuffers), LIM_MIN_UINT32(96) },
1671 { PN(checkAlways), PN(limits.maxDescriptorSetSampledImages), LIM_MIN_UINT32(1800) },
1672 { PN(checkAlways), PN(limits.maxDescriptorSetStorageImages), LIM_MIN_UINT32(144) },
1673 { PN(checkAlways), PN(limits.maxFragmentCombinedOutputResources), LIM_MIN_UINT32(16) },
1674 { PN(checkAlways), PN(limits.maxComputeWorkGroupInvocations), LIM_MIN_UINT32(256) },
1675 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[0]), LIM_MIN_UINT32(256) },
1676 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[1]), LIM_MIN_UINT32(256) },
1677 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[2]), LIM_MIN_UINT32(64) },
1678 { PN(checkAlways), PN(limits.subPixelPrecisionBits), LIM_MIN_UINT32(8) },
1679 { PN(checkAlways), PN(limits.mipmapPrecisionBits), LIM_MIN_UINT32(6) },
1680 { PN(checkAlways), PN(limits.maxSamplerLodBias), LIM_MIN_FLOAT(14.0f) },
1681 { PN(checkAlways), PN(limits.pointSizeGranularity), LIM_MAX_FLOAT(0.125f) },
1682 { PN(checkAlways), PN(limits.lineWidthGranularity), LIM_MAX_FLOAT(0.5f) },
1683 { PN(checkAlways), PN(limits.standardSampleLocations), LIM_MIN_UINT32(1) },
1684 { PN(checkAlways), PN(limits.maxColorAttachments), LIM_MIN_UINT32(7) },
1686 // Vulkan 1.1 limits
1687 { PN(checkAlways), PN(vk11Properties.subgroupSize), LIM_MIN_UINT32(4) },
1688 { PN(checkAlways), PN(vk11Properties.subgroupSupportedStages), LIM_MIN_UINT32(VK_SHADER_STAGE_COMPUTE_BIT|VK_SHADER_STAGE_FRAGMENT_BIT) },
1689 { PN(checkAlways), PN(vk11Properties.subgroupSupportedOperations), LIM_MIN_UINT32(VK_SUBGROUP_FEATURE_BASIC_BIT|VK_SUBGROUP_FEATURE_VOTE_BIT|
1690 VK_SUBGROUP_FEATURE_ARITHMETIC_BIT|VK_SUBGROUP_FEATURE_BALLOT_BIT|
1691 VK_SUBGROUP_FEATURE_SHUFFLE_BIT|VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT|
1692 VK_SUBGROUP_FEATURE_QUAD_BIT) },
1693 // Vulkan 1.2 limits
1694 { PN(checkAlways), PN(vk12Properties.shaderSignedZeroInfNanPreserveFloat16), LIM_MIN_UINT32(1) },
1695 { PN(checkAlways), PN(vk12Properties.shaderSignedZeroInfNanPreserveFloat32), LIM_MIN_UINT32(1) },
1697 // Vulkan 1.3 limits
1698 { PN(checkAlways), PN(vk13Properties.maxSubgroupSize), LIM_MIN_UINT32(4) },
1701 for (const auto& featureLimit : featureLimitTable)
1702 oneOrMoreChecksFailed |= !validateLimit(featureLimit, log);
1704 if (!context.isDeviceFunctionalitySupported("VK_KHR_global_priority"))
1706 log << TestLog::Message
1707 << "VK_KHR_global_priority is not supported"
1708 << TestLog::EndMessage;
1709 oneOrMoreChecksFailed = VK_TRUE;
1712 if (oneOrMoreChecksFailed)
1713 TCU_THROW(NotSupportedError, "Profile not supported");
1715 return tcu::TestStatus::pass("Profile supported");
1718 void createTestDevice (Context& context, void* pNext, const char* const* ppEnabledExtensionNames, deUint32 enabledExtensionCount)
1720 const PlatformInterface& platformInterface = context.getPlatformInterface();
1721 const auto validationEnabled = context.getTestContext().getCommandLine().isValidationEnabled();
1722 const Unique<VkInstance> instance (createDefaultInstance(platformInterface, context.getUsedApiVersion()));
1723 const InstanceDriver instanceDriver (platformInterface, instance.get());
1724 const VkPhysicalDevice physicalDevice = chooseDevice(instanceDriver, instance.get(), context.getTestContext().getCommandLine());
1725 const deUint32 queueFamilyIndex = 0;
1726 const deUint32 queueCount = 1;
1727 const deUint32 queueIndex = 0;
1728 const float queuePriority = 1.0f;
1729 const vector<VkQueueFamilyProperties> queueFamilyProperties = getPhysicalDeviceQueueFamilyProperties(instanceDriver, physicalDevice);
1730 const VkDeviceQueueCreateInfo deviceQueueCreateInfo =
1732 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, // VkStructureType sType;
1733 DE_NULL, // const void* pNext;
1734 (VkDeviceQueueCreateFlags)0u, // VkDeviceQueueCreateFlags flags;
1735 queueFamilyIndex, // deUint32 queueFamilyIndex;
1736 queueCount, // deUint32 queueCount;
1737 &queuePriority, // const float* pQueuePriorities;
1739 const VkDeviceCreateInfo deviceCreateInfo =
1741 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // VkStructureType sType;
1742 pNext, // const void* pNext;
1743 (VkDeviceCreateFlags)0u, // VkDeviceCreateFlags flags;
1744 1, // deUint32 queueCreateInfoCount;
1745 &deviceQueueCreateInfo, // const VkDeviceQueueCreateInfo* pQueueCreateInfos;
1746 0, // deUint32 enabledLayerCount;
1747 DE_NULL, // const char* const* ppEnabledLayerNames;
1748 enabledExtensionCount, // deUint32 enabledExtensionCount;
1749 ppEnabledExtensionNames, // const char* const* ppEnabledExtensionNames;
1750 DE_NULL, // const VkPhysicalDeviceFeatures* pEnabledFeatures;
1752 const Unique<VkDevice> device (createCustomDevice(validationEnabled, platformInterface, *instance, instanceDriver, physicalDevice, &deviceCreateInfo));
1753 const DeviceDriver deviceDriver (platformInterface, instance.get(), device.get());
1754 const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex);
1756 VK_CHECK(deviceDriver.queueWaitIdle(queue));
1759 void cleanVulkanStruct (void* structPtr, size_t structSize)
1761 struct StructureBase
1763 VkStructureType sType;
1767 VkStructureType sType = ((StructureBase*)structPtr)->sType;
1769 deMemset(structPtr, 0, structSize);
1771 ((StructureBase*)structPtr)->sType = sType;
1774 template <deUint32 VK_API_VERSION>
1775 tcu::TestStatus featureBitInfluenceOnDeviceCreate (Context& context)
1777 #define FEATURE_TABLE_ITEM(CORE, EXT, FIELD, STR) { &(CORE), sizeof(CORE), &(CORE.FIELD), #CORE "." #FIELD, &(EXT), sizeof(EXT), &(EXT.FIELD), #EXT "." #FIELD, STR }
1778 #define DEPENDENCY_DUAL_ITEM(CORE, EXT, FIELD, PARENT) { &(CORE.FIELD), &(CORE.PARENT) }, { &(EXT.FIELD), &(EXT.PARENT) }
1779 #define DEPENDENCY_SINGLE_ITEM(CORE, FIELD, PARENT) { &(CORE.FIELD), &(CORE.PARENT) }
1781 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1782 const InstanceInterface& vki = context.getInstanceInterface();
1783 TestLog& log = context.getTestContext().getLog();
1784 const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
1786 VkPhysicalDeviceFeatures2 features2 = initVulkanStructure();
1788 VkPhysicalDeviceVulkan11Features vulkan11Features = initVulkanStructure();
1789 VkPhysicalDeviceVulkan12Features vulkan12Features = initVulkanStructure();
1790 VkPhysicalDevice16BitStorageFeaturesKHR sixteenBitStorageFeatures = initVulkanStructure();
1791 VkPhysicalDeviceMultiviewFeatures multiviewFeatures = initVulkanStructure();
1792 VkPhysicalDeviceVariablePointersFeatures variablePointersFeatures = initVulkanStructure();
1793 VkPhysicalDeviceProtectedMemoryFeatures protectedMemoryFeatures = initVulkanStructure();
1794 VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYcbcrConversionFeatures = initVulkanStructure();
1795 VkPhysicalDeviceShaderDrawParametersFeatures shaderDrawParametersFeatures = initVulkanStructure();
1796 VkPhysicalDevice8BitStorageFeatures eightBitStorageFeatures = initVulkanStructure();
1797 VkPhysicalDeviceShaderAtomicInt64Features shaderAtomicInt64Features = initVulkanStructure();
1798 VkPhysicalDeviceShaderFloat16Int8Features shaderFloat16Int8Features = initVulkanStructure();
1799 VkPhysicalDeviceDescriptorIndexingFeatures descriptorIndexingFeatures = initVulkanStructure();
1800 VkPhysicalDeviceScalarBlockLayoutFeatures scalarBlockLayoutFeatures = initVulkanStructure();
1801 VkPhysicalDeviceImagelessFramebufferFeatures imagelessFramebufferFeatures = initVulkanStructure();
1802 VkPhysicalDeviceUniformBufferStandardLayoutFeatures uniformBufferStandardLayoutFeatures = initVulkanStructure();
1803 VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures shaderSubgroupExtendedTypesFeatures = initVulkanStructure();
1804 VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures separateDepthStencilLayoutsFeatures = initVulkanStructure();
1805 VkPhysicalDeviceHostQueryResetFeatures hostQueryResetFeatures = initVulkanStructure();
1806 VkPhysicalDeviceTimelineSemaphoreFeatures timelineSemaphoreFeatures = initVulkanStructure();
1807 VkPhysicalDeviceBufferDeviceAddressFeatures bufferDeviceAddressFeatures = initVulkanStructure();
1808 VkPhysicalDeviceVulkanMemoryModelFeatures vulkanMemoryModelFeatures = initVulkanStructure();
1810 VkPhysicalDeviceVulkan13Features vulkan13Features = initVulkanStructure();
1811 VkPhysicalDeviceImageRobustnessFeatures imageRobustnessFeatures = initVulkanStructure();
1812 VkPhysicalDeviceInlineUniformBlockFeatures inlineUniformBlockFeatures = initVulkanStructure();
1813 VkPhysicalDevicePipelineCreationCacheControlFeatures pipelineCreationCacheControlFeatures = initVulkanStructure();
1814 VkPhysicalDevicePrivateDataFeatures privateDataFeatures = initVulkanStructure();
1815 VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures shaderDemoteToHelperInvocationFeatures = initVulkanStructure();
1816 VkPhysicalDeviceShaderTerminateInvocationFeatures shaderTerminateInvocationFeatures = initVulkanStructure();
1817 VkPhysicalDeviceSubgroupSizeControlFeatures subgroupSizeControlFeatures = initVulkanStructure();
1818 VkPhysicalDeviceSynchronization2Features synchronization2Features = initVulkanStructure();
1819 VkPhysicalDeviceTextureCompressionASTCHDRFeatures textureCompressionASTCHDRFeatures = initVulkanStructure();
1820 VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures zeroInitializeWorkgroupMemoryFeatures = initVulkanStructure();
1821 VkPhysicalDeviceDynamicRenderingFeatures dynamicRenderingFeatures = initVulkanStructure();
1822 VkPhysicalDeviceShaderIntegerDotProductFeatures shaderIntegerDotProductFeatures = initVulkanStructure();
1823 VkPhysicalDeviceMaintenance4Features maintenance4Features = initVulkanStructure();
1825 struct UnusedExtensionFeatures
1827 VkStructureType sType;
1829 VkBool32 descriptorIndexing;
1830 VkBool32 samplerFilterMinmax;
1831 } unusedExtensionFeatures;
1835 void* coreStructPtr;
1836 size_t coreStructSize;
1837 VkBool32* coreFieldPtr;
1838 const char* coreFieldName;
1840 size_t extStructSize;
1841 VkBool32* extFieldPtr;
1842 const char* extFieldName;
1843 const char* extString;
1845 struct FeatureDependencyTable
1847 VkBool32* featurePtr;
1848 VkBool32* dependOnPtr;
1851 std::vector<FeatureTable> featureTable;
1852 std::vector<FeatureDependencyTable> featureDependencyTable;
1854 if (VK_API_VERSION == VK_API_VERSION_1_2)
1858 FEATURE_TABLE_ITEM(vulkan11Features, sixteenBitStorageFeatures, storageBuffer16BitAccess, "VK_KHR_16bit_storage"),
1859 FEATURE_TABLE_ITEM(vulkan11Features, sixteenBitStorageFeatures, uniformAndStorageBuffer16BitAccess, "VK_KHR_16bit_storage"),
1860 FEATURE_TABLE_ITEM(vulkan11Features, sixteenBitStorageFeatures, storagePushConstant16, "VK_KHR_16bit_storage"),
1861 FEATURE_TABLE_ITEM(vulkan11Features, sixteenBitStorageFeatures, storageInputOutput16, "VK_KHR_16bit_storage"),
1862 FEATURE_TABLE_ITEM(vulkan11Features, multiviewFeatures, multiview, "VK_KHR_multiview"),
1863 FEATURE_TABLE_ITEM(vulkan11Features, multiviewFeatures, multiviewGeometryShader, "VK_KHR_multiview"),
1864 FEATURE_TABLE_ITEM(vulkan11Features, multiviewFeatures, multiviewTessellationShader, "VK_KHR_multiview"),
1865 FEATURE_TABLE_ITEM(vulkan11Features, variablePointersFeatures, variablePointersStorageBuffer, "VK_KHR_variable_pointers"),
1866 FEATURE_TABLE_ITEM(vulkan11Features, variablePointersFeatures, variablePointers, "VK_KHR_variable_pointers"),
1867 FEATURE_TABLE_ITEM(vulkan11Features, protectedMemoryFeatures, protectedMemory, DE_NULL),
1868 FEATURE_TABLE_ITEM(vulkan11Features, samplerYcbcrConversionFeatures, samplerYcbcrConversion, "VK_KHR_sampler_ycbcr_conversion"),
1869 FEATURE_TABLE_ITEM(vulkan11Features, shaderDrawParametersFeatures, shaderDrawParameters, DE_NULL),
1870 FEATURE_TABLE_ITEM(vulkan12Features, eightBitStorageFeatures, storageBuffer8BitAccess, "VK_KHR_8bit_storage"),
1871 FEATURE_TABLE_ITEM(vulkan12Features, eightBitStorageFeatures, uniformAndStorageBuffer8BitAccess, "VK_KHR_8bit_storage"),
1872 FEATURE_TABLE_ITEM(vulkan12Features, eightBitStorageFeatures, storagePushConstant8, "VK_KHR_8bit_storage"),
1873 FEATURE_TABLE_ITEM(vulkan12Features, shaderAtomicInt64Features, shaderBufferInt64Atomics, "VK_KHR_shader_atomic_int64"),
1874 FEATURE_TABLE_ITEM(vulkan12Features, shaderAtomicInt64Features, shaderSharedInt64Atomics, "VK_KHR_shader_atomic_int64"),
1875 FEATURE_TABLE_ITEM(vulkan12Features, shaderFloat16Int8Features, shaderFloat16, "VK_KHR_shader_float16_int8"),
1876 FEATURE_TABLE_ITEM(vulkan12Features, shaderFloat16Int8Features, shaderInt8, "VK_KHR_shader_float16_int8"),
1877 FEATURE_TABLE_ITEM(vulkan12Features, unusedExtensionFeatures, descriptorIndexing, DE_NULL),
1878 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderInputAttachmentArrayDynamicIndexing, "VK_EXT_descriptor_indexing"),
1879 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderUniformTexelBufferArrayDynamicIndexing, "VK_EXT_descriptor_indexing"),
1880 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderStorageTexelBufferArrayDynamicIndexing, "VK_EXT_descriptor_indexing"),
1881 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderUniformBufferArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1882 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderSampledImageArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1883 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderStorageBufferArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1884 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderStorageImageArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1885 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderInputAttachmentArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1886 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderUniformTexelBufferArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1887 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderStorageTexelBufferArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1888 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingUniformBufferUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1889 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingSampledImageUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1890 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingStorageImageUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1891 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingStorageBufferUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1892 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingUniformTexelBufferUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1893 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingStorageTexelBufferUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1894 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingUpdateUnusedWhilePending, "VK_EXT_descriptor_indexing"),
1895 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingPartiallyBound, "VK_EXT_descriptor_indexing"),
1896 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingVariableDescriptorCount, "VK_EXT_descriptor_indexing"),
1897 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, runtimeDescriptorArray, "VK_EXT_descriptor_indexing"),
1898 FEATURE_TABLE_ITEM(vulkan12Features, unusedExtensionFeatures, samplerFilterMinmax, "VK_EXT_sampler_filter_minmax"),
1899 FEATURE_TABLE_ITEM(vulkan12Features, scalarBlockLayoutFeatures, scalarBlockLayout, "VK_EXT_scalar_block_layout"),
1900 FEATURE_TABLE_ITEM(vulkan12Features, imagelessFramebufferFeatures, imagelessFramebuffer, "VK_KHR_imageless_framebuffer"),
1901 FEATURE_TABLE_ITEM(vulkan12Features, uniformBufferStandardLayoutFeatures, uniformBufferStandardLayout, "VK_KHR_uniform_buffer_standard_layout"),
1902 FEATURE_TABLE_ITEM(vulkan12Features, shaderSubgroupExtendedTypesFeatures, shaderSubgroupExtendedTypes, "VK_KHR_shader_subgroup_extended_types"),
1903 FEATURE_TABLE_ITEM(vulkan12Features, separateDepthStencilLayoutsFeatures, separateDepthStencilLayouts, "VK_KHR_separate_depth_stencil_layouts"),
1904 FEATURE_TABLE_ITEM(vulkan12Features, hostQueryResetFeatures, hostQueryReset, "VK_EXT_host_query_reset"),
1905 FEATURE_TABLE_ITEM(vulkan12Features, timelineSemaphoreFeatures, timelineSemaphore, "VK_KHR_timeline_semaphore"),
1906 FEATURE_TABLE_ITEM(vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddress, "VK_EXT_buffer_device_address"),
1907 FEATURE_TABLE_ITEM(vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddressCaptureReplay, "VK_EXT_buffer_device_address"),
1908 FEATURE_TABLE_ITEM(vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddressMultiDevice, "VK_EXT_buffer_device_address"),
1909 FEATURE_TABLE_ITEM(vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModel, "VK_KHR_vulkan_memory_model"),
1910 FEATURE_TABLE_ITEM(vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModelDeviceScope, "VK_KHR_vulkan_memory_model"),
1911 FEATURE_TABLE_ITEM(vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModelAvailabilityVisibilityChains, "VK_KHR_vulkan_memory_model"),
1914 featureDependencyTable =
1916 DEPENDENCY_DUAL_ITEM (vulkan11Features, multiviewFeatures, multiviewGeometryShader, multiview),
1917 DEPENDENCY_DUAL_ITEM (vulkan11Features, multiviewFeatures, multiviewTessellationShader, multiview),
1918 DEPENDENCY_DUAL_ITEM (vulkan11Features, variablePointersFeatures, variablePointers, variablePointersStorageBuffer),
1919 DEPENDENCY_DUAL_ITEM (vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddressCaptureReplay, bufferDeviceAddress),
1920 DEPENDENCY_DUAL_ITEM (vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddressMultiDevice, bufferDeviceAddress),
1921 DEPENDENCY_DUAL_ITEM (vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModelDeviceScope, vulkanMemoryModel),
1922 DEPENDENCY_DUAL_ITEM (vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModelAvailabilityVisibilityChains, vulkanMemoryModel),
1925 else // if (VK_API_VERSION == VK_API_VERSION_1_3)
1929 FEATURE_TABLE_ITEM(vulkan13Features, imageRobustnessFeatures, robustImageAccess, "VK_EXT_image_robustness"),
1930 FEATURE_TABLE_ITEM(vulkan13Features, inlineUniformBlockFeatures, inlineUniformBlock, "VK_EXT_inline_uniform_block"),
1931 FEATURE_TABLE_ITEM(vulkan13Features, inlineUniformBlockFeatures, descriptorBindingInlineUniformBlockUpdateAfterBind, "VK_EXT_inline_uniform_block"),
1932 FEATURE_TABLE_ITEM(vulkan13Features, pipelineCreationCacheControlFeatures, pipelineCreationCacheControl, "VK_EXT_pipeline_creation_cache_control"),
1933 FEATURE_TABLE_ITEM(vulkan13Features, privateDataFeatures, privateData, "VK_EXT_private_data"),
1934 FEATURE_TABLE_ITEM(vulkan13Features, shaderDemoteToHelperInvocationFeatures, shaderDemoteToHelperInvocation, "VK_EXT_shader_demote_to_helper_invocation"),
1935 FEATURE_TABLE_ITEM(vulkan13Features, shaderTerminateInvocationFeatures, shaderTerminateInvocation, "VK_KHR_shader_terminate_invocation"),
1936 FEATURE_TABLE_ITEM(vulkan13Features, subgroupSizeControlFeatures, subgroupSizeControl, "VK_EXT_subgroup_size_control"),
1937 FEATURE_TABLE_ITEM(vulkan13Features, subgroupSizeControlFeatures, computeFullSubgroups, "VK_EXT_subgroup_size_control"),
1938 FEATURE_TABLE_ITEM(vulkan13Features, synchronization2Features, synchronization2, "VK_KHR_synchronization2"),
1939 FEATURE_TABLE_ITEM(vulkan13Features, textureCompressionASTCHDRFeatures, textureCompressionASTC_HDR, "VK_EXT_texture_compression_astc_hdr"),
1940 FEATURE_TABLE_ITEM(vulkan13Features, zeroInitializeWorkgroupMemoryFeatures, shaderZeroInitializeWorkgroupMemory, "VK_KHR_zero_initialize_workgroup_memory"),
1941 FEATURE_TABLE_ITEM(vulkan13Features, dynamicRenderingFeatures, dynamicRendering, "VK_KHR_dynamic_rendering"),
1942 FEATURE_TABLE_ITEM(vulkan13Features, shaderIntegerDotProductFeatures, shaderIntegerDotProduct, "VK_KHR_shader_integer_dot_product"),
1943 FEATURE_TABLE_ITEM(vulkan13Features, maintenance4Features, maintenance4, "VK_KHR_maintenance4"),
1947 deMemset(&unusedExtensionFeatures, 0, sizeof(unusedExtensionFeatures));
1949 for (FeatureTable& testedFeature : featureTable)
1951 VkBool32 coreFeatureState= DE_FALSE;
1952 VkBool32 extFeatureState = DE_FALSE;
1956 void* structPtr = testedFeature.coreStructPtr;
1957 size_t structSize = testedFeature.coreStructSize;
1958 VkBool32* featurePtr = testedFeature.coreFieldPtr;
1960 if (structPtr != &unusedExtensionFeatures)
1961 features2.pNext = structPtr;
1963 vki.getPhysicalDeviceFeatures2(physicalDevice, &features2);
1965 coreFeatureState = featurePtr[0];
1967 log << TestLog::Message
1968 << "Feature status "
1969 << testedFeature.coreFieldName << "=" << coreFeatureState
1970 << TestLog::EndMessage;
1972 if (coreFeatureState)
1974 cleanVulkanStruct(structPtr, structSize);
1976 featurePtr[0] = DE_TRUE;
1978 for (FeatureDependencyTable featureDependency : featureDependencyTable)
1979 if (featureDependency.featurePtr == featurePtr)
1980 featureDependency.dependOnPtr[0] = DE_TRUE;
1982 createTestDevice(context, &features2, DE_NULL, 0u);
1988 void* structPtr = testedFeature.extStructPtr;
1989 size_t structSize = testedFeature.extStructSize;
1990 VkBool32* featurePtr = testedFeature.extFieldPtr;
1991 const char* extStringPtr = testedFeature.extString;
1993 if (structPtr != &unusedExtensionFeatures)
1994 features2.pNext = structPtr;
1996 if (extStringPtr == DE_NULL || isExtensionSupported(deviceExtensionProperties, RequiredExtension(extStringPtr)))
1998 vki.getPhysicalDeviceFeatures2(physicalDevice, &features2);
2000 extFeatureState = *featurePtr;
2002 log << TestLog::Message
2003 << "Feature status "
2004 << testedFeature.extFieldName << "=" << extFeatureState
2005 << TestLog::EndMessage;
2007 if (extFeatureState)
2009 cleanVulkanStruct(structPtr, structSize);
2011 featurePtr[0] = DE_TRUE;
2013 for (FeatureDependencyTable& featureDependency : featureDependencyTable)
2014 if (featureDependency.featurePtr == featurePtr)
2015 featureDependency.dependOnPtr[0] = DE_TRUE;
2017 createTestDevice(context, &features2, &extStringPtr, (extStringPtr == DE_NULL) ? 0u : 1u );
2023 return tcu::TestStatus::pass("pass");
2026 template<typename T>
2027 class CheckIncompleteResult
2030 virtual ~CheckIncompleteResult (void) {}
2031 virtual void getResult (Context& context, T* data) = 0;
2033 void operator() (Context& context, tcu::ResultCollector& results, const std::size_t expectedCompleteSize)
2035 if (expectedCompleteSize == 0)
2038 vector<T> outputData (expectedCompleteSize);
2039 const deUint32 usedSize = static_cast<deUint32>(expectedCompleteSize / 3);
2041 ValidateQueryBits::fillBits(outputData.begin(), outputData.end()); // unused entries should have this pattern intact
2043 m_result = VK_SUCCESS;
2045 getResult(context, &outputData[0]); // update m_count and m_result
2047 if (m_count != usedSize || m_result != VK_INCOMPLETE || !ValidateQueryBits::checkBits(outputData.begin() + m_count, outputData.end()))
2048 results.fail("Query didn't return VK_INCOMPLETE");
2056 struct CheckEnumeratePhysicalDevicesIncompleteResult : public CheckIncompleteResult<VkPhysicalDevice>
2058 void getResult (Context& context, VkPhysicalDevice* data)
2060 m_result = context.getInstanceInterface().enumeratePhysicalDevices(context.getInstance(), &m_count, data);
2064 struct CheckEnumeratePhysicalDeviceGroupsIncompleteResult : public CheckIncompleteResult<VkPhysicalDeviceGroupProperties>
2066 void getResult (Context& context, VkPhysicalDeviceGroupProperties* data)
2068 m_result = context.getInstanceInterface().enumeratePhysicalDeviceGroups(context.getInstance(), &m_count, data);
2072 struct CheckEnumerateInstanceLayerPropertiesIncompleteResult : public CheckIncompleteResult<VkLayerProperties>
2074 void getResult (Context& context, VkLayerProperties* data)
2076 m_result = context.getPlatformInterface().enumerateInstanceLayerProperties(&m_count, data);
2080 struct CheckEnumerateDeviceLayerPropertiesIncompleteResult : public CheckIncompleteResult<VkLayerProperties>
2082 void getResult (Context& context, VkLayerProperties* data)
2084 m_result = context.getInstanceInterface().enumerateDeviceLayerProperties(context.getPhysicalDevice(), &m_count, data);
2088 struct CheckEnumerateInstanceExtensionPropertiesIncompleteResult : public CheckIncompleteResult<VkExtensionProperties>
2090 CheckEnumerateInstanceExtensionPropertiesIncompleteResult (std::string layerName = std::string()) : m_layerName(layerName) {}
2092 void getResult (Context& context, VkExtensionProperties* data)
2094 const char* pLayerName = (m_layerName.length() != 0 ? m_layerName.c_str() : DE_NULL);
2095 m_result = context.getPlatformInterface().enumerateInstanceExtensionProperties(pLayerName, &m_count, data);
2099 const std::string m_layerName;
2102 struct CheckEnumerateDeviceExtensionPropertiesIncompleteResult : public CheckIncompleteResult<VkExtensionProperties>
2104 CheckEnumerateDeviceExtensionPropertiesIncompleteResult (std::string layerName = std::string()) : m_layerName(layerName) {}
2106 void getResult (Context& context, VkExtensionProperties* data)
2108 const char* pLayerName = (m_layerName.length() != 0 ? m_layerName.c_str() : DE_NULL);
2109 m_result = context.getInstanceInterface().enumerateDeviceExtensionProperties(context.getPhysicalDevice(), pLayerName, &m_count, data);
2113 const std::string m_layerName;
2116 tcu::TestStatus enumeratePhysicalDevices (Context& context)
2118 TestLog& log = context.getTestContext().getLog();
2119 tcu::ResultCollector results (log);
2120 const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(context.getInstanceInterface(), context.getInstance());
2122 log << TestLog::Integer("NumDevices", "Number of devices", "", QP_KEY_TAG_NONE, deInt64(devices.size()));
2124 for (size_t ndx = 0; ndx < devices.size(); ndx++)
2125 log << TestLog::Message << ndx << ": " << devices[ndx] << TestLog::EndMessage;
2127 CheckEnumeratePhysicalDevicesIncompleteResult()(context, results, devices.size());
2129 return tcu::TestStatus(results.getResult(), results.getMessage());
2132 tcu::TestStatus enumeratePhysicalDeviceGroups (Context& context)
2134 TestLog& log = context.getTestContext().getLog();
2135 tcu::ResultCollector results (log);
2136 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_device_group_creation"));
2137 const InstanceDriver& vki (instance.getDriver());
2138 const vector<VkPhysicalDeviceGroupProperties> devicegroups = enumeratePhysicalDeviceGroups(vki, instance);
2140 log << TestLog::Integer("NumDevices", "Number of device groups", "", QP_KEY_TAG_NONE, deInt64(devicegroups.size()));
2142 for (size_t ndx = 0; ndx < devicegroups.size(); ndx++)
2143 log << TestLog::Message << ndx << ": " << devicegroups[ndx] << TestLog::EndMessage;
2145 CheckEnumeratePhysicalDeviceGroupsIncompleteResult()(context, results, devicegroups.size());
2147 return tcu::TestStatus(results.getResult(), results.getMessage());
2150 template<typename T>
2151 void collectDuplicates (set<T>& duplicates, const vector<T>& values)
2155 for (size_t ndx = 0; ndx < values.size(); ndx++)
2157 const T& value = values[ndx];
2159 if (!seen.insert(value).second)
2160 duplicates.insert(value);
2164 void checkDuplicates (tcu::ResultCollector& results, const char* what, const vector<string>& values)
2166 set<string> duplicates;
2168 collectDuplicates(duplicates, values);
2170 for (set<string>::const_iterator iter = duplicates.begin(); iter != duplicates.end(); ++iter)
2172 std::ostringstream msg;
2173 msg << "Duplicate " << what << ": " << *iter;
2174 results.fail(msg.str());
2178 void checkDuplicateExtensions (tcu::ResultCollector& results, const vector<string>& extensions)
2180 checkDuplicates(results, "extension", extensions);
2183 void checkDuplicateLayers (tcu::ResultCollector& results, const vector<string>& layers)
2185 checkDuplicates(results, "layer", layers);
2188 void checkKhrExtensions (tcu::ResultCollector& results,
2189 const vector<string>& extensions,
2190 const int numAllowedKhrExtensions,
2191 const char* const* allowedKhrExtensions)
2193 const set<string> allowedExtSet (allowedKhrExtensions, allowedKhrExtensions+numAllowedKhrExtensions);
2195 for (vector<string>::const_iterator extIter = extensions.begin(); extIter != extensions.end(); ++extIter)
2197 // Only Khronos-controlled extensions are checked
2198 if (de::beginsWith(*extIter, "VK_KHR_") &&
2199 !de::contains(allowedExtSet, *extIter))
2201 results.fail("Unknown extension " + *extIter);
2206 void checkInstanceExtensions (tcu::ResultCollector& results, const vector<string>& extensions)
2208 #include "vkInstanceExtensions.inl"
2210 checkKhrExtensions(results, extensions, DE_LENGTH_OF_ARRAY(s_allowedInstanceKhrExtensions), s_allowedInstanceKhrExtensions);
2211 checkDuplicateExtensions(results, extensions);
2214 void checkDeviceExtensions (tcu::ResultCollector& results, const vector<string>& extensions)
2216 #include "vkDeviceExtensions.inl"
2218 checkKhrExtensions(results, extensions, DE_LENGTH_OF_ARRAY(s_allowedDeviceKhrExtensions), s_allowedDeviceKhrExtensions);
2219 checkDuplicateExtensions(results, extensions);
2222 void checkInstanceExtensionDependencies(tcu::ResultCollector& results,
2223 int dependencyLength,
2224 const std::tuple<deUint32, deUint32, const char*, const char*>* dependencies,
2225 deUint32 versionMajor,
2226 deUint32 versionMinor,
2227 const vector<VkExtensionProperties>& extensionProperties)
2229 for (int ndx = 0; ndx < dependencyLength; ndx++)
2231 deUint32 currentVersionMajor, currentVersionMinor;
2232 const char* extensionFirst;
2233 const char* extensionSecond;
2234 std::tie(currentVersionMajor, currentVersionMinor, extensionFirst, extensionSecond) = dependencies[ndx];
2235 if (currentVersionMajor != versionMajor || currentVersionMinor != versionMinor)
2237 if (isExtensionSupported(extensionProperties, RequiredExtension(extensionFirst)) &&
2238 !isExtensionSupported(extensionProperties, RequiredExtension(extensionSecond)))
2240 results.fail("Extension " + string(extensionFirst) + " is missing dependency: " + string(extensionSecond));
2245 void checkDeviceExtensionDependencies(tcu::ResultCollector& results,
2246 int dependencyLength,
2247 const std::tuple<deUint32, deUint32, const char*, const char*>* dependencies,
2248 deUint32 versionMajor,
2249 deUint32 versionMinor,
2250 const vector<VkExtensionProperties>& instanceExtensionProperties,
2251 const vector<VkExtensionProperties>& deviceExtensionProperties)
2253 for (int ndx = 0; ndx < dependencyLength; ndx++)
2255 deUint32 currentVersionMajor, currentVersionMinor;
2256 const char* extensionFirst;
2257 const char* extensionSecond;
2258 std::tie(currentVersionMajor, currentVersionMinor, extensionFirst, extensionSecond) = dependencies[ndx];
2259 if (currentVersionMajor != versionMajor || currentVersionMinor != versionMinor)
2261 if (isExtensionSupported(deviceExtensionProperties, RequiredExtension(extensionFirst)) &&
2262 !isExtensionSupported(deviceExtensionProperties, RequiredExtension(extensionSecond)) &&
2263 !isExtensionSupported(instanceExtensionProperties, RequiredExtension(extensionSecond)))
2265 results.fail("Extension " + string(extensionFirst) + " is missing dependency: " + string(extensionSecond));
2270 tcu::TestStatus enumerateInstanceLayers (Context& context)
2272 TestLog& log = context.getTestContext().getLog();
2273 tcu::ResultCollector results (log);
2274 const vector<VkLayerProperties> properties = enumerateInstanceLayerProperties(context.getPlatformInterface());
2275 vector<string> layerNames;
2277 for (size_t ndx = 0; ndx < properties.size(); ndx++)
2279 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
2281 layerNames.push_back(properties[ndx].layerName);
2284 checkDuplicateLayers(results, layerNames);
2285 CheckEnumerateInstanceLayerPropertiesIncompleteResult()(context, results, layerNames.size());
2287 return tcu::TestStatus(results.getResult(), results.getMessage());
2290 tcu::TestStatus enumerateInstanceExtensions (Context& context)
2292 TestLog& log = context.getTestContext().getLog();
2293 tcu::ResultCollector results (log);
2296 const ScopedLogSection section (log, "Global", "Global Extensions");
2297 const vector<VkExtensionProperties> properties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
2298 vector<string> extensionNames;
2300 for (size_t ndx = 0; ndx < properties.size(); ndx++)
2302 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
2304 extensionNames.push_back(properties[ndx].extensionName);
2307 checkInstanceExtensions(results, extensionNames);
2308 CheckEnumerateInstanceExtensionPropertiesIncompleteResult()(context, results, properties.size());
2310 for (const auto& version : releasedApiVersions)
2312 deUint32 versionMajor, versionMinor;
2313 std::tie(std::ignore, versionMajor, versionMinor) = version;
2314 if (context.contextSupports(vk::ApiVersion(versionMajor, versionMinor, 0)))
2316 checkInstanceExtensionDependencies(results,
2317 DE_LENGTH_OF_ARRAY(instanceExtensionDependencies),
2318 instanceExtensionDependencies,
2328 const vector<VkLayerProperties> layers = enumerateInstanceLayerProperties(context.getPlatformInterface());
2330 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
2332 const ScopedLogSection section (log, layer->layerName, string("Layer: ") + layer->layerName);
2333 const vector<VkExtensionProperties> properties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), layer->layerName);
2334 vector<string> extensionNames;
2336 for (size_t extNdx = 0; extNdx < properties.size(); extNdx++)
2338 log << TestLog::Message << extNdx << ": " << properties[extNdx] << TestLog::EndMessage;
2340 extensionNames.push_back(properties[extNdx].extensionName);
2343 checkInstanceExtensions(results, extensionNames);
2344 CheckEnumerateInstanceExtensionPropertiesIncompleteResult(layer->layerName)(context, results, properties.size());
2348 return tcu::TestStatus(results.getResult(), results.getMessage());
2351 tcu::TestStatus testNoKhxExtensions (Context& context)
2353 VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
2354 const PlatformInterface& vkp = context.getPlatformInterface();
2355 const InstanceInterface& vki = context.getInstanceInterface();
2357 tcu::ResultCollector results(context.getTestContext().getLog());
2358 bool testSucceeded = true;
2359 deUint32 instanceExtensionsCount;
2360 deUint32 deviceExtensionsCount;
2362 // grab number of instance and device extensions
2363 vkp.enumerateInstanceExtensionProperties(DE_NULL, &instanceExtensionsCount, DE_NULL);
2364 vki.enumerateDeviceExtensionProperties(physicalDevice, DE_NULL, &deviceExtensionsCount, DE_NULL);
2365 vector<VkExtensionProperties> extensionsProperties(instanceExtensionsCount + deviceExtensionsCount);
2367 // grab instance and device extensions into single vector
2368 if (instanceExtensionsCount)
2369 vkp.enumerateInstanceExtensionProperties(DE_NULL, &instanceExtensionsCount, &extensionsProperties[0]);
2370 if (deviceExtensionsCount)
2371 vki.enumerateDeviceExtensionProperties(physicalDevice, DE_NULL, &deviceExtensionsCount, &extensionsProperties[instanceExtensionsCount]);
2373 // iterate over all extensions and verify their names
2374 vector<VkExtensionProperties>::const_iterator extension = extensionsProperties.begin();
2375 while (extension != extensionsProperties.end())
2377 // KHX author ID is no longer used, all KHX extensions have been promoted to KHR status
2378 std::string extensionName(extension->extensionName);
2379 bool caseFailed = de::beginsWith(extensionName, "VK_KHX_");
2382 results.fail("Invalid extension name " + extensionName);
2383 testSucceeded = false;
2389 return tcu::TestStatus::pass("No extensions begining with \"VK_KHX\"");
2390 return tcu::TestStatus::fail("One or more extensions begins with \"VK_KHX\"");
2393 tcu::TestStatus enumerateDeviceLayers (Context& context)
2395 TestLog& log = context.getTestContext().getLog();
2396 tcu::ResultCollector results (log);
2397 const vector<VkLayerProperties> properties = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
2398 vector<string> layerNames;
2400 for (size_t ndx = 0; ndx < properties.size(); ndx++)
2402 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
2404 layerNames.push_back(properties[ndx].layerName);
2407 checkDuplicateLayers(results, layerNames);
2408 CheckEnumerateDeviceLayerPropertiesIncompleteResult()(context, results, layerNames.size());
2410 return tcu::TestStatus(results.getResult(), results.getMessage());
2413 tcu::TestStatus enumerateDeviceExtensions (Context& context)
2415 TestLog& log = context.getTestContext().getLog();
2416 tcu::ResultCollector results (log);
2419 const ScopedLogSection section (log, "Global", "Global Extensions");
2420 const vector<VkExtensionProperties> instanceExtensionProperties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
2421 const vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
2422 vector<string> deviceExtensionNames;
2424 for (size_t ndx = 0; ndx < deviceExtensionProperties.size(); ndx++)
2426 log << TestLog::Message << ndx << ": " << deviceExtensionProperties[ndx] << TestLog::EndMessage;
2428 deviceExtensionNames.push_back(deviceExtensionProperties[ndx].extensionName);
2431 checkDeviceExtensions(results, deviceExtensionNames);
2432 CheckEnumerateDeviceExtensionPropertiesIncompleteResult()(context, results, deviceExtensionProperties.size());
2434 for (const auto& version : releasedApiVersions)
2436 deUint32 versionMajor, versionMinor;
2437 std::tie(std::ignore, versionMajor, versionMinor) = version;
2438 if (context.contextSupports(vk::ApiVersion(versionMajor, versionMinor, 0)))
2440 checkDeviceExtensionDependencies(results,
2441 DE_LENGTH_OF_ARRAY(deviceExtensionDependencies),
2442 deviceExtensionDependencies,
2445 instanceExtensionProperties,
2446 deviceExtensionProperties);
2453 const vector<VkLayerProperties> layers = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
2455 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
2457 const ScopedLogSection section (log, layer->layerName, string("Layer: ") + layer->layerName);
2458 const vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), layer->layerName);
2459 vector<string> extensionNames;
2461 for (size_t extNdx = 0; extNdx < properties.size(); extNdx++)
2463 log << TestLog::Message << extNdx << ": " << properties[extNdx] << TestLog::EndMessage;
2466 extensionNames.push_back(properties[extNdx].extensionName);
2469 checkDeviceExtensions(results, extensionNames);
2470 CheckEnumerateDeviceExtensionPropertiesIncompleteResult(layer->layerName)(context, results, properties.size());
2474 return tcu::TestStatus(results.getResult(), results.getMessage());
2477 tcu::TestStatus extensionCoreVersions (Context& context)
2481 const char* extName;
2483 auto& log = context.getTestContext().getLog();
2484 tcu::ResultCollector results (log);
2486 const auto instanceExtensionProperties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
2487 const auto deviceExtensionProperties = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
2489 for (const auto& majorMinorName : extensionRequiredCoreVersion)
2491 std::tie(major, minor, extName) = majorMinorName;
2492 const RequiredExtension reqExt (extName);
2494 if ((isExtensionSupported(instanceExtensionProperties, reqExt) || isExtensionSupported(deviceExtensionProperties, reqExt)) &&
2495 !context.contextSupports(vk::ApiVersion(major, minor, 0u)))
2497 results.fail("Required core version for " + std::string(extName) + " not met (" + de::toString(major) + "." + de::toString(minor) + ")");
2501 return tcu::TestStatus(results.getResult(), results.getMessage());
2504 #define VK_SIZE_OF(STRUCT, MEMBER) (sizeof(((STRUCT*)0)->MEMBER))
2505 #define OFFSET_TABLE_ENTRY(STRUCT, MEMBER) { (size_t)DE_OFFSET_OF(STRUCT, MEMBER), VK_SIZE_OF(STRUCT, MEMBER) }
2507 tcu::TestStatus deviceFeatures (Context& context)
2509 using namespace ValidateQueryBits;
2511 TestLog& log = context.getTestContext().getLog();
2512 VkPhysicalDeviceFeatures* features;
2513 deUint8 buffer[sizeof(VkPhysicalDeviceFeatures) + GUARD_SIZE];
2515 const QueryMemberTableEntry featureOffsetTable[] =
2517 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, robustBufferAccess),
2518 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, fullDrawIndexUint32),
2519 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, imageCubeArray),
2520 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, independentBlend),
2521 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, geometryShader),
2522 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, tessellationShader),
2523 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sampleRateShading),
2524 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, dualSrcBlend),
2525 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, logicOp),
2526 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, multiDrawIndirect),
2527 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, drawIndirectFirstInstance),
2528 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, depthClamp),
2529 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, depthBiasClamp),
2530 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, fillModeNonSolid),
2531 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, depthBounds),
2532 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, wideLines),
2533 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, largePoints),
2534 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, alphaToOne),
2535 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, multiViewport),
2536 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, samplerAnisotropy),
2537 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, textureCompressionETC2),
2538 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, textureCompressionASTC_LDR),
2539 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, textureCompressionBC),
2540 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, occlusionQueryPrecise),
2541 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, pipelineStatisticsQuery),
2542 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, vertexPipelineStoresAndAtomics),
2543 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, fragmentStoresAndAtomics),
2544 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderTessellationAndGeometryPointSize),
2545 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderImageGatherExtended),
2546 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageExtendedFormats),
2547 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageMultisample),
2548 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageReadWithoutFormat),
2549 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageWriteWithoutFormat),
2550 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderUniformBufferArrayDynamicIndexing),
2551 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderSampledImageArrayDynamicIndexing),
2552 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageBufferArrayDynamicIndexing),
2553 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageArrayDynamicIndexing),
2554 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderClipDistance),
2555 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderCullDistance),
2556 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderFloat64),
2557 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderInt64),
2558 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderInt16),
2559 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderResourceResidency),
2560 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderResourceMinLod),
2561 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseBinding),
2562 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidencyBuffer),
2563 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidencyImage2D),
2564 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidencyImage3D),
2565 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidency2Samples),
2566 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidency4Samples),
2567 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidency8Samples),
2568 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidency16Samples),
2569 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidencyAliased),
2570 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, variableMultisampleRate),
2571 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, inheritedQueries),
2575 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
2576 features = reinterpret_cast<VkPhysicalDeviceFeatures*>(buffer);
2578 context.getInstanceInterface().getPhysicalDeviceFeatures(context.getPhysicalDevice(), features);
2580 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
2581 << TestLog::Message << *features << TestLog::EndMessage;
2583 // Requirements and dependencies
2585 if (!features->robustBufferAccess)
2586 return tcu::TestStatus::fail("robustBufferAccess is not supported");
2588 // multiViewport requires MultiViewport (SPIR-V capability) support, which depends on Geometry
2589 if (features->multiViewport && !features->geometryShader)
2590 return tcu::TestStatus::fail("multiViewport is supported but geometryShader is not");
2593 for (int ndx = 0; ndx < GUARD_SIZE; ndx++)
2595 if (buffer[ndx + sizeof(VkPhysicalDeviceFeatures)] != GUARD_VALUE)
2597 log << TestLog::Message << "deviceFeatures - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
2598 return tcu::TestStatus::fail("deviceFeatures buffer overflow");
2602 if (!validateInitComplete(context.getPhysicalDevice(), &InstanceInterface::getPhysicalDeviceFeatures, context.getInstanceInterface(), featureOffsetTable))
2604 log << TestLog::Message << "deviceFeatures - VkPhysicalDeviceFeatures not completely initialized" << TestLog::EndMessage;
2605 return tcu::TestStatus::fail("deviceFeatures incomplete initialization");
2608 return tcu::TestStatus::pass("Query succeeded");
2611 static const ValidateQueryBits::QueryMemberTableEntry s_physicalDevicePropertiesOffsetTable[] =
2613 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, apiVersion),
2614 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, driverVersion),
2615 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, vendorID),
2616 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, deviceID),
2617 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, deviceType),
2618 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, pipelineCacheUUID),
2619 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension1D),
2620 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension2D),
2621 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension3D),
2622 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimensionCube),
2623 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageArrayLayers),
2624 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelBufferElements),
2625 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxUniformBufferRange),
2626 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxStorageBufferRange),
2627 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPushConstantsSize),
2628 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxMemoryAllocationCount),
2629 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerAllocationCount),
2630 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.bufferImageGranularity),
2631 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sparseAddressSpaceSize),
2632 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxBoundDescriptorSets),
2633 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorSamplers),
2634 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorUniformBuffers),
2635 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorStorageBuffers),
2636 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorSampledImages),
2637 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorStorageImages),
2638 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorInputAttachments),
2639 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageResources),
2640 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetSamplers),
2641 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetUniformBuffers),
2642 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetUniformBuffersDynamic),
2643 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageBuffers),
2644 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageBuffersDynamic),
2645 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetSampledImages),
2646 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageImages),
2647 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetInputAttachments),
2648 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputAttributes),
2649 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputBindings),
2650 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputAttributeOffset),
2651 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputBindingStride),
2652 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexOutputComponents),
2653 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationGenerationLevel),
2654 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationPatchSize),
2655 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerVertexInputComponents),
2656 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerVertexOutputComponents),
2657 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerPatchOutputComponents),
2658 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlTotalOutputComponents),
2659 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationEvaluationInputComponents),
2660 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationEvaluationOutputComponents),
2661 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryShaderInvocations),
2662 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryInputComponents),
2663 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryOutputComponents),
2664 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryOutputVertices),
2665 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryTotalOutputComponents),
2666 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentInputComponents),
2667 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentOutputAttachments),
2668 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentDualSrcAttachments),
2669 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentCombinedOutputResources),
2670 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeSharedMemorySize),
2671 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupCount[3]),
2672 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupInvocations),
2673 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupSize[3]),
2674 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subPixelPrecisionBits),
2675 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subTexelPrecisionBits),
2676 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.mipmapPrecisionBits),
2677 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDrawIndexedIndexValue),
2678 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDrawIndirectCount),
2679 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerLodBias),
2680 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerAnisotropy),
2681 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxViewports),
2682 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxViewportDimensions[2]),
2683 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.viewportBoundsRange[2]),
2684 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.viewportSubPixelBits),
2685 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minMemoryMapAlignment),
2686 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelBufferOffsetAlignment),
2687 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minUniformBufferOffsetAlignment),
2688 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minStorageBufferOffsetAlignment),
2689 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelOffset),
2690 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelOffset),
2691 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelGatherOffset),
2692 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelGatherOffset),
2693 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minInterpolationOffset),
2694 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxInterpolationOffset),
2695 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subPixelInterpolationOffsetBits),
2696 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferWidth),
2697 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferHeight),
2698 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferLayers),
2699 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferColorSampleCounts),
2700 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferDepthSampleCounts),
2701 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferStencilSampleCounts),
2702 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferNoAttachmentsSampleCounts),
2703 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxColorAttachments),
2704 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageColorSampleCounts),
2705 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageIntegerSampleCounts),
2706 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageDepthSampleCounts),
2707 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageStencilSampleCounts),
2708 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.storageImageSampleCounts),
2709 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSampleMaskWords),
2710 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.timestampComputeAndGraphics),
2711 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.timestampPeriod),
2712 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxClipDistances),
2713 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxCullDistances),
2714 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxCombinedClipAndCullDistances),
2715 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.discreteQueuePriorities),
2716 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.pointSizeRange[2]),
2717 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.lineWidthRange[2]),
2718 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.pointSizeGranularity),
2719 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.lineWidthGranularity),
2720 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.strictLines),
2721 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.standardSampleLocations),
2722 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.optimalBufferCopyOffsetAlignment),
2723 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.optimalBufferCopyRowPitchAlignment),
2724 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.nonCoherentAtomSize),
2725 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard2DBlockShape),
2726 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard2DMultisampleBlockShape),
2727 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard3DBlockShape),
2728 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyAlignedMipSize),
2729 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyNonResidentStrict),
2733 tcu::TestStatus deviceProperties (Context& context)
2735 using namespace ValidateQueryBits;
2737 TestLog& log = context.getTestContext().getLog();
2738 VkPhysicalDeviceProperties* props;
2739 VkPhysicalDeviceFeatures features;
2740 deUint8 buffer[sizeof(VkPhysicalDeviceProperties) + GUARD_SIZE];
2742 props = reinterpret_cast<VkPhysicalDeviceProperties*>(buffer);
2743 deMemset(props, GUARD_VALUE, sizeof(buffer));
2745 context.getInstanceInterface().getPhysicalDeviceProperties(context.getPhysicalDevice(), props);
2746 context.getInstanceInterface().getPhysicalDeviceFeatures(context.getPhysicalDevice(), &features);
2748 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
2749 << TestLog::Message << *props << TestLog::EndMessage;
2751 if (!validateFeatureLimits(props, &features, log))
2752 return tcu::TestStatus::fail("deviceProperties - feature limits failed");
2754 for (int ndx = 0; ndx < GUARD_SIZE; ndx++)
2756 if (buffer[ndx + sizeof(VkPhysicalDeviceProperties)] != GUARD_VALUE)
2758 log << TestLog::Message << "deviceProperties - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
2759 return tcu::TestStatus::fail("deviceProperties buffer overflow");
2763 if (!validateInitComplete(context.getPhysicalDevice(), &InstanceInterface::getPhysicalDeviceProperties, context.getInstanceInterface(), s_physicalDevicePropertiesOffsetTable))
2765 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceProperties not completely initialized" << TestLog::EndMessage;
2766 return tcu::TestStatus::fail("deviceProperties incomplete initialization");
2769 // Check if deviceName string is properly terminated.
2770 if (deStrnlen(props->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE) == VK_MAX_PHYSICAL_DEVICE_NAME_SIZE)
2772 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceProperties deviceName not properly initialized" << TestLog::EndMessage;
2773 return tcu::TestStatus::fail("deviceProperties incomplete initialization");
2777 const ApiVersion deviceVersion = unpackVersion(props->apiVersion);
2778 const ApiVersion deqpVersion = unpackVersion(VK_API_VERSION_1_3);
2780 if (deviceVersion.majorNum != deqpVersion.majorNum)
2782 log << TestLog::Message << "deviceProperties - API Major Version " << deviceVersion.majorNum << " is not valid" << TestLog::EndMessage;
2783 return tcu::TestStatus::fail("deviceProperties apiVersion not valid");
2786 if (deviceVersion.minorNum > deqpVersion.minorNum)
2788 log << TestLog::Message << "deviceProperties - API Minor Version " << deviceVersion.minorNum << " is not valid for this version of dEQP" << TestLog::EndMessage;
2789 return tcu::TestStatus::fail("deviceProperties apiVersion not valid");
2793 return tcu::TestStatus::pass("DeviceProperites query succeeded");
2796 tcu::TestStatus deviceQueueFamilyProperties (Context& context)
2798 TestLog& log = context.getTestContext().getLog();
2799 const vector<VkQueueFamilyProperties> queueProperties = getPhysicalDeviceQueueFamilyProperties(context.getInstanceInterface(), context.getPhysicalDevice());
2801 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage;
2803 for (size_t queueNdx = 0; queueNdx < queueProperties.size(); queueNdx++)
2804 log << TestLog::Message << queueNdx << ": " << queueProperties[queueNdx] << TestLog::EndMessage;
2806 return tcu::TestStatus::pass("Querying queue properties succeeded");
2809 tcu::TestStatus deviceMemoryProperties (Context& context)
2811 TestLog& log = context.getTestContext().getLog();
2812 VkPhysicalDeviceMemoryProperties* memProps;
2813 deUint8 buffer[sizeof(VkPhysicalDeviceMemoryProperties) + GUARD_SIZE];
2815 memProps = reinterpret_cast<VkPhysicalDeviceMemoryProperties*>(buffer);
2816 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
2818 context.getInstanceInterface().getPhysicalDeviceMemoryProperties(context.getPhysicalDevice(), memProps);
2820 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
2821 << TestLog::Message << *memProps << TestLog::EndMessage;
2823 for (deInt32 ndx = 0; ndx < GUARD_SIZE; ndx++)
2825 if (buffer[ndx + sizeof(VkPhysicalDeviceMemoryProperties)] != GUARD_VALUE)
2827 log << TestLog::Message << "deviceMemoryProperties - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
2828 return tcu::TestStatus::fail("deviceMemoryProperties buffer overflow");
2832 if (memProps->memoryHeapCount >= VK_MAX_MEMORY_HEAPS)
2834 log << TestLog::Message << "deviceMemoryProperties - HeapCount larger than " << (deUint32)VK_MAX_MEMORY_HEAPS << TestLog::EndMessage;
2835 return tcu::TestStatus::fail("deviceMemoryProperties HeapCount too large");
2838 if (memProps->memoryHeapCount == 1)
2840 if ((memProps->memoryHeaps[0].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) == 0)
2842 log << TestLog::Message << "deviceMemoryProperties - Single heap is not marked DEVICE_LOCAL" << TestLog::EndMessage;
2843 return tcu::TestStatus::fail("deviceMemoryProperties invalid HeapFlags");
2847 const VkMemoryPropertyFlags validPropertyFlags[] =
2850 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
2851 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
2852 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
2853 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
2854 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
2855 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
2856 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
2857 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
2860 const VkMemoryPropertyFlags requiredPropertyFlags[] =
2862 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
2865 bool requiredFlagsFound[DE_LENGTH_OF_ARRAY(requiredPropertyFlags)];
2866 std::fill(DE_ARRAY_BEGIN(requiredFlagsFound), DE_ARRAY_END(requiredFlagsFound), false);
2868 for (deUint32 memoryNdx = 0; memoryNdx < memProps->memoryTypeCount; memoryNdx++)
2870 bool validPropTypeFound = false;
2872 if (memProps->memoryTypes[memoryNdx].heapIndex >= memProps->memoryHeapCount)
2874 log << TestLog::Message << "deviceMemoryProperties - heapIndex " << memProps->memoryTypes[memoryNdx].heapIndex << " larger than heapCount" << TestLog::EndMessage;
2875 return tcu::TestStatus::fail("deviceMemoryProperties - invalid heapIndex");
2878 const VkMemoryPropertyFlags bitsToCheck = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT|VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT;
2880 for (const VkMemoryPropertyFlags* requiredFlagsIterator = DE_ARRAY_BEGIN(requiredPropertyFlags); requiredFlagsIterator != DE_ARRAY_END(requiredPropertyFlags); requiredFlagsIterator++)
2881 if ((memProps->memoryTypes[memoryNdx].propertyFlags & *requiredFlagsIterator) == *requiredFlagsIterator)
2882 requiredFlagsFound[requiredFlagsIterator - DE_ARRAY_BEGIN(requiredPropertyFlags)] = true;
2884 if (de::contains(DE_ARRAY_BEGIN(validPropertyFlags), DE_ARRAY_END(validPropertyFlags), memProps->memoryTypes[memoryNdx].propertyFlags & bitsToCheck))
2885 validPropTypeFound = true;
2887 if (!validPropTypeFound)
2889 log << TestLog::Message << "deviceMemoryProperties - propertyFlags "
2890 << memProps->memoryTypes[memoryNdx].propertyFlags << " not valid" << TestLog::EndMessage;
2891 return tcu::TestStatus::fail("deviceMemoryProperties propertyFlags not valid");
2894 if (memProps->memoryTypes[memoryNdx].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
2896 if ((memProps->memoryHeaps[memProps->memoryTypes[memoryNdx].heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) == 0)
2898 log << TestLog::Message << "deviceMemoryProperties - DEVICE_LOCAL memory type references heap which is not DEVICE_LOCAL" << TestLog::EndMessage;
2899 return tcu::TestStatus::fail("deviceMemoryProperties inconsistent memoryType and HeapFlags");
2904 if (memProps->memoryHeaps[memProps->memoryTypes[memoryNdx].heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT)
2906 log << TestLog::Message << "deviceMemoryProperties - non-DEVICE_LOCAL memory type references heap with is DEVICE_LOCAL" << TestLog::EndMessage;
2907 return tcu::TestStatus::fail("deviceMemoryProperties inconsistent memoryType and HeapFlags");
2912 bool* requiredFlagsFoundIterator = std::find(DE_ARRAY_BEGIN(requiredFlagsFound), DE_ARRAY_END(requiredFlagsFound), false);
2913 if (requiredFlagsFoundIterator != DE_ARRAY_END(requiredFlagsFound))
2915 DE_ASSERT(requiredFlagsFoundIterator - DE_ARRAY_BEGIN(requiredFlagsFound) <= DE_LENGTH_OF_ARRAY(requiredPropertyFlags));
2916 log << TestLog::Message << "deviceMemoryProperties - required property flags "
2917 << getMemoryPropertyFlagsStr(requiredPropertyFlags[requiredFlagsFoundIterator - DE_ARRAY_BEGIN(requiredFlagsFound)]) << " not found" << TestLog::EndMessage;
2919 return tcu::TestStatus::fail("deviceMemoryProperties propertyFlags not valid");
2922 return tcu::TestStatus::pass("Querying memory properties succeeded");
2925 tcu::TestStatus deviceGroupPeerMemoryFeatures (Context& context)
2927 TestLog& log = context.getTestContext().getLog();
2928 const PlatformInterface& vkp = context.getPlatformInterface();
2929 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_device_group_creation"));
2930 const InstanceDriver& vki (instance.getDriver());
2931 const tcu::CommandLine& cmdLine = context.getTestContext().getCommandLine();
2932 const deUint32 devGroupIdx = cmdLine.getVKDeviceGroupId() - 1;
2933 const deUint32 deviceIdx = vk::chooseDeviceIndex(context.getInstanceInterface(), instance, cmdLine);
2934 const float queuePriority = 1.0f;
2935 VkPhysicalDeviceMemoryProperties memProps;
2936 VkPeerMemoryFeatureFlags* peerMemFeatures;
2937 deUint8 buffer [sizeof(VkPeerMemoryFeatureFlags) + GUARD_SIZE];
2938 deUint32 numPhysicalDevices = 0;
2939 deUint32 queueFamilyIndex = 0;
2941 const vector<VkPhysicalDeviceGroupProperties> deviceGroupProps = enumeratePhysicalDeviceGroups(vki, instance);
2942 std::vector<const char*> deviceExtensions;
2943 deviceExtensions.push_back("VK_KHR_device_group");
2945 if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_device_group"))
2946 deviceExtensions.push_back("VK_KHR_device_group");
2948 const std::vector<VkQueueFamilyProperties> queueProps = getPhysicalDeviceQueueFamilyProperties(vki, deviceGroupProps[devGroupIdx].physicalDevices[deviceIdx]);
2949 for (size_t queueNdx = 0; queueNdx < queueProps.size(); queueNdx++)
2951 if (queueProps[queueNdx].queueFlags & VK_QUEUE_GRAPHICS_BIT)
2952 queueFamilyIndex = (deUint32)queueNdx;
2954 const VkDeviceQueueCreateInfo deviceQueueCreateInfo =
2956 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, //type
2958 (VkDeviceQueueCreateFlags)0u, //flags
2959 queueFamilyIndex, //queueFamilyIndex;
2961 &queuePriority, //pQueuePriorities;
2964 // Need atleast 2 devices for peer memory features
2965 numPhysicalDevices = deviceGroupProps[devGroupIdx].physicalDeviceCount;
2966 if (numPhysicalDevices < 2)
2967 TCU_THROW(NotSupportedError, "Need a device Group with at least 2 physical devices.");
2969 // Create device groups
2970 const VkDeviceGroupDeviceCreateInfo deviceGroupInfo =
2972 VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, //stype
2974 deviceGroupProps[devGroupIdx].physicalDeviceCount, //physicalDeviceCount
2975 deviceGroupProps[devGroupIdx].physicalDevices //physicalDevices
2978 const VkDeviceCreateInfo deviceCreateInfo =
2980 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, //sType;
2981 &deviceGroupInfo, //pNext;
2982 (VkDeviceCreateFlags)0u, //flags
2983 1, //queueRecordCount;
2984 &deviceQueueCreateInfo, //pRequestedQueues;
2986 DE_NULL, //ppEnabledLayerNames;
2987 deUint32(deviceExtensions.size()), //extensionCount;
2988 (deviceExtensions.empty() ? DE_NULL : &deviceExtensions[0]), //ppEnabledExtensionNames;
2989 DE_NULL, //pEnabledFeatures;
2992 Move<VkDevice> deviceGroup = createCustomDevice(context.getTestContext().getCommandLine().isValidationEnabled(), vkp, instance, vki, deviceGroupProps[devGroupIdx].physicalDevices[deviceIdx], &deviceCreateInfo);
2993 const DeviceDriver vk (vkp, instance, *deviceGroup);
2994 context.getInstanceInterface().getPhysicalDeviceMemoryProperties(deviceGroupProps[devGroupIdx].physicalDevices[deviceIdx], &memProps);
2996 peerMemFeatures = reinterpret_cast<VkPeerMemoryFeatureFlags*>(buffer);
2997 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
2999 for (deUint32 heapIndex = 0; heapIndex < memProps.memoryHeapCount; heapIndex++)
3001 for (deUint32 localDeviceIndex = 0; localDeviceIndex < numPhysicalDevices; localDeviceIndex++)
3003 for (deUint32 remoteDeviceIndex = 0; remoteDeviceIndex < numPhysicalDevices; remoteDeviceIndex++)
3005 if (localDeviceIndex != remoteDeviceIndex)
3007 vk.getDeviceGroupPeerMemoryFeatures(deviceGroup.get(), heapIndex, localDeviceIndex, remoteDeviceIndex, peerMemFeatures);
3010 for (deInt32 ndx = 0; ndx < GUARD_SIZE; ndx++)
3012 if (buffer[ndx + sizeof(VkPeerMemoryFeatureFlags)] != GUARD_VALUE)
3014 log << TestLog::Message << "deviceGroupPeerMemoryFeatures - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
3015 return tcu::TestStatus::fail("deviceGroupPeerMemoryFeatures buffer overflow");
3019 VkPeerMemoryFeatureFlags requiredFlag = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT;
3020 VkPeerMemoryFeatureFlags maxValidFlag = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT|VK_PEER_MEMORY_FEATURE_COPY_DST_BIT|
3021 VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT|VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT;
3022 if ((!(*peerMemFeatures & requiredFlag)) ||
3023 *peerMemFeatures > maxValidFlag)
3024 return tcu::TestStatus::fail("deviceGroupPeerMemoryFeatures invalid flag");
3026 log << TestLog::Message << "deviceGroup = " << deviceGroup.get() << TestLog::EndMessage
3027 << TestLog::Message << "heapIndex = " << heapIndex << TestLog::EndMessage
3028 << TestLog::Message << "localDeviceIndex = " << localDeviceIndex << TestLog::EndMessage
3029 << TestLog::Message << "remoteDeviceIndex = " << remoteDeviceIndex << TestLog::EndMessage
3030 << TestLog::Message << "PeerMemoryFeatureFlags = " << *peerMemFeatures << TestLog::EndMessage;
3036 return tcu::TestStatus::pass("Querying deviceGroup peer memory features succeeded");
3039 tcu::TestStatus deviceMemoryBudgetProperties (Context& context)
3041 TestLog& log = context.getTestContext().getLog();
3042 deUint8 buffer[sizeof(VkPhysicalDeviceMemoryBudgetPropertiesEXT) + GUARD_SIZE];
3044 if (!context.isDeviceFunctionalitySupported("VK_EXT_memory_budget"))
3045 TCU_THROW(NotSupportedError, "VK_EXT_memory_budget is not supported");
3047 VkPhysicalDeviceMemoryBudgetPropertiesEXT *budgetProps = reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT *>(buffer);
3048 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
3050 budgetProps->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
3051 budgetProps->pNext = DE_NULL;
3053 VkPhysicalDeviceMemoryProperties2 memProps;
3054 deMemset(&memProps, 0, sizeof(memProps));
3055 memProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
3056 memProps.pNext = budgetProps;
3058 context.getInstanceInterface().getPhysicalDeviceMemoryProperties2(context.getPhysicalDevice(), &memProps);
3060 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
3061 << TestLog::Message << *budgetProps << TestLog::EndMessage;
3063 for (deInt32 ndx = 0; ndx < GUARD_SIZE; ndx++)
3065 if (buffer[ndx + sizeof(VkPhysicalDeviceMemoryBudgetPropertiesEXT)] != GUARD_VALUE)
3067 log << TestLog::Message << "deviceMemoryBudgetProperties - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
3068 return tcu::TestStatus::fail("deviceMemoryBudgetProperties buffer overflow");
3072 for (deUint32 i = 0; i < memProps.memoryProperties.memoryHeapCount; ++i)
3074 if (budgetProps->heapBudget[i] == 0)
3076 log << TestLog::Message << "deviceMemoryBudgetProperties - Supported heaps must report nonzero budget" << TestLog::EndMessage;
3077 return tcu::TestStatus::fail("deviceMemoryBudgetProperties invalid heap budget (zero)");
3079 if (budgetProps->heapBudget[i] > memProps.memoryProperties.memoryHeaps[i].size)
3081 log << TestLog::Message << "deviceMemoryBudgetProperties - Heap budget must be less than or equal to heap size" << TestLog::EndMessage;
3082 return tcu::TestStatus::fail("deviceMemoryBudgetProperties invalid heap budget (too large)");
3086 for (deUint32 i = memProps.memoryProperties.memoryHeapCount; i < VK_MAX_MEMORY_HEAPS; ++i)
3088 if (budgetProps->heapBudget[i] != 0 || budgetProps->heapUsage[i] != 0)
3090 log << TestLog::Message << "deviceMemoryBudgetProperties - Unused heaps must report budget/usage of zero" << TestLog::EndMessage;
3091 return tcu::TestStatus::fail("deviceMemoryBudgetProperties invalid unused heaps");
3095 return tcu::TestStatus::pass("Querying memory budget properties succeeded");
3101 #include "vkMandatoryFeatures.inl"
3105 tcu::TestStatus deviceMandatoryFeatures(Context& context)
3107 if ( checkMandatoryFeatures(context) )
3108 return tcu::TestStatus::pass("Passed");
3109 return tcu::TestStatus::fail("Not all mandatory features are supported ( see: vkspec.html#features-requirements )");
3112 VkFormatFeatureFlags getBaseRequiredOptimalTilingFeatures (VkFormat format)
3117 VkFormatFeatureFlags flags;
3122 SAIM = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT,
3123 BLSR = VK_FORMAT_FEATURE_BLIT_SRC_BIT,
3124 SIFL = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT,
3125 COAT = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT,
3126 BLDS = VK_FORMAT_FEATURE_BLIT_DST_BIT,
3127 CABL = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT,
3128 STIM = VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT,
3129 STIA = VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT,
3130 DSAT = VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT,
3131 TRSR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT,
3132 TRDS = VK_FORMAT_FEATURE_TRANSFER_DST_BIT
3135 static const Formatpair formatflags[] =
3137 { VK_FORMAT_B4G4R4A4_UNORM_PACK16, SAIM | BLSR | TRSR | TRDS | SIFL },
3138 { VK_FORMAT_R5G6B5_UNORM_PACK16, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3139 { VK_FORMAT_A1R5G5B5_UNORM_PACK16, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3140 { VK_FORMAT_R8_UNORM, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3141 { VK_FORMAT_R8_SNORM, SAIM | BLSR | TRSR | TRDS | SIFL },
3142 { VK_FORMAT_R8_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3143 { VK_FORMAT_R8_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3144 { VK_FORMAT_R8G8_UNORM, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3145 { VK_FORMAT_R8G8_SNORM, SAIM | BLSR | TRSR | TRDS | SIFL },
3146 { VK_FORMAT_R8G8_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3147 { VK_FORMAT_R8G8_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3148 { VK_FORMAT_R8G8B8A8_UNORM, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | STIM | CABL },
3149 { VK_FORMAT_R8G8B8A8_SNORM, SAIM | BLSR | TRSR | TRDS | SIFL | STIM },
3150 { VK_FORMAT_R8G8B8A8_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3151 { VK_FORMAT_R8G8B8A8_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3152 { VK_FORMAT_R8G8B8A8_SRGB, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3153 { VK_FORMAT_B8G8R8A8_UNORM, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3154 { VK_FORMAT_B8G8R8A8_SRGB, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3155 { VK_FORMAT_A8B8G8R8_UNORM_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3156 { VK_FORMAT_A8B8G8R8_SNORM_PACK32, SAIM | BLSR | TRSR | TRDS | SIFL },
3157 { VK_FORMAT_A8B8G8R8_UINT_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3158 { VK_FORMAT_A8B8G8R8_SINT_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3159 { VK_FORMAT_A8B8G8R8_SRGB_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3160 { VK_FORMAT_A2B10G10R10_UNORM_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3161 { VK_FORMAT_A2B10G10R10_UINT_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3162 { VK_FORMAT_R16_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3163 { VK_FORMAT_R16_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3164 { VK_FORMAT_R16_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3165 { VK_FORMAT_R16G16_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3166 { VK_FORMAT_R16G16_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
3167 { VK_FORMAT_R16G16_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
3168 { VK_FORMAT_R16G16B16A16_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3169 { VK_FORMAT_R16G16B16A16_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3170 { VK_FORMAT_R16G16B16A16_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | STIM | CABL },
3171 { VK_FORMAT_R32_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM | STIA },
3172 { VK_FORMAT_R32_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM | STIA },
3173 { VK_FORMAT_R32_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3174 { VK_FORMAT_R32G32_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3175 { VK_FORMAT_R32G32_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3176 { VK_FORMAT_R32G32_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3177 { VK_FORMAT_R32G32B32A32_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3178 { VK_FORMAT_R32G32B32A32_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3179 { VK_FORMAT_R32G32B32A32_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
3180 { VK_FORMAT_B10G11R11_UFLOAT_PACK32, SAIM | BLSR | TRSR | TRDS | SIFL },
3181 { VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, SAIM | BLSR | TRSR | TRDS | SIFL },
3182 { VK_FORMAT_D16_UNORM, SAIM | BLSR | TRSR | TRDS | DSAT },
3185 size_t formatpairs = sizeof(formatflags) / sizeof(Formatpair);
3187 for (unsigned int i = 0; i < formatpairs; i++)
3188 if (formatflags[i].format == format)
3189 return formatflags[i].flags;
3193 VkFormatFeatureFlags getRequiredOptimalExtendedTilingFeatures (Context& context, VkFormat format, VkFormatFeatureFlags queriedFlags)
3195 VkFormatFeatureFlags flags = (VkFormatFeatureFlags)0;
3197 // VK_EXT_sampler_filter_minmax:
3198 // If filterMinmaxSingleComponentFormats is VK_TRUE, the following formats must
3199 // support the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT feature with
3200 // VK_IMAGE_TILING_OPTIMAL, if they support VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT.
3202 static const VkFormat s_requiredSampledImageFilterMinMaxFormats[] =
3206 VK_FORMAT_R16_UNORM,
3207 VK_FORMAT_R16_SNORM,
3208 VK_FORMAT_R16_SFLOAT,
3209 VK_FORMAT_R32_SFLOAT,
3210 VK_FORMAT_D16_UNORM,
3211 VK_FORMAT_X8_D24_UNORM_PACK32,
3212 VK_FORMAT_D32_SFLOAT,
3213 VK_FORMAT_D16_UNORM_S8_UINT,
3214 VK_FORMAT_D24_UNORM_S8_UINT,
3215 VK_FORMAT_D32_SFLOAT_S8_UINT,
3218 if ((queriedFlags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0)
3220 if (de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_EXT_sampler_filter_minmax"))
3222 if (de::contains(DE_ARRAY_BEGIN(s_requiredSampledImageFilterMinMaxFormats), DE_ARRAY_END(s_requiredSampledImageFilterMinMaxFormats), format))
3224 VkPhysicalDeviceSamplerFilterMinmaxProperties physicalDeviceSamplerMinMaxProperties =
3226 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT,
3233 VkPhysicalDeviceProperties2 physicalDeviceProperties;
3234 physicalDeviceProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
3235 physicalDeviceProperties.pNext = &physicalDeviceSamplerMinMaxProperties;
3237 const InstanceInterface& vk = context.getInstanceInterface();
3238 vk.getPhysicalDeviceProperties2(context.getPhysicalDevice(), &physicalDeviceProperties);
3241 if (physicalDeviceSamplerMinMaxProperties.filterMinmaxSingleComponentFormats)
3243 flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT;
3249 // VK_EXT_filter_cubic:
3250 // If cubic filtering is supported, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT must be supported for the following image view types:
3251 // VK_IMAGE_VIEW_TYPE_2D, VK_IMAGE_VIEW_TYPE_2D_ARRAY
3252 static const VkFormat s_requiredSampledImageFilterCubicFormats[] =
3254 VK_FORMAT_R4G4_UNORM_PACK8,
3255 VK_FORMAT_R4G4B4A4_UNORM_PACK16,
3256 VK_FORMAT_B4G4R4A4_UNORM_PACK16,
3257 VK_FORMAT_R5G6B5_UNORM_PACK16,
3258 VK_FORMAT_B5G6R5_UNORM_PACK16,
3259 VK_FORMAT_R5G5B5A1_UNORM_PACK16,
3260 VK_FORMAT_B5G5R5A1_UNORM_PACK16,
3261 VK_FORMAT_A1R5G5B5_UNORM_PACK16,
3265 VK_FORMAT_R8G8_UNORM,
3266 VK_FORMAT_R8G8_SNORM,
3267 VK_FORMAT_R8G8_SRGB,
3268 VK_FORMAT_R8G8B8_UNORM,
3269 VK_FORMAT_R8G8B8_SNORM,
3270 VK_FORMAT_R8G8B8_SRGB,
3271 VK_FORMAT_B8G8R8_UNORM,
3272 VK_FORMAT_B8G8R8_SNORM,
3273 VK_FORMAT_B8G8R8_SRGB,
3274 VK_FORMAT_R8G8B8A8_UNORM,
3275 VK_FORMAT_R8G8B8A8_SNORM,
3276 VK_FORMAT_R8G8B8A8_SRGB,
3277 VK_FORMAT_B8G8R8A8_UNORM,
3278 VK_FORMAT_B8G8R8A8_SNORM,
3279 VK_FORMAT_B8G8R8A8_SRGB,
3280 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
3281 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
3282 VK_FORMAT_A8B8G8R8_SRGB_PACK32
3285 static const VkFormat s_requiredSampledImageFilterCubicFormatsETC2[] =
3287 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
3288 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
3289 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,
3290 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,
3291 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,
3292 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK
3295 if ( (queriedFlags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0 && de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_EXT_filter_cubic") )
3297 if ( de::contains(DE_ARRAY_BEGIN(s_requiredSampledImageFilterCubicFormats), DE_ARRAY_END(s_requiredSampledImageFilterCubicFormats), format) )
3298 flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT;
3300 VkPhysicalDeviceFeatures2 coreFeatures;
3301 deMemset(&coreFeatures, 0, sizeof(coreFeatures));
3303 coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
3304 coreFeatures.pNext = DE_NULL;
3305 context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &coreFeatures);
3306 if ( coreFeatures.features.textureCompressionETC2 && de::contains(DE_ARRAY_BEGIN(s_requiredSampledImageFilterCubicFormatsETC2), DE_ARRAY_END(s_requiredSampledImageFilterCubicFormatsETC2), format) )
3307 flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT;
3313 VkFormatFeatureFlags getRequiredBufferFeatures (VkFormat format)
3315 static const VkFormat s_requiredVertexBufferFormats[] =
3321 VK_FORMAT_R8G8_UNORM,
3322 VK_FORMAT_R8G8_SNORM,
3323 VK_FORMAT_R8G8_UINT,
3324 VK_FORMAT_R8G8_SINT,
3325 VK_FORMAT_R8G8B8A8_UNORM,
3326 VK_FORMAT_R8G8B8A8_SNORM,
3327 VK_FORMAT_R8G8B8A8_UINT,
3328 VK_FORMAT_R8G8B8A8_SINT,
3329 VK_FORMAT_B8G8R8A8_UNORM,
3330 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
3331 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
3332 VK_FORMAT_A8B8G8R8_UINT_PACK32,
3333 VK_FORMAT_A8B8G8R8_SINT_PACK32,
3334 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
3335 VK_FORMAT_R16_UNORM,
3336 VK_FORMAT_R16_SNORM,
3339 VK_FORMAT_R16_SFLOAT,
3340 VK_FORMAT_R16G16_UNORM,
3341 VK_FORMAT_R16G16_SNORM,
3342 VK_FORMAT_R16G16_UINT,
3343 VK_FORMAT_R16G16_SINT,
3344 VK_FORMAT_R16G16_SFLOAT,
3345 VK_FORMAT_R16G16B16A16_UNORM,
3346 VK_FORMAT_R16G16B16A16_SNORM,
3347 VK_FORMAT_R16G16B16A16_UINT,
3348 VK_FORMAT_R16G16B16A16_SINT,
3349 VK_FORMAT_R16G16B16A16_SFLOAT,
3352 VK_FORMAT_R32_SFLOAT,
3353 VK_FORMAT_R32G32_UINT,
3354 VK_FORMAT_R32G32_SINT,
3355 VK_FORMAT_R32G32_SFLOAT,
3356 VK_FORMAT_R32G32B32_UINT,
3357 VK_FORMAT_R32G32B32_SINT,
3358 VK_FORMAT_R32G32B32_SFLOAT,
3359 VK_FORMAT_R32G32B32A32_UINT,
3360 VK_FORMAT_R32G32B32A32_SINT,
3361 VK_FORMAT_R32G32B32A32_SFLOAT
3363 static const VkFormat s_requiredUniformTexelBufferFormats[] =
3369 VK_FORMAT_R8G8_UNORM,
3370 VK_FORMAT_R8G8_SNORM,
3371 VK_FORMAT_R8G8_UINT,
3372 VK_FORMAT_R8G8_SINT,
3373 VK_FORMAT_R8G8B8A8_UNORM,
3374 VK_FORMAT_R8G8B8A8_SNORM,
3375 VK_FORMAT_R8G8B8A8_UINT,
3376 VK_FORMAT_R8G8B8A8_SINT,
3377 VK_FORMAT_B8G8R8A8_UNORM,
3378 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
3379 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
3380 VK_FORMAT_A8B8G8R8_UINT_PACK32,
3381 VK_FORMAT_A8B8G8R8_SINT_PACK32,
3382 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
3383 VK_FORMAT_A2B10G10R10_UINT_PACK32,
3386 VK_FORMAT_R16_SFLOAT,
3387 VK_FORMAT_R16G16_UINT,
3388 VK_FORMAT_R16G16_SINT,
3389 VK_FORMAT_R16G16_SFLOAT,
3390 VK_FORMAT_R16G16B16A16_UINT,
3391 VK_FORMAT_R16G16B16A16_SINT,
3392 VK_FORMAT_R16G16B16A16_SFLOAT,
3395 VK_FORMAT_R32_SFLOAT,
3396 VK_FORMAT_R32G32_UINT,
3397 VK_FORMAT_R32G32_SINT,
3398 VK_FORMAT_R32G32_SFLOAT,
3399 VK_FORMAT_R32G32B32A32_UINT,
3400 VK_FORMAT_R32G32B32A32_SINT,
3401 VK_FORMAT_R32G32B32A32_SFLOAT,
3402 VK_FORMAT_B10G11R11_UFLOAT_PACK32
3404 static const VkFormat s_requiredStorageTexelBufferFormats[] =
3406 VK_FORMAT_R8G8B8A8_UNORM,
3407 VK_FORMAT_R8G8B8A8_SNORM,
3408 VK_FORMAT_R8G8B8A8_UINT,
3409 VK_FORMAT_R8G8B8A8_SINT,
3410 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
3411 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
3412 VK_FORMAT_A8B8G8R8_UINT_PACK32,
3413 VK_FORMAT_A8B8G8R8_SINT_PACK32,
3414 VK_FORMAT_R16G16B16A16_UINT,
3415 VK_FORMAT_R16G16B16A16_SINT,
3416 VK_FORMAT_R16G16B16A16_SFLOAT,
3419 VK_FORMAT_R32_SFLOAT,
3420 VK_FORMAT_R32G32_UINT,
3421 VK_FORMAT_R32G32_SINT,
3422 VK_FORMAT_R32G32_SFLOAT,
3423 VK_FORMAT_R32G32B32A32_UINT,
3424 VK_FORMAT_R32G32B32A32_SINT,
3425 VK_FORMAT_R32G32B32A32_SFLOAT
3427 static const VkFormat s_requiredStorageTexelBufferAtomicFormats[] =
3433 VkFormatFeatureFlags flags = (VkFormatFeatureFlags)0;
3435 if (de::contains(DE_ARRAY_BEGIN(s_requiredVertexBufferFormats), DE_ARRAY_END(s_requiredVertexBufferFormats), format))
3436 flags |= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT;
3438 if (de::contains(DE_ARRAY_BEGIN(s_requiredUniformTexelBufferFormats), DE_ARRAY_END(s_requiredUniformTexelBufferFormats), format))
3439 flags |= VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT;
3441 if (de::contains(DE_ARRAY_BEGIN(s_requiredStorageTexelBufferFormats), DE_ARRAY_END(s_requiredStorageTexelBufferFormats), format))
3442 flags |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT;
3444 if (de::contains(DE_ARRAY_BEGIN(s_requiredStorageTexelBufferAtomicFormats), DE_ARRAY_END(s_requiredStorageTexelBufferAtomicFormats), format))
3445 flags |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT;
3450 VkPhysicalDeviceSamplerYcbcrConversionFeatures getPhysicalDeviceSamplerYcbcrConversionFeatures (const InstanceInterface& vk, VkPhysicalDevice physicalDevice)
3452 VkPhysicalDeviceFeatures2 coreFeatures;
3453 VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcrFeatures;
3455 deMemset(&coreFeatures, 0, sizeof(coreFeatures));
3456 deMemset(&ycbcrFeatures, 0, sizeof(ycbcrFeatures));
3458 coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
3459 coreFeatures.pNext = &ycbcrFeatures;
3460 ycbcrFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES;
3462 vk.getPhysicalDeviceFeatures2(physicalDevice, &coreFeatures);
3464 return ycbcrFeatures;
3467 void checkYcbcrApiSupport (Context& context)
3469 // check if YCbcr API and are supported by implementation
3471 // the support for formats and YCbCr may still be optional - see isYcbcrConversionSupported below
3473 if (!vk::isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_sampler_ycbcr_conversion"))
3475 if (!context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"))
3476 TCU_THROW(NotSupportedError, "VK_KHR_sampler_ycbcr_conversion is not supported");
3478 // Hard dependency for ycbcr
3479 TCU_CHECK(de::contains(context.getInstanceExtensions().begin(), context.getInstanceExtensions().end(), "VK_KHR_get_physical_device_properties2"));
3483 bool isYcbcrConversionSupported (Context& context)
3485 checkYcbcrApiSupport(context);
3487 const VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcrFeatures = getPhysicalDeviceSamplerYcbcrConversionFeatures(context.getInstanceInterface(), context.getPhysicalDevice());
3489 return (ycbcrFeatures.samplerYcbcrConversion == VK_TRUE);
3492 VkFormatFeatureFlags getRequiredYcbcrFormatFeatures (Context& context, VkFormat format)
3494 bool req = isYcbcrConversionSupported(context) && ( format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM ||
3495 format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM);
3497 const VkFormatFeatureFlags required = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
3498 | VK_FORMAT_FEATURE_TRANSFER_SRC_BIT
3499 | VK_FORMAT_FEATURE_TRANSFER_DST_BIT
3500 | VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT;
3501 return req ? required : (VkFormatFeatureFlags)0;
3504 VkFormatFeatureFlags getRequiredOptimalTilingFeatures (Context& context, VkFormat format)
3506 if (isYCbCrFormat(format))
3507 return getRequiredYcbcrFormatFeatures(context, format);
3510 VkFormatFeatureFlags ret = getBaseRequiredOptimalTilingFeatures(format);
3512 // \todo [2017-05-16 pyry] This should be extended to cover for example COLOR_ATTACHMENT for depth formats etc.
3513 // \todo [2017-05-18 pyry] Any other color conversion related features that can't be supported by regular formats?
3514 ret |= getRequiredOptimalExtendedTilingFeatures(context, format, ret);
3516 // Compressed formats have optional support for some features
3517 // TODO: Is this really correct? It looks like it should be checking the different compressed features
3518 if (isCompressedFormat(format) && (ret & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT))
3519 ret |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
3520 VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
3521 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
3522 VK_FORMAT_FEATURE_BLIT_SRC_BIT;
3528 bool requiresYCbCrConversion(Context& context, VkFormat format)
3530 if (format == VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16)
3532 if (!context.isDeviceFunctionalitySupported("VK_EXT_rgba10x6_formats"))
3534 VkPhysicalDeviceFeatures2 coreFeatures;
3535 VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT rgba10x6features;
3537 deMemset(&coreFeatures, 0, sizeof(coreFeatures));
3538 deMemset(&rgba10x6features, 0, sizeof(rgba10x6features));
3540 coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
3541 coreFeatures.pNext = &rgba10x6features;
3542 rgba10x6features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT;
3544 const InstanceInterface &vk = context.getInstanceInterface();
3545 vk.getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &coreFeatures);
3547 return !rgba10x6features.formatRgba10x6WithoutYCbCrSampler;
3550 return isYCbCrFormat(format) &&
3551 format != VK_FORMAT_R10X6_UNORM_PACK16 && format != VK_FORMAT_R10X6G10X6_UNORM_2PACK16 &&
3552 format != VK_FORMAT_R12X4_UNORM_PACK16 && format != VK_FORMAT_R12X4G12X4_UNORM_2PACK16;
3555 VkFormatFeatureFlags getAllowedOptimalTilingFeatures (Context &context, VkFormat format)
3557 // YCbCr formats only support a subset of format feature flags
3558 const VkFormatFeatureFlags ycbcrAllows =
3559 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
3560 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT |
3561 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG |
3562 VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
3563 VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
3564 VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT |
3565 VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT |
3566 VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT |
3567 VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT |
3568 VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT |
3569 VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT |
3570 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT |
3571 VK_FORMAT_FEATURE_DISJOINT_BIT;
3573 // By default everything is allowed.
3574 VkFormatFeatureFlags allow = (VkFormatFeatureFlags)~0u;
3575 // Formats for which SamplerYCbCrConversion is required may not support certain features.
3576 if (requiresYCbCrConversion(context, format))
3577 allow &= ycbcrAllows;
3578 // single-plane formats *may not* support DISJOINT_BIT
3579 if (!isYCbCrFormat(format) || getPlaneCount(format) == 1)
3580 allow &= ~VK_FORMAT_FEATURE_DISJOINT_BIT;
3585 VkFormatFeatureFlags getAllowedBufferFeatures (Context &context, VkFormat format)
3587 // TODO: Do we allow non-buffer flags in the bufferFeatures?
3588 return requiresYCbCrConversion(context, format) ? (VkFormatFeatureFlags)0 : (VkFormatFeatureFlags)(~VK_FORMAT_FEATURE_DISJOINT_BIT);
3591 tcu::TestStatus formatProperties (Context& context, VkFormat format)
3593 // check if Ycbcr format enums are valid given the version and extensions
3594 if (isYCbCrFormat(format))
3595 checkYcbcrApiSupport(context);
3597 TestLog& log = context.getTestContext().getLog();
3598 const VkFormatProperties properties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
3601 const VkFormatFeatureFlags reqImg = getRequiredOptimalTilingFeatures(context, format);
3602 const VkFormatFeatureFlags reqBuf = getRequiredBufferFeatures(format);
3603 const VkFormatFeatureFlags allowImg = getAllowedOptimalTilingFeatures(context, format);
3604 const VkFormatFeatureFlags allowBuf = getAllowedBufferFeatures(context, format);
3606 const struct feature_req
3608 const char* fieldName;
3609 VkFormatFeatureFlags supportedFeatures;
3610 VkFormatFeatureFlags requiredFeatures;
3611 VkFormatFeatureFlags allowedFeatures;
3614 { "linearTilingFeatures", properties.linearTilingFeatures, (VkFormatFeatureFlags)0, allowImg },
3615 { "optimalTilingFeatures", properties.optimalTilingFeatures, reqImg, allowImg },
3616 { "bufferFeatures", properties.bufferFeatures, reqBuf, allowBuf }
3619 log << TestLog::Message << properties << TestLog::EndMessage;
3621 for (int fieldNdx = 0; fieldNdx < DE_LENGTH_OF_ARRAY(fields); fieldNdx++)
3623 const char* const fieldName = fields[fieldNdx].fieldName;
3624 const VkFormatFeatureFlags supported = fields[fieldNdx].supportedFeatures;
3625 const VkFormatFeatureFlags required = fields[fieldNdx].requiredFeatures;
3626 const VkFormatFeatureFlags allowed = fields[fieldNdx].allowedFeatures;
3628 if ((supported & required) != required)
3630 log << TestLog::Message << "ERROR in " << fieldName << ":\n"
3631 << " required: " << getFormatFeatureFlagsStr(required) << "\n "
3632 << " missing: " << getFormatFeatureFlagsStr(~supported & required)
3633 << TestLog::EndMessage;
3637 if ((supported & ~allowed) != 0)
3639 log << TestLog::Message << "ERROR in " << fieldName << ":\n"
3640 << " has: " << getFormatFeatureFlagsStr(supported & ~allowed)
3641 << TestLog::EndMessage;
3645 if (((supported & VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT) != 0) &&
3646 ((supported & VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT) == 0))
3648 log << TestLog::Message << "ERROR in " << fieldName << ":\n"
3649 << " supports VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT"
3650 << " but not VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT"
3651 << TestLog::EndMessage;
3657 return tcu::TestStatus::pass("Query and validation passed");
3659 return tcu::TestStatus::fail("Required features not supported");
3662 bool optimalTilingFeaturesSupported (Context& context, VkFormat format, VkFormatFeatureFlags features)
3664 const VkFormatProperties properties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
3666 return (properties.optimalTilingFeatures & features) == features;
3669 bool optimalTilingFeaturesSupportedForAll (Context& context, const VkFormat* begin, const VkFormat* end, VkFormatFeatureFlags features)
3671 for (const VkFormat* cur = begin; cur != end; ++cur)
3673 if (!optimalTilingFeaturesSupported(context, *cur, features))
3680 tcu::TestStatus testDepthStencilSupported (Context& context)
3682 if (!optimalTilingFeaturesSupported(context, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) &&
3683 !optimalTilingFeaturesSupported(context, VK_FORMAT_D32_SFLOAT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
3684 return tcu::TestStatus::fail("Doesn't support one of VK_FORMAT_X8_D24_UNORM_PACK32 or VK_FORMAT_D32_SFLOAT");
3686 if (!optimalTilingFeaturesSupported(context, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) &&
3687 !optimalTilingFeaturesSupported(context, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
3688 return tcu::TestStatus::fail("Doesn't support one of VK_FORMAT_D24_UNORM_S8_UINT or VK_FORMAT_D32_SFLOAT_S8_UINT");
3690 return tcu::TestStatus::pass("Required depth/stencil formats supported");
3693 tcu::TestStatus testCompressedFormatsSupported (Context& context)
3695 static const VkFormat s_allBcFormats[] =
3697 VK_FORMAT_BC1_RGB_UNORM_BLOCK,
3698 VK_FORMAT_BC1_RGB_SRGB_BLOCK,
3699 VK_FORMAT_BC1_RGBA_UNORM_BLOCK,
3700 VK_FORMAT_BC1_RGBA_SRGB_BLOCK,
3701 VK_FORMAT_BC2_UNORM_BLOCK,
3702 VK_FORMAT_BC2_SRGB_BLOCK,
3703 VK_FORMAT_BC3_UNORM_BLOCK,
3704 VK_FORMAT_BC3_SRGB_BLOCK,
3705 VK_FORMAT_BC4_UNORM_BLOCK,
3706 VK_FORMAT_BC4_SNORM_BLOCK,
3707 VK_FORMAT_BC5_UNORM_BLOCK,
3708 VK_FORMAT_BC5_SNORM_BLOCK,
3709 VK_FORMAT_BC6H_UFLOAT_BLOCK,
3710 VK_FORMAT_BC6H_SFLOAT_BLOCK,
3711 VK_FORMAT_BC7_UNORM_BLOCK,
3712 VK_FORMAT_BC7_SRGB_BLOCK,
3714 static const VkFormat s_allEtc2Formats[] =
3716 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
3717 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
3718 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,
3719 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,
3720 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,
3721 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,
3722 VK_FORMAT_EAC_R11_UNORM_BLOCK,
3723 VK_FORMAT_EAC_R11_SNORM_BLOCK,
3724 VK_FORMAT_EAC_R11G11_UNORM_BLOCK,
3725 VK_FORMAT_EAC_R11G11_SNORM_BLOCK,
3727 static const VkFormat s_allAstcLdrFormats[] =
3729 VK_FORMAT_ASTC_4x4_UNORM_BLOCK,
3730 VK_FORMAT_ASTC_4x4_SRGB_BLOCK,
3731 VK_FORMAT_ASTC_5x4_UNORM_BLOCK,
3732 VK_FORMAT_ASTC_5x4_SRGB_BLOCK,
3733 VK_FORMAT_ASTC_5x5_UNORM_BLOCK,
3734 VK_FORMAT_ASTC_5x5_SRGB_BLOCK,
3735 VK_FORMAT_ASTC_6x5_UNORM_BLOCK,
3736 VK_FORMAT_ASTC_6x5_SRGB_BLOCK,
3737 VK_FORMAT_ASTC_6x6_UNORM_BLOCK,
3738 VK_FORMAT_ASTC_6x6_SRGB_BLOCK,
3739 VK_FORMAT_ASTC_8x5_UNORM_BLOCK,
3740 VK_FORMAT_ASTC_8x5_SRGB_BLOCK,
3741 VK_FORMAT_ASTC_8x6_UNORM_BLOCK,
3742 VK_FORMAT_ASTC_8x6_SRGB_BLOCK,
3743 VK_FORMAT_ASTC_8x8_UNORM_BLOCK,
3744 VK_FORMAT_ASTC_8x8_SRGB_BLOCK,
3745 VK_FORMAT_ASTC_10x5_UNORM_BLOCK,
3746 VK_FORMAT_ASTC_10x5_SRGB_BLOCK,
3747 VK_FORMAT_ASTC_10x6_UNORM_BLOCK,
3748 VK_FORMAT_ASTC_10x6_SRGB_BLOCK,
3749 VK_FORMAT_ASTC_10x8_UNORM_BLOCK,
3750 VK_FORMAT_ASTC_10x8_SRGB_BLOCK,
3751 VK_FORMAT_ASTC_10x10_UNORM_BLOCK,
3752 VK_FORMAT_ASTC_10x10_SRGB_BLOCK,
3753 VK_FORMAT_ASTC_12x10_UNORM_BLOCK,
3754 VK_FORMAT_ASTC_12x10_SRGB_BLOCK,
3755 VK_FORMAT_ASTC_12x12_UNORM_BLOCK,
3756 VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
3761 const char* setName;
3762 const char* featureName;
3763 const VkBool32 VkPhysicalDeviceFeatures::* feature;
3764 const VkFormat* formatsBegin;
3765 const VkFormat* formatsEnd;
3766 } s_compressedFormatSets[] =
3768 { "BC", "textureCompressionBC", &VkPhysicalDeviceFeatures::textureCompressionBC, DE_ARRAY_BEGIN(s_allBcFormats), DE_ARRAY_END(s_allBcFormats) },
3769 { "ETC2", "textureCompressionETC2", &VkPhysicalDeviceFeatures::textureCompressionETC2, DE_ARRAY_BEGIN(s_allEtc2Formats), DE_ARRAY_END(s_allEtc2Formats) },
3770 { "ASTC LDR", "textureCompressionASTC_LDR", &VkPhysicalDeviceFeatures::textureCompressionASTC_LDR, DE_ARRAY_BEGIN(s_allAstcLdrFormats), DE_ARRAY_END(s_allAstcLdrFormats) },
3773 TestLog& log = context.getTestContext().getLog();
3774 const VkPhysicalDeviceFeatures& features = context.getDeviceFeatures();
3775 int numSupportedSets = 0;
3777 int numWarnings = 0;
3779 for (int setNdx = 0; setNdx < DE_LENGTH_OF_ARRAY(s_compressedFormatSets); ++setNdx)
3781 const char* const setName = s_compressedFormatSets[setNdx].setName;
3782 const char* const featureName = s_compressedFormatSets[setNdx].featureName;
3783 const bool featureBitSet = features.*s_compressedFormatSets[setNdx].feature == VK_TRUE;
3784 const VkFormatFeatureFlags requiredFeatures =
3785 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT |
3786 VK_FORMAT_FEATURE_TRANSFER_SRC_BIT | VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
3787 const bool allSupported = optimalTilingFeaturesSupportedForAll(context,
3788 s_compressedFormatSets[setNdx].formatsBegin,
3789 s_compressedFormatSets[setNdx].formatsEnd,
3792 if (featureBitSet && !allSupported)
3794 log << TestLog::Message << "ERROR: " << featureName << " = VK_TRUE but " << setName << " formats not supported" << TestLog::EndMessage;
3797 else if (allSupported && !featureBitSet)
3799 log << TestLog::Message << "WARNING: " << setName << " formats supported but " << featureName << " = VK_FALSE" << TestLog::EndMessage;
3805 log << TestLog::Message << "All " << setName << " formats are supported" << TestLog::EndMessage;
3806 numSupportedSets += 1;
3809 log << TestLog::Message << setName << " formats are not supported" << TestLog::EndMessage;
3812 if (numSupportedSets == 0)
3814 log << TestLog::Message << "No compressed format sets supported" << TestLog::EndMessage;
3819 return tcu::TestStatus::fail("Compressed format support not valid");
3820 else if (numWarnings > 0)
3821 return tcu::TestStatus(QP_TEST_RESULT_QUALITY_WARNING, "Found inconsistencies in compressed format support");
3823 return tcu::TestStatus::pass("Compressed texture format support is valid");
3826 void createFormatTests (tcu::TestCaseGroup* testGroup)
3828 DE_STATIC_ASSERT(VK_FORMAT_UNDEFINED == 0);
3834 } s_formatRanges[] =
3837 { (VkFormat)(VK_FORMAT_UNDEFINED+1), VK_CORE_FORMAT_LAST },
3840 { VK_FORMAT_G8B8G8R8_422_UNORM, (VkFormat)(VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM+1) },
3842 // YCbCr extended formats
3843 { VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT, (VkFormat)(VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT+1) },
3846 for (int rangeNdx = 0; rangeNdx < DE_LENGTH_OF_ARRAY(s_formatRanges); ++rangeNdx)
3848 const VkFormat rangeBegin = s_formatRanges[rangeNdx].begin;
3849 const VkFormat rangeEnd = s_formatRanges[rangeNdx].end;
3851 for (VkFormat format = rangeBegin; format != rangeEnd; format = (VkFormat)(format+1))
3853 const char* const enumName = getFormatName(format);
3854 const string caseName = de::toLower(string(enumName).substr(10));
3856 addFunctionCase(testGroup, caseName, enumName, formatProperties, format);
3860 addFunctionCase(testGroup, "depth_stencil", "", testDepthStencilSupported);
3861 addFunctionCase(testGroup, "compressed_formats", "", testCompressedFormatsSupported);
3864 VkImageUsageFlags getValidImageUsageFlags (const VkFormatFeatureFlags supportedFeatures, const bool useKhrMaintenance1Semantics)
3866 VkImageUsageFlags flags = (VkImageUsageFlags)0;
3868 if (useKhrMaintenance1Semantics)
3870 if ((supportedFeatures & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT) != 0)
3871 flags |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
3873 if ((supportedFeatures & VK_FORMAT_FEATURE_TRANSFER_DST_BIT) != 0)
3874 flags |= VK_IMAGE_USAGE_TRANSFER_DST_BIT;
3878 // If format is supported at all, it must be valid transfer src+dst
3879 if (supportedFeatures != 0)
3880 flags |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT;
3883 if ((supportedFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0)
3884 flags |= VK_IMAGE_USAGE_SAMPLED_BIT;
3886 if ((supportedFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) != 0)
3887 flags |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT|VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
3889 if ((supportedFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) != 0)
3890 flags |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
3892 if ((supportedFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) != 0)
3893 flags |= VK_IMAGE_USAGE_STORAGE_BIT;
3898 bool isValidImageUsageFlagCombination (VkImageUsageFlags usage)
3900 if ((usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) != 0)
3902 const VkImageUsageFlags allowedFlags = VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
3903 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
3904 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
3905 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
3907 // Only *_ATTACHMENT_BIT flags can be combined with TRANSIENT_ATTACHMENT_BIT
3908 if ((usage & ~allowedFlags) != 0)
3911 // TRANSIENT_ATTACHMENT_BIT is not valid without COLOR_ or DEPTH_STENCIL_ATTACHMENT_BIT
3912 if ((usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) == 0)
3919 VkImageCreateFlags getValidImageCreateFlags (const VkPhysicalDeviceFeatures& deviceFeatures, VkFormat format, VkFormatFeatureFlags formatFeatures, VkImageType type, VkImageUsageFlags usage)
3921 VkImageCreateFlags flags = (VkImageCreateFlags)0;
3923 if ((usage & VK_IMAGE_USAGE_SAMPLED_BIT) != 0)
3925 flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
3927 if (type == VK_IMAGE_TYPE_2D && !isYCbCrFormat(format))
3929 flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
3933 if (isYCbCrFormat(format) && getPlaneCount(format) > 1)
3935 if (formatFeatures & VK_FORMAT_FEATURE_DISJOINT_BIT_KHR)
3936 flags |= VK_IMAGE_CREATE_DISJOINT_BIT_KHR;
3939 if ((usage & (VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_STORAGE_BIT)) != 0 &&
3940 (usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) == 0)
3942 if (deviceFeatures.sparseBinding)
3943 flags |= VK_IMAGE_CREATE_SPARSE_BINDING_BIT|VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT;
3945 if (deviceFeatures.sparseResidencyAliased)
3946 flags |= VK_IMAGE_CREATE_SPARSE_BINDING_BIT|VK_IMAGE_CREATE_SPARSE_ALIASED_BIT;
3952 bool isValidImageCreateFlagCombination (VkImageCreateFlags createFlags)
3954 bool isValid = true;
3956 if (((createFlags & (VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT|VK_IMAGE_CREATE_SPARSE_ALIASED_BIT)) != 0) &&
3957 ((createFlags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) == 0))
3965 bool isRequiredImageParameterCombination (const VkPhysicalDeviceFeatures& deviceFeatures,
3966 const VkFormat format,
3967 const VkFormatProperties& formatProperties,
3968 const VkImageType imageType,
3969 const VkImageTiling imageTiling,
3970 const VkImageUsageFlags usageFlags,
3971 const VkImageCreateFlags createFlags)
3973 DE_UNREF(deviceFeatures);
3974 DE_UNREF(formatProperties);
3975 DE_UNREF(createFlags);
3977 // Linear images can have arbitrary limitations
3978 if (imageTiling == VK_IMAGE_TILING_LINEAR)
3981 // Support for other usages for compressed formats is optional
3982 if (isCompressedFormat(format) &&
3983 (usageFlags & ~(VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT)) != 0)
3986 // Support for 1D, and sliced 3D compressed formats is optional
3987 if (isCompressedFormat(format) && (imageType == VK_IMAGE_TYPE_1D || imageType == VK_IMAGE_TYPE_3D))
3990 // Support for 1D and 3D depth/stencil textures is optional
3991 if (isDepthStencilFormat(format) && (imageType == VK_IMAGE_TYPE_1D || imageType == VK_IMAGE_TYPE_3D))
3994 DE_ASSERT(deviceFeatures.sparseBinding || (createFlags & (VK_IMAGE_CREATE_SPARSE_BINDING_BIT|VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT)) == 0);
3995 DE_ASSERT(deviceFeatures.sparseResidencyAliased || (createFlags & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) == 0);
3997 if (isYCbCrFormat(format) && (createFlags & (VK_IMAGE_CREATE_SPARSE_BINDING_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT)))
4000 if (createFlags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT)
4002 if (isCompressedFormat(format))
4005 if (isDepthStencilFormat(format))
4008 if (!deIsPowerOfTwo32(mapVkFormat(format).getPixelSize()))
4013 case VK_IMAGE_TYPE_2D:
4014 return (deviceFeatures.sparseResidencyImage2D == VK_TRUE);
4015 case VK_IMAGE_TYPE_3D:
4016 return (deviceFeatures.sparseResidencyImage3D == VK_TRUE);
4025 VkSampleCountFlags getRequiredOptimalTilingSampleCounts (const VkPhysicalDeviceLimits& deviceLimits,
4026 const VkFormat format,
4027 const VkImageUsageFlags usageFlags)
4029 if (isCompressedFormat(format))
4030 return VK_SAMPLE_COUNT_1_BIT;
4032 bool hasDepthComp = false;
4033 bool hasStencilComp = false;
4034 const bool isYCbCr = isYCbCrFormat(format);
4037 const tcu::TextureFormat tcuFormat = mapVkFormat(format);
4038 hasDepthComp = (tcuFormat.order == tcu::TextureFormat::D || tcuFormat.order == tcu::TextureFormat::DS);
4039 hasStencilComp = (tcuFormat.order == tcu::TextureFormat::S || tcuFormat.order == tcu::TextureFormat::DS);
4042 const bool isColorFormat = !hasDepthComp && !hasStencilComp;
4043 VkSampleCountFlags sampleCounts = ~(VkSampleCountFlags)0;
4045 DE_ASSERT((hasDepthComp || hasStencilComp) != isColorFormat);
4047 if ((usageFlags & VK_IMAGE_USAGE_STORAGE_BIT) != 0)
4048 sampleCounts &= deviceLimits.storageImageSampleCounts;
4050 if ((usageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) != 0)
4053 sampleCounts &= deviceLimits.sampledImageDepthSampleCounts;
4056 sampleCounts &= deviceLimits.sampledImageStencilSampleCounts;
4061 sampleCounts &= deviceLimits.sampledImageColorSampleCounts;
4064 const tcu::TextureFormat tcuFormat = mapVkFormat(format);
4065 const tcu::TextureChannelClass chnClass = tcu::getTextureChannelClass(tcuFormat.type);
4067 if (chnClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER ||
4068 chnClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER)
4069 sampleCounts &= deviceLimits.sampledImageIntegerSampleCounts;
4071 sampleCounts &= deviceLimits.sampledImageColorSampleCounts;
4076 if ((usageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) != 0)
4077 sampleCounts &= deviceLimits.framebufferColorSampleCounts;
4079 if ((usageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) != 0)
4082 sampleCounts &= deviceLimits.framebufferDepthSampleCounts;
4085 sampleCounts &= deviceLimits.framebufferStencilSampleCounts;
4088 // If there is no usage flag set that would have corresponding device limit,
4089 // only VK_SAMPLE_COUNT_1_BIT is required.
4090 if (sampleCounts == ~(VkSampleCountFlags)0)
4091 sampleCounts &= VK_SAMPLE_COUNT_1_BIT;
4093 return sampleCounts;
4096 struct ImageFormatPropertyCase
4098 typedef tcu::TestStatus (*Function) (Context& context, const VkFormat format, const VkImageType imageType, const VkImageTiling tiling);
4100 Function testFunction;
4102 VkImageType imageType;
4103 VkImageTiling tiling;
4105 ImageFormatPropertyCase (Function testFunction_, VkFormat format_, VkImageType imageType_, VkImageTiling tiling_)
4106 : testFunction (testFunction_)
4108 , imageType (imageType_)
4112 ImageFormatPropertyCase (void)
4113 : testFunction ((Function)DE_NULL)
4114 , format (VK_FORMAT_UNDEFINED)
4115 , imageType (VK_CORE_IMAGE_TYPE_LAST)
4116 , tiling (VK_CORE_IMAGE_TILING_LAST)
4120 tcu::TestStatus imageFormatProperties (Context& context, const VkFormat format, const VkImageType imageType, const VkImageTiling tiling)
4122 if (isYCbCrFormat(format))
4123 // check if Ycbcr format enums are valid given the version and extensions
4124 checkYcbcrApiSupport(context);
4126 TestLog& log = context.getTestContext().getLog();
4127 const VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures();
4128 const VkPhysicalDeviceLimits& deviceLimits = context.getDeviceProperties().limits;
4129 const VkFormatProperties formatProperties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
4130 const bool hasKhrMaintenance1 = context.isDeviceFunctionalitySupported("VK_KHR_maintenance1");
4132 const VkFormatFeatureFlags supportedFeatures = tiling == VK_IMAGE_TILING_LINEAR ? formatProperties.linearTilingFeatures : formatProperties.optimalTilingFeatures;
4133 const VkImageUsageFlags usageFlagSet = getValidImageUsageFlags(supportedFeatures, hasKhrMaintenance1);
4135 tcu::ResultCollector results (log, "ERROR: ");
4137 if (hasKhrMaintenance1 && (supportedFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0)
4139 results.check((supportedFeatures & (VK_FORMAT_FEATURE_TRANSFER_SRC_BIT|VK_FORMAT_FEATURE_TRANSFER_DST_BIT)) != 0,
4140 "A sampled image format must have VK_FORMAT_FEATURE_TRANSFER_SRC_BIT and VK_FORMAT_FEATURE_TRANSFER_DST_BIT format feature flags set");
4143 if (isYcbcrConversionSupported(context) && (format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR || format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR))
4145 VkFormatFeatureFlags requiredFeatures = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR | VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
4146 if (tiling == VK_IMAGE_TILING_OPTIMAL)
4147 requiredFeatures |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR;
4149 results.check((supportedFeatures & requiredFeatures) == requiredFeatures,
4150 getFormatName(format) + string(" must support ") + de::toString(getFormatFeatureFlagsStr(requiredFeatures)));
4153 for (VkImageUsageFlags curUsageFlags = 0; curUsageFlags <= usageFlagSet; curUsageFlags++)
4155 if ((curUsageFlags & ~usageFlagSet) != 0 ||
4156 !isValidImageUsageFlagCombination(curUsageFlags))
4159 const VkImageCreateFlags createFlagSet = getValidImageCreateFlags(deviceFeatures, format, supportedFeatures, imageType, curUsageFlags);
4161 for (VkImageCreateFlags curCreateFlags = 0; curCreateFlags <= createFlagSet; curCreateFlags++)
4163 if ((curCreateFlags & ~createFlagSet) != 0 ||
4164 !isValidImageCreateFlagCombination(curCreateFlags))
4167 const bool isRequiredCombination = isRequiredImageParameterCombination(deviceFeatures,
4174 VkImageFormatProperties properties;
4175 VkResult queryResult;
4177 log << TestLog::Message << "Testing " << getImageTypeStr(imageType) << ", "
4178 << getImageTilingStr(tiling) << ", "
4179 << getImageUsageFlagsStr(curUsageFlags) << ", "
4180 << getImageCreateFlagsStr(curCreateFlags)
4181 << TestLog::EndMessage;
4183 // Set return value to known garbage
4184 deMemset(&properties, 0xcd, sizeof(properties));
4186 queryResult = context.getInstanceInterface().getPhysicalDeviceImageFormatProperties(context.getPhysicalDevice(),
4194 if (queryResult == VK_SUCCESS)
4196 const deUint32 fullMipPyramidSize = de::max(de::max(deLog2Floor32(properties.maxExtent.width),
4197 deLog2Floor32(properties.maxExtent.height)),
4198 deLog2Floor32(properties.maxExtent.depth)) + 1;
4200 log << TestLog::Message << properties << "\n" << TestLog::EndMessage;
4202 results.check(imageType != VK_IMAGE_TYPE_1D || (properties.maxExtent.width >= 1 && properties.maxExtent.height == 1 && properties.maxExtent.depth == 1), "Invalid dimensions for 1D image");
4203 results.check(imageType != VK_IMAGE_TYPE_2D || (properties.maxExtent.width >= 1 && properties.maxExtent.height >= 1 && properties.maxExtent.depth == 1), "Invalid dimensions for 2D image");
4204 results.check(imageType != VK_IMAGE_TYPE_3D || (properties.maxExtent.width >= 1 && properties.maxExtent.height >= 1 && properties.maxExtent.depth >= 1), "Invalid dimensions for 3D image");
4205 results.check(imageType != VK_IMAGE_TYPE_3D || properties.maxArrayLayers == 1, "Invalid maxArrayLayers for 3D image");
4207 if (tiling == VK_IMAGE_TILING_OPTIMAL && imageType == VK_IMAGE_TYPE_2D && !(curCreateFlags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) &&
4208 (supportedFeatures & (VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)))
4210 const VkSampleCountFlags requiredSampleCounts = getRequiredOptimalTilingSampleCounts(deviceLimits, format, curUsageFlags);
4211 results.check((properties.sampleCounts & requiredSampleCounts) == requiredSampleCounts, "Required sample counts not supported");
4214 results.check(properties.sampleCounts == VK_SAMPLE_COUNT_1_BIT, "sampleCounts != VK_SAMPLE_COUNT_1_BIT");
4216 if (isRequiredCombination)
4218 results.check(imageType != VK_IMAGE_TYPE_1D || (properties.maxExtent.width >= deviceLimits.maxImageDimension1D),
4219 "Reported dimensions smaller than device limits");
4220 results.check(imageType != VK_IMAGE_TYPE_2D || (properties.maxExtent.width >= deviceLimits.maxImageDimension2D &&
4221 properties.maxExtent.height >= deviceLimits.maxImageDimension2D),
4222 "Reported dimensions smaller than device limits");
4223 results.check(imageType != VK_IMAGE_TYPE_3D || (properties.maxExtent.width >= deviceLimits.maxImageDimension3D &&
4224 properties.maxExtent.height >= deviceLimits.maxImageDimension3D &&
4225 properties.maxExtent.depth >= deviceLimits.maxImageDimension3D),
4226 "Reported dimensions smaller than device limits");
4227 results.check((isYCbCrFormat(format) && (properties.maxMipLevels == 1)) || properties.maxMipLevels == fullMipPyramidSize,
4228 "Invalid mip pyramid size");
4229 results.check((isYCbCrFormat(format) && (properties.maxArrayLayers == 1)) || imageType == VK_IMAGE_TYPE_3D ||
4230 properties.maxArrayLayers >= deviceLimits.maxImageArrayLayers, "Invalid maxArrayLayers");
4234 results.check(properties.maxMipLevels == 1 || properties.maxMipLevels == fullMipPyramidSize, "Invalid mip pyramid size");
4235 results.check(properties.maxArrayLayers >= 1, "Invalid maxArrayLayers");
4238 results.check(properties.maxResourceSize >= (VkDeviceSize)MINIMUM_REQUIRED_IMAGE_RESOURCE_SIZE,
4239 "maxResourceSize smaller than minimum required size");
4241 else if (queryResult == VK_ERROR_FORMAT_NOT_SUPPORTED)
4243 log << TestLog::Message << "Got VK_ERROR_FORMAT_NOT_SUPPORTED" << TestLog::EndMessage;
4245 if (isRequiredCombination)
4246 results.fail("VK_ERROR_FORMAT_NOT_SUPPORTED returned for required image parameter combination");
4248 // Specification requires that all fields are set to 0
4249 results.check(properties.maxExtent.width == 0, "maxExtent.width != 0");
4250 results.check(properties.maxExtent.height == 0, "maxExtent.height != 0");
4251 results.check(properties.maxExtent.depth == 0, "maxExtent.depth != 0");
4252 results.check(properties.maxMipLevels == 0, "maxMipLevels != 0");
4253 results.check(properties.maxArrayLayers == 0, "maxArrayLayers != 0");
4254 results.check(properties.sampleCounts == 0, "sampleCounts != 0");
4255 results.check(properties.maxResourceSize == 0, "maxResourceSize != 0");
4259 results.fail("Got unexpected error" + de::toString(queryResult));
4264 return tcu::TestStatus(results.getResult(), results.getMessage());
4267 // VK_KHR_get_physical_device_properties2
4269 string toString(const VkPhysicalDevicePCIBusInfoPropertiesEXT& value)
4271 std::ostringstream s;
4272 s << "VkPhysicalDevicePCIBusInfoPropertiesEXT = {\n";
4273 s << "\tsType = " << value.sType << '\n';
4274 s << "\tpciDomain = " << value.pciDomain << '\n';
4275 s << "\tpciBus = " << value.pciBus << '\n';
4276 s << "\tpciDevice = " << value.pciDevice << '\n';
4277 s << "\tpciFunction = " << value.pciFunction << '\n';
4282 bool checkExtension (vector<VkExtensionProperties>& properties, const char* extension)
4284 for (size_t ndx = 0; ndx < properties.size(); ++ndx)
4286 if (strncmp(properties[ndx].extensionName, extension, VK_MAX_EXTENSION_NAME_SIZE) == 0)
4292 #include "vkDeviceFeatures2.inl"
4294 tcu::TestStatus deviceFeatures2 (Context& context)
4296 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4297 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4298 const InstanceDriver& vki (instance.getDriver());
4299 TestLog& log = context.getTestContext().getLog();
4300 VkPhysicalDeviceFeatures coreFeatures;
4301 VkPhysicalDeviceFeatures2 extFeatures;
4303 deMemset(&coreFeatures, 0xcd, sizeof(coreFeatures));
4304 deMemset(&extFeatures.features, 0xcd, sizeof(extFeatures.features));
4305 std::vector<std::string> instExtensions = context.getInstanceExtensions();
4307 extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
4308 extFeatures.pNext = DE_NULL;
4310 vki.getPhysicalDeviceFeatures(physicalDevice, &coreFeatures);
4311 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
4313 TCU_CHECK(extFeatures.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2);
4314 TCU_CHECK(extFeatures.pNext == DE_NULL);
4316 if (deMemCmp(&coreFeatures, &extFeatures.features, sizeof(VkPhysicalDeviceFeatures)) != 0)
4317 TCU_FAIL("Mismatch between features reported by vkGetPhysicalDeviceFeatures and vkGetPhysicalDeviceFeatures2");
4319 log << TestLog::Message << extFeatures << TestLog::EndMessage;
4321 return tcu::TestStatus::pass("Querying device features succeeded");
4324 tcu::TestStatus deviceProperties2 (Context& context)
4326 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4327 const InstanceDriver& vki (instance.getDriver());
4328 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
4329 TestLog& log = context.getTestContext().getLog();
4330 VkPhysicalDeviceProperties coreProperties;
4331 VkPhysicalDeviceProperties2 extProperties;
4333 extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
4334 extProperties.pNext = DE_NULL;
4336 vki.getPhysicalDeviceProperties(physicalDevice, &coreProperties);
4337 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4339 TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2);
4340 TCU_CHECK(extProperties.pNext == DE_NULL);
4342 // We can't use memcmp() here because the structs may contain padding bytes that drivers may or may not
4343 // have written while writing the data and memcmp will compare them anyway, so we iterate through the
4344 // valid bytes for each field in the struct and compare only the valid bytes for each one.
4345 for (int propNdx = 0; propNdx < DE_LENGTH_OF_ARRAY(s_physicalDevicePropertiesOffsetTable); propNdx++)
4347 const size_t offset = s_physicalDevicePropertiesOffsetTable[propNdx].offset;
4348 const size_t size = s_physicalDevicePropertiesOffsetTable[propNdx].size;
4350 const deUint8* corePropertyBytes = reinterpret_cast<deUint8*>(&coreProperties) + offset;
4351 const deUint8* extPropertyBytes = reinterpret_cast<deUint8*>(&extProperties.properties) + offset;
4353 if (deMemCmp(corePropertyBytes, extPropertyBytes, size) != 0)
4354 TCU_FAIL("Mismatch between properties reported by vkGetPhysicalDeviceProperties and vkGetPhysicalDeviceProperties2");
4357 log << TestLog::Message << extProperties.properties << TestLog::EndMessage;
4359 const int count = 2u;
4361 vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
4362 const bool khr_external_fence_capabilities = checkExtension(properties, "VK_KHR_external_fence_capabilities") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4363 const bool khr_external_memory_capabilities = checkExtension(properties, "VK_KHR_external_memory_capabilities") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4364 const bool khr_external_semaphore_capabilities = checkExtension(properties, "VK_KHR_external_semaphore_capabilities") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4365 const bool khr_multiview = checkExtension(properties, "VK_KHR_multiview") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4366 const bool khr_device_protected_memory = context.contextSupports(vk::ApiVersion(1, 1, 0));
4367 const bool khr_device_subgroup = context.contextSupports(vk::ApiVersion(1, 1, 0));
4368 const bool khr_maintenance2 = checkExtension(properties, "VK_KHR_maintenance2") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4369 const bool khr_maintenance3 = checkExtension(properties, "VK_KHR_maintenance3") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4370 const bool khr_depth_stencil_resolve = checkExtension(properties, "VK_KHR_depth_stencil_resolve") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4371 const bool khr_driver_properties = checkExtension(properties, "VK_KHR_driver_properties") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4372 const bool khr_shader_float_controls = checkExtension(properties, "VK_KHR_shader_float_controls") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4373 const bool khr_descriptor_indexing = checkExtension(properties, "VK_EXT_descriptor_indexing") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4374 const bool khr_sampler_filter_minmax = checkExtension(properties, "VK_EXT_sampler_filter_minmax") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4375 const bool khr_integer_dot_product = checkExtension(properties, "VK_KHR_shader_integer_dot_product") || context.contextSupports(vk::ApiVersion(1, 3, 0));
4376 const bool khr_inline_uniform_block = checkExtension(properties, "VK_EXT_inline_uniform_block") || context.contextSupports(vk::ApiVersion(1, 3, 0));
4377 const bool khr_maintenance4 = checkExtension(properties, "VK_KHR_maintenance4") || context.contextSupports(vk::ApiVersion(1, 3, 0));
4378 const bool khr_subgroup_size_control = checkExtension(properties, "VK_EXT_subgroup_size_control") || context.contextSupports(vk::ApiVersion(1, 3, 0));
4379 const bool khr_texel_buffer_alignment = checkExtension(properties, "VK_EXT_texel_buffer_alignment") || context.contextSupports(vk::ApiVersion(1, 3, 0));
4381 VkPhysicalDeviceIDProperties idProperties[count];
4382 VkPhysicalDeviceMultiviewProperties multiviewProperties[count];
4383 VkPhysicalDeviceProtectedMemoryProperties protectedMemoryPropertiesKHR[count];
4384 VkPhysicalDeviceSubgroupProperties subgroupProperties[count];
4385 VkPhysicalDevicePointClippingProperties pointClippingProperties[count];
4386 VkPhysicalDeviceMaintenance3Properties maintenance3Properties[count];
4387 VkPhysicalDeviceDepthStencilResolveProperties depthStencilResolveProperties[count];
4388 VkPhysicalDeviceDriverProperties driverProperties[count];
4389 VkPhysicalDeviceFloatControlsProperties floatControlsProperties[count];
4390 VkPhysicalDeviceDescriptorIndexingProperties descriptorIndexingProperties[count];
4391 VkPhysicalDeviceSamplerFilterMinmaxProperties samplerFilterMinmaxProperties[count];
4392 VkPhysicalDeviceShaderIntegerDotProductProperties integerDotProductProperties[count];
4393 VkPhysicalDeviceInlineUniformBlockProperties inlineUniformBlockProperties[count];
4394 VkPhysicalDeviceMaintenance4Properties maintenance4Properties[count];
4395 VkPhysicalDeviceSubgroupSizeControlProperties subgroupSizeControlProperties[count];
4396 VkPhysicalDeviceTexelBufferAlignmentProperties texelBufferAlignmentProperties[count];
4398 for (int ndx = 0; ndx < count; ++ndx)
4400 deMemset(&idProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceIDProperties ));
4401 deMemset(&multiviewProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceMultiviewProperties ));
4402 deMemset(&protectedMemoryPropertiesKHR[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceProtectedMemoryProperties ));
4403 deMemset(&subgroupProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceSubgroupProperties ));
4404 deMemset(&pointClippingProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDevicePointClippingProperties ));
4405 deMemset(&maintenance3Properties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceMaintenance3Properties ));
4406 deMemset(&depthStencilResolveProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceDepthStencilResolveProperties ));
4407 deMemset(&driverProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceDriverProperties ));
4408 deMemset(&floatControlsProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceFloatControlsProperties ));
4409 deMemset(&descriptorIndexingProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceDescriptorIndexingProperties ));
4410 deMemset(&samplerFilterMinmaxProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceSamplerFilterMinmaxProperties ));
4411 deMemset(&integerDotProductProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR ));
4412 deMemset(&inlineUniformBlockProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceInlineUniformBlockProperties ));
4413 deMemset(&maintenance4Properties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceMaintenance4Properties ));
4414 deMemset(&subgroupSizeControlProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceSubgroupSizeControlProperties ));
4415 deMemset(&texelBufferAlignmentProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceTexelBufferAlignmentProperties ));
4417 idProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
4418 idProperties[ndx].pNext = &multiviewProperties[ndx];
4420 multiviewProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES;
4421 multiviewProperties[ndx].pNext = &protectedMemoryPropertiesKHR[ndx];
4423 protectedMemoryPropertiesKHR[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES;
4424 protectedMemoryPropertiesKHR[ndx].pNext = &subgroupProperties[ndx];
4426 subgroupProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
4427 subgroupProperties[ndx].pNext = &pointClippingProperties[ndx];
4429 pointClippingProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES;
4430 pointClippingProperties[ndx].pNext = &maintenance3Properties[ndx];
4432 maintenance3Properties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES;
4433 maintenance3Properties[ndx].pNext = &depthStencilResolveProperties[ndx];
4435 depthStencilResolveProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES;
4436 depthStencilResolveProperties[ndx].pNext = &driverProperties[ndx];
4438 driverProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
4439 driverProperties[ndx].pNext = &floatControlsProperties[ndx];
4441 floatControlsProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR;
4442 floatControlsProperties[ndx].pNext = &descriptorIndexingProperties[ndx];
4444 descriptorIndexingProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES;
4445 descriptorIndexingProperties[ndx].pNext = &samplerFilterMinmaxProperties[ndx];
4447 samplerFilterMinmaxProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES;
4448 samplerFilterMinmaxProperties[ndx].pNext = &integerDotProductProperties[ndx];
4450 integerDotProductProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR;
4451 integerDotProductProperties[ndx].pNext = &inlineUniformBlockProperties[ndx];
4453 inlineUniformBlockProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES;
4454 inlineUniformBlockProperties[ndx].pNext = &maintenance4Properties[ndx];
4456 maintenance4Properties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES;
4457 maintenance4Properties[ndx].pNext = &subgroupSizeControlProperties[ndx];
4459 subgroupSizeControlProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES;
4460 subgroupSizeControlProperties[ndx].pNext = &texelBufferAlignmentProperties[ndx];
4462 texelBufferAlignmentProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES;
4463 texelBufferAlignmentProperties[ndx].pNext = DE_NULL;
4465 extProperties.pNext = &idProperties[ndx];
4467 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4470 if ( khr_external_fence_capabilities || khr_external_memory_capabilities || khr_external_semaphore_capabilities )
4471 log << TestLog::Message << idProperties[0] << TestLog::EndMessage;
4473 log << TestLog::Message << multiviewProperties[0] << TestLog::EndMessage;
4474 if (khr_device_protected_memory)
4475 log << TestLog::Message << protectedMemoryPropertiesKHR[0] << TestLog::EndMessage;
4476 if (khr_device_subgroup)
4477 log << TestLog::Message << subgroupProperties[0] << TestLog::EndMessage;
4478 if (khr_maintenance2)
4479 log << TestLog::Message << pointClippingProperties[0] << TestLog::EndMessage;
4480 if (khr_maintenance3)
4481 log << TestLog::Message << maintenance3Properties[0] << TestLog::EndMessage;
4482 if (khr_depth_stencil_resolve)
4483 log << TestLog::Message << depthStencilResolveProperties[0] << TestLog::EndMessage;
4484 if (khr_driver_properties)
4485 log << TestLog::Message << driverProperties[0] << TestLog::EndMessage;
4486 if (khr_shader_float_controls)
4487 log << TestLog::Message << floatControlsProperties[0] << TestLog::EndMessage;
4488 if (khr_descriptor_indexing)
4489 log << TestLog::Message << descriptorIndexingProperties[0] << TestLog::EndMessage;
4490 if (khr_sampler_filter_minmax)
4491 log << TestLog::Message << samplerFilterMinmaxProperties[0] << TestLog::EndMessage;
4492 if (khr_integer_dot_product)
4493 log << TestLog::Message << integerDotProductProperties[0] << TestLog::EndMessage;
4494 if (khr_inline_uniform_block)
4495 log << TestLog::Message << inlineUniformBlockProperties[0] << TestLog::EndMessage;
4496 if (khr_maintenance4)
4497 log << TestLog::Message << maintenance4Properties[0] << TestLog::EndMessage;
4498 if (khr_subgroup_size_control)
4499 log << TestLog::Message << subgroupSizeControlProperties[0] << TestLog::EndMessage;
4500 if (khr_texel_buffer_alignment)
4501 log << TestLog::Message << texelBufferAlignmentProperties[0] << TestLog::EndMessage;
4503 if (khr_integer_dot_product)
4504 log << TestLog::Message << integerDotProductProperties[0] << TestLog::EndMessage;
4506 if ( khr_external_fence_capabilities || khr_external_memory_capabilities || khr_external_semaphore_capabilities )
4508 if ((deMemCmp(idProperties[0].deviceUUID, idProperties[1].deviceUUID, VK_UUID_SIZE) != 0) ||
4509 (deMemCmp(idProperties[0].driverUUID, idProperties[1].driverUUID, VK_UUID_SIZE) != 0) ||
4510 (idProperties[0].deviceLUIDValid != idProperties[1].deviceLUIDValid))
4512 TCU_FAIL("Mismatch between VkPhysicalDeviceIDProperties");
4514 else if (idProperties[0].deviceLUIDValid)
4516 // If deviceLUIDValid is VK_FALSE, the contents of deviceLUID and deviceNodeMask are undefined
4517 // so thay can only be compared when deviceLUIDValid is VK_TRUE.
4518 if ((deMemCmp(idProperties[0].deviceLUID, idProperties[1].deviceLUID, VK_LUID_SIZE) != 0) ||
4519 (idProperties[0].deviceNodeMask != idProperties[1].deviceNodeMask))
4521 TCU_FAIL("Mismatch between VkPhysicalDeviceIDProperties");
4525 if (khr_multiview &&
4526 (multiviewProperties[0].maxMultiviewViewCount != multiviewProperties[1].maxMultiviewViewCount ||
4527 multiviewProperties[0].maxMultiviewInstanceIndex != multiviewProperties[1].maxMultiviewInstanceIndex))
4529 TCU_FAIL("Mismatch between VkPhysicalDeviceMultiviewProperties");
4531 if (khr_device_protected_memory &&
4532 (protectedMemoryPropertiesKHR[0].protectedNoFault != protectedMemoryPropertiesKHR[1].protectedNoFault))
4534 TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryProperties");
4536 if (khr_device_subgroup &&
4537 (subgroupProperties[0].subgroupSize != subgroupProperties[1].subgroupSize ||
4538 subgroupProperties[0].supportedStages != subgroupProperties[1].supportedStages ||
4539 subgroupProperties[0].supportedOperations != subgroupProperties[1].supportedOperations ||
4540 subgroupProperties[0].quadOperationsInAllStages != subgroupProperties[1].quadOperationsInAllStages ))
4542 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupProperties");
4544 if (khr_maintenance2 &&
4545 (pointClippingProperties[0].pointClippingBehavior != pointClippingProperties[1].pointClippingBehavior))
4547 TCU_FAIL("Mismatch between VkPhysicalDevicePointClippingProperties");
4549 if (khr_maintenance3 &&
4550 (maintenance3Properties[0].maxPerSetDescriptors != maintenance3Properties[1].maxPerSetDescriptors ||
4551 maintenance3Properties[0].maxMemoryAllocationSize != maintenance3Properties[1].maxMemoryAllocationSize))
4553 if (protectedMemoryPropertiesKHR[0].protectedNoFault != protectedMemoryPropertiesKHR[1].protectedNoFault)
4555 TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryProperties");
4557 if ((subgroupProperties[0].subgroupSize != subgroupProperties[1].subgroupSize) ||
4558 (subgroupProperties[0].supportedStages != subgroupProperties[1].supportedStages) ||
4559 (subgroupProperties[0].supportedOperations != subgroupProperties[1].supportedOperations) ||
4560 (subgroupProperties[0].quadOperationsInAllStages != subgroupProperties[1].quadOperationsInAllStages))
4562 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupProperties");
4564 TCU_FAIL("Mismatch between VkPhysicalDeviceMaintenance3Properties");
4566 if (khr_depth_stencil_resolve &&
4567 (depthStencilResolveProperties[0].supportedDepthResolveModes != depthStencilResolveProperties[1].supportedDepthResolveModes ||
4568 depthStencilResolveProperties[0].supportedStencilResolveModes != depthStencilResolveProperties[1].supportedStencilResolveModes ||
4569 depthStencilResolveProperties[0].independentResolveNone != depthStencilResolveProperties[1].independentResolveNone ||
4570 depthStencilResolveProperties[0].independentResolve != depthStencilResolveProperties[1].independentResolve))
4572 TCU_FAIL("Mismatch between VkPhysicalDeviceDepthStencilResolveProperties");
4574 if (khr_driver_properties &&
4575 (driverProperties[0].driverID != driverProperties[1].driverID ||
4576 strncmp(driverProperties[0].driverName, driverProperties[1].driverName, VK_MAX_DRIVER_NAME_SIZE) != 0 ||
4577 strncmp(driverProperties[0].driverInfo, driverProperties[1].driverInfo, VK_MAX_DRIVER_INFO_SIZE) != 0 ||
4578 driverProperties[0].conformanceVersion.major != driverProperties[1].conformanceVersion.major ||
4579 driverProperties[0].conformanceVersion.minor != driverProperties[1].conformanceVersion.minor ||
4580 driverProperties[0].conformanceVersion.subminor != driverProperties[1].conformanceVersion.subminor ||
4581 driverProperties[0].conformanceVersion.patch != driverProperties[1].conformanceVersion.patch))
4583 TCU_FAIL("Mismatch between VkPhysicalDeviceDriverProperties");
4585 if (khr_shader_float_controls &&
4586 (floatControlsProperties[0].denormBehaviorIndependence != floatControlsProperties[1].denormBehaviorIndependence ||
4587 floatControlsProperties[0].roundingModeIndependence != floatControlsProperties[1].roundingModeIndependence ||
4588 floatControlsProperties[0].shaderSignedZeroInfNanPreserveFloat16 != floatControlsProperties[1].shaderSignedZeroInfNanPreserveFloat16 ||
4589 floatControlsProperties[0].shaderSignedZeroInfNanPreserveFloat32 != floatControlsProperties[1].shaderSignedZeroInfNanPreserveFloat32 ||
4590 floatControlsProperties[0].shaderSignedZeroInfNanPreserveFloat64 != floatControlsProperties[1].shaderSignedZeroInfNanPreserveFloat64 ||
4591 floatControlsProperties[0].shaderDenormPreserveFloat16 != floatControlsProperties[1].shaderDenormPreserveFloat16 ||
4592 floatControlsProperties[0].shaderDenormPreserveFloat32 != floatControlsProperties[1].shaderDenormPreserveFloat32 ||
4593 floatControlsProperties[0].shaderDenormPreserveFloat64 != floatControlsProperties[1].shaderDenormPreserveFloat64 ||
4594 floatControlsProperties[0].shaderDenormFlushToZeroFloat16 != floatControlsProperties[1].shaderDenormFlushToZeroFloat16 ||
4595 floatControlsProperties[0].shaderDenormFlushToZeroFloat32 != floatControlsProperties[1].shaderDenormFlushToZeroFloat32 ||
4596 floatControlsProperties[0].shaderDenormFlushToZeroFloat64 != floatControlsProperties[1].shaderDenormFlushToZeroFloat64 ||
4597 floatControlsProperties[0].shaderRoundingModeRTEFloat16 != floatControlsProperties[1].shaderRoundingModeRTEFloat16 ||
4598 floatControlsProperties[0].shaderRoundingModeRTEFloat32 != floatControlsProperties[1].shaderRoundingModeRTEFloat32 ||
4599 floatControlsProperties[0].shaderRoundingModeRTEFloat64 != floatControlsProperties[1].shaderRoundingModeRTEFloat64 ||
4600 floatControlsProperties[0].shaderRoundingModeRTZFloat16 != floatControlsProperties[1].shaderRoundingModeRTZFloat16 ||
4601 floatControlsProperties[0].shaderRoundingModeRTZFloat32 != floatControlsProperties[1].shaderRoundingModeRTZFloat32 ||
4602 floatControlsProperties[0].shaderRoundingModeRTZFloat64 != floatControlsProperties[1].shaderRoundingModeRTZFloat64 ))
4604 TCU_FAIL("Mismatch between VkPhysicalDeviceFloatControlsProperties");
4606 if (khr_descriptor_indexing &&
4607 (descriptorIndexingProperties[0].maxUpdateAfterBindDescriptorsInAllPools != descriptorIndexingProperties[1].maxUpdateAfterBindDescriptorsInAllPools ||
4608 descriptorIndexingProperties[0].shaderUniformBufferArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderUniformBufferArrayNonUniformIndexingNative ||
4609 descriptorIndexingProperties[0].shaderSampledImageArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderSampledImageArrayNonUniformIndexingNative ||
4610 descriptorIndexingProperties[0].shaderStorageBufferArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderStorageBufferArrayNonUniformIndexingNative ||
4611 descriptorIndexingProperties[0].shaderStorageImageArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderStorageImageArrayNonUniformIndexingNative ||
4612 descriptorIndexingProperties[0].shaderInputAttachmentArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderInputAttachmentArrayNonUniformIndexingNative ||
4613 descriptorIndexingProperties[0].robustBufferAccessUpdateAfterBind != descriptorIndexingProperties[1].robustBufferAccessUpdateAfterBind ||
4614 descriptorIndexingProperties[0].quadDivergentImplicitLod != descriptorIndexingProperties[1].quadDivergentImplicitLod ||
4615 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindSamplers != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindSamplers ||
4616 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindUniformBuffers != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindUniformBuffers ||
4617 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindStorageBuffers != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindStorageBuffers ||
4618 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindSampledImages != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindSampledImages ||
4619 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindStorageImages != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindStorageImages ||
4620 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindInputAttachments != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindInputAttachments ||
4621 descriptorIndexingProperties[0].maxPerStageUpdateAfterBindResources != descriptorIndexingProperties[1].maxPerStageUpdateAfterBindResources ||
4622 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindSamplers != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindSamplers ||
4623 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindUniformBuffers != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindUniformBuffers ||
4624 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindUniformBuffersDynamic != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindUniformBuffersDynamic ||
4625 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindStorageBuffers != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindStorageBuffers ||
4626 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindStorageBuffersDynamic != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindStorageBuffersDynamic ||
4627 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindSampledImages != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindSampledImages ||
4628 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindStorageImages != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindStorageImages ||
4629 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindInputAttachments != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindInputAttachments ))
4631 TCU_FAIL("Mismatch between VkPhysicalDeviceDescriptorIndexingProperties");
4633 if (khr_sampler_filter_minmax &&
4634 (samplerFilterMinmaxProperties[0].filterMinmaxSingleComponentFormats != samplerFilterMinmaxProperties[1].filterMinmaxSingleComponentFormats ||
4635 samplerFilterMinmaxProperties[0].filterMinmaxImageComponentMapping != samplerFilterMinmaxProperties[1].filterMinmaxImageComponentMapping))
4637 TCU_FAIL("Mismatch between VkPhysicalDeviceSamplerFilterMinmaxProperties");
4639 if (khr_integer_dot_product &&
4640 (integerDotProductProperties[0].integerDotProduct8BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct8BitUnsignedAccelerated ||
4641 integerDotProductProperties[0].integerDotProduct8BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct8BitSignedAccelerated ||
4642 integerDotProductProperties[0].integerDotProduct8BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct8BitMixedSignednessAccelerated ||
4643 integerDotProductProperties[0].integerDotProduct4x8BitPackedUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedUnsignedAccelerated ||
4644 integerDotProductProperties[0].integerDotProduct4x8BitPackedSignedAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedSignedAccelerated ||
4645 integerDotProductProperties[0].integerDotProduct4x8BitPackedMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedMixedSignednessAccelerated ||
4646 integerDotProductProperties[0].integerDotProduct16BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct16BitUnsignedAccelerated ||
4647 integerDotProductProperties[0].integerDotProduct16BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct16BitSignedAccelerated ||
4648 integerDotProductProperties[0].integerDotProduct16BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct16BitMixedSignednessAccelerated ||
4649 integerDotProductProperties[0].integerDotProduct32BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct32BitUnsignedAccelerated ||
4650 integerDotProductProperties[0].integerDotProduct32BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct32BitSignedAccelerated ||
4651 integerDotProductProperties[0].integerDotProduct32BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct32BitMixedSignednessAccelerated ||
4652 integerDotProductProperties[0].integerDotProduct64BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct64BitUnsignedAccelerated ||
4653 integerDotProductProperties[0].integerDotProduct64BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct64BitSignedAccelerated ||
4654 integerDotProductProperties[0].integerDotProduct64BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct64BitMixedSignednessAccelerated ||
4655 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitUnsignedAccelerated ||
4656 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitSignedAccelerated ||
4657 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated ||
4658 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated ||
4659 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated ||
4660 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated ||
4661 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitUnsignedAccelerated ||
4662 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitSignedAccelerated ||
4663 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated ||
4664 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitUnsignedAccelerated ||
4665 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitSignedAccelerated ||
4666 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated ||
4667 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitUnsignedAccelerated ||
4668 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitSignedAccelerated ||
4669 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated))
4671 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR");
4673 if (khr_inline_uniform_block &&
4674 (inlineUniformBlockProperties[0].maxInlineUniformBlockSize != inlineUniformBlockProperties[1].maxInlineUniformBlockSize ||
4675 inlineUniformBlockProperties[0].maxPerStageDescriptorInlineUniformBlocks != inlineUniformBlockProperties[1].maxPerStageDescriptorInlineUniformBlocks ||
4676 inlineUniformBlockProperties[0].maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks != inlineUniformBlockProperties[1].maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks ||
4677 inlineUniformBlockProperties[0].maxDescriptorSetInlineUniformBlocks != inlineUniformBlockProperties[1].maxDescriptorSetInlineUniformBlocks ||
4678 inlineUniformBlockProperties[0].maxDescriptorSetUpdateAfterBindInlineUniformBlocks != inlineUniformBlockProperties[1].maxDescriptorSetUpdateAfterBindInlineUniformBlocks))
4680 TCU_FAIL("Mismatch between VkPhysicalDeviceInlineUniformBlockProperties");
4682 if (khr_maintenance4 &&
4683 (maintenance4Properties[0].maxBufferSize != maintenance4Properties[1].maxBufferSize))
4685 TCU_FAIL("Mismatch between VkPhysicalDeviceMaintenance4Properties");
4687 if (khr_subgroup_size_control &&
4688 (subgroupSizeControlProperties[0].minSubgroupSize != subgroupSizeControlProperties[1].minSubgroupSize ||
4689 subgroupSizeControlProperties[0].maxSubgroupSize != subgroupSizeControlProperties[1].maxSubgroupSize ||
4690 subgroupSizeControlProperties[0].maxComputeWorkgroupSubgroups != subgroupSizeControlProperties[1].maxComputeWorkgroupSubgroups ||
4691 subgroupSizeControlProperties[0].requiredSubgroupSizeStages != subgroupSizeControlProperties[1].requiredSubgroupSizeStages))
4693 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupSizeControlProperties");
4695 if (khr_texel_buffer_alignment &&
4696 (texelBufferAlignmentProperties[0].storageTexelBufferOffsetAlignmentBytes != texelBufferAlignmentProperties[1].storageTexelBufferOffsetAlignmentBytes ||
4697 texelBufferAlignmentProperties[0].storageTexelBufferOffsetSingleTexelAlignment != texelBufferAlignmentProperties[1].storageTexelBufferOffsetSingleTexelAlignment ||
4698 texelBufferAlignmentProperties[0].uniformTexelBufferOffsetAlignmentBytes != texelBufferAlignmentProperties[1].uniformTexelBufferOffsetAlignmentBytes ||
4699 texelBufferAlignmentProperties[0].uniformTexelBufferOffsetSingleTexelAlignment != texelBufferAlignmentProperties[1].uniformTexelBufferOffsetSingleTexelAlignment))
4701 TCU_FAIL("Mismatch between VkPhysicalDeviceTexelBufferAlignmentProperties");
4704 if (khr_integer_dot_product &&
4705 (integerDotProductProperties[0].integerDotProduct8BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct8BitUnsignedAccelerated ||
4706 integerDotProductProperties[0].integerDotProduct8BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct8BitSignedAccelerated ||
4707 integerDotProductProperties[0].integerDotProduct8BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct8BitMixedSignednessAccelerated ||
4708 integerDotProductProperties[0].integerDotProduct4x8BitPackedUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedUnsignedAccelerated ||
4709 integerDotProductProperties[0].integerDotProduct4x8BitPackedSignedAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedSignedAccelerated ||
4710 integerDotProductProperties[0].integerDotProduct4x8BitPackedMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedMixedSignednessAccelerated ||
4711 integerDotProductProperties[0].integerDotProduct16BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct16BitUnsignedAccelerated ||
4712 integerDotProductProperties[0].integerDotProduct16BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct16BitSignedAccelerated ||
4713 integerDotProductProperties[0].integerDotProduct16BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct16BitMixedSignednessAccelerated ||
4714 integerDotProductProperties[0].integerDotProduct32BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct32BitUnsignedAccelerated ||
4715 integerDotProductProperties[0].integerDotProduct32BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct32BitSignedAccelerated ||
4716 integerDotProductProperties[0].integerDotProduct32BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct32BitMixedSignednessAccelerated ||
4717 integerDotProductProperties[0].integerDotProduct64BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct64BitUnsignedAccelerated ||
4718 integerDotProductProperties[0].integerDotProduct64BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct64BitSignedAccelerated ||
4719 integerDotProductProperties[0].integerDotProduct64BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct64BitMixedSignednessAccelerated ||
4720 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitUnsignedAccelerated ||
4721 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitSignedAccelerated ||
4722 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated ||
4723 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated ||
4724 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated ||
4725 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated ||
4726 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitUnsignedAccelerated ||
4727 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitSignedAccelerated ||
4728 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated ||
4729 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitUnsignedAccelerated ||
4730 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitSignedAccelerated ||
4731 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated ||
4732 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitUnsignedAccelerated ||
4733 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitSignedAccelerated ||
4734 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated))
4736 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR");
4739 if (isExtensionSupported(properties, RequiredExtension("VK_KHR_push_descriptor")))
4741 VkPhysicalDevicePushDescriptorPropertiesKHR pushDescriptorProperties[count];
4743 for (int ndx = 0; ndx < count; ++ndx)
4745 deMemset(&pushDescriptorProperties[ndx], 0xFF * ndx, sizeof(VkPhysicalDevicePushDescriptorPropertiesKHR));
4747 pushDescriptorProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR;
4748 pushDescriptorProperties[ndx].pNext = DE_NULL;
4750 extProperties.pNext = &pushDescriptorProperties[ndx];
4752 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4754 pushDescriptorProperties[ndx].pNext = DE_NULL;
4757 log << TestLog::Message << pushDescriptorProperties[0] << TestLog::EndMessage;
4759 if ( pushDescriptorProperties[0].maxPushDescriptors != pushDescriptorProperties[1].maxPushDescriptors )
4761 TCU_FAIL("Mismatch between VkPhysicalDevicePushDescriptorPropertiesKHR ");
4763 if (pushDescriptorProperties[0].maxPushDescriptors < 32)
4765 TCU_FAIL("VkPhysicalDevicePushDescriptorPropertiesKHR.maxPushDescriptors must be at least 32");
4769 if (isExtensionSupported(properties, RequiredExtension("VK_KHR_performance_query")))
4771 VkPhysicalDevicePerformanceQueryPropertiesKHR performanceQueryProperties[count];
4773 for (int ndx = 0; ndx < count; ++ndx)
4775 deMemset(&performanceQueryProperties[ndx], 0xFF * ndx, sizeof(VkPhysicalDevicePerformanceQueryPropertiesKHR));
4776 performanceQueryProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR;
4777 performanceQueryProperties[ndx].pNext = DE_NULL;
4779 extProperties.pNext = &performanceQueryProperties[ndx];
4781 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4784 log << TestLog::Message << performanceQueryProperties[0] << TestLog::EndMessage;
4786 if (performanceQueryProperties[0].allowCommandBufferQueryCopies != performanceQueryProperties[1].allowCommandBufferQueryCopies)
4788 TCU_FAIL("Mismatch between VkPhysicalDevicePerformanceQueryPropertiesKHR");
4792 if (isExtensionSupported(properties, RequiredExtension("VK_EXT_pci_bus_info", 2, 2)))
4794 VkPhysicalDevicePCIBusInfoPropertiesEXT pciBusInfoProperties[count];
4796 for (int ndx = 0; ndx < count; ++ndx)
4798 // Each PCI device is identified by an 8-bit domain number, 5-bit
4799 // device number and 3-bit function number[1][2].
4801 // In addition, because PCI systems can be interconnected and
4802 // divided in segments, Linux assigns a 16-bit number to the device
4803 // as the "domain". In Windows, the segment or domain is stored in
4804 // the higher 24-bit section of the bus number.
4806 // This means the maximum unsigned 32-bit integer for these members
4807 // are invalid values and should change after querying properties.
4809 // [1] https://en.wikipedia.org/wiki/PCI_configuration_space
4810 // [2] PCI Express Base Specification Revision 3.0, section 2.2.4.2.
4811 deMemset(pciBusInfoProperties + ndx, 0xFF * ndx, sizeof(pciBusInfoProperties[ndx]));
4812 pciBusInfoProperties[ndx].pciDomain = DEUINT32_MAX;
4813 pciBusInfoProperties[ndx].pciBus = DEUINT32_MAX;
4814 pciBusInfoProperties[ndx].pciDevice = DEUINT32_MAX;
4815 pciBusInfoProperties[ndx].pciFunction = DEUINT32_MAX;
4817 pciBusInfoProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT;
4818 pciBusInfoProperties[ndx].pNext = DE_NULL;
4820 extProperties.pNext = pciBusInfoProperties + ndx;
4821 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4824 log << TestLog::Message << toString(pciBusInfoProperties[0]) << TestLog::EndMessage;
4826 if (pciBusInfoProperties[0].pciDomain != pciBusInfoProperties[1].pciDomain ||
4827 pciBusInfoProperties[0].pciBus != pciBusInfoProperties[1].pciBus ||
4828 pciBusInfoProperties[0].pciDevice != pciBusInfoProperties[1].pciDevice ||
4829 pciBusInfoProperties[0].pciFunction != pciBusInfoProperties[1].pciFunction)
4831 TCU_FAIL("Mismatch between VkPhysicalDevicePCIBusInfoPropertiesEXT");
4833 if (pciBusInfoProperties[0].pciDomain == DEUINT32_MAX ||
4834 pciBusInfoProperties[0].pciBus == DEUINT32_MAX ||
4835 pciBusInfoProperties[0].pciDevice == DEUINT32_MAX ||
4836 pciBusInfoProperties[0].pciFunction == DEUINT32_MAX)
4838 TCU_FAIL("Invalid information in VkPhysicalDevicePCIBusInfoPropertiesEXT");
4842 if (isExtensionSupported(properties, RequiredExtension("VK_KHR_portability_subset")))
4844 VkPhysicalDevicePortabilitySubsetPropertiesKHR portabilitySubsetProperties[count];
4846 for (int ndx = 0; ndx < count; ++ndx)
4848 deMemset(&portabilitySubsetProperties[ndx], 0xFF * ndx, sizeof(VkPhysicalDevicePortabilitySubsetPropertiesKHR));
4849 portabilitySubsetProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR;
4850 portabilitySubsetProperties[ndx].pNext = DE_NULL;
4852 extProperties.pNext = &portabilitySubsetProperties[ndx];
4854 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4857 log << TestLog::Message << portabilitySubsetProperties[0] << TestLog::EndMessage;
4859 if (portabilitySubsetProperties[0].minVertexInputBindingStrideAlignment != portabilitySubsetProperties[1].minVertexInputBindingStrideAlignment)
4861 TCU_FAIL("Mismatch between VkPhysicalDevicePortabilitySubsetPropertiesKHR");
4865 return tcu::TestStatus::pass("Querying device properties succeeded");
4868 string toString (const VkFormatProperties2& value)
4870 std::ostringstream s;
4871 s << "VkFormatProperties2 = {\n";
4872 s << "\tsType = " << value.sType << '\n';
4873 s << "\tformatProperties = {\n";
4874 s << "\tlinearTilingFeatures = " << getFormatFeatureFlagsStr(value.formatProperties.linearTilingFeatures) << '\n';
4875 s << "\toptimalTilingFeatures = " << getFormatFeatureFlagsStr(value.formatProperties.optimalTilingFeatures) << '\n';
4876 s << "\tbufferFeatures = " << getFormatFeatureFlagsStr(value.formatProperties.bufferFeatures) << '\n';
4882 tcu::TestStatus deviceFormatProperties2 (Context& context)
4884 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4885 const InstanceDriver& vki (instance.getDriver());
4886 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
4887 TestLog& log = context.getTestContext().getLog();
4889 for (int formatNdx = 0; formatNdx < VK_CORE_FORMAT_LAST; ++formatNdx)
4891 const VkFormat format = (VkFormat)formatNdx;
4892 VkFormatProperties coreProperties;
4893 VkFormatProperties2 extProperties;
4895 deMemset(&coreProperties, 0xcd, sizeof(VkFormatProperties));
4896 deMemset(&extProperties, 0xcd, sizeof(VkFormatProperties2));
4898 extProperties.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
4899 extProperties.pNext = DE_NULL;
4901 vki.getPhysicalDeviceFormatProperties(physicalDevice, format, &coreProperties);
4902 vki.getPhysicalDeviceFormatProperties2(physicalDevice, format, &extProperties);
4904 TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2);
4905 TCU_CHECK(extProperties.pNext == DE_NULL);
4907 if (deMemCmp(&coreProperties, &extProperties.formatProperties, sizeof(VkFormatProperties)) != 0)
4908 TCU_FAIL("Mismatch between format properties reported by vkGetPhysicalDeviceFormatProperties and vkGetPhysicalDeviceFormatProperties2");
4910 log << TestLog::Message << toString (extProperties) << TestLog::EndMessage;
4913 return tcu::TestStatus::pass("Querying device format properties succeeded");
4916 tcu::TestStatus deviceQueueFamilyProperties2 (Context& context)
4918 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4919 const InstanceDriver& vki (instance.getDriver());
4920 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
4921 TestLog& log = context.getTestContext().getLog();
4922 deUint32 numCoreQueueFamilies = ~0u;
4923 deUint32 numExtQueueFamilies = ~0u;
4925 vki.getPhysicalDeviceQueueFamilyProperties(physicalDevice, &numCoreQueueFamilies, DE_NULL);
4926 vki.getPhysicalDeviceQueueFamilyProperties2(physicalDevice, &numExtQueueFamilies, DE_NULL);
4928 TCU_CHECK_MSG(numCoreQueueFamilies == numExtQueueFamilies, "Different number of queue family properties reported");
4929 TCU_CHECK(numCoreQueueFamilies > 0);
4932 std::vector<VkQueueFamilyProperties> coreProperties (numCoreQueueFamilies);
4933 std::vector<VkQueueFamilyProperties2> extProperties (numExtQueueFamilies);
4935 deMemset(&coreProperties[0], 0xcd, sizeof(VkQueueFamilyProperties)*numCoreQueueFamilies);
4936 deMemset(&extProperties[0], 0xcd, sizeof(VkQueueFamilyProperties2)*numExtQueueFamilies);
4938 for (size_t ndx = 0; ndx < extProperties.size(); ++ndx)
4940 extProperties[ndx].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2;
4941 extProperties[ndx].pNext = DE_NULL;
4944 vki.getPhysicalDeviceQueueFamilyProperties(physicalDevice, &numCoreQueueFamilies, &coreProperties[0]);
4945 vki.getPhysicalDeviceQueueFamilyProperties2(physicalDevice, &numExtQueueFamilies, &extProperties[0]);
4947 TCU_CHECK((size_t)numCoreQueueFamilies == coreProperties.size());
4948 TCU_CHECK((size_t)numExtQueueFamilies == extProperties.size());
4949 DE_ASSERT(numCoreQueueFamilies == numExtQueueFamilies);
4951 for (size_t ndx = 0; ndx < extProperties.size(); ++ndx)
4953 TCU_CHECK(extProperties[ndx].sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2);
4954 TCU_CHECK(extProperties[ndx].pNext == DE_NULL);
4956 if (deMemCmp(&coreProperties[ndx], &extProperties[ndx].queueFamilyProperties, sizeof(VkQueueFamilyProperties)) != 0)
4957 TCU_FAIL("Mismatch between format properties reported by vkGetPhysicalDeviceQueueFamilyProperties and vkGetPhysicalDeviceQueueFamilyProperties2");
4959 log << TestLog::Message << " queueFamilyNdx = " << ndx <<TestLog::EndMessage
4960 << TestLog::Message << extProperties[ndx] << TestLog::EndMessage;
4964 return tcu::TestStatus::pass("Querying device queue family properties succeeded");
4967 tcu::TestStatus deviceMemoryProperties2 (Context& context)
4969 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4970 const InstanceDriver& vki (instance.getDriver());
4971 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
4972 TestLog& log = context.getTestContext().getLog();
4973 VkPhysicalDeviceMemoryProperties coreProperties;
4974 VkPhysicalDeviceMemoryProperties2 extProperties;
4976 deMemset(&coreProperties, 0xcd, sizeof(VkPhysicalDeviceMemoryProperties));
4977 deMemset(&extProperties, 0xcd, sizeof(VkPhysicalDeviceMemoryProperties2));
4979 extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
4980 extProperties.pNext = DE_NULL;
4982 vki.getPhysicalDeviceMemoryProperties(physicalDevice, &coreProperties);
4983 vki.getPhysicalDeviceMemoryProperties2(physicalDevice, &extProperties);
4985 TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2);
4986 TCU_CHECK(extProperties.pNext == DE_NULL);
4988 if (coreProperties.memoryTypeCount != extProperties.memoryProperties.memoryTypeCount)
4989 TCU_FAIL("Mismatch between memoryTypeCount reported by vkGetPhysicalDeviceMemoryProperties and vkGetPhysicalDeviceMemoryProperties2");
4990 if (coreProperties.memoryHeapCount != extProperties.memoryProperties.memoryHeapCount)
4991 TCU_FAIL("Mismatch between memoryHeapCount reported by vkGetPhysicalDeviceMemoryProperties and vkGetPhysicalDeviceMemoryProperties2");
4992 for (deUint32 i = 0; i < coreProperties.memoryTypeCount; i++)
4993 if (deMemCmp(&coreProperties.memoryTypes[i], &extProperties.memoryProperties.memoryTypes[i], sizeof(VkMemoryType)) != 0)
4994 TCU_FAIL("Mismatch between memoryTypes reported by vkGetPhysicalDeviceMemoryProperties and vkGetPhysicalDeviceMemoryProperties2");
4995 for (deUint32 i = 0; i < coreProperties.memoryHeapCount; i++)
4996 if (deMemCmp(&coreProperties.memoryHeaps[i], &extProperties.memoryProperties.memoryHeaps[i], sizeof(VkMemoryHeap)) != 0)
4997 TCU_FAIL("Mismatch between memoryHeaps reported by vkGetPhysicalDeviceMemoryProperties and vkGetPhysicalDeviceMemoryProperties2");
4999 log << TestLog::Message << extProperties << TestLog::EndMessage;
5001 return tcu::TestStatus::pass("Querying device memory properties succeeded");
5004 tcu::TestStatus deviceFeaturesVulkan12 (Context& context)
5006 using namespace ValidateQueryBits;
5008 const QueryMemberTableEntry feature11OffsetTable[] =
5010 // VkPhysicalDevice16BitStorageFeatures
5011 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, storageBuffer16BitAccess),
5012 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, uniformAndStorageBuffer16BitAccess),
5013 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, storagePushConstant16),
5014 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, storageInputOutput16),
5016 // VkPhysicalDeviceMultiviewFeatures
5017 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, multiview),
5018 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, multiviewGeometryShader),
5019 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, multiviewTessellationShader),
5021 // VkPhysicalDeviceVariablePointersFeatures
5022 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, variablePointersStorageBuffer),
5023 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, variablePointers),
5025 // VkPhysicalDeviceProtectedMemoryFeatures
5026 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, protectedMemory),
5028 // VkPhysicalDeviceSamplerYcbcrConversionFeatures
5029 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, samplerYcbcrConversion),
5031 // VkPhysicalDeviceShaderDrawParametersFeatures
5032 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, shaderDrawParameters),
5035 const QueryMemberTableEntry feature12OffsetTable[] =
5038 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, samplerMirrorClampToEdge),
5039 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, drawIndirectCount),
5041 // VkPhysicalDevice8BitStorageFeatures
5042 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, storageBuffer8BitAccess),
5043 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, uniformAndStorageBuffer8BitAccess),
5044 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, storagePushConstant8),
5046 // VkPhysicalDeviceShaderAtomicInt64Features
5047 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderBufferInt64Atomics),
5048 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderSharedInt64Atomics),
5050 // VkPhysicalDeviceShaderFloat16Int8Features
5051 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderFloat16),
5052 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderInt8),
5054 // VkPhysicalDeviceDescriptorIndexingFeatures
5055 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorIndexing),
5056 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderInputAttachmentArrayDynamicIndexing),
5057 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderUniformTexelBufferArrayDynamicIndexing),
5058 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderStorageTexelBufferArrayDynamicIndexing),
5059 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderUniformBufferArrayNonUniformIndexing),
5060 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderSampledImageArrayNonUniformIndexing),
5061 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderStorageBufferArrayNonUniformIndexing),
5062 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderStorageImageArrayNonUniformIndexing),
5063 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderInputAttachmentArrayNonUniformIndexing),
5064 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderUniformTexelBufferArrayNonUniformIndexing),
5065 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderStorageTexelBufferArrayNonUniformIndexing),
5066 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingUniformBufferUpdateAfterBind),
5067 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingSampledImageUpdateAfterBind),
5068 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingStorageImageUpdateAfterBind),
5069 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingStorageBufferUpdateAfterBind),
5070 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingUniformTexelBufferUpdateAfterBind),
5071 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingStorageTexelBufferUpdateAfterBind),
5072 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingUpdateUnusedWhilePending),
5073 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingPartiallyBound),
5074 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingVariableDescriptorCount),
5075 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, runtimeDescriptorArray),
5078 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, samplerFilterMinmax),
5080 // VkPhysicalDeviceScalarBlockLayoutFeatures
5081 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, scalarBlockLayout),
5083 // VkPhysicalDeviceImagelessFramebufferFeatures
5084 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, imagelessFramebuffer),
5086 // VkPhysicalDeviceUniformBufferStandardLayoutFeatures
5087 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, uniformBufferStandardLayout),
5089 // VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures
5090 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderSubgroupExtendedTypes),
5092 // VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures
5093 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, separateDepthStencilLayouts),
5095 // VkPhysicalDeviceHostQueryResetFeatures
5096 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, hostQueryReset),
5098 // VkPhysicalDeviceTimelineSemaphoreFeatures
5099 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, timelineSemaphore),
5101 // VkPhysicalDeviceBufferDeviceAddressFeatures
5102 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, bufferDeviceAddress),
5103 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, bufferDeviceAddressCaptureReplay),
5104 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, bufferDeviceAddressMultiDevice),
5106 // VkPhysicalDeviceVulkanMemoryModelFeatures
5107 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, vulkanMemoryModel),
5108 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, vulkanMemoryModelDeviceScope),
5109 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, vulkanMemoryModelAvailabilityVisibilityChains),
5112 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderOutputViewportIndex),
5113 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderOutputLayer),
5114 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, subgroupBroadcastDynamicId),
5117 TestLog& log = context.getTestContext().getLog();
5118 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5119 const InstanceDriver& vki = instance.getDriver();
5120 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
5121 const deUint32 vulkan11FeaturesBufferSize = sizeof(VkPhysicalDeviceVulkan11Features) + GUARD_SIZE;
5122 const deUint32 vulkan12FeaturesBufferSize = sizeof(VkPhysicalDeviceVulkan12Features) + GUARD_SIZE;
5123 VkPhysicalDeviceFeatures2 extFeatures;
5124 deUint8 buffer11a[vulkan11FeaturesBufferSize];
5125 deUint8 buffer11b[vulkan11FeaturesBufferSize];
5126 deUint8 buffer12a[vulkan12FeaturesBufferSize];
5127 deUint8 buffer12b[vulkan12FeaturesBufferSize];
5128 const int count = 2u;
5129 VkPhysicalDeviceVulkan11Features* vulkan11Features[count] = { (VkPhysicalDeviceVulkan11Features*)(buffer11a), (VkPhysicalDeviceVulkan11Features*)(buffer11b)};
5130 VkPhysicalDeviceVulkan12Features* vulkan12Features[count] = { (VkPhysicalDeviceVulkan12Features*)(buffer12a), (VkPhysicalDeviceVulkan12Features*)(buffer12b)};
5132 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
5133 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
5135 deMemset(buffer11b, GUARD_VALUE, sizeof(buffer11b));
5136 deMemset(buffer12a, GUARD_VALUE, sizeof(buffer12a));
5137 deMemset(buffer12b, GUARD_VALUE, sizeof(buffer12b));
5138 deMemset(buffer11a, GUARD_VALUE, sizeof(buffer11a));
5140 // Validate all fields initialized
5141 for (int ndx = 0; ndx < count; ++ndx)
5143 deMemset(&extFeatures.features, 0x00, sizeof(extFeatures.features));
5144 extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
5145 extFeatures.pNext = vulkan11Features[ndx];
5147 deMemset(vulkan11Features[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan11Features));
5148 vulkan11Features[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
5149 vulkan11Features[ndx]->pNext = vulkan12Features[ndx];
5151 deMemset(vulkan12Features[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan12Features));
5152 vulkan12Features[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
5153 vulkan12Features[ndx]->pNext = DE_NULL;
5155 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
5158 log << TestLog::Message << *vulkan11Features[0] << TestLog::EndMessage;
5159 log << TestLog::Message << *vulkan12Features[0] << TestLog::EndMessage;
5161 if (!validateStructsWithGuard(feature11OffsetTable, vulkan11Features, GUARD_VALUE, GUARD_SIZE))
5163 log << TestLog::Message << "deviceFeatures - VkPhysicalDeviceVulkan11Features initialization failure" << TestLog::EndMessage;
5165 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan11Features initialization failure");
5168 if (!validateStructsWithGuard(feature12OffsetTable, vulkan12Features, GUARD_VALUE, GUARD_SIZE))
5170 log << TestLog::Message << "deviceFeatures - VkPhysicalDeviceVulkan12Features initialization failure" << TestLog::EndMessage;
5172 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan12Features initialization failure");
5175 return tcu::TestStatus::pass("Querying Vulkan 1.2 device features succeeded");
5178 tcu::TestStatus deviceFeaturesVulkan13 (Context& context)
5180 using namespace ValidateQueryBits;
5182 const QueryMemberTableEntry feature13OffsetTable[] =
5184 // VkPhysicalDeviceImageRobustnessFeatures
5185 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, robustImageAccess),
5187 // VkPhysicalDeviceInlineUniformBlockFeatures
5188 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, inlineUniformBlock),
5189 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, descriptorBindingInlineUniformBlockUpdateAfterBind),
5191 // VkPhysicalDevicePipelineCreationCacheControlFeatures
5192 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, pipelineCreationCacheControl),
5194 // VkPhysicalDevicePrivateDataFeatures
5195 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, privateData),
5197 // VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures
5198 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, shaderDemoteToHelperInvocation),
5200 // VkPhysicalDeviceShaderTerminateInvocationFeatures
5201 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, shaderTerminateInvocation),
5203 // VkPhysicalDeviceSubgroupSizeControlFeatures
5204 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, subgroupSizeControl),
5205 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, computeFullSubgroups),
5207 // VkPhysicalDeviceSynchronization2Features
5208 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, synchronization2),
5210 // VkPhysicalDeviceTextureCompressionASTCHDRFeatures
5211 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, textureCompressionASTC_HDR),
5213 // VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures
5214 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, shaderZeroInitializeWorkgroupMemory),
5216 // VkPhysicalDeviceDynamicRenderingFeatures
5217 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, dynamicRendering),
5219 // VkPhysicalDeviceShaderIntegerDotProductFeatures
5220 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, shaderIntegerDotProduct),
5222 // VkPhysicalDeviceMaintenance4Features
5223 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Features, maintenance4),
5226 TestLog& log = context.getTestContext().getLog();
5227 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
5228 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5229 const InstanceDriver& vki = instance.getDriver();
5230 const deUint32 vulkan13FeaturesBufferSize = sizeof(VkPhysicalDeviceVulkan13Features) + GUARD_SIZE;
5231 VkPhysicalDeviceFeatures2 extFeatures;
5232 deUint8 buffer13a[vulkan13FeaturesBufferSize];
5233 deUint8 buffer13b[vulkan13FeaturesBufferSize];
5234 const int count = 2u;
5235 VkPhysicalDeviceVulkan13Features* vulkan13Features[count] = { (VkPhysicalDeviceVulkan13Features*)(buffer13a), (VkPhysicalDeviceVulkan13Features*)(buffer13b)};
5237 if (!context.contextSupports(vk::ApiVersion(1, 3, 0)))
5238 TCU_THROW(NotSupportedError, "At least Vulkan 1.3 required to run test");
5240 deMemset(buffer13a, GUARD_VALUE, sizeof(buffer13a));
5241 deMemset(buffer13b, GUARD_VALUE, sizeof(buffer13b));
5243 // Validate all fields initialized
5244 for (int ndx = 0; ndx < count; ++ndx)
5246 deMemset(&extFeatures.features, 0x00, sizeof(extFeatures.features));
5247 extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
5248 extFeatures.pNext = vulkan13Features[ndx];
5250 deMemset(vulkan13Features[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan13Features));
5251 vulkan13Features[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES;
5252 vulkan13Features[ndx]->pNext = DE_NULL;
5254 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
5257 log << TestLog::Message << *vulkan13Features[0] << TestLog::EndMessage;
5259 if (!validateStructsWithGuard(feature13OffsetTable, vulkan13Features, GUARD_VALUE, GUARD_SIZE))
5261 log << TestLog::Message << "deviceFeatures - VkPhysicalDeviceVulkan13Features initialization failure" << TestLog::EndMessage;
5263 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan13Features initialization failure");
5266 return tcu::TestStatus::pass("Querying Vulkan 1.3 device features succeeded");
5269 tcu::TestStatus devicePropertiesVulkan12 (Context& context)
5271 using namespace ValidateQueryBits;
5273 const QueryMemberTableEntry properties11OffsetTable[] =
5275 // VkPhysicalDeviceIDProperties
5276 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, deviceUUID),
5277 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, driverUUID),
5278 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, deviceLUID),
5279 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, deviceNodeMask),
5280 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, deviceLUIDValid),
5282 // VkPhysicalDeviceSubgroupProperties
5283 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, subgroupSize),
5284 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, subgroupSupportedStages),
5285 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, subgroupSupportedOperations),
5286 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, subgroupQuadOperationsInAllStages),
5288 // VkPhysicalDevicePointClippingProperties
5289 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, pointClippingBehavior),
5291 // VkPhysicalDeviceMultiviewProperties
5292 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, maxMultiviewViewCount),
5293 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, maxMultiviewInstanceIndex),
5295 // VkPhysicalDeviceProtectedMemoryProperties
5296 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, protectedNoFault),
5298 // VkPhysicalDeviceMaintenance3Properties
5299 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, maxPerSetDescriptors),
5300 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, maxMemoryAllocationSize),
5303 const QueryMemberTableEntry properties12OffsetTable[] =
5305 // VkPhysicalDeviceDriverProperties
5306 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, driverID),
5307 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, conformanceVersion),
5309 // VkPhysicalDeviceFloatControlsProperties
5310 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, denormBehaviorIndependence),
5311 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, roundingModeIndependence),
5312 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderSignedZeroInfNanPreserveFloat16),
5313 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderSignedZeroInfNanPreserveFloat32),
5314 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderSignedZeroInfNanPreserveFloat64),
5315 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormPreserveFloat16),
5316 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormPreserveFloat32),
5317 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormPreserveFloat64),
5318 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormFlushToZeroFloat16),
5319 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormFlushToZeroFloat32),
5320 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormFlushToZeroFloat64),
5321 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTEFloat16),
5322 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTEFloat32),
5323 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTEFloat64),
5324 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTZFloat16),
5325 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTZFloat32),
5326 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTZFloat64),
5328 // VkPhysicalDeviceDescriptorIndexingProperties
5329 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxUpdateAfterBindDescriptorsInAllPools),
5330 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderUniformBufferArrayNonUniformIndexingNative),
5331 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderSampledImageArrayNonUniformIndexingNative),
5332 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderStorageBufferArrayNonUniformIndexingNative),
5333 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderStorageImageArrayNonUniformIndexingNative),
5334 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderInputAttachmentArrayNonUniformIndexingNative),
5335 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, robustBufferAccessUpdateAfterBind),
5336 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, quadDivergentImplicitLod),
5337 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindSamplers),
5338 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindUniformBuffers),
5339 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindStorageBuffers),
5340 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindSampledImages),
5341 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindStorageImages),
5342 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindInputAttachments),
5343 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageUpdateAfterBindResources),
5344 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindSamplers),
5345 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindUniformBuffers),
5346 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindUniformBuffersDynamic),
5347 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindStorageBuffers),
5348 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindStorageBuffersDynamic),
5349 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindSampledImages),
5350 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindStorageImages),
5351 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindInputAttachments),
5353 // VkPhysicalDeviceDepthStencilResolveProperties
5354 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, supportedDepthResolveModes),
5355 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, supportedStencilResolveModes),
5356 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, independentResolveNone),
5357 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, independentResolve),
5359 // VkPhysicalDeviceSamplerFilterMinmaxProperties
5360 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, filterMinmaxSingleComponentFormats),
5361 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, filterMinmaxImageComponentMapping),
5363 // VkPhysicalDeviceTimelineSemaphoreProperties
5364 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxTimelineSemaphoreValueDifference),
5367 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, framebufferIntegerColorSampleCounts),
5370 TestLog& log = context.getTestContext().getLog();
5371 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5372 const InstanceDriver& vki = instance.getDriver();
5373 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
5374 const deUint32 vulkan11PropertiesBufferSize = sizeof(VkPhysicalDeviceVulkan11Properties) + GUARD_SIZE;
5375 const deUint32 vulkan12PropertiesBufferSize = sizeof(VkPhysicalDeviceVulkan12Properties) + GUARD_SIZE;
5376 VkPhysicalDeviceProperties2 extProperties;
5377 deUint8 buffer11a[vulkan11PropertiesBufferSize];
5378 deUint8 buffer11b[vulkan11PropertiesBufferSize];
5379 deUint8 buffer12a[vulkan12PropertiesBufferSize];
5380 deUint8 buffer12b[vulkan12PropertiesBufferSize];
5381 const int count = 2u;
5382 VkPhysicalDeviceVulkan11Properties* vulkan11Properties[count] = { (VkPhysicalDeviceVulkan11Properties*)(buffer11a), (VkPhysicalDeviceVulkan11Properties*)(buffer11b)};
5383 VkPhysicalDeviceVulkan12Properties* vulkan12Properties[count] = { (VkPhysicalDeviceVulkan12Properties*)(buffer12a), (VkPhysicalDeviceVulkan12Properties*)(buffer12b)};
5385 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
5386 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
5388 deMemset(buffer11a, GUARD_VALUE, sizeof(buffer11a));
5389 deMemset(buffer11b, GUARD_VALUE, sizeof(buffer11b));
5390 deMemset(buffer12a, GUARD_VALUE, sizeof(buffer12a));
5391 deMemset(buffer12b, GUARD_VALUE, sizeof(buffer12b));
5393 for (int ndx = 0; ndx < count; ++ndx)
5395 deMemset(&extProperties.properties, 0x00, sizeof(extProperties.properties));
5396 extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
5397 extProperties.pNext = vulkan11Properties[ndx];
5399 deMemset(vulkan11Properties[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan11Properties));
5400 vulkan11Properties[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES;
5401 vulkan11Properties[ndx]->pNext = vulkan12Properties[ndx];
5403 deMemset(vulkan12Properties[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan12Properties));
5404 vulkan12Properties[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES;
5405 vulkan12Properties[ndx]->pNext = DE_NULL;
5407 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
5410 log << TestLog::Message << *vulkan11Properties[0] << TestLog::EndMessage;
5411 log << TestLog::Message << *vulkan12Properties[0] << TestLog::EndMessage;
5413 if (!validateStructsWithGuard(properties11OffsetTable, vulkan11Properties, GUARD_VALUE, GUARD_SIZE))
5415 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceVulkan11Properties initialization failure" << TestLog::EndMessage;
5417 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan11Properties initialization failure");
5420 if (!validateStructsWithGuard(properties12OffsetTable, vulkan12Properties, GUARD_VALUE, GUARD_SIZE) ||
5421 strncmp(vulkan12Properties[0]->driverName, vulkan12Properties[1]->driverName, VK_MAX_DRIVER_NAME_SIZE) != 0 ||
5422 strncmp(vulkan12Properties[0]->driverInfo, vulkan12Properties[1]->driverInfo, VK_MAX_DRIVER_INFO_SIZE) != 0 )
5424 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceVulkan12Properties initialization failure" << TestLog::EndMessage;
5426 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan12Properties initialization failure");
5429 return tcu::TestStatus::pass("Querying Vulkan 1.2 device properties succeeded");
5432 tcu::TestStatus devicePropertiesVulkan13 (Context& context)
5434 using namespace ValidateQueryBits;
5436 const QueryMemberTableEntry properties13OffsetTable[] =
5438 // VkPhysicalDeviceSubgroupSizeControlProperties
5439 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, minSubgroupSize),
5440 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxSubgroupSize),
5441 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxComputeWorkgroupSubgroups),
5442 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, requiredSubgroupSizeStages),
5444 // VkPhysicalDeviceInlineUniformBlockProperties
5445 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxInlineUniformBlockSize),
5446 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxPerStageDescriptorInlineUniformBlocks),
5447 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks),
5448 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxDescriptorSetInlineUniformBlocks),
5449 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxDescriptorSetUpdateAfterBindInlineUniformBlocks),
5452 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxInlineUniformTotalSize),
5454 // VkPhysicalDeviceShaderIntegerDotProductProperties
5455 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct8BitUnsignedAccelerated),
5456 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct8BitSignedAccelerated),
5457 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct8BitMixedSignednessAccelerated),
5458 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct4x8BitPackedUnsignedAccelerated),
5459 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct4x8BitPackedSignedAccelerated),
5460 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct4x8BitPackedMixedSignednessAccelerated),
5461 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct16BitUnsignedAccelerated),
5462 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct16BitSignedAccelerated),
5463 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct16BitMixedSignednessAccelerated),
5464 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct32BitUnsignedAccelerated),
5465 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct32BitSignedAccelerated),
5466 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct32BitMixedSignednessAccelerated),
5467 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct64BitUnsignedAccelerated),
5468 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct64BitSignedAccelerated),
5469 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProduct64BitMixedSignednessAccelerated),
5470 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating8BitUnsignedAccelerated),
5471 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating8BitSignedAccelerated),
5472 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated),
5473 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated),
5474 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated),
5475 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated),
5476 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating16BitUnsignedAccelerated),
5477 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating16BitSignedAccelerated),
5478 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated),
5479 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating32BitUnsignedAccelerated),
5480 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating32BitSignedAccelerated),
5481 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated),
5482 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating64BitUnsignedAccelerated),
5483 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating64BitSignedAccelerated),
5484 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated),
5486 // VkPhysicalDeviceTexelBufferAlignmentProperties
5487 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, storageTexelBufferOffsetAlignmentBytes),
5488 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, storageTexelBufferOffsetSingleTexelAlignment),
5489 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, uniformTexelBufferOffsetAlignmentBytes),
5490 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, uniformTexelBufferOffsetSingleTexelAlignment),
5492 // VkPhysicalDeviceMaintenance4Properties
5493 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan13Properties, maxBufferSize),
5497 TestLog& log = context.getTestContext().getLog();
5498 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
5499 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5500 const InstanceDriver& vki = instance.getDriver();
5501 const deUint32 vulkan13PropertiesBufferSize = sizeof(VkPhysicalDeviceVulkan13Properties) + GUARD_SIZE;
5502 VkPhysicalDeviceProperties2 extProperties;
5503 deUint8 buffer13a[vulkan13PropertiesBufferSize];
5504 deUint8 buffer13b[vulkan13PropertiesBufferSize];
5505 const int count = 2u;
5506 VkPhysicalDeviceVulkan13Properties* vulkan13Properties[count] = { (VkPhysicalDeviceVulkan13Properties*)(buffer13a), (VkPhysicalDeviceVulkan13Properties*)(buffer13b)};
5508 if (!context.contextSupports(vk::ApiVersion(1, 3, 0)))
5509 TCU_THROW(NotSupportedError, "At least Vulkan 1.3 required to run test");
5511 deMemset(buffer13a, GUARD_VALUE, sizeof(buffer13a));
5512 deMemset(buffer13b, GUARD_VALUE, sizeof(buffer13b));
5514 for (int ndx = 0; ndx < count; ++ndx)
5516 deMemset(&extProperties.properties, 0x00, sizeof(extProperties.properties));
5517 extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
5518 extProperties.pNext = vulkan13Properties[ndx];
5520 deMemset(vulkan13Properties[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan13Properties));
5521 vulkan13Properties[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES;
5522 vulkan13Properties[ndx]->pNext = DE_NULL;
5524 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
5527 log << TestLog::Message << *vulkan13Properties[0] << TestLog::EndMessage;
5529 if (!validateStructsWithGuard(properties13OffsetTable, vulkan13Properties, GUARD_VALUE, GUARD_SIZE))
5531 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceVulkan13Properties initialization failure" << TestLog::EndMessage;
5533 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan13Properties initialization failure");
5536 return tcu::TestStatus::pass("Querying Vulkan 1.3 device properties succeeded");
5539 tcu::TestStatus deviceFeatureExtensionsConsistencyVulkan12(Context& context)
5541 TestLog& log = context.getTestContext().getLog();
5542 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5543 const InstanceDriver& vki = instance.getDriver();
5544 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
5546 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
5547 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
5549 VkPhysicalDeviceVulkan12Features vulkan12Features = initVulkanStructure();
5550 VkPhysicalDeviceVulkan11Features vulkan11Features = initVulkanStructure(&vulkan12Features);
5551 VkPhysicalDeviceFeatures2 extFeatures = initVulkanStructure(&vulkan11Features);
5553 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
5555 log << TestLog::Message << vulkan11Features << TestLog::EndMessage;
5556 log << TestLog::Message << vulkan12Features << TestLog::EndMessage;
5558 // Validate if proper VkPhysicalDeviceVulkanXXFeatures fields are set when corresponding extensions are present
5559 std::pair<std::pair<const char*,const char*>, VkBool32> extensions2validate[] =
5561 { { "VK_KHR_sampler_mirror_clamp_to_edge", "VkPhysicalDeviceVulkan12Features.samplerMirrorClampToEdge" }, vulkan12Features.samplerMirrorClampToEdge },
5562 { { "VK_KHR_draw_indirect_count", "VkPhysicalDeviceVulkan12Features.drawIndirectCount" }, vulkan12Features.drawIndirectCount },
5563 { { "VK_EXT_descriptor_indexing", "VkPhysicalDeviceVulkan12Features.descriptorIndexing" }, vulkan12Features.descriptorIndexing },
5564 { { "VK_EXT_sampler_filter_minmax", "VkPhysicalDeviceVulkan12Features.samplerFilterMinmax" }, vulkan12Features.samplerFilterMinmax },
5565 { { "VK_EXT_shader_viewport_index_layer", "VkPhysicalDeviceVulkan12Features.shaderOutputViewportIndex" }, vulkan12Features.shaderOutputViewportIndex },
5566 { { "VK_EXT_shader_viewport_index_layer", "VkPhysicalDeviceVulkan12Features.shaderOutputLayer" }, vulkan12Features.shaderOutputLayer }
5568 vector<VkExtensionProperties> extensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
5569 for (const auto& ext : extensions2validate)
5570 if (checkExtension(extensionProperties, ext.first.first) && !ext.second)
5571 TCU_FAIL(string("Mismatch between extension ") + ext.first.first + " and " + ext.first.second);
5573 // collect all extension features
5575 VkPhysicalDevice16BitStorageFeatures device16BitStorageFeatures = initVulkanStructure();
5576 VkPhysicalDeviceMultiviewFeatures deviceMultiviewFeatures = initVulkanStructure(&device16BitStorageFeatures);
5577 VkPhysicalDeviceProtectedMemoryFeatures protectedMemoryFeatures = initVulkanStructure(&deviceMultiviewFeatures);
5578 VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYcbcrConversionFeatures = initVulkanStructure(&protectedMemoryFeatures);
5579 VkPhysicalDeviceShaderDrawParametersFeatures shaderDrawParametersFeatures = initVulkanStructure(&samplerYcbcrConversionFeatures);
5580 VkPhysicalDeviceVariablePointersFeatures variablePointerFeatures = initVulkanStructure(&shaderDrawParametersFeatures);
5581 VkPhysicalDevice8BitStorageFeatures device8BitStorageFeatures = initVulkanStructure(&variablePointerFeatures);
5582 VkPhysicalDeviceShaderAtomicInt64Features shaderAtomicInt64Features = initVulkanStructure(&device8BitStorageFeatures);
5583 VkPhysicalDeviceShaderFloat16Int8Features shaderFloat16Int8Features = initVulkanStructure(&shaderAtomicInt64Features);
5584 VkPhysicalDeviceDescriptorIndexingFeatures descriptorIndexingFeatures = initVulkanStructure(&shaderFloat16Int8Features);
5585 VkPhysicalDeviceScalarBlockLayoutFeatures scalarBlockLayoutFeatures = initVulkanStructure(&descriptorIndexingFeatures);
5586 VkPhysicalDeviceImagelessFramebufferFeatures imagelessFramebufferFeatures = initVulkanStructure(&scalarBlockLayoutFeatures);
5587 VkPhysicalDeviceUniformBufferStandardLayoutFeatures uniformBufferStandardLayoutFeatures = initVulkanStructure(&imagelessFramebufferFeatures);
5588 VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures shaderSubgroupExtendedTypesFeatures = initVulkanStructure(&uniformBufferStandardLayoutFeatures);
5589 VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures separateDepthStencilLayoutsFeatures = initVulkanStructure(&shaderSubgroupExtendedTypesFeatures);
5590 VkPhysicalDeviceHostQueryResetFeatures hostQueryResetFeatures = initVulkanStructure(&separateDepthStencilLayoutsFeatures);
5591 VkPhysicalDeviceTimelineSemaphoreFeatures timelineSemaphoreFeatures = initVulkanStructure(&hostQueryResetFeatures);
5592 VkPhysicalDeviceBufferDeviceAddressFeatures bufferDeviceAddressFeatures = initVulkanStructure(&timelineSemaphoreFeatures);
5593 VkPhysicalDeviceVulkanMemoryModelFeatures vulkanMemoryModelFeatures = initVulkanStructure(&bufferDeviceAddressFeatures);
5594 extFeatures = initVulkanStructure(&vulkanMemoryModelFeatures);
5596 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
5598 log << TestLog::Message << extFeatures << TestLog::EndMessage;
5599 log << TestLog::Message << device16BitStorageFeatures << TestLog::EndMessage;
5600 log << TestLog::Message << deviceMultiviewFeatures << TestLog::EndMessage;
5601 log << TestLog::Message << protectedMemoryFeatures << TestLog::EndMessage;
5602 log << TestLog::Message << samplerYcbcrConversionFeatures << TestLog::EndMessage;
5603 log << TestLog::Message << shaderDrawParametersFeatures << TestLog::EndMessage;
5604 log << TestLog::Message << variablePointerFeatures << TestLog::EndMessage;
5605 log << TestLog::Message << device8BitStorageFeatures << TestLog::EndMessage;
5606 log << TestLog::Message << shaderAtomicInt64Features << TestLog::EndMessage;
5607 log << TestLog::Message << shaderFloat16Int8Features << TestLog::EndMessage;
5608 log << TestLog::Message << descriptorIndexingFeatures << TestLog::EndMessage;
5609 log << TestLog::Message << scalarBlockLayoutFeatures << TestLog::EndMessage;
5610 log << TestLog::Message << imagelessFramebufferFeatures << TestLog::EndMessage;
5611 log << TestLog::Message << uniformBufferStandardLayoutFeatures << TestLog::EndMessage;
5612 log << TestLog::Message << shaderSubgroupExtendedTypesFeatures << TestLog::EndMessage;
5613 log << TestLog::Message << separateDepthStencilLayoutsFeatures << TestLog::EndMessage;
5614 log << TestLog::Message << hostQueryResetFeatures << TestLog::EndMessage;
5615 log << TestLog::Message << timelineSemaphoreFeatures << TestLog::EndMessage;
5616 log << TestLog::Message << bufferDeviceAddressFeatures << TestLog::EndMessage;
5617 log << TestLog::Message << vulkanMemoryModelFeatures << TestLog::EndMessage;
5619 if (( device16BitStorageFeatures.storageBuffer16BitAccess != vulkan11Features.storageBuffer16BitAccess ||
5620 device16BitStorageFeatures.uniformAndStorageBuffer16BitAccess != vulkan11Features.uniformAndStorageBuffer16BitAccess ||
5621 device16BitStorageFeatures.storagePushConstant16 != vulkan11Features.storagePushConstant16 ||
5622 device16BitStorageFeatures.storageInputOutput16 != vulkan11Features.storageInputOutput16 ))
5624 TCU_FAIL("Mismatch between VkPhysicalDevice16BitStorageFeatures and VkPhysicalDeviceVulkan11Features");
5627 if (( deviceMultiviewFeatures.multiview != vulkan11Features.multiview ||
5628 deviceMultiviewFeatures.multiviewGeometryShader != vulkan11Features.multiviewGeometryShader ||
5629 deviceMultiviewFeatures.multiviewTessellationShader != vulkan11Features.multiviewTessellationShader ))
5631 TCU_FAIL("Mismatch between VkPhysicalDeviceMultiviewFeatures and VkPhysicalDeviceVulkan11Features");
5634 if ( (protectedMemoryFeatures.protectedMemory != vulkan11Features.protectedMemory ))
5636 TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryFeatures and VkPhysicalDeviceVulkan11Features");
5639 if ( (samplerYcbcrConversionFeatures.samplerYcbcrConversion != vulkan11Features.samplerYcbcrConversion ))
5641 TCU_FAIL("Mismatch between VkPhysicalDeviceSamplerYcbcrConversionFeatures and VkPhysicalDeviceVulkan11Features");
5644 if ( (shaderDrawParametersFeatures.shaderDrawParameters != vulkan11Features.shaderDrawParameters ))
5646 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderDrawParametersFeatures and VkPhysicalDeviceVulkan11Features");
5649 if (( variablePointerFeatures.variablePointersStorageBuffer != vulkan11Features.variablePointersStorageBuffer ||
5650 variablePointerFeatures.variablePointers != vulkan11Features.variablePointers))
5652 TCU_FAIL("Mismatch between VkPhysicalDeviceVariablePointersFeatures and VkPhysicalDeviceVulkan11Features");
5655 if (( device8BitStorageFeatures.storageBuffer8BitAccess != vulkan12Features.storageBuffer8BitAccess ||
5656 device8BitStorageFeatures.uniformAndStorageBuffer8BitAccess != vulkan12Features.uniformAndStorageBuffer8BitAccess ||
5657 device8BitStorageFeatures.storagePushConstant8 != vulkan12Features.storagePushConstant8 ))
5659 TCU_FAIL("Mismatch between VkPhysicalDevice8BitStorageFeatures and VkPhysicalDeviceVulkan12Features");
5662 if (( shaderAtomicInt64Features.shaderBufferInt64Atomics != vulkan12Features.shaderBufferInt64Atomics ||
5663 shaderAtomicInt64Features.shaderSharedInt64Atomics != vulkan12Features.shaderSharedInt64Atomics ))
5665 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderAtomicInt64Features and VkPhysicalDeviceVulkan12Features");
5668 if (( shaderFloat16Int8Features.shaderFloat16 != vulkan12Features.shaderFloat16 ||
5669 shaderFloat16Int8Features.shaderInt8 != vulkan12Features.shaderInt8 ))
5671 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderFloat16Int8Features and VkPhysicalDeviceVulkan12Features");
5674 if ((vulkan12Features.descriptorIndexing) &&
5675 ( descriptorIndexingFeatures.shaderInputAttachmentArrayDynamicIndexing != vulkan12Features.shaderInputAttachmentArrayDynamicIndexing ||
5676 descriptorIndexingFeatures.shaderUniformTexelBufferArrayDynamicIndexing != vulkan12Features.shaderUniformTexelBufferArrayDynamicIndexing ||
5677 descriptorIndexingFeatures.shaderStorageTexelBufferArrayDynamicIndexing != vulkan12Features.shaderStorageTexelBufferArrayDynamicIndexing ||
5678 descriptorIndexingFeatures.shaderUniformBufferArrayNonUniformIndexing != vulkan12Features.shaderUniformBufferArrayNonUniformIndexing ||
5679 descriptorIndexingFeatures.shaderSampledImageArrayNonUniformIndexing != vulkan12Features.shaderSampledImageArrayNonUniformIndexing ||
5680 descriptorIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing != vulkan12Features.shaderStorageBufferArrayNonUniformIndexing ||
5681 descriptorIndexingFeatures.shaderStorageImageArrayNonUniformIndexing != vulkan12Features.shaderStorageImageArrayNonUniformIndexing ||
5682 descriptorIndexingFeatures.shaderInputAttachmentArrayNonUniformIndexing != vulkan12Features.shaderInputAttachmentArrayNonUniformIndexing ||
5683 descriptorIndexingFeatures.shaderUniformTexelBufferArrayNonUniformIndexing != vulkan12Features.shaderUniformTexelBufferArrayNonUniformIndexing ||
5684 descriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing != vulkan12Features.shaderStorageTexelBufferArrayNonUniformIndexing ||
5685 descriptorIndexingFeatures.descriptorBindingUniformBufferUpdateAfterBind != vulkan12Features.descriptorBindingUniformBufferUpdateAfterBind ||
5686 descriptorIndexingFeatures.descriptorBindingSampledImageUpdateAfterBind != vulkan12Features.descriptorBindingSampledImageUpdateAfterBind ||
5687 descriptorIndexingFeatures.descriptorBindingStorageImageUpdateAfterBind != vulkan12Features.descriptorBindingStorageImageUpdateAfterBind ||
5688 descriptorIndexingFeatures.descriptorBindingStorageBufferUpdateAfterBind != vulkan12Features.descriptorBindingStorageBufferUpdateAfterBind ||
5689 descriptorIndexingFeatures.descriptorBindingUniformTexelBufferUpdateAfterBind != vulkan12Features.descriptorBindingUniformTexelBufferUpdateAfterBind ||
5690 descriptorIndexingFeatures.descriptorBindingStorageTexelBufferUpdateAfterBind != vulkan12Features.descriptorBindingStorageTexelBufferUpdateAfterBind ||
5691 descriptorIndexingFeatures.descriptorBindingUpdateUnusedWhilePending != vulkan12Features.descriptorBindingUpdateUnusedWhilePending ||
5692 descriptorIndexingFeatures.descriptorBindingPartiallyBound != vulkan12Features.descriptorBindingPartiallyBound ||
5693 descriptorIndexingFeatures.descriptorBindingVariableDescriptorCount != vulkan12Features.descriptorBindingVariableDescriptorCount ||
5694 descriptorIndexingFeatures.runtimeDescriptorArray != vulkan12Features.runtimeDescriptorArray ))
5696 TCU_FAIL("Mismatch between VkPhysicalDeviceDescriptorIndexingFeatures and VkPhysicalDeviceVulkan12Features");
5699 if (( scalarBlockLayoutFeatures.scalarBlockLayout != vulkan12Features.scalarBlockLayout ))
5701 TCU_FAIL("Mismatch between VkPhysicalDeviceScalarBlockLayoutFeatures and VkPhysicalDeviceVulkan12Features");
5704 if (( imagelessFramebufferFeatures.imagelessFramebuffer != vulkan12Features.imagelessFramebuffer ))
5706 TCU_FAIL("Mismatch between VkPhysicalDeviceImagelessFramebufferFeatures and VkPhysicalDeviceVulkan12Features");
5709 if (( uniformBufferStandardLayoutFeatures.uniformBufferStandardLayout != vulkan12Features.uniformBufferStandardLayout ))
5711 TCU_FAIL("Mismatch between VkPhysicalDeviceUniformBufferStandardLayoutFeatures and VkPhysicalDeviceVulkan12Features");
5714 if (( shaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes != vulkan12Features.shaderSubgroupExtendedTypes ))
5716 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures and VkPhysicalDeviceVulkan12Features");
5719 if (( separateDepthStencilLayoutsFeatures.separateDepthStencilLayouts != vulkan12Features.separateDepthStencilLayouts ))
5721 TCU_FAIL("Mismatch between VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures and VkPhysicalDeviceVulkan12Features");
5724 if (( hostQueryResetFeatures.hostQueryReset != vulkan12Features.hostQueryReset ))
5726 TCU_FAIL("Mismatch between VkPhysicalDeviceHostQueryResetFeatures and VkPhysicalDeviceVulkan12Features");
5729 if (( timelineSemaphoreFeatures.timelineSemaphore != vulkan12Features.timelineSemaphore ))
5731 TCU_FAIL("Mismatch between VkPhysicalDeviceTimelineSemaphoreFeatures and VkPhysicalDeviceVulkan12Features");
5734 if (( bufferDeviceAddressFeatures.bufferDeviceAddress != vulkan12Features.bufferDeviceAddress ||
5735 bufferDeviceAddressFeatures.bufferDeviceAddressCaptureReplay != vulkan12Features.bufferDeviceAddressCaptureReplay ||
5736 bufferDeviceAddressFeatures.bufferDeviceAddressMultiDevice != vulkan12Features.bufferDeviceAddressMultiDevice ))
5738 TCU_FAIL("Mismatch between VkPhysicalDeviceBufferDeviceAddressFeatures and VkPhysicalDeviceVulkan12Features");
5741 if (( vulkanMemoryModelFeatures.vulkanMemoryModel != vulkan12Features.vulkanMemoryModel ||
5742 vulkanMemoryModelFeatures.vulkanMemoryModelDeviceScope != vulkan12Features.vulkanMemoryModelDeviceScope ||
5743 vulkanMemoryModelFeatures.vulkanMemoryModelAvailabilityVisibilityChains != vulkan12Features.vulkanMemoryModelAvailabilityVisibilityChains ))
5745 TCU_FAIL("Mismatch between VkPhysicalDeviceVulkanMemoryModelFeatures and VkPhysicalDeviceVulkan12Features");
5749 return tcu::TestStatus::pass("Vulkan 1.2 device features are consistent with extensions");
5752 tcu::TestStatus deviceFeatureExtensionsConsistencyVulkan13(Context& context)
5754 TestLog& log = context.getTestContext().getLog();
5755 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
5756 const CustomInstance instance = createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2");
5757 const InstanceDriver& vki = instance.getDriver();
5759 if (!context.contextSupports(vk::ApiVersion(1, 3, 0)))
5760 TCU_THROW(NotSupportedError, "At least Vulkan 1.3 required to run test");
5762 VkPhysicalDeviceVulkan13Features vulkan13Features = initVulkanStructure();
5763 VkPhysicalDeviceFeatures2 extFeatures = initVulkanStructure(&vulkan13Features);
5765 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
5767 log << TestLog::Message << vulkan13Features << TestLog::EndMessage;
5769 // Validate if required VkPhysicalDeviceVulkan13Features fields are set
5770 std::pair<const char*, VkBool32> features2validate[]
5772 { { "VkPhysicalDeviceVulkan13Features.robustImageAccess" }, vulkan13Features.robustImageAccess },
5773 { { "VkPhysicalDeviceVulkan13Features.inlineUniformBlock" }, vulkan13Features.inlineUniformBlock },
5774 { { "VkPhysicalDeviceVulkan13Features.pipelineCreationCacheControl" }, vulkan13Features.pipelineCreationCacheControl },
5775 { { "VkPhysicalDeviceVulkan13Features.privateData" }, vulkan13Features.privateData },
5776 { { "VkPhysicalDeviceVulkan13Features.shaderDemoteToHelperInvocation" }, vulkan13Features.shaderDemoteToHelperInvocation },
5777 { { "VkPhysicalDeviceVulkan13Features.shaderTerminateInvocation" }, vulkan13Features.shaderTerminateInvocation },
5778 { { "VkPhysicalDeviceVulkan13Features.subgroupSizeControl" }, vulkan13Features.subgroupSizeControl },
5779 { { "VkPhysicalDeviceVulkan13Features.computeFullSubgroups" }, vulkan13Features.computeFullSubgroups },
5780 { { "VkPhysicalDeviceVulkan13Features.synchronization2" }, vulkan13Features.synchronization2 },
5781 { { "VkPhysicalDeviceVulkan13Features.shaderZeroInitializeWorkgroupMemory" }, vulkan13Features.shaderZeroInitializeWorkgroupMemory },
5782 { { "VkPhysicalDeviceVulkan13Features.dynamicRendering" }, vulkan13Features.dynamicRendering },
5783 { { "VkPhysicalDeviceVulkan13Features.shaderIntegerDotProduct" }, vulkan13Features.shaderIntegerDotProduct },
5784 { { "VkPhysicalDeviceVulkan13Features.maintenance4" }, vulkan13Features.maintenance4 },
5786 for (const auto& feature : features2validate)
5788 if (!feature.second)
5789 TCU_FAIL(string("Required feature ") + feature.first + " is not set");
5792 // collect all extension features
5794 VkPhysicalDeviceImageRobustnessFeatures imageRobustnessFeatures = initVulkanStructure();
5795 VkPhysicalDeviceInlineUniformBlockFeatures inlineUniformBlockFeatures = initVulkanStructure(&imageRobustnessFeatures);
5796 VkPhysicalDevicePipelineCreationCacheControlFeatures pipelineCreationCacheControlFeatures = initVulkanStructure(&inlineUniformBlockFeatures);
5797 VkPhysicalDevicePrivateDataFeatures privateDataFeatures = initVulkanStructure(&pipelineCreationCacheControlFeatures);
5798 VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures shaderDemoteToHelperInvocationFeatures = initVulkanStructure(&privateDataFeatures);
5799 VkPhysicalDeviceShaderTerminateInvocationFeatures shaderTerminateInvocationFeatures = initVulkanStructure(&shaderDemoteToHelperInvocationFeatures);
5800 VkPhysicalDeviceSubgroupSizeControlFeatures subgroupSizeControlFeatures = initVulkanStructure(&shaderTerminateInvocationFeatures);
5801 VkPhysicalDeviceSynchronization2Features synchronization2Features = initVulkanStructure(&subgroupSizeControlFeatures);
5802 VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures zeroInitializeWorkgroupMemoryFeatures = initVulkanStructure(&synchronization2Features);
5803 VkPhysicalDeviceDynamicRenderingFeatures dynamicRenderingFeatures = initVulkanStructure(&zeroInitializeWorkgroupMemoryFeatures);
5804 VkPhysicalDeviceShaderIntegerDotProductFeatures shaderIntegerDotProductFeatures = initVulkanStructure(&dynamicRenderingFeatures);
5805 VkPhysicalDeviceMaintenance4Features maintenance4Features = initVulkanStructure(&shaderIntegerDotProductFeatures);
5807 // those two structures are part of extensions promoted in vk1.2 but now in 1.3 have required features
5808 VkPhysicalDeviceVulkanMemoryModelFeatures vulkanMemoryModelFeatures = initVulkanStructure(&maintenance4Features);
5809 VkPhysicalDeviceBufferDeviceAddressFeatures bufferDeviceAddressFeatures = initVulkanStructure(&vulkanMemoryModelFeatures);
5811 extFeatures = initVulkanStructure(&bufferDeviceAddressFeatures);
5813 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
5815 log << TestLog::Message << extFeatures << TestLog::EndMessage;
5816 log << TestLog::Message << imageRobustnessFeatures << TestLog::EndMessage;
5817 log << TestLog::Message << inlineUniformBlockFeatures << TestLog::EndMessage;
5818 log << TestLog::Message << pipelineCreationCacheControlFeatures << TestLog::EndMessage;
5819 log << TestLog::Message << privateDataFeatures << TestLog::EndMessage;
5820 log << TestLog::Message << shaderDemoteToHelperInvocationFeatures << TestLog::EndMessage;
5821 log << TestLog::Message << shaderTerminateInvocationFeatures << TestLog::EndMessage;
5822 log << TestLog::Message << subgroupSizeControlFeatures << TestLog::EndMessage;
5823 log << TestLog::Message << synchronization2Features << TestLog::EndMessage;
5824 log << TestLog::Message << zeroInitializeWorkgroupMemoryFeatures << TestLog::EndMessage;
5825 log << TestLog::Message << dynamicRenderingFeatures << TestLog::EndMessage;
5826 log << TestLog::Message << shaderIntegerDotProductFeatures << TestLog::EndMessage;
5827 log << TestLog::Message << maintenance4Features << TestLog::EndMessage;
5829 if (imageRobustnessFeatures.robustImageAccess != vulkan13Features.robustImageAccess)
5830 TCU_FAIL("Mismatch between VkPhysicalDeviceImageRobustnessFeatures and VkPhysicalDeviceVulkan13Features");
5832 if ((inlineUniformBlockFeatures.inlineUniformBlock != vulkan13Features.inlineUniformBlock) ||
5833 (inlineUniformBlockFeatures.descriptorBindingInlineUniformBlockUpdateAfterBind != vulkan13Features.descriptorBindingInlineUniformBlockUpdateAfterBind))
5835 TCU_FAIL("Mismatch between VkPhysicalDeviceInlineUniformBlockFeatures and VkPhysicalDeviceVulkan13Features");
5838 if (pipelineCreationCacheControlFeatures.pipelineCreationCacheControl != vulkan13Features.pipelineCreationCacheControl)
5839 TCU_FAIL("Mismatch between VkPhysicalDevicePipelineCreationCacheControlFeatures and VkPhysicalDeviceVulkan13Features");
5841 if (privateDataFeatures.privateData != vulkan13Features.privateData)
5842 TCU_FAIL("Mismatch between VkPhysicalDevicePrivateDataFeatures and VkPhysicalDeviceVulkan13Features");
5844 if (shaderDemoteToHelperInvocationFeatures.shaderDemoteToHelperInvocation != vulkan13Features.shaderDemoteToHelperInvocation)
5845 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures and VkPhysicalDeviceVulkan13Features");
5847 if (shaderTerminateInvocationFeatures.shaderTerminateInvocation != vulkan13Features.shaderTerminateInvocation)
5848 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderTerminateInvocationFeatures and VkPhysicalDeviceVulkan13Features");
5850 if ((subgroupSizeControlFeatures.subgroupSizeControl != vulkan13Features.subgroupSizeControl) ||
5851 (subgroupSizeControlFeatures.computeFullSubgroups != vulkan13Features.computeFullSubgroups))
5853 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupSizeControlFeatures and VkPhysicalDeviceVulkan13Features");
5856 if (synchronization2Features.synchronization2 != vulkan13Features.synchronization2)
5857 TCU_FAIL("Mismatch between VkPhysicalDeviceSynchronization2Features and VkPhysicalDeviceVulkan13Features");
5859 if (zeroInitializeWorkgroupMemoryFeatures.shaderZeroInitializeWorkgroupMemory != vulkan13Features.shaderZeroInitializeWorkgroupMemory)
5860 TCU_FAIL("Mismatch between VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures and VkPhysicalDeviceVulkan13Features");
5862 if (dynamicRenderingFeatures.dynamicRendering != vulkan13Features.dynamicRendering)
5863 TCU_FAIL("Mismatch between VkPhysicalDeviceDynamicRenderingFeatures and VkPhysicalDeviceVulkan13Features");
5865 if (shaderIntegerDotProductFeatures.shaderIntegerDotProduct != vulkan13Features.shaderIntegerDotProduct)
5866 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderIntegerDotProductFeatures and VkPhysicalDeviceVulkan13Features");
5868 if (maintenance4Features.maintenance4 != vulkan13Features.maintenance4)
5869 TCU_FAIL("Mismatch between VkPhysicalDeviceMaintenance4Features and VkPhysicalDeviceVulkan13Features");
5871 // check required features from extensions that were promoted in earlier vulkan version
5872 if (!vulkanMemoryModelFeatures.vulkanMemoryModel)
5873 TCU_FAIL("vulkanMemoryModel feature from VkPhysicalDeviceVulkanMemoryModelFeatures is required");
5874 if (!vulkanMemoryModelFeatures.vulkanMemoryModelDeviceScope)
5875 TCU_FAIL("vulkanMemoryModelDeviceScope feature from VkPhysicalDeviceVulkanMemoryModelFeatures is required");
5876 if (!bufferDeviceAddressFeatures.bufferDeviceAddress)
5877 TCU_FAIL("bufferDeviceAddress feature from VkPhysicalDeviceBufferDeviceAddressFeatures is required");
5880 return tcu::TestStatus::pass("Vulkan 1.3 device features are consistent with extensions");
5883 tcu::TestStatus devicePropertyExtensionsConsistencyVulkan12(Context& context)
5885 TestLog& log = context.getTestContext().getLog();
5886 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5887 const InstanceDriver& vki = instance.getDriver();
5888 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
5890 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
5891 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
5893 VkPhysicalDeviceVulkan12Properties vulkan12Properties = initVulkanStructure();
5894 VkPhysicalDeviceVulkan11Properties vulkan11Properties = initVulkanStructure(&vulkan12Properties);
5895 VkPhysicalDeviceProperties2 extProperties = initVulkanStructure(&vulkan11Properties);
5897 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
5899 log << TestLog::Message << vulkan11Properties << TestLog::EndMessage;
5900 log << TestLog::Message << vulkan12Properties << TestLog::EndMessage;
5902 // Validate all fields initialized matching to extension structures
5904 VkPhysicalDeviceIDProperties idProperties = initVulkanStructure();
5905 VkPhysicalDeviceSubgroupProperties subgroupProperties = initVulkanStructure(&idProperties);
5906 VkPhysicalDevicePointClippingProperties pointClippingProperties = initVulkanStructure(&subgroupProperties);
5907 VkPhysicalDeviceMultiviewProperties multiviewProperties = initVulkanStructure(&pointClippingProperties);
5908 VkPhysicalDeviceProtectedMemoryProperties protectedMemoryPropertiesKHR = initVulkanStructure(&multiviewProperties);
5909 VkPhysicalDeviceMaintenance3Properties maintenance3Properties = initVulkanStructure(&protectedMemoryPropertiesKHR);
5910 VkPhysicalDeviceDriverProperties driverProperties = initVulkanStructure(&maintenance3Properties);
5911 VkPhysicalDeviceFloatControlsProperties floatControlsProperties = initVulkanStructure(&driverProperties);
5912 VkPhysicalDeviceDescriptorIndexingProperties descriptorIndexingProperties = initVulkanStructure(&floatControlsProperties);
5913 VkPhysicalDeviceDepthStencilResolveProperties depthStencilResolveProperties = initVulkanStructure(&descriptorIndexingProperties);
5914 VkPhysicalDeviceSamplerFilterMinmaxProperties samplerFilterMinmaxProperties = initVulkanStructure(&depthStencilResolveProperties);
5915 VkPhysicalDeviceTimelineSemaphoreProperties timelineSemaphoreProperties = initVulkanStructure(&samplerFilterMinmaxProperties);
5916 extProperties = initVulkanStructure(&timelineSemaphoreProperties);
5918 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
5920 if ((deMemCmp(idProperties.deviceUUID, vulkan11Properties.deviceUUID, VK_UUID_SIZE) != 0) ||
5921 (deMemCmp(idProperties.driverUUID, vulkan11Properties.driverUUID, VK_UUID_SIZE) != 0) ||
5922 (idProperties.deviceLUIDValid != vulkan11Properties.deviceLUIDValid))
5924 TCU_FAIL("Mismatch between VkPhysicalDeviceIDProperties and VkPhysicalDeviceVulkan11Properties");
5926 else if (idProperties.deviceLUIDValid)
5928 // If deviceLUIDValid is VK_FALSE, the contents of deviceLUID and deviceNodeMask are undefined
5929 // so thay can only be compared when deviceLUIDValid is VK_TRUE.
5930 if ((deMemCmp(idProperties.deviceLUID, vulkan11Properties.deviceLUID, VK_LUID_SIZE) != 0) ||
5931 (idProperties.deviceNodeMask != vulkan11Properties.deviceNodeMask))
5933 TCU_FAIL("Mismatch between VkPhysicalDeviceIDProperties and VkPhysicalDeviceVulkan11Properties");
5937 if ((subgroupProperties.subgroupSize != vulkan11Properties.subgroupSize ||
5938 subgroupProperties.supportedStages != vulkan11Properties.subgroupSupportedStages ||
5939 subgroupProperties.supportedOperations != vulkan11Properties.subgroupSupportedOperations ||
5940 subgroupProperties.quadOperationsInAllStages != vulkan11Properties.subgroupQuadOperationsInAllStages))
5942 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupProperties and VkPhysicalDeviceVulkan11Properties");
5945 if ((pointClippingProperties.pointClippingBehavior != vulkan11Properties.pointClippingBehavior))
5947 TCU_FAIL("Mismatch between VkPhysicalDevicePointClippingProperties and VkPhysicalDeviceVulkan11Properties");
5950 if ((multiviewProperties.maxMultiviewViewCount != vulkan11Properties.maxMultiviewViewCount ||
5951 multiviewProperties.maxMultiviewInstanceIndex != vulkan11Properties.maxMultiviewInstanceIndex))
5953 TCU_FAIL("Mismatch between VkPhysicalDeviceMultiviewProperties and VkPhysicalDeviceVulkan11Properties");
5956 if ((protectedMemoryPropertiesKHR.protectedNoFault != vulkan11Properties.protectedNoFault))
5958 TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryProperties and VkPhysicalDeviceVulkan11Properties");
5961 if ((maintenance3Properties.maxPerSetDescriptors != vulkan11Properties.maxPerSetDescriptors ||
5962 maintenance3Properties.maxMemoryAllocationSize != vulkan11Properties.maxMemoryAllocationSize))
5964 TCU_FAIL("Mismatch between VkPhysicalDeviceMaintenance3Properties and VkPhysicalDeviceVulkan11Properties");
5967 if ((driverProperties.driverID != vulkan12Properties.driverID ||
5968 strncmp(driverProperties.driverName, vulkan12Properties.driverName, VK_MAX_DRIVER_NAME_SIZE) != 0 ||
5969 strncmp(driverProperties.driverInfo, vulkan12Properties.driverInfo, VK_MAX_DRIVER_INFO_SIZE) != 0 ||
5970 driverProperties.conformanceVersion.major != vulkan12Properties.conformanceVersion.major ||
5971 driverProperties.conformanceVersion.minor != vulkan12Properties.conformanceVersion.minor ||
5972 driverProperties.conformanceVersion.subminor != vulkan12Properties.conformanceVersion.subminor ||
5973 driverProperties.conformanceVersion.patch != vulkan12Properties.conformanceVersion.patch))
5975 TCU_FAIL("Mismatch between VkPhysicalDeviceDriverProperties and VkPhysicalDeviceVulkan12Properties");
5978 if ((floatControlsProperties.denormBehaviorIndependence != vulkan12Properties.denormBehaviorIndependence ||
5979 floatControlsProperties.roundingModeIndependence != vulkan12Properties.roundingModeIndependence ||
5980 floatControlsProperties.shaderSignedZeroInfNanPreserveFloat16 != vulkan12Properties.shaderSignedZeroInfNanPreserveFloat16 ||
5981 floatControlsProperties.shaderSignedZeroInfNanPreserveFloat32 != vulkan12Properties.shaderSignedZeroInfNanPreserveFloat32 ||
5982 floatControlsProperties.shaderSignedZeroInfNanPreserveFloat64 != vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64 ||
5983 floatControlsProperties.shaderDenormPreserveFloat16 != vulkan12Properties.shaderDenormPreserveFloat16 ||
5984 floatControlsProperties.shaderDenormPreserveFloat32 != vulkan12Properties.shaderDenormPreserveFloat32 ||
5985 floatControlsProperties.shaderDenormPreserveFloat64 != vulkan12Properties.shaderDenormPreserveFloat64 ||
5986 floatControlsProperties.shaderDenormFlushToZeroFloat16 != vulkan12Properties.shaderDenormFlushToZeroFloat16 ||
5987 floatControlsProperties.shaderDenormFlushToZeroFloat32 != vulkan12Properties.shaderDenormFlushToZeroFloat32 ||
5988 floatControlsProperties.shaderDenormFlushToZeroFloat64 != vulkan12Properties.shaderDenormFlushToZeroFloat64 ||
5989 floatControlsProperties.shaderRoundingModeRTEFloat16 != vulkan12Properties.shaderRoundingModeRTEFloat16 ||
5990 floatControlsProperties.shaderRoundingModeRTEFloat32 != vulkan12Properties.shaderRoundingModeRTEFloat32 ||
5991 floatControlsProperties.shaderRoundingModeRTEFloat64 != vulkan12Properties.shaderRoundingModeRTEFloat64 ||
5992 floatControlsProperties.shaderRoundingModeRTZFloat16 != vulkan12Properties.shaderRoundingModeRTZFloat16 ||
5993 floatControlsProperties.shaderRoundingModeRTZFloat32 != vulkan12Properties.shaderRoundingModeRTZFloat32 ||
5994 floatControlsProperties.shaderRoundingModeRTZFloat64 != vulkan12Properties.shaderRoundingModeRTZFloat64 ))
5996 TCU_FAIL("Mismatch between VkPhysicalDeviceFloatControlsProperties and VkPhysicalDeviceVulkan12Properties");
5999 if ((descriptorIndexingProperties.maxUpdateAfterBindDescriptorsInAllPools != vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools ||
6000 descriptorIndexingProperties.shaderUniformBufferArrayNonUniformIndexingNative != vulkan12Properties.shaderUniformBufferArrayNonUniformIndexingNative ||
6001 descriptorIndexingProperties.shaderSampledImageArrayNonUniformIndexingNative != vulkan12Properties.shaderSampledImageArrayNonUniformIndexingNative ||
6002 descriptorIndexingProperties.shaderStorageBufferArrayNonUniformIndexingNative != vulkan12Properties.shaderStorageBufferArrayNonUniformIndexingNative ||
6003 descriptorIndexingProperties.shaderStorageImageArrayNonUniformIndexingNative != vulkan12Properties.shaderStorageImageArrayNonUniformIndexingNative ||
6004 descriptorIndexingProperties.shaderInputAttachmentArrayNonUniformIndexingNative != vulkan12Properties.shaderInputAttachmentArrayNonUniformIndexingNative ||
6005 descriptorIndexingProperties.robustBufferAccessUpdateAfterBind != vulkan12Properties.robustBufferAccessUpdateAfterBind ||
6006 descriptorIndexingProperties.quadDivergentImplicitLod != vulkan12Properties.quadDivergentImplicitLod ||
6007 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindSamplers != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers ||
6008 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindUniformBuffers != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers ||
6009 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindStorageBuffers != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers ||
6010 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindSampledImages != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages ||
6011 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindStorageImages != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages ||
6012 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindInputAttachments != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments ||
6013 descriptorIndexingProperties.maxPerStageUpdateAfterBindResources != vulkan12Properties.maxPerStageUpdateAfterBindResources ||
6014 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindSamplers != vulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers ||
6015 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindUniformBuffers != vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers ||
6016 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic != vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic ||
6017 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageBuffers != vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers ||
6018 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic != vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic ||
6019 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindSampledImages != vulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages ||
6020 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageImages != vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages ||
6021 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindInputAttachments != vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments ))
6023 TCU_FAIL("Mismatch between VkPhysicalDeviceDescriptorIndexingProperties and VkPhysicalDeviceVulkan12Properties");
6026 if ((depthStencilResolveProperties.supportedDepthResolveModes != vulkan12Properties.supportedDepthResolveModes ||
6027 depthStencilResolveProperties.supportedStencilResolveModes != vulkan12Properties.supportedStencilResolveModes ||
6028 depthStencilResolveProperties.independentResolveNone != vulkan12Properties.independentResolveNone ||
6029 depthStencilResolveProperties.independentResolve != vulkan12Properties.independentResolve))
6031 TCU_FAIL("Mismatch between VkPhysicalDeviceDepthStencilResolveProperties and VkPhysicalDeviceVulkan12Properties");
6034 if ((samplerFilterMinmaxProperties.filterMinmaxSingleComponentFormats != vulkan12Properties.filterMinmaxSingleComponentFormats ||
6035 samplerFilterMinmaxProperties.filterMinmaxImageComponentMapping != vulkan12Properties.filterMinmaxImageComponentMapping))
6037 TCU_FAIL("Mismatch between VkPhysicalDeviceSamplerFilterMinmaxProperties and VkPhysicalDeviceVulkan12Properties");
6040 if ((timelineSemaphoreProperties.maxTimelineSemaphoreValueDifference != vulkan12Properties.maxTimelineSemaphoreValueDifference))
6042 TCU_FAIL("Mismatch between VkPhysicalDeviceTimelineSemaphoreProperties and VkPhysicalDeviceVulkan12Properties");
6046 return tcu::TestStatus::pass("Vulkan 1.2 device properties are consistent with extension properties");
6049 tcu::TestStatus devicePropertyExtensionsConsistencyVulkan13(Context& context)
6051 TestLog& log = context.getTestContext().getLog();
6052 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
6053 const CustomInstance instance = createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2");
6054 const InstanceDriver& vki = instance.getDriver();
6056 if (!context.contextSupports(vk::ApiVersion(1, 3, 0)))
6057 TCU_THROW(NotSupportedError, "At least Vulkan 1.3 required to run test");
6059 VkPhysicalDeviceVulkan13Properties vulkan13Properties = initVulkanStructure();
6060 VkPhysicalDeviceProperties2 extProperties = initVulkanStructure(&vulkan13Properties);
6062 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
6064 log << TestLog::Message << vulkan13Properties << TestLog::EndMessage;
6066 // Validate all fields initialized matching to extension structures
6068 VkPhysicalDeviceSubgroupSizeControlProperties subgroupSizeControlProperties = initVulkanStructure();
6069 VkPhysicalDeviceInlineUniformBlockProperties inlineUniformBlockProperties = initVulkanStructure(&subgroupSizeControlProperties);
6070 VkPhysicalDeviceShaderIntegerDotProductProperties shaderIntegerDotProductProperties = initVulkanStructure(&inlineUniformBlockProperties);
6071 VkPhysicalDeviceTexelBufferAlignmentProperties texelBufferAlignmentProperties = initVulkanStructure(&shaderIntegerDotProductProperties);
6072 VkPhysicalDeviceMaintenance4Properties maintenance4Properties = initVulkanStructure(&texelBufferAlignmentProperties);
6073 extProperties = initVulkanStructure(&maintenance4Properties);
6075 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
6077 if (subgroupSizeControlProperties.minSubgroupSize != vulkan13Properties.minSubgroupSize ||
6078 subgroupSizeControlProperties.maxSubgroupSize != vulkan13Properties.maxSubgroupSize ||
6079 subgroupSizeControlProperties.maxComputeWorkgroupSubgroups != vulkan13Properties.maxComputeWorkgroupSubgroups ||
6080 subgroupSizeControlProperties.requiredSubgroupSizeStages != vulkan13Properties.requiredSubgroupSizeStages)
6082 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupSizeControlProperties and VkPhysicalDeviceVulkan13Properties");
6085 if (inlineUniformBlockProperties.maxInlineUniformBlockSize != vulkan13Properties.maxInlineUniformBlockSize ||
6086 inlineUniformBlockProperties.maxPerStageDescriptorInlineUniformBlocks != vulkan13Properties.maxPerStageDescriptorInlineUniformBlocks ||
6087 inlineUniformBlockProperties.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks != vulkan13Properties.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks ||
6088 inlineUniformBlockProperties.maxDescriptorSetInlineUniformBlocks != vulkan13Properties.maxDescriptorSetInlineUniformBlocks ||
6089 inlineUniformBlockProperties.maxDescriptorSetUpdateAfterBindInlineUniformBlocks != vulkan13Properties.maxDescriptorSetUpdateAfterBindInlineUniformBlocks)
6091 TCU_FAIL("Mismatch between VkPhysicalDeviceInlineUniformBlockProperties and VkPhysicalDeviceVulkan13Properties");
6094 if (shaderIntegerDotProductProperties.integerDotProduct8BitUnsignedAccelerated != vulkan13Properties.integerDotProduct8BitUnsignedAccelerated ||
6095 shaderIntegerDotProductProperties.integerDotProduct8BitSignedAccelerated != vulkan13Properties.integerDotProduct8BitSignedAccelerated ||
6096 shaderIntegerDotProductProperties.integerDotProduct8BitMixedSignednessAccelerated != vulkan13Properties.integerDotProduct8BitMixedSignednessAccelerated ||
6097 shaderIntegerDotProductProperties.integerDotProduct4x8BitPackedUnsignedAccelerated != vulkan13Properties.integerDotProduct4x8BitPackedUnsignedAccelerated ||
6098 shaderIntegerDotProductProperties.integerDotProduct4x8BitPackedSignedAccelerated != vulkan13Properties.integerDotProduct4x8BitPackedSignedAccelerated ||
6099 shaderIntegerDotProductProperties.integerDotProduct4x8BitPackedMixedSignednessAccelerated != vulkan13Properties.integerDotProduct4x8BitPackedMixedSignednessAccelerated ||
6100 shaderIntegerDotProductProperties.integerDotProduct16BitUnsignedAccelerated != vulkan13Properties.integerDotProduct16BitUnsignedAccelerated ||
6101 shaderIntegerDotProductProperties.integerDotProduct16BitSignedAccelerated != vulkan13Properties.integerDotProduct16BitSignedAccelerated ||
6102 shaderIntegerDotProductProperties.integerDotProduct16BitMixedSignednessAccelerated != vulkan13Properties.integerDotProduct16BitMixedSignednessAccelerated ||
6103 shaderIntegerDotProductProperties.integerDotProduct32BitUnsignedAccelerated != vulkan13Properties.integerDotProduct32BitUnsignedAccelerated ||
6104 shaderIntegerDotProductProperties.integerDotProduct32BitSignedAccelerated != vulkan13Properties.integerDotProduct32BitSignedAccelerated ||
6105 shaderIntegerDotProductProperties.integerDotProduct32BitMixedSignednessAccelerated != vulkan13Properties.integerDotProduct32BitMixedSignednessAccelerated ||
6106 shaderIntegerDotProductProperties.integerDotProduct64BitUnsignedAccelerated != vulkan13Properties.integerDotProduct64BitUnsignedAccelerated ||
6107 shaderIntegerDotProductProperties.integerDotProduct64BitSignedAccelerated != vulkan13Properties.integerDotProduct64BitSignedAccelerated ||
6108 shaderIntegerDotProductProperties.integerDotProduct64BitMixedSignednessAccelerated != vulkan13Properties.integerDotProduct64BitMixedSignednessAccelerated ||
6109 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating8BitUnsignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating8BitUnsignedAccelerated ||
6110 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating8BitSignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating8BitSignedAccelerated ||
6111 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated ||
6112 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated ||
6113 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated ||
6114 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated ||
6115 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating16BitUnsignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating16BitUnsignedAccelerated ||
6116 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating16BitSignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating16BitSignedAccelerated ||
6117 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated ||
6118 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating32BitUnsignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating32BitUnsignedAccelerated ||
6119 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating32BitSignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating32BitSignedAccelerated ||
6120 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated ||
6121 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating64BitUnsignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating64BitUnsignedAccelerated ||
6122 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating64BitSignedAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating64BitSignedAccelerated ||
6123 shaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated != vulkan13Properties.integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated)
6125 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderIntegerDotProductProperties and VkPhysicalDeviceVulkan13Properties");
6128 if (texelBufferAlignmentProperties.storageTexelBufferOffsetAlignmentBytes != vulkan13Properties.storageTexelBufferOffsetAlignmentBytes ||
6129 texelBufferAlignmentProperties.storageTexelBufferOffsetSingleTexelAlignment != vulkan13Properties.storageTexelBufferOffsetSingleTexelAlignment ||
6130 texelBufferAlignmentProperties.uniformTexelBufferOffsetAlignmentBytes != vulkan13Properties.uniformTexelBufferOffsetAlignmentBytes ||
6131 texelBufferAlignmentProperties.uniformTexelBufferOffsetSingleTexelAlignment != vulkan13Properties.uniformTexelBufferOffsetSingleTexelAlignment)
6133 TCU_FAIL("Mismatch between VkPhysicalDeviceTexelBufferAlignmentProperties and VkPhysicalDeviceVulkan13Properties");
6136 if (maintenance4Properties.maxBufferSize != vulkan13Properties.maxBufferSize)
6138 TCU_FAIL("Mismatch between VkPhysicalDeviceMaintenance4Properties and VkPhysicalDeviceVulkan13Properties");
6142 return tcu::TestStatus::pass("Vulkan 1.3 device properties are consistent with extension properties");
6145 tcu::TestStatus imageFormatProperties2 (Context& context, const VkFormat format, const VkImageType imageType, const VkImageTiling tiling)
6147 if (isYCbCrFormat(format))
6148 // check if Ycbcr format enums are valid given the version and extensions
6149 checkYcbcrApiSupport(context);
6151 TestLog& log = context.getTestContext().getLog();
6153 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
6154 const InstanceDriver& vki (instance.getDriver());
6155 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
6157 const VkImageCreateFlags ycbcrFlags = isYCbCrFormat(format) ? (VkImageCreateFlags)VK_IMAGE_CREATE_DISJOINT_BIT_KHR : (VkImageCreateFlags)0u;
6158 const VkImageUsageFlags allUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT
6159 | VK_IMAGE_USAGE_TRANSFER_DST_BIT
6160 | VK_IMAGE_USAGE_SAMPLED_BIT
6161 | VK_IMAGE_USAGE_STORAGE_BIT
6162 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
6163 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
6164 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
6165 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
6166 const VkImageCreateFlags allCreateFlags = VK_IMAGE_CREATE_SPARSE_BINDING_BIT
6167 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
6168 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT
6169 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
6170 | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
6173 for (VkImageUsageFlags curUsageFlags = (VkImageUsageFlags)1; curUsageFlags <= allUsageFlags; curUsageFlags++)
6175 if (!isValidImageUsageFlagCombination(curUsageFlags))
6178 for (VkImageCreateFlags curCreateFlags = 0; curCreateFlags <= allCreateFlags; curCreateFlags++)
6180 const VkPhysicalDeviceImageFormatInfo2 imageFormatInfo =
6182 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
6191 VkImageFormatProperties coreProperties;
6192 VkImageFormatProperties2 extProperties;
6193 VkResult coreResult;
6196 deMemset(&coreProperties, 0xcd, sizeof(VkImageFormatProperties));
6197 deMemset(&extProperties, 0xcd, sizeof(VkImageFormatProperties2));
6199 extProperties.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
6200 extProperties.pNext = DE_NULL;
6202 coreResult = vki.getPhysicalDeviceImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.tiling, imageFormatInfo.usage, imageFormatInfo.flags, &coreProperties);
6203 extResult = vki.getPhysicalDeviceImageFormatProperties2(physicalDevice, &imageFormatInfo, &extProperties);
6205 TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2);
6206 TCU_CHECK(extProperties.pNext == DE_NULL);
6208 if ((coreResult != extResult) ||
6209 (deMemCmp(&coreProperties, &extProperties.imageFormatProperties, sizeof(VkImageFormatProperties)) != 0))
6211 log << TestLog::Message << "ERROR: device mismatch with query " << imageFormatInfo << TestLog::EndMessage
6212 << TestLog::Message << "vkGetPhysicalDeviceImageFormatProperties() returned " << coreResult << ", " << coreProperties << TestLog::EndMessage
6213 << TestLog::Message << "vkGetPhysicalDeviceImageFormatProperties2() returned " << extResult << ", " << extProperties << TestLog::EndMessage;
6214 TCU_FAIL("Mismatch between image format properties reported by vkGetPhysicalDeviceImageFormatProperties and vkGetPhysicalDeviceImageFormatProperties2");
6219 return tcu::TestStatus::pass("Querying image format properties succeeded");
6222 tcu::TestStatus sparseImageFormatProperties2 (Context& context, const VkFormat format, const VkImageType imageType, const VkImageTiling tiling)
6224 TestLog& log = context.getTestContext().getLog();
6226 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
6227 const InstanceDriver& vki (instance.getDriver());
6228 const VkPhysicalDevice physicalDevice (chooseDevice(vki, instance, context.getTestContext().getCommandLine()));
6230 const VkImageUsageFlags allUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT
6231 | VK_IMAGE_USAGE_TRANSFER_DST_BIT
6232 | VK_IMAGE_USAGE_SAMPLED_BIT
6233 | VK_IMAGE_USAGE_STORAGE_BIT
6234 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
6235 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
6236 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
6237 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
6239 for (deUint32 sampleCountBit = VK_SAMPLE_COUNT_1_BIT; sampleCountBit <= VK_SAMPLE_COUNT_64_BIT; sampleCountBit = (sampleCountBit << 1u))
6241 for (VkImageUsageFlags curUsageFlags = (VkImageUsageFlags)1; curUsageFlags <= allUsageFlags; curUsageFlags++)
6243 if (!isValidImageUsageFlagCombination(curUsageFlags))
6246 const VkPhysicalDeviceSparseImageFormatInfo2 imageFormatInfo =
6248 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2,
6252 (VkSampleCountFlagBits)sampleCountBit,
6257 deUint32 numCoreProperties = 0u;
6258 deUint32 numExtProperties = 0u;
6261 vki.getPhysicalDeviceSparseImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.samples, imageFormatInfo.usage, imageFormatInfo.tiling, &numCoreProperties, DE_NULL);
6262 vki.getPhysicalDeviceSparseImageFormatProperties2(physicalDevice, &imageFormatInfo, &numExtProperties, DE_NULL);
6264 if (numCoreProperties != numExtProperties)
6266 log << TestLog::Message << "ERROR: different number of properties reported for " << imageFormatInfo << TestLog::EndMessage;
6267 TCU_FAIL("Mismatch in reported property count");
6270 if (!context.getDeviceFeatures().sparseBinding)
6272 // There is no support for sparse binding, getPhysicalDeviceSparseImageFormatProperties* MUST report no properties
6273 // Only have to check one of the entrypoints as a mismatch in count is already caught.
6274 if (numCoreProperties > 0)
6276 log << TestLog::Message << "ERROR: device does not support sparse binding but claims support for " << numCoreProperties << " properties in vkGetPhysicalDeviceSparseImageFormatProperties with parameters " << imageFormatInfo << TestLog::EndMessage;
6277 TCU_FAIL("Claimed format properties inconsistent with overall sparseBinding feature");
6281 if (numCoreProperties > 0)
6283 std::vector<VkSparseImageFormatProperties> coreProperties (numCoreProperties);
6284 std::vector<VkSparseImageFormatProperties2> extProperties (numExtProperties);
6286 deMemset(&coreProperties[0], 0xcd, sizeof(VkSparseImageFormatProperties)*numCoreProperties);
6287 deMemset(&extProperties[0], 0xcd, sizeof(VkSparseImageFormatProperties2)*numExtProperties);
6289 for (deUint32 ndx = 0; ndx < numExtProperties; ++ndx)
6291 extProperties[ndx].sType = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2;
6292 extProperties[ndx].pNext = DE_NULL;
6295 vki.getPhysicalDeviceSparseImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.samples, imageFormatInfo.usage, imageFormatInfo.tiling, &numCoreProperties, &coreProperties[0]);
6296 vki.getPhysicalDeviceSparseImageFormatProperties2(physicalDevice, &imageFormatInfo, &numExtProperties, &extProperties[0]);
6298 TCU_CHECK((size_t)numCoreProperties == coreProperties.size());
6299 TCU_CHECK((size_t)numExtProperties == extProperties.size());
6301 for (deUint32 ndx = 0; ndx < numCoreProperties; ++ndx)
6303 TCU_CHECK(extProperties[ndx].sType == VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2);
6304 TCU_CHECK(extProperties[ndx].pNext == DE_NULL);
6306 if ((deMemCmp(&coreProperties[ndx], &extProperties[ndx].properties, sizeof(VkSparseImageFormatProperties)) != 0))
6308 log << TestLog::Message << "ERROR: device mismatch with query " << imageFormatInfo << " property " << ndx << TestLog::EndMessage
6309 << TestLog::Message << "vkGetPhysicalDeviceSparseImageFormatProperties() returned " << coreProperties[ndx] << TestLog::EndMessage
6310 << TestLog::Message << "vkGetPhysicalDeviceSparseImageFormatProperties2() returned " << extProperties[ndx] << TestLog::EndMessage;
6311 TCU_FAIL("Mismatch between image format properties reported by vkGetPhysicalDeviceSparseImageFormatProperties and vkGetPhysicalDeviceSparseImageFormatProperties2");
6318 return tcu::TestStatus::pass("Querying sparse image format properties succeeded");
6321 tcu::TestStatus execImageFormatTest (Context& context, ImageFormatPropertyCase testCase)
6323 return testCase.testFunction(context, testCase.format, testCase.imageType, testCase.tiling);
6326 void createImageFormatTypeTilingTests (tcu::TestCaseGroup* testGroup, ImageFormatPropertyCase params)
6328 DE_ASSERT(params.format == VK_FORMAT_UNDEFINED);
6334 ImageFormatPropertyCase params;
6335 } s_formatRanges[] =
6338 { (VkFormat)(VK_FORMAT_UNDEFINED + 1), VK_CORE_FORMAT_LAST, params },
6341 { VK_FORMAT_G8B8G8R8_422_UNORM_KHR, (VkFormat)(VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR + 1), params },
6343 // YCbCr extended formats
6344 { VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT, (VkFormat)(VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT+1), params },
6347 for (int rangeNdx = 0; rangeNdx < DE_LENGTH_OF_ARRAY(s_formatRanges); ++rangeNdx)
6349 const VkFormat rangeBegin = s_formatRanges[rangeNdx].begin;
6350 const VkFormat rangeEnd = s_formatRanges[rangeNdx].end;
6352 for (VkFormat format = rangeBegin; format != rangeEnd; format = (VkFormat)(format+1))
6354 const bool isYCbCr = isYCbCrFormat(format);
6355 const bool isSparse = (params.testFunction == sparseImageFormatProperties2);
6357 if (isYCbCr && isSparse)
6360 if (isYCbCr && params.imageType != VK_IMAGE_TYPE_2D)
6363 const char* const enumName = getFormatName(format);
6364 const string caseName = de::toLower(string(enumName).substr(10));
6366 params.format = format;
6368 addFunctionCase(testGroup, caseName, enumName, execImageFormatTest, params);
6373 void createImageFormatTypeTests (tcu::TestCaseGroup* testGroup, ImageFormatPropertyCase params)
6375 DE_ASSERT(params.tiling == VK_CORE_IMAGE_TILING_LAST);
6377 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "optimal", "", createImageFormatTypeTilingTests, ImageFormatPropertyCase(params.testFunction, VK_FORMAT_UNDEFINED, params.imageType, VK_IMAGE_TILING_OPTIMAL)));
6378 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "linear", "", createImageFormatTypeTilingTests, ImageFormatPropertyCase(params.testFunction, VK_FORMAT_UNDEFINED, params.imageType, VK_IMAGE_TILING_LINEAR)));
6381 void createImageFormatTests (tcu::TestCaseGroup* testGroup, ImageFormatPropertyCase::Function testFunction)
6383 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "1d", "", createImageFormatTypeTests, ImageFormatPropertyCase(testFunction, VK_FORMAT_UNDEFINED, VK_IMAGE_TYPE_1D, VK_CORE_IMAGE_TILING_LAST)));
6384 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "2d", "", createImageFormatTypeTests, ImageFormatPropertyCase(testFunction, VK_FORMAT_UNDEFINED, VK_IMAGE_TYPE_2D, VK_CORE_IMAGE_TILING_LAST)));
6385 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "3d", "", createImageFormatTypeTests, ImageFormatPropertyCase(testFunction, VK_FORMAT_UNDEFINED, VK_IMAGE_TYPE_3D, VK_CORE_IMAGE_TILING_LAST)));
6389 // Android CTS -specific tests
6394 void checkExtensions (tcu::ResultCollector& results, const set<string>& allowedExtensions, const vector<VkExtensionProperties>& reportedExtensions)
6396 for (vector<VkExtensionProperties>::const_iterator extension = reportedExtensions.begin(); extension != reportedExtensions.end(); ++extension)
6398 const string extensionName (extension->extensionName);
6399 const bool mustBeKnown = de::beginsWith(extensionName, "VK_GOOGLE_") ||
6400 de::beginsWith(extensionName, "VK_ANDROID_");
6402 if (mustBeKnown && !de::contains(allowedExtensions, extensionName))
6403 results.fail("Unknown extension: " + extensionName);
6407 tcu::TestStatus testNoUnknownExtensions (Context& context)
6409 TestLog& log = context.getTestContext().getLog();
6410 tcu::ResultCollector results (log);
6411 set<string> allowedInstanceExtensions;
6412 set<string> allowedDeviceExtensions;
6414 // All known extensions should be added to allowedExtensions:
6415 // allowedExtensions.insert("VK_GOOGLE_extension1");
6416 allowedDeviceExtensions.insert("VK_ANDROID_external_memory_android_hardware_buffer");
6417 allowedDeviceExtensions.insert("VK_GOOGLE_display_timing");
6418 allowedDeviceExtensions.insert("VK_GOOGLE_decorate_string");
6419 allowedDeviceExtensions.insert("VK_GOOGLE_hlsl_functionality1");
6420 allowedInstanceExtensions.insert("VK_GOOGLE_surfaceless_query");
6422 // Instance extensions
6423 checkExtensions(results,
6424 allowedInstanceExtensions,
6425 enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL));
6427 // Extensions exposed by instance layers
6429 const vector<VkLayerProperties> layers = enumerateInstanceLayerProperties(context.getPlatformInterface());
6431 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
6433 checkExtensions(results,
6434 allowedInstanceExtensions,
6435 enumerateInstanceExtensionProperties(context.getPlatformInterface(), layer->layerName));
6439 // Device extensions
6440 checkExtensions(results,
6441 allowedDeviceExtensions,
6442 enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL));
6444 // Extensions exposed by device layers
6446 const vector<VkLayerProperties> layers = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
6448 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
6450 checkExtensions(results,
6451 allowedDeviceExtensions,
6452 enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), layer->layerName));
6456 return tcu::TestStatus(results.getResult(), results.getMessage());
6459 tcu::TestStatus testNoLayers (Context& context)
6461 TestLog& log = context.getTestContext().getLog();
6462 tcu::ResultCollector results (log);
6465 const vector<VkLayerProperties> layers = enumerateInstanceLayerProperties(context.getPlatformInterface());
6467 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
6468 results.fail(string("Instance layer enumerated: ") + layer->layerName);
6472 const vector<VkLayerProperties> layers = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
6474 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
6475 results.fail(string("Device layer enumerated: ") + layer->layerName);
6478 return tcu::TestStatus(results.getResult(), results.getMessage());
6481 tcu::TestStatus testMandatoryExtensions (Context& context)
6483 TestLog& log = context.getTestContext().getLog();
6484 tcu::ResultCollector results (log);
6486 // Instance extensions
6488 static const string mandatoryExtensions[] =
6490 "VK_KHR_get_physical_device_properties2",
6493 for (const auto &ext : mandatoryExtensions)
6495 if (!context.isInstanceFunctionalitySupported(ext))
6496 results.fail(ext + " is not supported");
6500 // Device extensions
6502 static const string mandatoryExtensions[] =
6504 "VK_KHR_maintenance1",
6507 for (const auto &ext : mandatoryExtensions)
6509 if (!context.isDeviceFunctionalitySupported(ext))
6510 results.fail(ext + " is not supported");
6514 return tcu::TestStatus(results.getResult(), results.getMessage());
6521 static inline void addFunctionCaseInNewSubgroup (
6522 tcu::TestContext& testCtx,
6523 tcu::TestCaseGroup* group,
6524 const std::string& subgroupName,
6525 const std::string& subgroupDescription,
6526 FunctionInstance0::Function testFunc)
6528 de::MovePtr<tcu::TestCaseGroup> subgroup(new tcu::TestCaseGroup(testCtx, subgroupName.c_str(), subgroupDescription.c_str()));
6529 addFunctionCase(subgroup.get(), "basic", "", testFunc);
6530 group->addChild(subgroup.release());
6533 tcu::TestCaseGroup* createFeatureInfoTests (tcu::TestContext& testCtx)
6535 de::MovePtr<tcu::TestCaseGroup> infoTests (new tcu::TestCaseGroup(testCtx, "info", "Platform Information Tests"));
6537 infoTests->addChild(createTestGroup(testCtx, "format_properties", "VkGetPhysicalDeviceFormatProperties() Tests", createFormatTests));
6538 infoTests->addChild(createTestGroup(testCtx, "image_format_properties", "VkGetPhysicalDeviceImageFormatProperties() Tests", createImageFormatTests, imageFormatProperties));
6541 de::MovePtr<tcu::TestCaseGroup> extCoreVersionGrp (new tcu::TestCaseGroup(testCtx, "extension_core_versions", "Tests checking extension required core versions"));
6543 addFunctionCase(extCoreVersionGrp.get(), "extension_core_versions", "", extensionCoreVersions);
6545 infoTests->addChild(extCoreVersionGrp.release());
6549 de::MovePtr<tcu::TestCaseGroup> extendedPropertiesTests (new tcu::TestCaseGroup(testCtx, "get_physical_device_properties2", "VK_KHR_get_physical_device_properties2"));
6552 de::MovePtr<tcu::TestCaseGroup> subgroup(new tcu::TestCaseGroup(testCtx, "features", ""));
6553 addFunctionCase(subgroup.get(), "core", "Extended Device Features", deviceFeatures2);
6554 addSeparateFeatureTests(subgroup.get());
6555 extendedPropertiesTests->addChild(subgroup.release());
6557 addFunctionCaseInNewSubgroup(testCtx, extendedPropertiesTests.get(), "properties", "Extended Device Properties", deviceProperties2);
6558 addFunctionCaseInNewSubgroup(testCtx, extendedPropertiesTests.get(), "format_properties", "Extended Device Format Properties", deviceFormatProperties2);
6559 addFunctionCaseInNewSubgroup(testCtx, extendedPropertiesTests.get(), "queue_family_properties", "Extended Device Queue Family Properties", deviceQueueFamilyProperties2);
6560 addFunctionCaseInNewSubgroup(testCtx, extendedPropertiesTests.get(), "memory_properties", "Extended Device Memory Properties", deviceMemoryProperties2);
6562 infoTests->addChild(extendedPropertiesTests.release());
6566 de::MovePtr<tcu::TestCaseGroup> extendedPropertiesTests (new tcu::TestCaseGroup(testCtx, "vulkan1p2", "Vulkan 1.2 related tests"));
6568 addFunctionCase(extendedPropertiesTests.get(), "features", "Extended Vulkan 1.2 Device Features", deviceFeaturesVulkan12);
6569 addFunctionCase(extendedPropertiesTests.get(), "properties", "Extended Vulkan 1.2 Device Properties", devicePropertiesVulkan12);
6570 addFunctionCase(extendedPropertiesTests.get(), "feature_extensions_consistency", "Vulkan 1.2 consistency between Features and Extensions", deviceFeatureExtensionsConsistencyVulkan12);
6571 addFunctionCase(extendedPropertiesTests.get(), "property_extensions_consistency", "Vulkan 1.2 consistency between Properties and Extensions", devicePropertyExtensionsConsistencyVulkan12);
6572 addFunctionCase(extendedPropertiesTests.get(), "feature_bits_influence", "Validate feature bits influence on feature activation", checkApiVersionSupport<1,2>, featureBitInfluenceOnDeviceCreate<VK_API_VERSION_1_2>);
6574 infoTests->addChild(extendedPropertiesTests.release());
6578 de::MovePtr<tcu::TestCaseGroup> extendedPropertiesTests (new tcu::TestCaseGroup(testCtx, "vulkan1p3", "Vulkan 1.3 related tests"));
6580 addFunctionCase(extendedPropertiesTests.get(), "features", "Extended Vulkan 1.3 Device Features", deviceFeaturesVulkan13);
6581 addFunctionCase(extendedPropertiesTests.get(), "properties", "Extended Vulkan 1.3 Device Properties", devicePropertiesVulkan13);
6582 addFunctionCase(extendedPropertiesTests.get(), "feature_extensions_consistency", "Vulkan 1.3 consistency between Features and Extensions", deviceFeatureExtensionsConsistencyVulkan13);
6583 addFunctionCase(extendedPropertiesTests.get(), "property_extensions_consistency", "Vulkan 1.3 consistency between Properties and Extensions", devicePropertyExtensionsConsistencyVulkan13);
6584 addFunctionCase(extendedPropertiesTests.get(), "feature_bits_influence", "Validate feature bits influence on feature activation", checkApiVersionSupport<1, 3>, featureBitInfluenceOnDeviceCreate<VK_API_VERSION_1_3>);
6586 infoTests->addChild(extendedPropertiesTests.release());
6590 de::MovePtr<tcu::TestCaseGroup> limitsValidationTests (new tcu::TestCaseGroup(testCtx, "vulkan1p2_limits_validation", "Vulkan 1.2 and core extensions limits validation"));
6592 addFunctionCase(limitsValidationTests.get(), "general", "Vulkan 1.2 Limit validation", checkApiVersionSupport<1, 2>, validateLimits12);
6593 addFunctionCase(limitsValidationTests.get(), "khr_push_descriptor", "VK_KHR_push_descriptor limit validation", checkSupportKhrPushDescriptor, validateLimitsKhrPushDescriptor);
6594 addFunctionCase(limitsValidationTests.get(), "khr_multiview", "VK_KHR_multiview limit validation", checkSupportKhrMultiview, validateLimitsKhrMultiview);
6595 addFunctionCase(limitsValidationTests.get(), "ext_discard_rectangles", "VK_EXT_discard_rectangles limit validation", checkSupportExtDiscardRectangles, validateLimitsExtDiscardRectangles);
6596 addFunctionCase(limitsValidationTests.get(), "ext_sample_locations", "VK_EXT_sample_locations limit validation", checkSupportExtSampleLocations, validateLimitsExtSampleLocations);
6597 addFunctionCase(limitsValidationTests.get(), "ext_external_memory_host", "VK_EXT_external_memory_host limit validation", checkSupportExtExternalMemoryHost, validateLimitsExtExternalMemoryHost);
6598 addFunctionCase(limitsValidationTests.get(), "ext_blend_operation_advanced", "VK_EXT_blend_operation_advanced limit validation", checkSupportExtBlendOperationAdvanced, validateLimitsExtBlendOperationAdvanced);
6599 addFunctionCase(limitsValidationTests.get(), "khr_maintenance_3", "VK_KHR_maintenance3 limit validation", checkSupportKhrMaintenance3, validateLimitsKhrMaintenance3);
6600 addFunctionCase(limitsValidationTests.get(), "ext_conservative_rasterization", "VK_EXT_conservative_rasterization limit validation", checkSupportExtConservativeRasterization, validateLimitsExtConservativeRasterization);
6601 addFunctionCase(limitsValidationTests.get(), "ext_descriptor_indexing", "VK_EXT_descriptor_indexing limit validation", checkSupportExtDescriptorIndexing, validateLimitsExtDescriptorIndexing);
6602 addFunctionCase(limitsValidationTests.get(), "ext_inline_uniform_block", "VK_EXT_inline_uniform_block limit validation", checkSupportExtInlineUniformBlock, validateLimitsExtInlineUniformBlock);
6603 addFunctionCase(limitsValidationTests.get(), "ext_vertex_attribute_divisor", "VK_EXT_vertex_attribute_divisor limit validation", checkSupportExtVertexAttributeDivisor, validateLimitsExtVertexAttributeDivisor);
6604 addFunctionCase(limitsValidationTests.get(), "nv_mesh_shader", "VK_NV_mesh_shader limit validation", checkSupportNvMeshShader, validateLimitsNvMeshShader);
6605 addFunctionCase(limitsValidationTests.get(), "ext_transform_feedback", "VK_EXT_transform_feedback limit validation", checkSupportExtTransformFeedback, validateLimitsExtTransformFeedback);
6606 addFunctionCase(limitsValidationTests.get(), "fragment_density_map", "VK_EXT_fragment_density_map limit validation", checkSupportExtFragmentDensityMap, validateLimitsExtFragmentDensityMap);
6607 addFunctionCase(limitsValidationTests.get(), "nv_ray_tracing", "VK_NV_ray_tracing limit validation", checkSupportNvRayTracing, validateLimitsNvRayTracing);
6608 addFunctionCase(limitsValidationTests.get(), "timeline_semaphore", "VK_KHR_timeline_semaphore limit validation", checkSupportKhrTimelineSemaphore, validateLimitsKhrTimelineSemaphore);
6609 addFunctionCase(limitsValidationTests.get(), "ext_line_rasterization", "VK_EXT_line_rasterization limit validation", checkSupportExtLineRasterization, validateLimitsExtLineRasterization);
6611 infoTests->addChild(limitsValidationTests.release());
6615 de::MovePtr<tcu::TestCaseGroup> limitsValidationTests(new tcu::TestCaseGroup(testCtx, "vulkan1p3_limits_validation", "Vulkan 1.3 and core extensions limits validation"));
6617 addFunctionCase(limitsValidationTests.get(), "khr_maintenance4", "VK_KHR_maintenance4", checkSupportKhrMaintenance4, validateLimitsKhrMaintenance4);
6618 addFunctionCase(limitsValidationTests.get(), "max_inline_uniform_total_size", "maxInlineUniformTotalSize limit validation", checkApiVersionSupport<1, 3>, validateLimitsMaxInlineUniformTotalSize);
6620 infoTests->addChild(limitsValidationTests.release());
6623 infoTests->addChild(createTestGroup(testCtx, "image_format_properties2", "VkGetPhysicalDeviceImageFormatProperties2() Tests", createImageFormatTests, imageFormatProperties2));
6624 infoTests->addChild(createTestGroup(testCtx, "sparse_image_format_properties2", "VkGetPhysicalDeviceSparseImageFormatProperties2() Tests", createImageFormatTests, sparseImageFormatProperties2));
6627 de::MovePtr<tcu::TestCaseGroup> profilesValidationTests(new tcu::TestCaseGroup(testCtx, "profiles", "Profiles limits and features validation"));
6629 addFunctionCase(profilesValidationTests.get(), "roadmap_2022", "Limits and features check for roadmap 2022", checkApiVersionSupport<1, 3>, validateRoadmap2022);
6631 infoTests->addChild(profilesValidationTests.release());
6635 de::MovePtr<tcu::TestCaseGroup> androidTests (new tcu::TestCaseGroup(testCtx, "android", "Android CTS Tests"));
6637 addFunctionCase(androidTests.get(), "mandatory_extensions", "Test that all mandatory extensions are supported", android::testMandatoryExtensions);
6638 addFunctionCase(androidTests.get(), "no_unknown_extensions", "Test for unknown device or instance extensions", android::testNoUnknownExtensions);
6639 addFunctionCase(androidTests.get(), "no_layers", "Test that no layers are enumerated", android::testNoLayers);
6641 infoTests->addChild(androidTests.release());
6644 return infoTests.release();
6647 void createFeatureInfoInstanceTests(tcu::TestCaseGroup* testGroup)
6649 addFunctionCase(testGroup, "physical_devices", "Physical devices", enumeratePhysicalDevices);
6650 addFunctionCase(testGroup, "physical_device_groups", "Physical devices Groups", enumeratePhysicalDeviceGroups);
6651 addFunctionCase(testGroup, "instance_layers", "Layers", enumerateInstanceLayers);
6652 addFunctionCase(testGroup, "instance_extensions", "Extensions", enumerateInstanceExtensions);
6655 void createFeatureInfoDeviceTests(tcu::TestCaseGroup* testGroup)
6657 addFunctionCase(testGroup, "device_features", "Device Features", deviceFeatures);
6658 addFunctionCase(testGroup, "device_properties", "Device Properties", deviceProperties);
6659 addFunctionCase(testGroup, "device_queue_family_properties", "Queue family properties", deviceQueueFamilyProperties);
6660 addFunctionCase(testGroup, "device_memory_properties", "Memory properties", deviceMemoryProperties);
6661 addFunctionCase(testGroup, "device_layers", "Layers", enumerateDeviceLayers);
6662 addFunctionCase(testGroup, "device_extensions", "Extensions", enumerateDeviceExtensions);
6663 addFunctionCase(testGroup, "device_no_khx_extensions", "KHX extensions", testNoKhxExtensions);
6664 addFunctionCase(testGroup, "device_memory_budget", "Memory budget", deviceMemoryBudgetProperties);
6665 addFunctionCase(testGroup, "device_mandatory_features", "Mandatory features", deviceMandatoryFeatures);
6668 void createFeatureInfoDeviceGroupTests(tcu::TestCaseGroup* testGroup)
6670 addFunctionCase(testGroup, "device_group_peer_memory_features", "Device Group peer memory features", deviceGroupPeerMemoryFeatures);