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;
139 } featureLimitTable[] = //!< Based on 1.0.28 Vulkan spec
141 { LIMIT(maxImageDimension1D), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
142 { LIMIT(maxImageDimension2D), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
143 { LIMIT(maxImageDimension3D), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
144 { LIMIT(maxImageDimensionCube), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
145 { LIMIT(maxImageArrayLayers), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
146 { LIMIT(maxTexelBufferElements), 65536, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
147 { LIMIT(maxUniformBufferRange), 16384, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
148 { LIMIT(maxStorageBufferRange), 134217728, 0, 0, 0, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
149 { LIMIT(maxPushConstantsSize), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
150 { LIMIT(maxMemoryAllocationCount), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
151 { LIMIT(maxSamplerAllocationCount), 4000, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
152 { LIMIT(bufferImageGranularity), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1 },
153 { LIMIT(bufferImageGranularity), 0, 0, 131072, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1 },
154 { LIMIT(sparseAddressSpaceSize), 0, 0, 2UL*1024*1024*1024, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1 },
155 { LIMIT(maxBoundDescriptorSets), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
156 { LIMIT(maxPerStageDescriptorSamplers), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
157 { LIMIT(maxPerStageDescriptorUniformBuffers), 12, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
158 { LIMIT(maxPerStageDescriptorStorageBuffers), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
159 { LIMIT(maxPerStageDescriptorSampledImages), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
160 { LIMIT(maxPerStageDescriptorStorageImages), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
161 { LIMIT(maxPerStageDescriptorInputAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
162 { LIMIT(maxPerStageResources), maxPerStageResourcesMin, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
163 { LIMIT(maxDescriptorSetSamplers), shaderStages * 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
164 { LIMIT(maxDescriptorSetUniformBuffers), shaderStages * 12, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
165 { LIMIT(maxDescriptorSetUniformBuffersDynamic), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
166 { LIMIT(maxDescriptorSetStorageBuffers), shaderStages * 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
167 { LIMIT(maxDescriptorSetStorageBuffersDynamic), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
168 { LIMIT(maxDescriptorSetSampledImages), shaderStages * 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
169 { LIMIT(maxDescriptorSetStorageImages), shaderStages * 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
170 { LIMIT(maxDescriptorSetInputAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
171 { LIMIT(maxVertexInputAttributes), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
172 { LIMIT(maxVertexInputBindings), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
173 { LIMIT(maxVertexInputAttributeOffset), 2047, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
174 { LIMIT(maxVertexInputBindingStride), 2048, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
175 { LIMIT(maxVertexOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
176 { LIMIT(maxTessellationGenerationLevel), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
177 { LIMIT(maxTessellationPatchSize), 32, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
178 { LIMIT(maxTessellationControlPerVertexInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
179 { LIMIT(maxTessellationControlPerVertexOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
180 { LIMIT(maxTessellationControlPerPatchOutputComponents), 120, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
181 { LIMIT(maxTessellationControlTotalOutputComponents), 2048, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
182 { LIMIT(maxTessellationEvaluationInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
183 { LIMIT(maxTessellationEvaluationOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
184 { LIMIT(maxGeometryShaderInvocations), 32, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
185 { LIMIT(maxGeometryInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
186 { LIMIT(maxGeometryOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
187 { LIMIT(maxGeometryOutputVertices), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
188 { LIMIT(maxGeometryTotalOutputComponents), 1024, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
189 { LIMIT(maxFragmentInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
190 { LIMIT(maxFragmentOutputAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
191 { LIMIT(maxFragmentDualSrcAttachments), 1, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
192 { LIMIT(maxFragmentCombinedOutputResources), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
193 { LIMIT(maxComputeSharedMemorySize), 16384, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
194 { LIMIT(maxComputeWorkGroupCount[0]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
195 { LIMIT(maxComputeWorkGroupCount[1]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
196 { LIMIT(maxComputeWorkGroupCount[2]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
197 { LIMIT(maxComputeWorkGroupInvocations), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
198 { LIMIT(maxComputeWorkGroupSize[0]), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
199 { LIMIT(maxComputeWorkGroupSize[1]), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
200 { LIMIT(maxComputeWorkGroupSize[2]), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
201 { LIMIT(subPixelPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
202 { LIMIT(subTexelPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
203 { LIMIT(mipmapPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
204 { LIMIT(maxDrawIndexedIndexValue), (deUint32)~0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
205 { LIMIT(maxDrawIndirectCount), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
206 { LIMIT(maxSamplerLodBias), 0, 0, 0, 2.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
207 { LIMIT(maxSamplerAnisotropy), 0, 0, 0, 16.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
208 { LIMIT(maxViewports), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
209 { LIMIT(maxViewportDimensions[0]), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
210 { LIMIT(maxViewportDimensions[1]), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
211 { LIMIT(viewportBoundsRange[0]), 0, 0, 0, -8192.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
212 { LIMIT(viewportBoundsRange[1]), 0, 0, 0, 8191.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
213 { LIMIT(viewportSubPixelBits), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
214 { LIMIT(minMemoryMapAlignment), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
215 { LIMIT(minTexelBufferOffsetAlignment), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1 },
216 { LIMIT(minTexelBufferOffsetAlignment), 0, 0, 256, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1 },
217 { LIMIT(minUniformBufferOffsetAlignment), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1 },
218 { LIMIT(minUniformBufferOffsetAlignment), 0, 0, 256, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1 },
219 { LIMIT(minStorageBufferOffsetAlignment), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1 },
220 { LIMIT(minStorageBufferOffsetAlignment), 0, 0, 256, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1 },
221 { LIMIT(minTexelOffset), 0, -8, 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MAX, -1 },
222 { LIMIT(maxTexelOffset), 7, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
223 { LIMIT(minTexelGatherOffset), 0, -8, 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MAX, -1 },
224 { LIMIT(maxTexelGatherOffset), 7, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
225 { LIMIT(minInterpolationOffset), 0, 0, 0, -0.5f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
226 { LIMIT(maxInterpolationOffset), 0, 0, 0, 0.5f - (1.0f/deFloatPow(2.0f, (float)limits->subPixelInterpolationOffsetBits)), LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
227 { LIMIT(subPixelInterpolationOffsetBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
228 { LIMIT(maxFramebufferWidth), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
229 { LIMIT(maxFramebufferHeight), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
230 { LIMIT(maxFramebufferLayers), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
231 { LIMIT(framebufferColorSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
232 { LIMIT(framebufferDepthSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
233 { LIMIT(framebufferStencilSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
234 { LIMIT(framebufferNoAttachmentsSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
235 { LIMIT(maxColorAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
236 { LIMIT(sampledImageColorSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
237 { LIMIT(sampledImageIntegerSampleCounts), VK_SAMPLE_COUNT_1_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
238 { LIMIT(sampledImageDepthSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
239 { LIMIT(sampledImageStencilSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
240 { LIMIT(storageImageSampleCounts), VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN, -1 },
241 { LIMIT(maxSampleMaskWords), 1, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
242 { LIMIT(timestampComputeAndGraphics), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE, -1 },
243 { LIMIT(timestampPeriod), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE, -1 },
244 { LIMIT(maxClipDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
245 { LIMIT(maxCullDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
246 { LIMIT(maxCombinedClipAndCullDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
247 { LIMIT(discreteQueuePriorities), 2, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
248 { LIMIT(pointSizeRange[0]), 0, 0, 0, 0.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
249 { LIMIT(pointSizeRange[0]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
250 { LIMIT(pointSizeRange[1]), 0, 0, 0, 64.0f - limits->pointSizeGranularity , LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
251 { LIMIT(lineWidthRange[0]), 0, 0, 0, 0.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
252 { LIMIT(lineWidthRange[0]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
253 { LIMIT(lineWidthRange[1]), 0, 0, 0, 8.0f - limits->lineWidthGranularity, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
254 { LIMIT(pointSizeGranularity), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
255 { LIMIT(lineWidthGranularity), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
256 { LIMIT(strictLines), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE, -1 },
257 { LIMIT(standardSampleLocations), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE, -1 },
258 { LIMIT(optimalBufferCopyOffsetAlignment), 0, 0, 0, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_NONE, -1 },
259 { LIMIT(optimalBufferCopyRowPitchAlignment), 0, 0, 0, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_NONE, -1 },
260 { LIMIT(nonCoherentAtomSize), 0, 0, 1, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1 },
261 { LIMIT(nonCoherentAtomSize), 0, 0, 256, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1 },
264 const struct UnsupportedFeatureLimitTable
266 deUint32 limitOffset;
268 deUint32 featureOffset;
269 deUint32 uintVal; //!< Format is UNSIGNED_INT
270 deInt32 intVal; //!< Format is SIGNED_INT
271 deUint64 deviceSizeVal; //!< Format is DEVICE_SIZE
272 float floatVal; //!< Format is FLOAT
273 } unsupportedFeatureTable[] =
275 { LIMIT(sparseAddressSpaceSize), FEATURE(sparseBinding), 0, 0, 0, 0.0f },
276 { LIMIT(maxTessellationGenerationLevel), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
277 { LIMIT(maxTessellationPatchSize), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
278 { LIMIT(maxTessellationControlPerVertexInputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
279 { LIMIT(maxTessellationControlPerVertexOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
280 { LIMIT(maxTessellationControlPerPatchOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
281 { LIMIT(maxTessellationControlTotalOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
282 { LIMIT(maxTessellationEvaluationInputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
283 { LIMIT(maxTessellationEvaluationOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
284 { LIMIT(maxGeometryShaderInvocations), FEATURE(geometryShader), 0, 0, 0, 0.0f },
285 { LIMIT(maxGeometryInputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
286 { LIMIT(maxGeometryOutputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
287 { LIMIT(maxGeometryOutputVertices), FEATURE(geometryShader), 0, 0, 0, 0.0f },
288 { LIMIT(maxGeometryTotalOutputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
289 { LIMIT(maxFragmentDualSrcAttachments), FEATURE(dualSrcBlend), 0, 0, 0, 0.0f },
290 { LIMIT(maxDrawIndexedIndexValue), FEATURE(fullDrawIndexUint32), (1<<24)-1, 0, 0, 0.0f },
291 { LIMIT(maxDrawIndirectCount), FEATURE(multiDrawIndirect), 1, 0, 0, 0.0f },
292 { LIMIT(maxSamplerAnisotropy), FEATURE(samplerAnisotropy), 1, 0, 0, 0.0f },
293 { LIMIT(maxViewports), FEATURE(multiViewport), 1, 0, 0, 0.0f },
294 { LIMIT(minTexelGatherOffset), FEATURE(shaderImageGatherExtended), 0, 0, 0, 0.0f },
295 { LIMIT(maxTexelGatherOffset), FEATURE(shaderImageGatherExtended), 0, 0, 0, 0.0f },
296 { LIMIT(minInterpolationOffset), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
297 { LIMIT(maxInterpolationOffset), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
298 { LIMIT(subPixelInterpolationOffsetBits), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
299 { LIMIT(storageImageSampleCounts), FEATURE(shaderStorageImageMultisample), VK_SAMPLE_COUNT_1_BIT, 0, 0, 0.0f },
300 { LIMIT(maxClipDistances), FEATURE(shaderClipDistance), 0, 0, 0, 0.0f },
301 { LIMIT(maxCullDistances), FEATURE(shaderCullDistance), 0, 0, 0, 0.0f },
302 { LIMIT(maxCombinedClipAndCullDistances), FEATURE(shaderClipDistance), 0, 0, 0, 0.0f },
303 { LIMIT(pointSizeRange[0]), FEATURE(largePoints), 0, 0, 0, 1.0f },
304 { LIMIT(pointSizeRange[1]), FEATURE(largePoints), 0, 0, 0, 1.0f },
305 { LIMIT(lineWidthRange[0]), FEATURE(wideLines), 0, 0, 0, 1.0f },
306 { LIMIT(lineWidthRange[1]), FEATURE(wideLines), 0, 0, 0, 1.0f },
307 { LIMIT(pointSizeGranularity), FEATURE(largePoints), 0, 0, 0, 0.0f },
308 { LIMIT(lineWidthGranularity), FEATURE(wideLines), 0, 0, 0, 0.0f }
311 log << TestLog::Message << *limits << TestLog::EndMessage;
313 //!< First build a map from limit to unsupported table index
314 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
316 for (deUint32 unsuppNdx = 0; unsuppNdx < DE_LENGTH_OF_ARRAY(unsupportedFeatureTable); unsuppNdx++)
318 if (unsupportedFeatureTable[unsuppNdx].limitOffset == featureLimitTable[ndx].offset)
320 featureLimitTable[ndx].unsuppTableNdx = unsuppNdx;
326 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
328 switch (featureLimitTable[ndx].format)
330 case LIMIT_FORMAT_UNSIGNED_INT:
332 deUint32 limitToCheck = featureLimitTable[ndx].uintVal;
333 if (featureLimitTable[ndx].unsuppTableNdx != -1)
335 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
336 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].uintVal;
339 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
342 if (*((deUint32*)((deUint8*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
344 log << TestLog::Message << "limit Validation failed " << featureLimitTable[ndx].name
345 << " not valid-limit type MIN - actual is "
346 << *((deUint32*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
350 else if (featureLimitTable[ndx].type == LIMIT_TYPE_MAX)
352 if (*((deUint32*)((deUint8*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
354 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
355 << " not valid-limit type MAX - actual is "
356 << *((deUint32*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
363 case LIMIT_FORMAT_FLOAT:
365 float limitToCheck = featureLimitTable[ndx].floatVal;
366 if (featureLimitTable[ndx].unsuppTableNdx != -1)
368 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
369 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].floatVal;
372 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
374 if (*((float*)((deUint8*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
376 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
377 << " not valid-limit type MIN - actual is "
378 << *((float*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
382 else if (featureLimitTable[ndx].type == LIMIT_TYPE_MAX)
384 if (*((float*)((deUint8*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
386 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
387 << " not valid-limit type MAX actual is "
388 << *((float*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
395 case LIMIT_FORMAT_SIGNED_INT:
397 deInt32 limitToCheck = featureLimitTable[ndx].intVal;
398 if (featureLimitTable[ndx].unsuppTableNdx != -1)
400 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
401 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].intVal;
403 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
405 if (*((deInt32*)((deUint8*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
407 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
408 << " not valid-limit type MIN actual is "
409 << *((deInt32*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
413 else if (featureLimitTable[ndx].type == LIMIT_TYPE_MAX)
415 if (*((deInt32*)((deUint8*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
417 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
418 << " not valid-limit type MAX actual is "
419 << *((deInt32*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
426 case LIMIT_FORMAT_DEVICE_SIZE:
428 deUint64 limitToCheck = featureLimitTable[ndx].deviceSizeVal;
429 if (featureLimitTable[ndx].unsuppTableNdx != -1)
431 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
432 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].deviceSizeVal;
435 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
437 if (*((deUint64*)((deUint8*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
439 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
440 << " not valid-limit type MIN actual is "
441 << *((deUint64*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
445 else if (featureLimitTable[ndx].type == LIMIT_TYPE_MAX)
447 if (*((deUint64*)((deUint8*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
449 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
450 << " not valid-limit type MAX actual is "
451 << *((deUint64*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
458 case LIMIT_FORMAT_BITMASK:
460 deUint32 limitToCheck = featureLimitTable[ndx].uintVal;
461 if (featureLimitTable[ndx].unsuppTableNdx != -1)
463 if (*((VkBool32*)((deUint8*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
464 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].uintVal;
467 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
469 if ((*((deUint32*)((deUint8*)limits+featureLimitTable[ndx].offset)) & limitToCheck) != limitToCheck)
471 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
472 << " not valid-limit type bitmask actual is "
473 << *((deUint64*)((deUint8*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
486 if (limits->maxFramebufferWidth > limits->maxViewportDimensions[0] ||
487 limits->maxFramebufferHeight > limits->maxViewportDimensions[1])
489 log << TestLog::Message << "limit validation failed, maxFramebufferDimension of "
490 << "[" << limits->maxFramebufferWidth << ", " << limits->maxFramebufferHeight << "] "
491 << "is larger than maxViewportDimension of "
492 << "[" << limits->maxViewportDimensions[0] << ", " << limits->maxViewportDimensions[1] << "]" << TestLog::EndMessage;
496 if (limits->viewportBoundsRange[0] > float(-2 * limits->maxViewportDimensions[0]))
498 log << TestLog::Message << "limit validation failed, viewPortBoundsRange[0] of " << limits->viewportBoundsRange[0]
499 << "is larger than -2*maxViewportDimension[0] of " << -2*limits->maxViewportDimensions[0] << TestLog::EndMessage;
503 if (limits->viewportBoundsRange[1] < float(2 * limits->maxViewportDimensions[1] - 1))
505 log << TestLog::Message << "limit validation failed, viewportBoundsRange[1] of " << limits->viewportBoundsRange[1]
506 << "is less than 2*maxViewportDimension[1] of " << 2*limits->maxViewportDimensions[1] << TestLog::EndMessage;
513 void validateLimitsCheckSupport (Context& context)
515 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
516 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
519 typedef struct FeatureLimitTableItem_
522 const char* condName;
525 deUint32 uintVal; //!< Format is UNSIGNED_INT
526 deInt32 intVal; //!< Format is SIGNED_INT
527 deUint64 deviceSizeVal; //!< Format is DEVICE_SIZE
528 float floatVal; //!< Format is FLOAT
531 } FeatureLimitTableItem;
534 bool validateNumericLimit (const T limitToCheck, const T reportedValue, const LimitType limitType, const char* limitName, TestLog& log)
536 if (limitType == LIMIT_TYPE_MIN)
538 if (reportedValue < limitToCheck)
540 log << TestLog::Message << "Limit validation failed " << limitName
541 << " reported value is " << reportedValue
542 << " expected MIN " << limitToCheck
543 << TestLog::EndMessage;
548 log << TestLog::Message << limitName
549 << "=" << reportedValue
550 << " (>=" << limitToCheck << ")"
551 << TestLog::EndMessage;
553 else if (limitType == LIMIT_TYPE_MAX)
555 if (reportedValue > limitToCheck)
557 log << TestLog::Message << "Limit validation failed " << limitName
558 << " reported value is " << reportedValue
559 << " expected MAX " << limitToCheck
560 << TestLog::EndMessage;
565 log << TestLog::Message << limitName
566 << "=" << reportedValue
567 << " (<=" << limitToCheck << ")"
568 << TestLog::EndMessage;
575 bool validateBitmaskLimit (const T limitToCheck, const T reportedValue, const LimitType limitType, const char* limitName, TestLog& log)
577 if (limitType == LIMIT_TYPE_MIN)
579 if ((reportedValue & limitToCheck) != limitToCheck)
581 log << TestLog::Message << "Limit validation failed " << limitName
582 << " reported value is " << reportedValue
583 << " expected MIN " << limitToCheck
584 << TestLog::EndMessage;
589 log << TestLog::Message << limitName
590 << "=" << tcu::toHex(reportedValue)
591 << " (contains " << tcu::toHex(limitToCheck) << ")"
592 << TestLog::EndMessage;
598 bool validateLimit (FeatureLimitTableItem limit, TestLog& log)
600 if (*((VkBool32*)limit.cond) == DE_FALSE)
602 log << TestLog::Message
603 << "Limit validation skipped '" << limit.name << "' due to "
604 << limit.condName << " == false'"
605 << TestLog::EndMessage;
610 switch (limit.format)
612 case LIMIT_FORMAT_UNSIGNED_INT:
614 const deUint32 limitToCheck = limit.uintVal;
615 const deUint32 reportedValue = *(deUint32*)limit.ptr;
617 return validateNumericLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
620 case LIMIT_FORMAT_FLOAT:
622 const float limitToCheck = limit.floatVal;
623 const float reportedValue = *(float*)limit.ptr;
625 return validateNumericLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
628 case LIMIT_FORMAT_SIGNED_INT:
630 const deInt32 limitToCheck = limit.intVal;
631 const deInt32 reportedValue = *(deInt32*)limit.ptr;
633 return validateNumericLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
636 case LIMIT_FORMAT_DEVICE_SIZE:
638 const deUint64 limitToCheck = limit.deviceSizeVal;
639 const deUint64 reportedValue = *(deUint64*)limit.ptr;
641 return validateNumericLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
644 case LIMIT_FORMAT_BITMASK:
646 const deUint32 limitToCheck = limit.uintVal;
647 const deUint32 reportedValue = *(deUint32*)limit.ptr;
649 return validateBitmaskLimit(limitToCheck, reportedValue, limit.type, limit.name, log);
653 TCU_THROW(InternalError, "Unknown LimitFormat specified");
660 #define PN(_X_) &(_X_), (const char*)(#_X_)
663 #define LIM_MIN_UINT32(X) deUint32(X), 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN
664 #define LIM_MAX_UINT32(X) deUint32(X), 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MAX
665 #define LIM_NONE_UINT32 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE
666 #define LIM_MIN_INT32(X) 0, deInt32(X), 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MIN
667 #define LIM_MAX_INT32(X) 0, deInt32(X), 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MAX
668 #define LIM_NONE_INT32 0, 0, 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_NONE
669 #define LIM_MIN_DEVSIZE(X) 0, 0, VkDeviceSize(X), 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN
670 #define LIM_MAX_DEVSIZE(X) 0, 0, VkDeviceSize(X), 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX
671 #define LIM_NONE_DEVSIZE 0, 0, 0, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_NONE
672 #define LIM_MIN_FLOAT(X) 0, 0, 0, float(X), LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN
673 #define LIM_MAX_FLOAT(X) 0, 0, 0, float(X), LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX
674 #define LIM_NONE_FLOAT 0, 0, 0, 0.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_NONE
675 #define LIM_MIN_BITI32(X) deUint32(X), 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MIN
676 #define LIM_MAX_BITI32(X) deUint32(X), 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_MAX
677 #define LIM_NONE_BITI32 0, 0, 0, 0.0f, LIMIT_FORMAT_BITMASK, LIMIT_TYPE_NONE
679 tcu::TestStatus validateLimits12 (Context& context)
681 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
682 const InstanceInterface& vki = context.getInstanceInterface();
683 TestLog& log = context.getTestContext().getLog();
684 bool limitsOk = true;
686 const VkPhysicalDeviceFeatures2& features2 = context.getDeviceFeatures2();
687 const VkPhysicalDeviceFeatures& features = features2.features;
688 const VkPhysicalDeviceVulkan12Features features12 = getPhysicalDeviceVulkan12Features(vki, physicalDevice);
690 const VkPhysicalDeviceProperties2& properties2 = context.getDeviceProperties2();
691 const VkPhysicalDeviceVulkan12Properties vulkan12Properties = getPhysicalDeviceVulkan12Properties(vki, physicalDevice);
692 const VkPhysicalDeviceVulkan11Properties vulkan11Properties = getPhysicalDeviceVulkan11Properties(vki, physicalDevice);
693 const VkPhysicalDeviceLimits& limits = properties2.properties.limits;
695 const VkBool32 checkAlways = VK_TRUE;
696 const VkBool32 checkVulkan12Limit = VK_TRUE;
698 deUint32 shaderStages = 3;
699 deUint32 maxPerStageResourcesMin = deMin32(128, limits.maxPerStageDescriptorUniformBuffers +
700 limits.maxPerStageDescriptorStorageBuffers +
701 limits.maxPerStageDescriptorSampledImages +
702 limits.maxPerStageDescriptorStorageImages +
703 limits.maxPerStageDescriptorInputAttachments +
704 limits.maxColorAttachments);
706 if (features.tessellationShader)
711 if (features.geometryShader)
716 FeatureLimitTableItem featureLimitTable[] =
718 { PN(checkAlways), PN(limits.maxImageDimension1D), LIM_MIN_UINT32(4096) },
719 { PN(checkAlways), PN(limits.maxImageDimension2D), LIM_MIN_UINT32(4096) },
720 { PN(checkAlways), PN(limits.maxImageDimension3D), LIM_MIN_UINT32(256) },
721 { PN(checkAlways), PN(limits.maxImageDimensionCube), LIM_MIN_UINT32(4096) },
722 { PN(checkAlways), PN(limits.maxImageArrayLayers), LIM_MIN_UINT32(256) },
723 { PN(checkAlways), PN(limits.maxTexelBufferElements), LIM_MIN_UINT32(65536) },
724 { PN(checkAlways), PN(limits.maxUniformBufferRange), LIM_MIN_UINT32(16384) },
725 { PN(checkAlways), PN(limits.maxStorageBufferRange), LIM_MIN_UINT32((1<<27)) },
726 { PN(checkAlways), PN(limits.maxPushConstantsSize), LIM_MIN_UINT32(128) },
727 { PN(checkAlways), PN(limits.maxMemoryAllocationCount), LIM_MIN_UINT32(4096) },
728 { PN(checkAlways), PN(limits.maxSamplerAllocationCount), LIM_MIN_UINT32(4000) },
729 { PN(checkAlways), PN(limits.bufferImageGranularity), LIM_MIN_DEVSIZE(1) },
730 { PN(checkAlways), PN(limits.bufferImageGranularity), LIM_MAX_DEVSIZE(131072) },
731 { PN(features.sparseBinding), PN(limits.sparseAddressSpaceSize), LIM_MIN_DEVSIZE((1ull<<31)) },
732 { PN(checkAlways), PN(limits.maxBoundDescriptorSets), LIM_MIN_UINT32(4) },
733 { PN(checkAlways), PN(limits.maxPerStageDescriptorSamplers), LIM_MIN_UINT32(16) },
734 { PN(checkAlways), PN(limits.maxPerStageDescriptorUniformBuffers), LIM_MIN_UINT32(12) },
735 { PN(checkAlways), PN(limits.maxPerStageDescriptorStorageBuffers), LIM_MIN_UINT32(4) },
736 { PN(checkAlways), PN(limits.maxPerStageDescriptorSampledImages), LIM_MIN_UINT32(16) },
737 { PN(checkAlways), PN(limits.maxPerStageDescriptorStorageImages), LIM_MIN_UINT32(4) },
738 { PN(checkAlways), PN(limits.maxPerStageDescriptorInputAttachments), LIM_MIN_UINT32(4) },
739 { PN(checkAlways), PN(limits.maxPerStageResources), LIM_MIN_UINT32(maxPerStageResourcesMin) },
740 { PN(checkAlways), PN(limits.maxDescriptorSetSamplers), LIM_MIN_UINT32(shaderStages * 16) },
741 { PN(checkAlways), PN(limits.maxDescriptorSetUniformBuffers), LIM_MIN_UINT32(shaderStages * 12) },
742 { PN(checkAlways), PN(limits.maxDescriptorSetUniformBuffersDynamic), LIM_MIN_UINT32(8) },
743 { PN(checkAlways), PN(limits.maxDescriptorSetStorageBuffers), LIM_MIN_UINT32(shaderStages * 4) },
744 { PN(checkAlways), PN(limits.maxDescriptorSetStorageBuffersDynamic), LIM_MIN_UINT32(4) },
745 { PN(checkAlways), PN(limits.maxDescriptorSetSampledImages), LIM_MIN_UINT32(shaderStages * 16) },
746 { PN(checkAlways), PN(limits.maxDescriptorSetStorageImages), LIM_MIN_UINT32(shaderStages * 4) },
747 { PN(checkAlways), PN(limits.maxDescriptorSetInputAttachments), LIM_MIN_UINT32(4) },
748 { PN(checkAlways), PN(limits.maxVertexInputAttributes), LIM_MIN_UINT32(16) },
749 { PN(checkAlways), PN(limits.maxVertexInputBindings), LIM_MIN_UINT32(16) },
750 { PN(checkAlways), PN(limits.maxVertexInputAttributeOffset), LIM_MIN_UINT32(2047) },
751 { PN(checkAlways), PN(limits.maxVertexInputBindingStride), LIM_MIN_UINT32(2048) },
752 { PN(checkAlways), PN(limits.maxVertexOutputComponents), LIM_MIN_UINT32(64) },
753 { PN(features.tessellationShader), PN(limits.maxTessellationGenerationLevel), LIM_MIN_UINT32(64) },
754 { PN(features.tessellationShader), PN(limits.maxTessellationPatchSize), LIM_MIN_UINT32(32) },
755 { PN(features.tessellationShader), PN(limits.maxTessellationControlPerVertexInputComponents), LIM_MIN_UINT32(64) },
756 { PN(features.tessellationShader), PN(limits.maxTessellationControlPerVertexOutputComponents), LIM_MIN_UINT32(64) },
757 { PN(features.tessellationShader), PN(limits.maxTessellationControlPerPatchOutputComponents), LIM_MIN_UINT32(120) },
758 { PN(features.tessellationShader), PN(limits.maxTessellationControlTotalOutputComponents), LIM_MIN_UINT32(2048) },
759 { PN(features.tessellationShader), PN(limits.maxTessellationEvaluationInputComponents), LIM_MIN_UINT32(64) },
760 { PN(features.tessellationShader), PN(limits.maxTessellationEvaluationOutputComponents), LIM_MIN_UINT32(64) },
761 { PN(features.geometryShader), PN(limits.maxGeometryShaderInvocations), LIM_MIN_UINT32(32) },
762 { PN(features.geometryShader), PN(limits.maxGeometryInputComponents), LIM_MIN_UINT32(64) },
763 { PN(features.geometryShader), PN(limits.maxGeometryOutputComponents), LIM_MIN_UINT32(64) },
764 { PN(features.geometryShader), PN(limits.maxGeometryOutputVertices), LIM_MIN_UINT32(256) },
765 { PN(features.geometryShader), PN(limits.maxGeometryTotalOutputComponents), LIM_MIN_UINT32(1024) },
766 { PN(checkAlways), PN(limits.maxFragmentInputComponents), LIM_MIN_UINT32(64) },
767 { PN(checkAlways), PN(limits.maxFragmentOutputAttachments), LIM_MIN_UINT32(4) },
768 { PN(features.dualSrcBlend), PN(limits.maxFragmentDualSrcAttachments), LIM_MIN_UINT32(1) },
769 { PN(checkAlways), PN(limits.maxFragmentCombinedOutputResources), LIM_MIN_UINT32(4) },
770 { PN(checkAlways), PN(limits.maxComputeSharedMemorySize), LIM_MIN_UINT32(16384) },
771 { PN(checkAlways), PN(limits.maxComputeWorkGroupCount[0]), LIM_MIN_UINT32(65535) },
772 { PN(checkAlways), PN(limits.maxComputeWorkGroupCount[1]), LIM_MIN_UINT32(65535) },
773 { PN(checkAlways), PN(limits.maxComputeWorkGroupCount[2]), LIM_MIN_UINT32(65535) },
774 { PN(checkAlways), PN(limits.maxComputeWorkGroupInvocations), LIM_MIN_UINT32(128) },
775 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[0]), LIM_MIN_UINT32(128) },
776 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[1]), LIM_MIN_UINT32(128) },
777 { PN(checkAlways), PN(limits.maxComputeWorkGroupSize[2]), LIM_MIN_UINT32(64) },
778 { PN(checkAlways), PN(limits.subPixelPrecisionBits), LIM_MIN_UINT32(4) },
779 { PN(checkAlways), PN(limits.subTexelPrecisionBits), LIM_MIN_UINT32(4) },
780 { PN(checkAlways), PN(limits.mipmapPrecisionBits), LIM_MIN_UINT32(4) },
781 { PN(features.fullDrawIndexUint32), PN(limits.maxDrawIndexedIndexValue), LIM_MIN_UINT32((deUint32)~0) },
782 { PN(features.multiDrawIndirect), PN(limits.maxDrawIndirectCount), LIM_MIN_UINT32(65535) },
783 { PN(checkAlways), PN(limits.maxSamplerLodBias), LIM_MIN_FLOAT(2.0f) },
784 { PN(features.samplerAnisotropy), PN(limits.maxSamplerAnisotropy), LIM_MIN_FLOAT(16.0f) },
785 { PN(features.multiViewport), PN(limits.maxViewports), LIM_MIN_UINT32(16) },
786 { PN(checkAlways), PN(limits.maxViewportDimensions[0]), LIM_MIN_UINT32(4096) },
787 { PN(checkAlways), PN(limits.maxViewportDimensions[1]), LIM_MIN_UINT32(4096) },
788 { PN(checkAlways), PN(limits.viewportBoundsRange[0]), LIM_MAX_FLOAT(-8192.0f) },
789 { PN(checkAlways), PN(limits.viewportBoundsRange[1]), LIM_MIN_FLOAT(8191.0f) },
790 { PN(checkAlways), PN(limits.viewportSubPixelBits), LIM_MIN_UINT32(0) },
791 { PN(checkAlways), PN(limits.minMemoryMapAlignment), LIM_MIN_UINT32(64) },
792 { PN(checkAlways), PN(limits.minTexelBufferOffsetAlignment), LIM_MIN_DEVSIZE(1) },
793 { PN(checkAlways), PN(limits.minTexelBufferOffsetAlignment), LIM_MAX_DEVSIZE(256) },
794 { PN(checkAlways), PN(limits.minUniformBufferOffsetAlignment), LIM_MIN_DEVSIZE(1) },
795 { PN(checkAlways), PN(limits.minUniformBufferOffsetAlignment), LIM_MAX_DEVSIZE(256) },
796 { PN(checkAlways), PN(limits.minStorageBufferOffsetAlignment), LIM_MIN_DEVSIZE(1) },
797 { PN(checkAlways), PN(limits.minStorageBufferOffsetAlignment), LIM_MAX_DEVSIZE(256) },
798 { PN(checkAlways), PN(limits.minTexelOffset), LIM_MAX_INT32(-8) },
799 { PN(checkAlways), PN(limits.maxTexelOffset), LIM_MIN_INT32(7) },
800 { PN(features.shaderImageGatherExtended), PN(limits.minTexelGatherOffset), LIM_MAX_INT32(-8) },
801 { PN(features.shaderImageGatherExtended), PN(limits.maxTexelGatherOffset), LIM_MIN_INT32(7) },
802 { PN(features.sampleRateShading), PN(limits.minInterpolationOffset), LIM_MAX_FLOAT(-0.5f) },
803 { PN(features.sampleRateShading), PN(limits.maxInterpolationOffset), LIM_MIN_FLOAT(0.5f - (1.0f/deFloatPow(2.0f, (float)limits.subPixelInterpolationOffsetBits))) },
804 { PN(features.sampleRateShading), PN(limits.subPixelInterpolationOffsetBits), LIM_MIN_UINT32(4) },
805 { PN(checkAlways), PN(limits.maxFramebufferWidth), LIM_MIN_UINT32(4096) },
806 { PN(checkAlways), PN(limits.maxFramebufferHeight), LIM_MIN_UINT32(4096) },
807 { PN(checkAlways), PN(limits.maxFramebufferLayers), LIM_MIN_UINT32(256) },
808 { PN(checkAlways), PN(limits.framebufferColorSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
809 { PN(checkVulkan12Limit), PN(vulkan12Properties.framebufferIntegerColorSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT) },
810 { PN(checkAlways), PN(limits.framebufferDepthSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
811 { PN(checkAlways), PN(limits.framebufferStencilSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
812 { PN(checkAlways), PN(limits.framebufferNoAttachmentsSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
813 { PN(checkAlways), PN(limits.maxColorAttachments), LIM_MIN_UINT32(4) },
814 { PN(checkAlways), PN(limits.sampledImageColorSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
815 { PN(checkAlways), PN(limits.sampledImageIntegerSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT) },
816 { PN(checkAlways), PN(limits.sampledImageDepthSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
817 { PN(checkAlways), PN(limits.sampledImageStencilSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
818 { PN(features.shaderStorageImageMultisample), PN(limits.storageImageSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
819 { PN(checkAlways), PN(limits.maxSampleMaskWords), LIM_MIN_UINT32(1) },
820 { PN(checkAlways), PN(limits.timestampComputeAndGraphics), LIM_NONE_UINT32 },
821 { PN(checkAlways), PN(limits.timestampPeriod), LIM_NONE_UINT32 },
822 { PN(features.shaderClipDistance), PN(limits.maxClipDistances), LIM_MIN_UINT32(8) },
823 { PN(features.shaderCullDistance), PN(limits.maxCullDistances), LIM_MIN_UINT32(8) },
824 { PN(features.shaderClipDistance), PN(limits.maxCombinedClipAndCullDistances), LIM_MIN_UINT32(8) },
825 { PN(checkAlways), PN(limits.discreteQueuePriorities), LIM_MIN_UINT32(2) },
826 { PN(features.largePoints), PN(limits.pointSizeRange[0]), LIM_MIN_FLOAT(0.0f) },
827 { PN(features.largePoints), PN(limits.pointSizeRange[0]), LIM_MAX_FLOAT(1.0f) },
828 { PN(features.largePoints), PN(limits.pointSizeRange[1]), LIM_MIN_FLOAT(64.0f - limits.pointSizeGranularity) },
829 { PN(features.wideLines), PN(limits.lineWidthRange[0]), LIM_MIN_FLOAT(0.0f) },
830 { PN(features.wideLines), PN(limits.lineWidthRange[0]), LIM_MAX_FLOAT(1.0f) },
831 { PN(features.wideLines), PN(limits.lineWidthRange[1]), LIM_MIN_FLOAT(8.0f - limits.lineWidthGranularity) },
832 { PN(features.largePoints), PN(limits.pointSizeGranularity), LIM_MIN_FLOAT(0.0f) },
833 { PN(features.largePoints), PN(limits.pointSizeGranularity), LIM_MAX_FLOAT(1.0f) },
834 { PN(features.wideLines), PN(limits.lineWidthGranularity), LIM_MIN_FLOAT(0.0f) },
835 { PN(features.wideLines), PN(limits.lineWidthGranularity), LIM_MAX_FLOAT(1.0f) },
836 { PN(checkAlways), PN(limits.strictLines), LIM_NONE_UINT32 },
837 { PN(checkAlways), PN(limits.standardSampleLocations), LIM_NONE_UINT32 },
838 { PN(checkAlways), PN(limits.optimalBufferCopyOffsetAlignment), LIM_NONE_DEVSIZE },
839 { PN(checkAlways), PN(limits.optimalBufferCopyRowPitchAlignment), LIM_NONE_DEVSIZE },
840 { PN(checkAlways), PN(limits.nonCoherentAtomSize), LIM_MIN_DEVSIZE(1) },
841 { PN(checkAlways), PN(limits.nonCoherentAtomSize), LIM_MAX_DEVSIZE(256) },
844 { PN(checkVulkan12Limit), PN(vulkan11Properties.maxMultiviewViewCount), LIM_MIN_UINT32(6) },
845 { PN(checkVulkan12Limit), PN(vulkan11Properties.maxMultiviewInstanceIndex), LIM_MIN_UINT32((1<<27) - 1) },
847 // VK_KHR_maintenance3
848 { PN(checkVulkan12Limit), PN(vulkan11Properties.maxPerSetDescriptors), LIM_MIN_UINT32(1024) },
849 { PN(checkVulkan12Limit), PN(vulkan11Properties.maxMemoryAllocationSize), LIM_MIN_DEVSIZE(1<<30) },
851 // VK_EXT_descriptor_indexing
852 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools), LIM_MIN_UINT32(500000) },
853 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers), LIM_MIN_UINT32(500000) },
854 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(12) },
855 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(500000) },
856 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages), LIM_MIN_UINT32(500000) },
857 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages), LIM_MIN_UINT32(500000) },
858 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments), LIM_MIN_UINT32(4) },
859 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageUpdateAfterBindResources), LIM_MIN_UINT32(500000) },
860 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers), LIM_MIN_UINT32(500000) },
861 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(shaderStages * 12) },
862 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), LIM_MIN_UINT32(8) },
863 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(500000) },
864 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), LIM_MIN_UINT32(4) },
865 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages), LIM_MIN_UINT32(500000) },
866 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages), LIM_MIN_UINT32(500000) },
867 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments), LIM_MIN_UINT32(4) },
868 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers), LIM_MIN_UINT32(limits.maxPerStageDescriptorSamplers) },
869 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(limits.maxPerStageDescriptorUniformBuffers) },
870 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageBuffers) },
871 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages), LIM_MIN_UINT32(limits.maxPerStageDescriptorSampledImages) },
872 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages), LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageImages) },
873 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments), LIM_MIN_UINT32(limits.maxPerStageDescriptorInputAttachments) },
874 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxPerStageUpdateAfterBindResources), LIM_MIN_UINT32(limits.maxPerStageResources) },
875 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers), LIM_MIN_UINT32(limits.maxDescriptorSetSamplers) },
876 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffers) },
877 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffersDynamic) },
878 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffers) },
879 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffersDynamic) },
880 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages), LIM_MIN_UINT32(limits.maxDescriptorSetSampledImages) },
881 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages), LIM_MIN_UINT32(limits.maxDescriptorSetStorageImages) },
882 { PN(features12.descriptorIndexing), PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments), LIM_MIN_UINT32(limits.maxDescriptorSetInputAttachments) },
885 { PN(checkVulkan12Limit), PN(vulkan12Properties.maxTimelineSemaphoreValueDifference), LIM_MIN_DEVSIZE((1ull<<31) - 1) },
888 log << TestLog::Message << limits << TestLog::EndMessage;
890 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
891 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
893 if (limits.maxFramebufferWidth > limits.maxViewportDimensions[0] ||
894 limits.maxFramebufferHeight > limits.maxViewportDimensions[1])
896 log << TestLog::Message << "limit validation failed, maxFramebufferDimension of "
897 << "[" << limits.maxFramebufferWidth << ", " << limits.maxFramebufferHeight << "] "
898 << "is larger than maxViewportDimension of "
899 << "[" << limits.maxViewportDimensions[0] << ", " << limits.maxViewportDimensions[1] << "]" << TestLog::EndMessage;
903 if (limits.viewportBoundsRange[0] > float(-2 * limits.maxViewportDimensions[0]))
905 log << TestLog::Message << "limit validation failed, viewPortBoundsRange[0] of " << limits.viewportBoundsRange[0]
906 << "is larger than -2*maxViewportDimension[0] of " << -2*limits.maxViewportDimensions[0] << TestLog::EndMessage;
910 if (limits.viewportBoundsRange[1] < float(2 * limits.maxViewportDimensions[1] - 1))
912 log << TestLog::Message << "limit validation failed, viewportBoundsRange[1] of " << limits.viewportBoundsRange[1]
913 << "is less than 2*maxViewportDimension[1] of " << 2*limits.maxViewportDimensions[1] << TestLog::EndMessage;
918 return tcu::TestStatus::pass("pass");
920 return tcu::TestStatus::fail("fail");
923 void checkSupportKhrPushDescriptor (Context& context)
925 context.requireDeviceFunctionality("VK_KHR_push_descriptor");
928 tcu::TestStatus validateLimitsKhrPushDescriptor (Context& context)
930 const VkBool32 checkAlways = VK_TRUE;
931 const VkPhysicalDevicePushDescriptorPropertiesKHR& pushDescriptorPropertiesKHR = context.getPushDescriptorProperties();
932 TestLog& log = context.getTestContext().getLog();
933 bool limitsOk = true;
935 FeatureLimitTableItem featureLimitTable[] =
937 { PN(checkAlways), PN(pushDescriptorPropertiesKHR.maxPushDescriptors), LIM_MIN_UINT32(32) },
940 log << TestLog::Message << pushDescriptorPropertiesKHR << TestLog::EndMessage;
942 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
943 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
946 return tcu::TestStatus::pass("pass");
948 return tcu::TestStatus::fail("fail");
951 void checkSupportKhrMultiview (Context& context)
953 context.requireDeviceFunctionality("VK_KHR_multiview");
956 tcu::TestStatus validateLimitsKhrMultiview (Context& context)
958 const VkBool32 checkAlways = VK_TRUE;
959 const VkPhysicalDeviceMultiviewProperties& multiviewProperties = context.getMultiviewProperties();
960 TestLog& log = context.getTestContext().getLog();
961 bool limitsOk = true;
963 FeatureLimitTableItem featureLimitTable[] =
966 { PN(checkAlways), PN(multiviewProperties.maxMultiviewViewCount), LIM_MIN_UINT32(6) },
967 { PN(checkAlways), PN(multiviewProperties.maxMultiviewInstanceIndex), LIM_MIN_UINT32((1<<27) - 1) },
970 log << TestLog::Message << multiviewProperties << TestLog::EndMessage;
972 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
973 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
976 return tcu::TestStatus::pass("pass");
978 return tcu::TestStatus::fail("fail");
981 void checkSupportExtDiscardRectangles (Context& context)
983 context.requireDeviceFunctionality("VK_EXT_discard_rectangles");
986 tcu::TestStatus validateLimitsExtDiscardRectangles (Context& context)
988 const VkBool32 checkAlways = VK_TRUE;
989 const VkPhysicalDeviceDiscardRectanglePropertiesEXT& discardRectanglePropertiesEXT = context.getDiscardRectanglePropertiesEXT();
990 TestLog& log = context.getTestContext().getLog();
991 bool limitsOk = true;
993 FeatureLimitTableItem featureLimitTable[] =
995 { PN(checkAlways), PN(discardRectanglePropertiesEXT.maxDiscardRectangles), LIM_MIN_UINT32(4) },
998 log << TestLog::Message << discardRectanglePropertiesEXT << TestLog::EndMessage;
1000 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1001 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1004 return tcu::TestStatus::pass("pass");
1006 return tcu::TestStatus::fail("fail");
1009 void checkSupportExtSampleLocations (Context& context)
1011 context.requireDeviceFunctionality("VK_EXT_sample_locations");
1014 tcu::TestStatus validateLimitsExtSampleLocations (Context& context)
1016 const VkBool32 checkAlways = VK_TRUE;
1017 const VkPhysicalDeviceSampleLocationsPropertiesEXT& sampleLocationsPropertiesEXT = context.getSampleLocationsPropertiesEXT();
1018 TestLog& log = context.getTestContext().getLog();
1019 bool limitsOk = true;
1021 FeatureLimitTableItem featureLimitTable[] =
1023 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.sampleLocationSampleCounts), LIM_MIN_BITI32(VK_SAMPLE_COUNT_4_BIT) },
1024 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.maxSampleLocationGridSize.width), LIM_MIN_FLOAT(0.0f) },
1025 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.maxSampleLocationGridSize.height), LIM_MIN_FLOAT(0.0f) },
1026 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.sampleLocationCoordinateRange[0]), LIM_MAX_FLOAT(0.0f) },
1027 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.sampleLocationCoordinateRange[1]), LIM_MIN_FLOAT(0.9375f) },
1028 { PN(checkAlways), PN(sampleLocationsPropertiesEXT.sampleLocationSubPixelBits), LIM_MIN_UINT32(4) },
1031 log << TestLog::Message << sampleLocationsPropertiesEXT << TestLog::EndMessage;
1033 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1034 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1037 return tcu::TestStatus::pass("pass");
1039 return tcu::TestStatus::fail("fail");
1042 void checkSupportExtExternalMemoryHost (Context& context)
1044 context.requireDeviceFunctionality("VK_EXT_external_memory_host");
1047 tcu::TestStatus validateLimitsExtExternalMemoryHost (Context& context)
1049 const VkBool32 checkAlways = VK_TRUE;
1050 const VkPhysicalDeviceExternalMemoryHostPropertiesEXT& externalMemoryHostPropertiesEXT = context.getExternalMemoryHostPropertiesEXT();
1051 TestLog& log = context.getTestContext().getLog();
1052 bool limitsOk = true;
1054 FeatureLimitTableItem featureLimitTable[] =
1056 { PN(checkAlways), PN(externalMemoryHostPropertiesEXT.minImportedHostPointerAlignment), LIM_MAX_DEVSIZE(65536) },
1059 log << TestLog::Message << externalMemoryHostPropertiesEXT << TestLog::EndMessage;
1061 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1062 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1065 return tcu::TestStatus::pass("pass");
1067 return tcu::TestStatus::fail("fail");
1070 void checkSupportExtBlendOperationAdvanced (Context& context)
1072 context.requireDeviceFunctionality("VK_EXT_blend_operation_advanced");
1075 tcu::TestStatus validateLimitsExtBlendOperationAdvanced (Context& context)
1077 const VkBool32 checkAlways = VK_TRUE;
1078 const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT& blendOperationAdvancedPropertiesEXT = context.getBlendOperationAdvancedPropertiesEXT();
1079 TestLog& log = context.getTestContext().getLog();
1080 bool limitsOk = true;
1082 FeatureLimitTableItem featureLimitTable[] =
1084 { PN(checkAlways), PN(blendOperationAdvancedPropertiesEXT.advancedBlendMaxColorAttachments), LIM_MIN_UINT32(1) },
1087 log << TestLog::Message << blendOperationAdvancedPropertiesEXT << TestLog::EndMessage;
1089 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1090 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1093 return tcu::TestStatus::pass("pass");
1095 return tcu::TestStatus::fail("fail");
1098 void checkSupportKhrMaintenance3 (Context& context)
1100 context.requireDeviceFunctionality("VK_KHR_maintenance3");
1103 tcu::TestStatus validateLimitsKhrMaintenance3 (Context& context)
1105 const VkBool32 checkAlways = VK_TRUE;
1106 const VkPhysicalDeviceMaintenance3Properties& maintenance3Properties = context.getMaintenance3Properties();
1107 TestLog& log = context.getTestContext().getLog();
1108 bool limitsOk = true;
1110 FeatureLimitTableItem featureLimitTable[] =
1112 { PN(checkAlways), PN(maintenance3Properties.maxPerSetDescriptors), LIM_MIN_UINT32(1024) },
1113 { PN(checkAlways), PN(maintenance3Properties.maxMemoryAllocationSize), LIM_MIN_DEVSIZE(1<<30) },
1116 log << TestLog::Message << maintenance3Properties << TestLog::EndMessage;
1118 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1119 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1122 return tcu::TestStatus::pass("pass");
1124 return tcu::TestStatus::fail("fail");
1127 void checkSupportExtConservativeRasterization (Context& context)
1129 context.requireDeviceFunctionality("VK_EXT_conservative_rasterization");
1132 tcu::TestStatus validateLimitsExtConservativeRasterization (Context& context)
1134 const VkBool32 checkAlways = VK_TRUE;
1135 const VkPhysicalDeviceConservativeRasterizationPropertiesEXT& conservativeRasterizationPropertiesEXT = context.getConservativeRasterizationPropertiesEXT();
1136 TestLog& log = context.getTestContext().getLog();
1137 bool limitsOk = true;
1139 FeatureLimitTableItem featureLimitTable[] =
1141 { PN(checkAlways), PN(conservativeRasterizationPropertiesEXT.primitiveOverestimationSize), LIM_MIN_FLOAT(0.0f) },
1142 { PN(checkAlways), PN(conservativeRasterizationPropertiesEXT.maxExtraPrimitiveOverestimationSize), LIM_MIN_FLOAT(0.0f) },
1143 { PN(checkAlways), PN(conservativeRasterizationPropertiesEXT.extraPrimitiveOverestimationSizeGranularity), LIM_MIN_FLOAT(0.0f) },
1146 log << TestLog::Message << conservativeRasterizationPropertiesEXT << TestLog::EndMessage;
1148 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1149 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1152 return tcu::TestStatus::pass("pass");
1154 return tcu::TestStatus::fail("fail");
1157 void checkSupportExtDescriptorIndexing (Context& context)
1159 const std::string& requiredDeviceExtension = "VK_EXT_descriptor_indexing";
1160 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1161 const InstanceInterface& vki = context.getInstanceInterface();
1162 const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
1164 if (!isExtensionSupported(deviceExtensionProperties, RequiredExtension(requiredDeviceExtension)))
1165 TCU_THROW(NotSupportedError, requiredDeviceExtension + " is not supported");
1167 // Extension string is present, then extension is really supported and should have been added into chain in DefaultDevice properties and features
1170 tcu::TestStatus validateLimitsExtDescriptorIndexing (Context& context)
1172 const VkBool32 checkAlways = VK_TRUE;
1173 const VkPhysicalDeviceProperties2& properties2 = context.getDeviceProperties2();
1174 const VkPhysicalDeviceLimits& limits = properties2.properties.limits;
1175 const VkPhysicalDeviceDescriptorIndexingPropertiesEXT& descriptorIndexingPropertiesEXT = context.getDescriptorIndexingProperties();
1176 const VkPhysicalDeviceFeatures& features = context.getDeviceFeatures();
1177 const deUint32 tessellationShaderCount = (features.tessellationShader) ? 2 : 0;
1178 const deUint32 geometryShaderCount = (features.geometryShader) ? 1 : 0;
1179 const deUint32 shaderStages = 3 + tessellationShaderCount + geometryShaderCount;
1180 TestLog& log = context.getTestContext().getLog();
1181 bool limitsOk = true;
1183 FeatureLimitTableItem featureLimitTable[] =
1185 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxUpdateAfterBindDescriptorsInAllPools), LIM_MIN_UINT32(500000) },
1186 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSamplers), LIM_MIN_UINT32(500000) },
1187 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(12) },
1188 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(500000) },
1189 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSampledImages), LIM_MIN_UINT32(500000) },
1190 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageImages), LIM_MIN_UINT32(500000) },
1191 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInputAttachments), LIM_MIN_UINT32(4) },
1192 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageUpdateAfterBindResources), LIM_MIN_UINT32(500000) },
1193 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSamplers), LIM_MIN_UINT32(500000) },
1194 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(shaderStages * 12) },
1195 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), LIM_MIN_UINT32(8) },
1196 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(500000) },
1197 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), LIM_MIN_UINT32(4) },
1198 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSampledImages), LIM_MIN_UINT32(500000) },
1199 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageImages), LIM_MIN_UINT32(500000) },
1200 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindInputAttachments), LIM_MIN_UINT32(4) },
1201 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSamplers), LIM_MIN_UINT32(limits.maxPerStageDescriptorSamplers) },
1202 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(limits.maxPerStageDescriptorUniformBuffers) },
1203 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageBuffers) },
1204 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSampledImages), LIM_MIN_UINT32(limits.maxPerStageDescriptorSampledImages) },
1205 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageImages), LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageImages) },
1206 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInputAttachments), LIM_MIN_UINT32(limits.maxPerStageDescriptorInputAttachments) },
1207 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxPerStageUpdateAfterBindResources), LIM_MIN_UINT32(limits.maxPerStageResources) },
1208 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSamplers), LIM_MIN_UINT32(limits.maxDescriptorSetSamplers) },
1209 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffers), LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffers) },
1210 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic), LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffersDynamic) },
1211 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffers), LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffers) },
1212 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic), LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffersDynamic) },
1213 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSampledImages), LIM_MIN_UINT32(limits.maxDescriptorSetSampledImages) },
1214 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageImages), LIM_MIN_UINT32(limits.maxDescriptorSetStorageImages) },
1215 { PN(checkAlways), PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindInputAttachments), LIM_MIN_UINT32(limits.maxDescriptorSetInputAttachments) },
1218 log << TestLog::Message << descriptorIndexingPropertiesEXT << TestLog::EndMessage;
1220 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1221 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1224 return tcu::TestStatus::pass("pass");
1226 return tcu::TestStatus::fail("fail");
1229 void checkSupportExtInlineUniformBlock (Context& context)
1231 context.requireDeviceFunctionality("VK_EXT_inline_uniform_block");
1234 tcu::TestStatus validateLimitsExtInlineUniformBlock (Context& context)
1236 const VkBool32 checkAlways = VK_TRUE;
1237 const VkPhysicalDeviceInlineUniformBlockPropertiesEXT& inlineUniformBlockPropertiesEXT = context.getInlineUniformBlockPropertiesEXT();
1238 TestLog& log = context.getTestContext().getLog();
1239 bool limitsOk = true;
1241 FeatureLimitTableItem featureLimitTable[] =
1243 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxInlineUniformBlockSize), LIM_MIN_UINT32(256) },
1244 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxPerStageDescriptorInlineUniformBlocks), LIM_MIN_UINT32(4) },
1245 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks), LIM_MIN_UINT32(4) },
1246 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxDescriptorSetInlineUniformBlocks), LIM_MIN_UINT32(4) },
1247 { PN(checkAlways), PN(inlineUniformBlockPropertiesEXT.maxDescriptorSetUpdateAfterBindInlineUniformBlocks), LIM_MIN_UINT32(4) },
1250 log << TestLog::Message << inlineUniformBlockPropertiesEXT << TestLog::EndMessage;
1252 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1253 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1256 return tcu::TestStatus::pass("pass");
1258 return tcu::TestStatus::fail("fail");
1261 void checkSupportExtVertexAttributeDivisor (Context& context)
1263 context.requireDeviceFunctionality("VK_EXT_vertex_attribute_divisor");
1266 tcu::TestStatus validateLimitsExtVertexAttributeDivisor (Context& context)
1268 const VkBool32 checkAlways = VK_TRUE;
1269 const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT& vertexAttributeDivisorPropertiesEXT = context.getVertexAttributeDivisorPropertiesEXT();
1270 TestLog& log = context.getTestContext().getLog();
1271 bool limitsOk = true;
1273 FeatureLimitTableItem featureLimitTable[] =
1275 { PN(checkAlways), PN(vertexAttributeDivisorPropertiesEXT.maxVertexAttribDivisor), LIM_MIN_UINT32((1<<16) - 1) },
1278 log << TestLog::Message << vertexAttributeDivisorPropertiesEXT << TestLog::EndMessage;
1280 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1281 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1284 return tcu::TestStatus::pass("pass");
1286 return tcu::TestStatus::fail("fail");
1289 void checkSupportNvMeshShader (Context& context)
1291 const std::string& requiredDeviceExtension = "VK_NV_mesh_shader";
1292 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1293 const InstanceInterface& vki = context.getInstanceInterface();
1294 const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
1296 if (!isExtensionSupported(deviceExtensionProperties, RequiredExtension(requiredDeviceExtension)))
1297 TCU_THROW(NotSupportedError, requiredDeviceExtension + " is not supported");
1300 tcu::TestStatus validateLimitsNvMeshShader (Context& context)
1302 const VkBool32 checkAlways = VK_TRUE;
1303 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1304 const InstanceInterface& vki = context.getInstanceInterface();
1305 TestLog& log = context.getTestContext().getLog();
1306 bool limitsOk = true;
1307 VkPhysicalDeviceMeshShaderPropertiesNV meshShaderPropertiesNV = initVulkanStructure();
1308 VkPhysicalDeviceProperties2 properties2 = initVulkanStructure(&meshShaderPropertiesNV);
1310 vki.getPhysicalDeviceProperties2(physicalDevice, &properties2);
1312 FeatureLimitTableItem featureLimitTable[] =
1314 { PN(checkAlways), PN(meshShaderPropertiesNV.maxDrawMeshTasksCount), LIM_MIN_UINT32(deUint32((1ull<<16) - 1)) },
1315 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskWorkGroupInvocations), LIM_MIN_UINT32(32) },
1316 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[0]), LIM_MIN_UINT32(32) },
1317 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[1]), LIM_MIN_UINT32(1) },
1318 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[2]), LIM_MIN_UINT32(1) },
1319 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskTotalMemorySize), LIM_MIN_UINT32(16384) },
1320 { PN(checkAlways), PN(meshShaderPropertiesNV.maxTaskOutputCount), LIM_MIN_UINT32((1<<16) - 1) },
1321 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshWorkGroupInvocations), LIM_MIN_UINT32(32) },
1322 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[0]), LIM_MIN_UINT32(32) },
1323 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[1]), LIM_MIN_UINT32(1) },
1324 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[2]), LIM_MIN_UINT32(1) },
1325 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshTotalMemorySize), LIM_MIN_UINT32(16384) },
1326 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshOutputVertices), LIM_MIN_UINT32(256) },
1327 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshOutputPrimitives), LIM_MIN_UINT32(256) },
1328 { PN(checkAlways), PN(meshShaderPropertiesNV.maxMeshMultiviewViewCount), LIM_MIN_UINT32(1) },
1331 log << TestLog::Message << meshShaderPropertiesNV << TestLog::EndMessage;
1333 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1334 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1337 return tcu::TestStatus::pass("pass");
1339 return tcu::TestStatus::fail("fail");
1342 void checkSupportExtTransformFeedback (Context& context)
1344 context.requireDeviceFunctionality("VK_EXT_transform_feedback");
1347 tcu::TestStatus validateLimitsExtTransformFeedback (Context& context)
1349 const VkBool32 checkAlways = VK_TRUE;
1350 const VkPhysicalDeviceTransformFeedbackPropertiesEXT& transformFeedbackPropertiesEXT = context.getTransformFeedbackPropertiesEXT();
1351 TestLog& log = context.getTestContext().getLog();
1352 bool limitsOk = true;
1354 FeatureLimitTableItem featureLimitTable[] =
1356 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackStreams), LIM_MIN_UINT32(1) },
1357 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBuffers), LIM_MIN_UINT32(1) },
1358 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferSize), LIM_MIN_DEVSIZE(1ull<<27) },
1359 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackStreamDataSize), LIM_MIN_UINT32(512) },
1360 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferDataSize), LIM_MIN_UINT32(512) },
1361 { PN(checkAlways), PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferDataStride), LIM_MIN_UINT32(512) },
1364 log << TestLog::Message << transformFeedbackPropertiesEXT << TestLog::EndMessage;
1366 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1367 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1370 return tcu::TestStatus::pass("pass");
1372 return tcu::TestStatus::fail("fail");
1375 void checkSupportExtFragmentDensityMap (Context& context)
1377 context.requireDeviceFunctionality("VK_EXT_fragment_density_map");
1380 tcu::TestStatus validateLimitsExtFragmentDensityMap (Context& context)
1382 const VkBool32 checkAlways = VK_TRUE;
1383 const VkPhysicalDeviceFragmentDensityMapPropertiesEXT& fragmentDensityMapPropertiesEXT = context.getFragmentDensityMapPropertiesEXT();
1384 TestLog& log = context.getTestContext().getLog();
1385 bool limitsOk = true;
1387 FeatureLimitTableItem featureLimitTable[] =
1389 { PN(checkAlways), PN(fragmentDensityMapPropertiesEXT.minFragmentDensityTexelSize.width), LIM_MIN_UINT32(1) },
1390 { PN(checkAlways), PN(fragmentDensityMapPropertiesEXT.minFragmentDensityTexelSize.height), LIM_MIN_UINT32(1) },
1391 { PN(checkAlways), PN(fragmentDensityMapPropertiesEXT.maxFragmentDensityTexelSize.width), LIM_MIN_UINT32(1) },
1392 { PN(checkAlways), PN(fragmentDensityMapPropertiesEXT.maxFragmentDensityTexelSize.height), LIM_MIN_UINT32(1) },
1395 log << TestLog::Message << fragmentDensityMapPropertiesEXT << TestLog::EndMessage;
1397 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1398 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1401 return tcu::TestStatus::pass("pass");
1403 return tcu::TestStatus::fail("fail");
1406 void checkSupportNvRayTracing (Context& context)
1408 const std::string& requiredDeviceExtension = "VK_NV_ray_tracing";
1409 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1410 const InstanceInterface& vki = context.getInstanceInterface();
1411 const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
1413 if (!isExtensionSupported(deviceExtensionProperties, RequiredExtension(requiredDeviceExtension)))
1414 TCU_THROW(NotSupportedError, requiredDeviceExtension + " is not supported");
1417 tcu::TestStatus validateLimitsNvRayTracing (Context& context)
1419 const VkBool32 checkAlways = VK_TRUE;
1420 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1421 const InstanceInterface& vki = context.getInstanceInterface();
1422 TestLog& log = context.getTestContext().getLog();
1423 bool limitsOk = true;
1424 VkPhysicalDeviceRayTracingPropertiesNV rayTracingPropertiesNV = initVulkanStructure();
1425 VkPhysicalDeviceProperties2 properties2 = initVulkanStructure(&rayTracingPropertiesNV);
1427 vki.getPhysicalDeviceProperties2(physicalDevice, &properties2);
1429 FeatureLimitTableItem featureLimitTable[] =
1431 { PN(checkAlways), PN(rayTracingPropertiesNV.shaderGroupHandleSize), LIM_MIN_UINT32(16) },
1432 { PN(checkAlways), PN(rayTracingPropertiesNV.maxRecursionDepth), LIM_MIN_UINT32(31) },
1433 { PN(checkAlways), PN(rayTracingPropertiesNV.shaderGroupBaseAlignment), LIM_MIN_UINT32(64) },
1434 { PN(checkAlways), PN(rayTracingPropertiesNV.maxGeometryCount), LIM_MIN_UINT32((1<<24) - 1) },
1435 { PN(checkAlways), PN(rayTracingPropertiesNV.maxInstanceCount), LIM_MIN_UINT32((1<<24) - 1) },
1436 { PN(checkAlways), PN(rayTracingPropertiesNV.maxTriangleCount), LIM_MIN_UINT32((1<<29) - 1) },
1437 { PN(checkAlways), PN(rayTracingPropertiesNV.maxDescriptorSetAccelerationStructures), LIM_MIN_UINT32(16) },
1440 log << TestLog::Message << rayTracingPropertiesNV << TestLog::EndMessage;
1442 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1443 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1446 return tcu::TestStatus::pass("pass");
1448 return tcu::TestStatus::fail("fail");
1451 void checkSupportKhrTimelineSemaphore (Context& context)
1453 context.requireDeviceFunctionality("VK_KHR_timeline_semaphore");
1456 tcu::TestStatus validateLimitsKhrTimelineSemaphore (Context& context)
1458 const VkBool32 checkAlways = VK_TRUE;
1459 const VkPhysicalDeviceTimelineSemaphorePropertiesKHR& timelineSemaphorePropertiesKHR = context.getTimelineSemaphoreProperties();
1460 bool limitsOk = true;
1461 TestLog& log = context.getTestContext().getLog();
1463 FeatureLimitTableItem featureLimitTable[] =
1465 { PN(checkAlways), PN(timelineSemaphorePropertiesKHR.maxTimelineSemaphoreValueDifference), LIM_MIN_DEVSIZE((1ull<<31) - 1) },
1468 log << TestLog::Message << timelineSemaphorePropertiesKHR << TestLog::EndMessage;
1470 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1471 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1474 return tcu::TestStatus::pass("pass");
1476 return tcu::TestStatus::fail("fail");
1479 void checkSupportExtLineRasterization (Context& context)
1481 context.requireDeviceFunctionality("VK_EXT_line_rasterization");
1484 tcu::TestStatus validateLimitsExtLineRasterization (Context& context)
1486 const VkBool32 checkAlways = VK_TRUE;
1487 const VkPhysicalDeviceLineRasterizationPropertiesEXT& lineRasterizationPropertiesEXT = context.getLineRasterizationPropertiesEXT();
1488 TestLog& log = context.getTestContext().getLog();
1489 bool limitsOk = true;
1491 FeatureLimitTableItem featureLimitTable[] =
1493 { PN(checkAlways), PN(lineRasterizationPropertiesEXT.lineSubPixelPrecisionBits), LIM_MIN_UINT32(4) },
1496 log << TestLog::Message << lineRasterizationPropertiesEXT << TestLog::EndMessage;
1498 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
1499 limitsOk = validateLimit(featureLimitTable[ndx], log) && limitsOk;
1502 return tcu::TestStatus::pass("pass");
1504 return tcu::TestStatus::fail("fail");
1507 void checkSupportFeatureBitInfluence (Context& context)
1509 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
1510 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
1513 void createTestDevice (Context& context, void* pNext, const char* const* ppEnabledExtensionNames, deUint32 enabledExtensionCount)
1515 const PlatformInterface& platformInterface = context.getPlatformInterface();
1516 const auto validationEnabled = context.getTestContext().getCommandLine().isValidationEnabled();
1517 const Unique<VkInstance> instance (createDefaultInstance(platformInterface, context.getUsedApiVersion()));
1518 const InstanceDriver instanceDriver (platformInterface, instance.get());
1519 const VkPhysicalDevice physicalDevice = chooseDevice(instanceDriver, instance.get(), context.getTestContext().getCommandLine());
1520 const deUint32 queueFamilyIndex = 0;
1521 const deUint32 queueCount = 1;
1522 const deUint32 queueIndex = 0;
1523 const float queuePriority = 1.0f;
1524 const vector<VkQueueFamilyProperties> queueFamilyProperties = getPhysicalDeviceQueueFamilyProperties(instanceDriver, physicalDevice);
1525 const VkDeviceQueueCreateInfo deviceQueueCreateInfo =
1527 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, // VkStructureType sType;
1528 DE_NULL, // const void* pNext;
1529 (VkDeviceQueueCreateFlags)0u, // VkDeviceQueueCreateFlags flags;
1530 queueFamilyIndex, // deUint32 queueFamilyIndex;
1531 queueCount, // deUint32 queueCount;
1532 &queuePriority, // const float* pQueuePriorities;
1534 const VkDeviceCreateInfo deviceCreateInfo =
1536 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // VkStructureType sType;
1537 pNext, // const void* pNext;
1538 (VkDeviceCreateFlags)0u, // VkDeviceCreateFlags flags;
1539 1, // deUint32 queueCreateInfoCount;
1540 &deviceQueueCreateInfo, // const VkDeviceQueueCreateInfo* pQueueCreateInfos;
1541 0, // deUint32 enabledLayerCount;
1542 DE_NULL, // const char* const* ppEnabledLayerNames;
1543 enabledExtensionCount, // deUint32 enabledExtensionCount;
1544 ppEnabledExtensionNames, // const char* const* ppEnabledExtensionNames;
1545 DE_NULL, // const VkPhysicalDeviceFeatures* pEnabledFeatures;
1547 const Unique<VkDevice> device (createCustomDevice(validationEnabled, platformInterface, *instance, instanceDriver, physicalDevice, &deviceCreateInfo));
1548 const DeviceDriver deviceDriver (platformInterface, instance.get(), device.get());
1549 const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex);
1551 VK_CHECK(deviceDriver.queueWaitIdle(queue));
1554 void cleanVulkanStruct (void* structPtr, size_t structSize)
1556 struct StructureBase
1558 VkStructureType sType;
1562 VkStructureType sType = ((StructureBase*)structPtr)->sType;
1564 deMemset(structPtr, 0, structSize);
1566 ((StructureBase*)structPtr)->sType = sType;
1569 tcu::TestStatus featureBitInfluenceOnDeviceCreate (Context& context)
1571 #define FEATURE_TABLE_ITEM(CORE, EXT, FIELD, STR) { &(CORE), sizeof(CORE), &(CORE.FIELD), #CORE "." #FIELD, &(EXT), sizeof(EXT), &(EXT.FIELD), #EXT "." #FIELD, STR }
1572 #define DEPENDENCY_DUAL_ITEM(CORE, EXT, FIELD, PARENT) { &(CORE.FIELD), &(CORE.PARENT) }, { &(EXT.FIELD), &(EXT.PARENT) }
1573 #define DEPENDENCY_SINGLE_ITEM(CORE, FIELD, PARENT) { &(CORE.FIELD), &(CORE.PARENT) }
1575 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1576 const InstanceInterface& vki = context.getInstanceInterface();
1577 TestLog& log = context.getTestContext().getLog();
1578 const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
1580 VkPhysicalDeviceFeatures2 features2 = initVulkanStructure();
1581 VkPhysicalDeviceVulkan11Features vulkan11Features = initVulkanStructure();
1582 VkPhysicalDeviceVulkan12Features vulkan12Features = initVulkanStructure();
1583 VkPhysicalDevice16BitStorageFeaturesKHR sixteenBitStorageFeatures = initVulkanStructure();
1584 VkPhysicalDeviceMultiviewFeatures multiviewFeatures = initVulkanStructure();
1585 VkPhysicalDeviceVariablePointersFeatures variablePointersFeatures = initVulkanStructure();
1586 VkPhysicalDeviceProtectedMemoryFeatures protectedMemoryFeatures = initVulkanStructure();
1587 VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYcbcrConversionFeatures = initVulkanStructure();
1588 VkPhysicalDeviceShaderDrawParametersFeatures shaderDrawParametersFeatures = initVulkanStructure();
1589 VkPhysicalDevice8BitStorageFeatures eightBitStorageFeatures = initVulkanStructure();
1590 VkPhysicalDeviceShaderAtomicInt64Features shaderAtomicInt64Features = initVulkanStructure();
1591 VkPhysicalDeviceShaderFloat16Int8Features shaderFloat16Int8Features = initVulkanStructure();
1592 VkPhysicalDeviceDescriptorIndexingFeatures descriptorIndexingFeatures = initVulkanStructure();
1593 VkPhysicalDeviceScalarBlockLayoutFeatures scalarBlockLayoutFeatures = initVulkanStructure();
1594 VkPhysicalDeviceImagelessFramebufferFeatures imagelessFramebufferFeatures = initVulkanStructure();
1595 VkPhysicalDeviceUniformBufferStandardLayoutFeatures uniformBufferStandardLayoutFeatures = initVulkanStructure();
1596 VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures shaderSubgroupExtendedTypesFeatures = initVulkanStructure();
1597 VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures separateDepthStencilLayoutsFeatures = initVulkanStructure();
1598 VkPhysicalDeviceHostQueryResetFeatures hostQueryResetFeatures = initVulkanStructure();
1599 VkPhysicalDeviceTimelineSemaphoreFeatures timelineSemaphoreFeatures = initVulkanStructure();
1600 VkPhysicalDeviceBufferDeviceAddressFeatures bufferDeviceAddressFeatures = initVulkanStructure();
1601 VkPhysicalDeviceVulkanMemoryModelFeatures vulkanMemoryModelFeatures = initVulkanStructure();
1603 struct UnusedExtensionFeatures
1605 VkStructureType sType;
1607 VkBool32 descriptorIndexing;
1608 VkBool32 samplerFilterMinmax;
1609 } unusedExtensionFeatures;
1613 void* coreStructPtr;
1614 size_t coreStructSize;
1615 VkBool32* coreFieldPtr;
1616 const char* coreFieldName;
1618 size_t extStructSize;
1619 VkBool32* extFieldPtr;
1620 const char* extFieldName;
1621 const char* extString;
1625 FEATURE_TABLE_ITEM(vulkan11Features, sixteenBitStorageFeatures, storageBuffer16BitAccess, "VK_KHR_16bit_storage"),
1626 FEATURE_TABLE_ITEM(vulkan11Features, sixteenBitStorageFeatures, uniformAndStorageBuffer16BitAccess, "VK_KHR_16bit_storage"),
1627 FEATURE_TABLE_ITEM(vulkan11Features, sixteenBitStorageFeatures, storagePushConstant16, "VK_KHR_16bit_storage"),
1628 FEATURE_TABLE_ITEM(vulkan11Features, sixteenBitStorageFeatures, storageInputOutput16, "VK_KHR_16bit_storage"),
1629 FEATURE_TABLE_ITEM(vulkan11Features, multiviewFeatures, multiview, "VK_KHR_multiview"),
1630 FEATURE_TABLE_ITEM(vulkan11Features, multiviewFeatures, multiviewGeometryShader, "VK_KHR_multiview"),
1631 FEATURE_TABLE_ITEM(vulkan11Features, multiviewFeatures, multiviewTessellationShader, "VK_KHR_multiview"),
1632 FEATURE_TABLE_ITEM(vulkan11Features, variablePointersFeatures, variablePointersStorageBuffer, "VK_KHR_variable_pointers"),
1633 FEATURE_TABLE_ITEM(vulkan11Features, variablePointersFeatures, variablePointers, "VK_KHR_variable_pointers"),
1634 FEATURE_TABLE_ITEM(vulkan11Features, protectedMemoryFeatures, protectedMemory, DE_NULL),
1635 FEATURE_TABLE_ITEM(vulkan11Features, samplerYcbcrConversionFeatures, samplerYcbcrConversion, "VK_KHR_sampler_ycbcr_conversion"),
1636 FEATURE_TABLE_ITEM(vulkan11Features, shaderDrawParametersFeatures, shaderDrawParameters, DE_NULL),
1637 FEATURE_TABLE_ITEM(vulkan12Features, eightBitStorageFeatures, storageBuffer8BitAccess, "VK_KHR_8bit_storage"),
1638 FEATURE_TABLE_ITEM(vulkan12Features, eightBitStorageFeatures, uniformAndStorageBuffer8BitAccess, "VK_KHR_8bit_storage"),
1639 FEATURE_TABLE_ITEM(vulkan12Features, eightBitStorageFeatures, storagePushConstant8, "VK_KHR_8bit_storage"),
1640 FEATURE_TABLE_ITEM(vulkan12Features, shaderAtomicInt64Features, shaderBufferInt64Atomics, "VK_KHR_shader_atomic_int64"),
1641 FEATURE_TABLE_ITEM(vulkan12Features, shaderAtomicInt64Features, shaderSharedInt64Atomics, "VK_KHR_shader_atomic_int64"),
1642 FEATURE_TABLE_ITEM(vulkan12Features, shaderFloat16Int8Features, shaderFloat16, "VK_KHR_shader_float16_int8"),
1643 FEATURE_TABLE_ITEM(vulkan12Features, shaderFloat16Int8Features, shaderInt8, "VK_KHR_shader_float16_int8"),
1644 FEATURE_TABLE_ITEM(vulkan12Features, unusedExtensionFeatures, descriptorIndexing, DE_NULL),
1645 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderInputAttachmentArrayDynamicIndexing, "VK_EXT_descriptor_indexing"),
1646 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderUniformTexelBufferArrayDynamicIndexing, "VK_EXT_descriptor_indexing"),
1647 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderStorageTexelBufferArrayDynamicIndexing, "VK_EXT_descriptor_indexing"),
1648 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderUniformBufferArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1649 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderSampledImageArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1650 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderStorageBufferArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1651 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderStorageImageArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1652 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderInputAttachmentArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1653 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderUniformTexelBufferArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1654 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, shaderStorageTexelBufferArrayNonUniformIndexing, "VK_EXT_descriptor_indexing"),
1655 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingUniformBufferUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1656 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingSampledImageUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1657 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingStorageImageUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1658 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingStorageBufferUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1659 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingUniformTexelBufferUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1660 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingStorageTexelBufferUpdateAfterBind, "VK_EXT_descriptor_indexing"),
1661 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingUpdateUnusedWhilePending, "VK_EXT_descriptor_indexing"),
1662 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingPartiallyBound, "VK_EXT_descriptor_indexing"),
1663 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, descriptorBindingVariableDescriptorCount, "VK_EXT_descriptor_indexing"),
1664 FEATURE_TABLE_ITEM(vulkan12Features, descriptorIndexingFeatures, runtimeDescriptorArray, "VK_EXT_descriptor_indexing"),
1665 FEATURE_TABLE_ITEM(vulkan12Features, unusedExtensionFeatures, samplerFilterMinmax, "VK_EXT_sampler_filter_minmax"),
1666 FEATURE_TABLE_ITEM(vulkan12Features, scalarBlockLayoutFeatures, scalarBlockLayout, "VK_EXT_scalar_block_layout"),
1667 FEATURE_TABLE_ITEM(vulkan12Features, imagelessFramebufferFeatures, imagelessFramebuffer, "VK_KHR_imageless_framebuffer"),
1668 FEATURE_TABLE_ITEM(vulkan12Features, uniformBufferStandardLayoutFeatures, uniformBufferStandardLayout, "VK_KHR_uniform_buffer_standard_layout"),
1669 FEATURE_TABLE_ITEM(vulkan12Features, shaderSubgroupExtendedTypesFeatures, shaderSubgroupExtendedTypes, "VK_KHR_shader_subgroup_extended_types"),
1670 FEATURE_TABLE_ITEM(vulkan12Features, separateDepthStencilLayoutsFeatures, separateDepthStencilLayouts, "VK_KHR_separate_depth_stencil_layouts"),
1671 FEATURE_TABLE_ITEM(vulkan12Features, hostQueryResetFeatures, hostQueryReset, "VK_EXT_host_query_reset"),
1672 FEATURE_TABLE_ITEM(vulkan12Features, timelineSemaphoreFeatures, timelineSemaphore, "VK_KHR_timeline_semaphore"),
1673 FEATURE_TABLE_ITEM(vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddress, "VK_EXT_buffer_device_address"),
1674 FEATURE_TABLE_ITEM(vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddressCaptureReplay, "VK_EXT_buffer_device_address"),
1675 FEATURE_TABLE_ITEM(vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddressMultiDevice, "VK_EXT_buffer_device_address"),
1676 FEATURE_TABLE_ITEM(vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModel, "VK_KHR_vulkan_memory_model"),
1677 FEATURE_TABLE_ITEM(vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModelDeviceScope, "VK_KHR_vulkan_memory_model"),
1678 FEATURE_TABLE_ITEM(vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModelAvailabilityVisibilityChains, "VK_KHR_vulkan_memory_model"),
1680 struct FeatureDependencyTable
1682 VkBool32* featurePtr;
1683 VkBool32* dependOnPtr;
1685 featureDependencyTable[] =
1687 DEPENDENCY_DUAL_ITEM (vulkan11Features, multiviewFeatures, multiviewGeometryShader, multiview),
1688 DEPENDENCY_DUAL_ITEM (vulkan11Features, multiviewFeatures, multiviewTessellationShader, multiview),
1689 DEPENDENCY_DUAL_ITEM (vulkan11Features, variablePointersFeatures, variablePointers, variablePointersStorageBuffer),
1690 DEPENDENCY_DUAL_ITEM (vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddressCaptureReplay, bufferDeviceAddress),
1691 DEPENDENCY_DUAL_ITEM (vulkan12Features, bufferDeviceAddressFeatures, bufferDeviceAddressMultiDevice, bufferDeviceAddress),
1692 DEPENDENCY_DUAL_ITEM (vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModelDeviceScope, vulkanMemoryModel),
1693 DEPENDENCY_DUAL_ITEM (vulkan12Features, vulkanMemoryModelFeatures, vulkanMemoryModelAvailabilityVisibilityChains, vulkanMemoryModel),
1696 deMemset(&unusedExtensionFeatures, 0, sizeof(unusedExtensionFeatures));
1698 for (size_t featureTableNdx = 0; featureTableNdx < DE_LENGTH_OF_ARRAY(featureTable); ++featureTableNdx)
1700 FeatureTable& testedFeature = featureTable[featureTableNdx];
1701 VkBool32 coreFeatureState= DE_FALSE;
1702 VkBool32 extFeatureState = DE_FALSE;
1706 void* structPtr = testedFeature.coreStructPtr;
1707 size_t structSize = testedFeature.coreStructSize;
1708 VkBool32* featurePtr = testedFeature.coreFieldPtr;
1710 if (structPtr != &unusedExtensionFeatures)
1711 features2.pNext = structPtr;
1713 vki.getPhysicalDeviceFeatures2(physicalDevice, &features2);
1715 coreFeatureState = featurePtr[0];
1717 log << TestLog::Message
1718 << "Feature status "
1719 << testedFeature.coreFieldName << "=" << coreFeatureState
1720 << TestLog::EndMessage;
1722 if (coreFeatureState)
1724 cleanVulkanStruct(structPtr, structSize);
1726 featurePtr[0] = DE_TRUE;
1728 for (size_t featureDependencyTableNdx = 0; featureDependencyTableNdx < DE_LENGTH_OF_ARRAY(featureDependencyTable); ++featureDependencyTableNdx)
1729 if (featureDependencyTable[featureDependencyTableNdx].featurePtr == featurePtr)
1730 featureDependencyTable[featureDependencyTableNdx].dependOnPtr[0] = DE_TRUE;
1732 createTestDevice(context, &features2, DE_NULL, 0u);
1738 void* structPtr = testedFeature.extStructPtr;
1739 size_t structSize = testedFeature.extStructSize;
1740 VkBool32* featurePtr = testedFeature.extFieldPtr;
1741 const char* extStringPtr = testedFeature.extString;
1743 if (structPtr != &unusedExtensionFeatures)
1744 features2.pNext = structPtr;
1746 if (extStringPtr == DE_NULL || isExtensionSupported(deviceExtensionProperties, RequiredExtension(extStringPtr)))
1748 vki.getPhysicalDeviceFeatures2(physicalDevice, &features2);
1750 extFeatureState = *featurePtr;
1752 log << TestLog::Message
1753 << "Feature status "
1754 << testedFeature.extFieldName << "=" << extFeatureState
1755 << TestLog::EndMessage;
1757 if (extFeatureState)
1759 cleanVulkanStruct(structPtr, structSize);
1761 featurePtr[0] = DE_TRUE;
1763 for (size_t featureDependencyTableNdx = 0; featureDependencyTableNdx < DE_LENGTH_OF_ARRAY(featureDependencyTable); ++featureDependencyTableNdx)
1764 if (featureDependencyTable[featureDependencyTableNdx].featurePtr == featurePtr)
1765 featureDependencyTable[featureDependencyTableNdx].dependOnPtr[0] = DE_TRUE;
1767 createTestDevice(context, &features2, &extStringPtr, (extStringPtr == DE_NULL) ? 0u : 1u );
1773 return tcu::TestStatus::pass("pass");
1776 template<typename T>
1777 class CheckIncompleteResult
1780 virtual ~CheckIncompleteResult (void) {}
1781 virtual void getResult (Context& context, T* data) = 0;
1783 void operator() (Context& context, tcu::ResultCollector& results, const std::size_t expectedCompleteSize)
1785 if (expectedCompleteSize == 0)
1788 vector<T> outputData (expectedCompleteSize);
1789 const deUint32 usedSize = static_cast<deUint32>(expectedCompleteSize / 3);
1791 ValidateQueryBits::fillBits(outputData.begin(), outputData.end()); // unused entries should have this pattern intact
1793 m_result = VK_SUCCESS;
1795 getResult(context, &outputData[0]); // update m_count and m_result
1797 if (m_count != usedSize || m_result != VK_INCOMPLETE || !ValidateQueryBits::checkBits(outputData.begin() + m_count, outputData.end()))
1798 results.fail("Query didn't return VK_INCOMPLETE");
1806 struct CheckEnumeratePhysicalDevicesIncompleteResult : public CheckIncompleteResult<VkPhysicalDevice>
1808 void getResult (Context& context, VkPhysicalDevice* data)
1810 m_result = context.getInstanceInterface().enumeratePhysicalDevices(context.getInstance(), &m_count, data);
1814 struct CheckEnumeratePhysicalDeviceGroupsIncompleteResult : public CheckIncompleteResult<VkPhysicalDeviceGroupProperties>
1816 void getResult (Context& context, VkPhysicalDeviceGroupProperties* data)
1818 m_result = context.getInstanceInterface().enumeratePhysicalDeviceGroups(context.getInstance(), &m_count, data);
1822 struct CheckEnumerateInstanceLayerPropertiesIncompleteResult : public CheckIncompleteResult<VkLayerProperties>
1824 void getResult (Context& context, VkLayerProperties* data)
1826 m_result = context.getPlatformInterface().enumerateInstanceLayerProperties(&m_count, data);
1830 struct CheckEnumerateDeviceLayerPropertiesIncompleteResult : public CheckIncompleteResult<VkLayerProperties>
1832 void getResult (Context& context, VkLayerProperties* data)
1834 m_result = context.getInstanceInterface().enumerateDeviceLayerProperties(context.getPhysicalDevice(), &m_count, data);
1838 struct CheckEnumerateInstanceExtensionPropertiesIncompleteResult : public CheckIncompleteResult<VkExtensionProperties>
1840 CheckEnumerateInstanceExtensionPropertiesIncompleteResult (std::string layerName = std::string()) : m_layerName(layerName) {}
1842 void getResult (Context& context, VkExtensionProperties* data)
1844 const char* pLayerName = (m_layerName.length() != 0 ? m_layerName.c_str() : DE_NULL);
1845 m_result = context.getPlatformInterface().enumerateInstanceExtensionProperties(pLayerName, &m_count, data);
1849 const std::string m_layerName;
1852 struct CheckEnumerateDeviceExtensionPropertiesIncompleteResult : public CheckIncompleteResult<VkExtensionProperties>
1854 CheckEnumerateDeviceExtensionPropertiesIncompleteResult (std::string layerName = std::string()) : m_layerName(layerName) {}
1856 void getResult (Context& context, VkExtensionProperties* data)
1858 const char* pLayerName = (m_layerName.length() != 0 ? m_layerName.c_str() : DE_NULL);
1859 m_result = context.getInstanceInterface().enumerateDeviceExtensionProperties(context.getPhysicalDevice(), pLayerName, &m_count, data);
1863 const std::string m_layerName;
1866 tcu::TestStatus enumeratePhysicalDevices (Context& context)
1868 TestLog& log = context.getTestContext().getLog();
1869 tcu::ResultCollector results (log);
1870 const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(context.getInstanceInterface(), context.getInstance());
1872 log << TestLog::Integer("NumDevices", "Number of devices", "", QP_KEY_TAG_NONE, deInt64(devices.size()));
1874 for (size_t ndx = 0; ndx < devices.size(); ndx++)
1875 log << TestLog::Message << ndx << ": " << devices[ndx] << TestLog::EndMessage;
1877 CheckEnumeratePhysicalDevicesIncompleteResult()(context, results, devices.size());
1879 return tcu::TestStatus(results.getResult(), results.getMessage());
1882 tcu::TestStatus enumeratePhysicalDeviceGroups (Context& context)
1884 TestLog& log = context.getTestContext().getLog();
1885 tcu::ResultCollector results (log);
1886 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_device_group_creation"));
1887 const InstanceDriver& vki (instance.getDriver());
1888 const vector<VkPhysicalDeviceGroupProperties> devicegroups = enumeratePhysicalDeviceGroups(vki, instance);
1890 log << TestLog::Integer("NumDevices", "Number of device groups", "", QP_KEY_TAG_NONE, deInt64(devicegroups.size()));
1892 for (size_t ndx = 0; ndx < devicegroups.size(); ndx++)
1893 log << TestLog::Message << ndx << ": " << devicegroups[ndx] << TestLog::EndMessage;
1895 CheckEnumeratePhysicalDeviceGroupsIncompleteResult()(context, results, devicegroups.size());
1897 return tcu::TestStatus(results.getResult(), results.getMessage());
1900 template<typename T>
1901 void collectDuplicates (set<T>& duplicates, const vector<T>& values)
1905 for (size_t ndx = 0; ndx < values.size(); ndx++)
1907 const T& value = values[ndx];
1909 if (!seen.insert(value).second)
1910 duplicates.insert(value);
1914 void checkDuplicates (tcu::ResultCollector& results, const char* what, const vector<string>& values)
1916 set<string> duplicates;
1918 collectDuplicates(duplicates, values);
1920 for (set<string>::const_iterator iter = duplicates.begin(); iter != duplicates.end(); ++iter)
1922 std::ostringstream msg;
1923 msg << "Duplicate " << what << ": " << *iter;
1924 results.fail(msg.str());
1928 void checkDuplicateExtensions (tcu::ResultCollector& results, const vector<string>& extensions)
1930 checkDuplicates(results, "extension", extensions);
1933 void checkDuplicateLayers (tcu::ResultCollector& results, const vector<string>& layers)
1935 checkDuplicates(results, "layer", layers);
1938 void checkKhrExtensions (tcu::ResultCollector& results,
1939 const vector<string>& extensions,
1940 const int numAllowedKhrExtensions,
1941 const char* const* allowedKhrExtensions)
1943 const set<string> allowedExtSet (allowedKhrExtensions, allowedKhrExtensions+numAllowedKhrExtensions);
1945 for (vector<string>::const_iterator extIter = extensions.begin(); extIter != extensions.end(); ++extIter)
1947 // Only Khronos-controlled extensions are checked
1948 if (de::beginsWith(*extIter, "VK_KHR_") &&
1949 !de::contains(allowedExtSet, *extIter))
1951 results.fail("Unknown extension " + *extIter);
1956 void checkInstanceExtensions (tcu::ResultCollector& results, const vector<string>& extensions)
1958 #include "vkInstanceExtensions.inl"
1960 checkKhrExtensions(results, extensions, DE_LENGTH_OF_ARRAY(s_allowedInstanceKhrExtensions), s_allowedInstanceKhrExtensions);
1961 checkDuplicateExtensions(results, extensions);
1964 void checkDeviceExtensions (tcu::ResultCollector& results, const vector<string>& extensions)
1966 #include "vkDeviceExtensions.inl"
1968 checkKhrExtensions(results, extensions, DE_LENGTH_OF_ARRAY(s_allowedDeviceKhrExtensions), s_allowedDeviceKhrExtensions);
1969 checkDuplicateExtensions(results, extensions);
1972 void checkInstanceExtensionDependencies(tcu::ResultCollector& results,
1973 int dependencyLength,
1974 const std::tuple<deUint32, deUint32, const char*, const char*>* dependencies,
1975 deUint32 versionMajor,
1976 deUint32 versionMinor,
1977 const vector<VkExtensionProperties>& extensionProperties)
1979 for (int ndx = 0; ndx < dependencyLength; ndx++)
1981 deUint32 currentVersionMajor, currentVersionMinor;
1982 const char* extensionFirst;
1983 const char* extensionSecond;
1984 std::tie(currentVersionMajor, currentVersionMinor, extensionFirst, extensionSecond) = dependencies[ndx];
1985 if (currentVersionMajor != versionMajor || currentVersionMinor != versionMinor)
1987 if (isExtensionSupported(extensionProperties, RequiredExtension(extensionFirst)) &&
1988 !isExtensionSupported(extensionProperties, RequiredExtension(extensionSecond)))
1990 results.fail("Extension " + string(extensionFirst) + " is missing dependency: " + string(extensionSecond));
1995 void checkDeviceExtensionDependencies(tcu::ResultCollector& results,
1996 int dependencyLength,
1997 const std::tuple<deUint32, deUint32, const char*, const char*>* dependencies,
1998 deUint32 versionMajor,
1999 deUint32 versionMinor,
2000 const vector<VkExtensionProperties>& instanceExtensionProperties,
2001 const vector<VkExtensionProperties>& deviceExtensionProperties)
2003 for (int ndx = 0; ndx < dependencyLength; ndx++)
2005 deUint32 currentVersionMajor, currentVersionMinor;
2006 const char* extensionFirst;
2007 const char* extensionSecond;
2008 std::tie(currentVersionMajor, currentVersionMinor, extensionFirst, extensionSecond) = dependencies[ndx];
2009 if (currentVersionMajor != versionMajor || currentVersionMinor != versionMinor)
2011 if (isExtensionSupported(deviceExtensionProperties, RequiredExtension(extensionFirst)) &&
2012 !isExtensionSupported(deviceExtensionProperties, RequiredExtension(extensionSecond)) &&
2013 !isExtensionSupported(instanceExtensionProperties, RequiredExtension(extensionSecond)))
2015 results.fail("Extension " + string(extensionFirst) + " is missing dependency: " + string(extensionSecond));
2020 tcu::TestStatus enumerateInstanceLayers (Context& context)
2022 TestLog& log = context.getTestContext().getLog();
2023 tcu::ResultCollector results (log);
2024 const vector<VkLayerProperties> properties = enumerateInstanceLayerProperties(context.getPlatformInterface());
2025 vector<string> layerNames;
2027 for (size_t ndx = 0; ndx < properties.size(); ndx++)
2029 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
2031 layerNames.push_back(properties[ndx].layerName);
2034 checkDuplicateLayers(results, layerNames);
2035 CheckEnumerateInstanceLayerPropertiesIncompleteResult()(context, results, layerNames.size());
2037 return tcu::TestStatus(results.getResult(), results.getMessage());
2040 tcu::TestStatus enumerateInstanceExtensions (Context& context)
2042 TestLog& log = context.getTestContext().getLog();
2043 tcu::ResultCollector results (log);
2046 const ScopedLogSection section (log, "Global", "Global Extensions");
2047 const vector<VkExtensionProperties> properties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
2048 vector<string> extensionNames;
2050 for (size_t ndx = 0; ndx < properties.size(); ndx++)
2052 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
2054 extensionNames.push_back(properties[ndx].extensionName);
2057 checkInstanceExtensions(results, extensionNames);
2058 CheckEnumerateInstanceExtensionPropertiesIncompleteResult()(context, results, properties.size());
2060 for (const auto& version : releasedApiVersions)
2062 deUint32 versionMajor, versionMinor;
2063 std::tie(std::ignore, versionMajor, versionMinor) = version;
2064 if (context.contextSupports(vk::ApiVersion(versionMajor, versionMinor, 0)))
2066 checkInstanceExtensionDependencies(results,
2067 DE_LENGTH_OF_ARRAY(instanceExtensionDependencies),
2068 instanceExtensionDependencies,
2078 const vector<VkLayerProperties> layers = enumerateInstanceLayerProperties(context.getPlatformInterface());
2080 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
2082 const ScopedLogSection section (log, layer->layerName, string("Layer: ") + layer->layerName);
2083 const vector<VkExtensionProperties> properties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), layer->layerName);
2084 vector<string> extensionNames;
2086 for (size_t extNdx = 0; extNdx < properties.size(); extNdx++)
2088 log << TestLog::Message << extNdx << ": " << properties[extNdx] << TestLog::EndMessage;
2090 extensionNames.push_back(properties[extNdx].extensionName);
2093 checkInstanceExtensions(results, extensionNames);
2094 CheckEnumerateInstanceExtensionPropertiesIncompleteResult(layer->layerName)(context, results, properties.size());
2098 return tcu::TestStatus(results.getResult(), results.getMessage());
2101 tcu::TestStatus testNoKhxExtensions (Context& context)
2103 VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
2104 const PlatformInterface& vkp = context.getPlatformInterface();
2105 const InstanceInterface& vki = context.getInstanceInterface();
2107 tcu::ResultCollector results(context.getTestContext().getLog());
2108 bool testSucceeded = true;
2109 deUint32 instanceExtensionsCount;
2110 deUint32 deviceExtensionsCount;
2112 // grab number of instance and device extensions
2113 vkp.enumerateInstanceExtensionProperties(DE_NULL, &instanceExtensionsCount, DE_NULL);
2114 vki.enumerateDeviceExtensionProperties(physicalDevice, DE_NULL, &deviceExtensionsCount, DE_NULL);
2115 vector<VkExtensionProperties> extensionsProperties(instanceExtensionsCount + deviceExtensionsCount);
2117 // grab instance and device extensions into single vector
2118 if (instanceExtensionsCount)
2119 vkp.enumerateInstanceExtensionProperties(DE_NULL, &instanceExtensionsCount, &extensionsProperties[0]);
2120 if (deviceExtensionsCount)
2121 vki.enumerateDeviceExtensionProperties(physicalDevice, DE_NULL, &deviceExtensionsCount, &extensionsProperties[instanceExtensionsCount]);
2123 // iterate over all extensions and verify their names
2124 vector<VkExtensionProperties>::const_iterator extension = extensionsProperties.begin();
2125 while (extension != extensionsProperties.end())
2127 // KHX author ID is no longer used, all KHX extensions have been promoted to KHR status
2128 std::string extensionName(extension->extensionName);
2129 bool caseFailed = de::beginsWith(extensionName, "VK_KHX_");
2132 results.fail("Invalid extension name " + extensionName);
2133 testSucceeded = false;
2139 return tcu::TestStatus::pass("No extensions begining with \"VK_KHX\"");
2140 return tcu::TestStatus::fail("One or more extensions begins with \"VK_KHX\"");
2143 tcu::TestStatus enumerateDeviceLayers (Context& context)
2145 TestLog& log = context.getTestContext().getLog();
2146 tcu::ResultCollector results (log);
2147 const vector<VkLayerProperties> properties = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
2148 vector<string> layerNames;
2150 for (size_t ndx = 0; ndx < properties.size(); ndx++)
2152 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
2154 layerNames.push_back(properties[ndx].layerName);
2157 checkDuplicateLayers(results, layerNames);
2158 CheckEnumerateDeviceLayerPropertiesIncompleteResult()(context, results, layerNames.size());
2160 return tcu::TestStatus(results.getResult(), results.getMessage());
2163 tcu::TestStatus enumerateDeviceExtensions (Context& context)
2165 TestLog& log = context.getTestContext().getLog();
2166 tcu::ResultCollector results (log);
2169 const ScopedLogSection section (log, "Global", "Global Extensions");
2170 const vector<VkExtensionProperties> instanceExtensionProperties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
2171 const vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
2172 vector<string> deviceExtensionNames;
2174 for (size_t ndx = 0; ndx < deviceExtensionProperties.size(); ndx++)
2176 log << TestLog::Message << ndx << ": " << deviceExtensionProperties[ndx] << TestLog::EndMessage;
2178 deviceExtensionNames.push_back(deviceExtensionProperties[ndx].extensionName);
2181 checkDeviceExtensions(results, deviceExtensionNames);
2182 CheckEnumerateDeviceExtensionPropertiesIncompleteResult()(context, results, deviceExtensionProperties.size());
2184 for (const auto& version : releasedApiVersions)
2186 deUint32 versionMajor, versionMinor;
2187 std::tie(std::ignore, versionMajor, versionMinor) = version;
2188 if (context.contextSupports(vk::ApiVersion(versionMajor, versionMinor, 0)))
2190 checkDeviceExtensionDependencies(results,
2191 DE_LENGTH_OF_ARRAY(deviceExtensionDependencies),
2192 deviceExtensionDependencies,
2195 instanceExtensionProperties,
2196 deviceExtensionProperties);
2203 const vector<VkLayerProperties> layers = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
2205 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
2207 const ScopedLogSection section (log, layer->layerName, string("Layer: ") + layer->layerName);
2208 const vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), layer->layerName);
2209 vector<string> extensionNames;
2211 for (size_t extNdx = 0; extNdx < properties.size(); extNdx++)
2213 log << TestLog::Message << extNdx << ": " << properties[extNdx] << TestLog::EndMessage;
2216 extensionNames.push_back(properties[extNdx].extensionName);
2219 checkDeviceExtensions(results, extensionNames);
2220 CheckEnumerateDeviceExtensionPropertiesIncompleteResult(layer->layerName)(context, results, properties.size());
2224 return tcu::TestStatus(results.getResult(), results.getMessage());
2227 tcu::TestStatus extensionCoreVersions (Context& context)
2231 const char* extName;
2233 auto& log = context.getTestContext().getLog();
2234 tcu::ResultCollector results (log);
2236 const auto instanceExtensionProperties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
2237 const auto deviceExtensionProperties = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
2239 for (const auto& majorMinorName : extensionRequiredCoreVersion)
2241 std::tie(major, minor, extName) = majorMinorName;
2242 const RequiredExtension reqExt (extName);
2244 if ((isExtensionSupported(instanceExtensionProperties, reqExt) || isExtensionSupported(deviceExtensionProperties, reqExt)) &&
2245 !context.contextSupports(vk::ApiVersion(major, minor, 0u)))
2247 results.fail("Required core version for " + std::string(extName) + " not met (" + de::toString(major) + "." + de::toString(minor) + ")");
2251 return tcu::TestStatus(results.getResult(), results.getMessage());
2254 #define VK_SIZE_OF(STRUCT, MEMBER) (sizeof(((STRUCT*)0)->MEMBER))
2255 #define OFFSET_TABLE_ENTRY(STRUCT, MEMBER) { (size_t)DE_OFFSET_OF(STRUCT, MEMBER), VK_SIZE_OF(STRUCT, MEMBER) }
2257 tcu::TestStatus deviceFeatures (Context& context)
2259 using namespace ValidateQueryBits;
2261 TestLog& log = context.getTestContext().getLog();
2262 VkPhysicalDeviceFeatures* features;
2263 deUint8 buffer[sizeof(VkPhysicalDeviceFeatures) + GUARD_SIZE];
2265 const QueryMemberTableEntry featureOffsetTable[] =
2267 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, robustBufferAccess),
2268 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, fullDrawIndexUint32),
2269 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, imageCubeArray),
2270 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, independentBlend),
2271 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, geometryShader),
2272 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, tessellationShader),
2273 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sampleRateShading),
2274 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, dualSrcBlend),
2275 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, logicOp),
2276 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, multiDrawIndirect),
2277 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, drawIndirectFirstInstance),
2278 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, depthClamp),
2279 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, depthBiasClamp),
2280 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, fillModeNonSolid),
2281 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, depthBounds),
2282 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, wideLines),
2283 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, largePoints),
2284 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, alphaToOne),
2285 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, multiViewport),
2286 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, samplerAnisotropy),
2287 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, textureCompressionETC2),
2288 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, textureCompressionASTC_LDR),
2289 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, textureCompressionBC),
2290 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, occlusionQueryPrecise),
2291 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, pipelineStatisticsQuery),
2292 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, vertexPipelineStoresAndAtomics),
2293 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, fragmentStoresAndAtomics),
2294 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderTessellationAndGeometryPointSize),
2295 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderImageGatherExtended),
2296 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageExtendedFormats),
2297 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageMultisample),
2298 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageReadWithoutFormat),
2299 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageWriteWithoutFormat),
2300 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderUniformBufferArrayDynamicIndexing),
2301 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderSampledImageArrayDynamicIndexing),
2302 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageBufferArrayDynamicIndexing),
2303 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderStorageImageArrayDynamicIndexing),
2304 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderClipDistance),
2305 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderCullDistance),
2306 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderFloat64),
2307 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderInt64),
2308 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderInt16),
2309 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderResourceResidency),
2310 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, shaderResourceMinLod),
2311 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseBinding),
2312 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidencyBuffer),
2313 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidencyImage2D),
2314 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidencyImage3D),
2315 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidency2Samples),
2316 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidency4Samples),
2317 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidency8Samples),
2318 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidency16Samples),
2319 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, sparseResidencyAliased),
2320 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, variableMultisampleRate),
2321 OFFSET_TABLE_ENTRY(VkPhysicalDeviceFeatures, inheritedQueries),
2325 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
2326 features = reinterpret_cast<VkPhysicalDeviceFeatures*>(buffer);
2328 context.getInstanceInterface().getPhysicalDeviceFeatures(context.getPhysicalDevice(), features);
2330 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
2331 << TestLog::Message << *features << TestLog::EndMessage;
2333 // Requirements and dependencies
2335 if (!features->robustBufferAccess)
2336 return tcu::TestStatus::fail("robustBufferAccess is not supported");
2338 // multiViewport requires MultiViewport (SPIR-V capability) support, which depends on Geometry
2339 if (features->multiViewport && !features->geometryShader)
2340 return tcu::TestStatus::fail("multiViewport is supported but geometryShader is not");
2343 for (int ndx = 0; ndx < GUARD_SIZE; ndx++)
2345 if (buffer[ndx + sizeof(VkPhysicalDeviceFeatures)] != GUARD_VALUE)
2347 log << TestLog::Message << "deviceFeatures - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
2348 return tcu::TestStatus::fail("deviceFeatures buffer overflow");
2352 if (!validateInitComplete(context.getPhysicalDevice(), &InstanceInterface::getPhysicalDeviceFeatures, context.getInstanceInterface(), featureOffsetTable))
2354 log << TestLog::Message << "deviceFeatures - VkPhysicalDeviceFeatures not completely initialized" << TestLog::EndMessage;
2355 return tcu::TestStatus::fail("deviceFeatures incomplete initialization");
2358 return tcu::TestStatus::pass("Query succeeded");
2361 static const ValidateQueryBits::QueryMemberTableEntry s_physicalDevicePropertiesOffsetTable[] =
2363 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, apiVersion),
2364 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, driverVersion),
2365 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, vendorID),
2366 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, deviceID),
2367 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, deviceType),
2368 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, pipelineCacheUUID),
2369 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension1D),
2370 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension2D),
2371 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension3D),
2372 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimensionCube),
2373 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageArrayLayers),
2374 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelBufferElements),
2375 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxUniformBufferRange),
2376 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxStorageBufferRange),
2377 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPushConstantsSize),
2378 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxMemoryAllocationCount),
2379 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerAllocationCount),
2380 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.bufferImageGranularity),
2381 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sparseAddressSpaceSize),
2382 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxBoundDescriptorSets),
2383 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorSamplers),
2384 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorUniformBuffers),
2385 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorStorageBuffers),
2386 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorSampledImages),
2387 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorStorageImages),
2388 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorInputAttachments),
2389 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageResources),
2390 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetSamplers),
2391 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetUniformBuffers),
2392 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetUniformBuffersDynamic),
2393 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageBuffers),
2394 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageBuffersDynamic),
2395 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetSampledImages),
2396 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageImages),
2397 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetInputAttachments),
2398 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputAttributes),
2399 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputBindings),
2400 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputAttributeOffset),
2401 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputBindingStride),
2402 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexOutputComponents),
2403 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationGenerationLevel),
2404 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationPatchSize),
2405 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerVertexInputComponents),
2406 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerVertexOutputComponents),
2407 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerPatchOutputComponents),
2408 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlTotalOutputComponents),
2409 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationEvaluationInputComponents),
2410 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationEvaluationOutputComponents),
2411 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryShaderInvocations),
2412 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryInputComponents),
2413 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryOutputComponents),
2414 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryOutputVertices),
2415 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryTotalOutputComponents),
2416 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentInputComponents),
2417 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentOutputAttachments),
2418 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentDualSrcAttachments),
2419 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentCombinedOutputResources),
2420 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeSharedMemorySize),
2421 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupCount[3]),
2422 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupInvocations),
2423 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupSize[3]),
2424 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subPixelPrecisionBits),
2425 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subTexelPrecisionBits),
2426 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.mipmapPrecisionBits),
2427 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDrawIndexedIndexValue),
2428 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDrawIndirectCount),
2429 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerLodBias),
2430 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerAnisotropy),
2431 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxViewports),
2432 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxViewportDimensions[2]),
2433 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.viewportBoundsRange[2]),
2434 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.viewportSubPixelBits),
2435 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minMemoryMapAlignment),
2436 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelBufferOffsetAlignment),
2437 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minUniformBufferOffsetAlignment),
2438 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minStorageBufferOffsetAlignment),
2439 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelOffset),
2440 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelOffset),
2441 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelGatherOffset),
2442 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelGatherOffset),
2443 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minInterpolationOffset),
2444 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxInterpolationOffset),
2445 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subPixelInterpolationOffsetBits),
2446 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferWidth),
2447 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferHeight),
2448 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferLayers),
2449 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferColorSampleCounts),
2450 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferDepthSampleCounts),
2451 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferStencilSampleCounts),
2452 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferNoAttachmentsSampleCounts),
2453 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxColorAttachments),
2454 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageColorSampleCounts),
2455 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageIntegerSampleCounts),
2456 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageDepthSampleCounts),
2457 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageStencilSampleCounts),
2458 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.storageImageSampleCounts),
2459 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSampleMaskWords),
2460 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.timestampComputeAndGraphics),
2461 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.timestampPeriod),
2462 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxClipDistances),
2463 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxCullDistances),
2464 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxCombinedClipAndCullDistances),
2465 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.discreteQueuePriorities),
2466 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.pointSizeRange[2]),
2467 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.lineWidthRange[2]),
2468 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.pointSizeGranularity),
2469 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.lineWidthGranularity),
2470 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.strictLines),
2471 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.standardSampleLocations),
2472 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.optimalBufferCopyOffsetAlignment),
2473 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.optimalBufferCopyRowPitchAlignment),
2474 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.nonCoherentAtomSize),
2475 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard2DBlockShape),
2476 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard2DMultisampleBlockShape),
2477 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard3DBlockShape),
2478 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyAlignedMipSize),
2479 OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyNonResidentStrict),
2483 tcu::TestStatus deviceProperties (Context& context)
2485 using namespace ValidateQueryBits;
2487 TestLog& log = context.getTestContext().getLog();
2488 VkPhysicalDeviceProperties* props;
2489 VkPhysicalDeviceFeatures features;
2490 deUint8 buffer[sizeof(VkPhysicalDeviceProperties) + GUARD_SIZE];
2492 props = reinterpret_cast<VkPhysicalDeviceProperties*>(buffer);
2493 deMemset(props, GUARD_VALUE, sizeof(buffer));
2495 context.getInstanceInterface().getPhysicalDeviceProperties(context.getPhysicalDevice(), props);
2496 context.getInstanceInterface().getPhysicalDeviceFeatures(context.getPhysicalDevice(), &features);
2498 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
2499 << TestLog::Message << *props << TestLog::EndMessage;
2501 if (!validateFeatureLimits(props, &features, log))
2502 return tcu::TestStatus::fail("deviceProperties - feature limits failed");
2504 for (int ndx = 0; ndx < GUARD_SIZE; ndx++)
2506 if (buffer[ndx + sizeof(VkPhysicalDeviceProperties)] != GUARD_VALUE)
2508 log << TestLog::Message << "deviceProperties - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
2509 return tcu::TestStatus::fail("deviceProperties buffer overflow");
2513 if (!validateInitComplete(context.getPhysicalDevice(), &InstanceInterface::getPhysicalDeviceProperties, context.getInstanceInterface(), s_physicalDevicePropertiesOffsetTable))
2515 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceProperties not completely initialized" << TestLog::EndMessage;
2516 return tcu::TestStatus::fail("deviceProperties incomplete initialization");
2519 // Check if deviceName string is properly terminated.
2520 if (deStrnlen(props->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE) == VK_MAX_PHYSICAL_DEVICE_NAME_SIZE)
2522 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceProperties deviceName not properly initialized" << TestLog::EndMessage;
2523 return tcu::TestStatus::fail("deviceProperties incomplete initialization");
2527 const ApiVersion deviceVersion = unpackVersion(props->apiVersion);
2528 const ApiVersion deqpVersion = unpackVersion(VK_API_VERSION_1_2);
2530 if (deviceVersion.majorNum != deqpVersion.majorNum)
2532 log << TestLog::Message << "deviceProperties - API Major Version " << deviceVersion.majorNum << " is not valid" << TestLog::EndMessage;
2533 return tcu::TestStatus::fail("deviceProperties apiVersion not valid");
2536 if (deviceVersion.minorNum > deqpVersion.minorNum)
2538 log << TestLog::Message << "deviceProperties - API Minor Version " << deviceVersion.minorNum << " is not valid for this version of dEQP" << TestLog::EndMessage;
2539 return tcu::TestStatus::fail("deviceProperties apiVersion not valid");
2543 return tcu::TestStatus::pass("DeviceProperites query succeeded");
2546 tcu::TestStatus deviceQueueFamilyProperties (Context& context)
2548 TestLog& log = context.getTestContext().getLog();
2549 const vector<VkQueueFamilyProperties> queueProperties = getPhysicalDeviceQueueFamilyProperties(context.getInstanceInterface(), context.getPhysicalDevice());
2551 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage;
2553 for (size_t queueNdx = 0; queueNdx < queueProperties.size(); queueNdx++)
2554 log << TestLog::Message << queueNdx << ": " << queueProperties[queueNdx] << TestLog::EndMessage;
2556 return tcu::TestStatus::pass("Querying queue properties succeeded");
2559 tcu::TestStatus deviceMemoryProperties (Context& context)
2561 TestLog& log = context.getTestContext().getLog();
2562 VkPhysicalDeviceMemoryProperties* memProps;
2563 deUint8 buffer[sizeof(VkPhysicalDeviceMemoryProperties) + GUARD_SIZE];
2565 memProps = reinterpret_cast<VkPhysicalDeviceMemoryProperties*>(buffer);
2566 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
2568 context.getInstanceInterface().getPhysicalDeviceMemoryProperties(context.getPhysicalDevice(), memProps);
2570 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
2571 << TestLog::Message << *memProps << TestLog::EndMessage;
2573 for (deInt32 ndx = 0; ndx < GUARD_SIZE; ndx++)
2575 if (buffer[ndx + sizeof(VkPhysicalDeviceMemoryProperties)] != GUARD_VALUE)
2577 log << TestLog::Message << "deviceMemoryProperties - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
2578 return tcu::TestStatus::fail("deviceMemoryProperties buffer overflow");
2582 if (memProps->memoryHeapCount >= VK_MAX_MEMORY_HEAPS)
2584 log << TestLog::Message << "deviceMemoryProperties - HeapCount larger than " << (deUint32)VK_MAX_MEMORY_HEAPS << TestLog::EndMessage;
2585 return tcu::TestStatus::fail("deviceMemoryProperties HeapCount too large");
2588 if (memProps->memoryHeapCount == 1)
2590 if ((memProps->memoryHeaps[0].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) == 0)
2592 log << TestLog::Message << "deviceMemoryProperties - Single heap is not marked DEVICE_LOCAL" << TestLog::EndMessage;
2593 return tcu::TestStatus::fail("deviceMemoryProperties invalid HeapFlags");
2597 const VkMemoryPropertyFlags validPropertyFlags[] =
2600 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
2601 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
2602 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
2603 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
2604 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
2605 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
2606 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_CACHED_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
2607 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT|VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
2610 const VkMemoryPropertyFlags requiredPropertyFlags[] =
2612 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT|VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
2615 bool requiredFlagsFound[DE_LENGTH_OF_ARRAY(requiredPropertyFlags)];
2616 std::fill(DE_ARRAY_BEGIN(requiredFlagsFound), DE_ARRAY_END(requiredFlagsFound), false);
2618 for (deUint32 memoryNdx = 0; memoryNdx < memProps->memoryTypeCount; memoryNdx++)
2620 bool validPropTypeFound = false;
2622 if (memProps->memoryTypes[memoryNdx].heapIndex >= memProps->memoryHeapCount)
2624 log << TestLog::Message << "deviceMemoryProperties - heapIndex " << memProps->memoryTypes[memoryNdx].heapIndex << " larger than heapCount" << TestLog::EndMessage;
2625 return tcu::TestStatus::fail("deviceMemoryProperties - invalid heapIndex");
2628 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;
2630 for (const VkMemoryPropertyFlags* requiredFlagsIterator = DE_ARRAY_BEGIN(requiredPropertyFlags); requiredFlagsIterator != DE_ARRAY_END(requiredPropertyFlags); requiredFlagsIterator++)
2631 if ((memProps->memoryTypes[memoryNdx].propertyFlags & *requiredFlagsIterator) == *requiredFlagsIterator)
2632 requiredFlagsFound[requiredFlagsIterator - DE_ARRAY_BEGIN(requiredPropertyFlags)] = true;
2634 if (de::contains(DE_ARRAY_BEGIN(validPropertyFlags), DE_ARRAY_END(validPropertyFlags), memProps->memoryTypes[memoryNdx].propertyFlags & bitsToCheck))
2635 validPropTypeFound = true;
2637 if (!validPropTypeFound)
2639 log << TestLog::Message << "deviceMemoryProperties - propertyFlags "
2640 << memProps->memoryTypes[memoryNdx].propertyFlags << " not valid" << TestLog::EndMessage;
2641 return tcu::TestStatus::fail("deviceMemoryProperties propertyFlags not valid");
2644 if (memProps->memoryTypes[memoryNdx].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
2646 if ((memProps->memoryHeaps[memProps->memoryTypes[memoryNdx].heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) == 0)
2648 log << TestLog::Message << "deviceMemoryProperties - DEVICE_LOCAL memory type references heap which is not DEVICE_LOCAL" << TestLog::EndMessage;
2649 return tcu::TestStatus::fail("deviceMemoryProperties inconsistent memoryType and HeapFlags");
2654 if (memProps->memoryHeaps[memProps->memoryTypes[memoryNdx].heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT)
2656 log << TestLog::Message << "deviceMemoryProperties - non-DEVICE_LOCAL memory type references heap with is DEVICE_LOCAL" << TestLog::EndMessage;
2657 return tcu::TestStatus::fail("deviceMemoryProperties inconsistent memoryType and HeapFlags");
2662 bool* requiredFlagsFoundIterator = std::find(DE_ARRAY_BEGIN(requiredFlagsFound), DE_ARRAY_END(requiredFlagsFound), false);
2663 if (requiredFlagsFoundIterator != DE_ARRAY_END(requiredFlagsFound))
2665 DE_ASSERT(requiredFlagsFoundIterator - DE_ARRAY_BEGIN(requiredFlagsFound) <= DE_LENGTH_OF_ARRAY(requiredPropertyFlags));
2666 log << TestLog::Message << "deviceMemoryProperties - required property flags "
2667 << getMemoryPropertyFlagsStr(requiredPropertyFlags[requiredFlagsFoundIterator - DE_ARRAY_BEGIN(requiredFlagsFound)]) << " not found" << TestLog::EndMessage;
2669 return tcu::TestStatus::fail("deviceMemoryProperties propertyFlags not valid");
2672 return tcu::TestStatus::pass("Querying memory properties succeeded");
2675 tcu::TestStatus deviceGroupPeerMemoryFeatures (Context& context)
2677 TestLog& log = context.getTestContext().getLog();
2678 const PlatformInterface& vkp = context.getPlatformInterface();
2679 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_device_group_creation"));
2680 const InstanceDriver& vki (instance.getDriver());
2681 const tcu::CommandLine& cmdLine = context.getTestContext().getCommandLine();
2682 const deUint32 devGroupIdx = cmdLine.getVKDeviceGroupId() - 1;
2683 const deUint32 deviceIdx = vk::chooseDeviceIndex(context.getInstanceInterface(), instance, cmdLine);
2684 const float queuePriority = 1.0f;
2685 VkPhysicalDeviceMemoryProperties memProps;
2686 VkPeerMemoryFeatureFlags* peerMemFeatures;
2687 deUint8 buffer [sizeof(VkPeerMemoryFeatureFlags) + GUARD_SIZE];
2688 deUint32 numPhysicalDevices = 0;
2689 deUint32 queueFamilyIndex = 0;
2691 const vector<VkPhysicalDeviceGroupProperties> deviceGroupProps = enumeratePhysicalDeviceGroups(vki, instance);
2692 std::vector<const char*> deviceExtensions;
2693 deviceExtensions.push_back("VK_KHR_device_group");
2695 if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_device_group"))
2696 deviceExtensions.push_back("VK_KHR_device_group");
2698 const std::vector<VkQueueFamilyProperties> queueProps = getPhysicalDeviceQueueFamilyProperties(vki, deviceGroupProps[devGroupIdx].physicalDevices[deviceIdx]);
2699 for (size_t queueNdx = 0; queueNdx < queueProps.size(); queueNdx++)
2701 if (queueProps[queueNdx].queueFlags & VK_QUEUE_GRAPHICS_BIT)
2702 queueFamilyIndex = (deUint32)queueNdx;
2704 const VkDeviceQueueCreateInfo deviceQueueCreateInfo =
2706 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, //type
2708 (VkDeviceQueueCreateFlags)0u, //flags
2709 queueFamilyIndex, //queueFamilyIndex;
2711 &queuePriority, //pQueuePriorities;
2714 // Need atleast 2 devices for peer memory features
2715 numPhysicalDevices = deviceGroupProps[devGroupIdx].physicalDeviceCount;
2716 if (numPhysicalDevices < 2)
2717 TCU_THROW(NotSupportedError, "Need a device Group with at least 2 physical devices.");
2719 // Create device groups
2720 const VkDeviceGroupDeviceCreateInfo deviceGroupInfo =
2722 VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, //stype
2724 deviceGroupProps[devGroupIdx].physicalDeviceCount, //physicalDeviceCount
2725 deviceGroupProps[devGroupIdx].physicalDevices //physicalDevices
2728 const VkDeviceCreateInfo deviceCreateInfo =
2730 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, //sType;
2731 &deviceGroupInfo, //pNext;
2732 (VkDeviceCreateFlags)0u, //flags
2733 1, //queueRecordCount;
2734 &deviceQueueCreateInfo, //pRequestedQueues;
2736 DE_NULL, //ppEnabledLayerNames;
2737 deUint32(deviceExtensions.size()), //extensionCount;
2738 (deviceExtensions.empty() ? DE_NULL : &deviceExtensions[0]), //ppEnabledExtensionNames;
2739 DE_NULL, //pEnabledFeatures;
2742 Move<VkDevice> deviceGroup = createCustomDevice(context.getTestContext().getCommandLine().isValidationEnabled(), vkp, instance, vki, deviceGroupProps[devGroupIdx].physicalDevices[deviceIdx], &deviceCreateInfo);
2743 const DeviceDriver vk (vkp, instance, *deviceGroup);
2744 context.getInstanceInterface().getPhysicalDeviceMemoryProperties(deviceGroupProps[devGroupIdx].physicalDevices[deviceIdx], &memProps);
2746 peerMemFeatures = reinterpret_cast<VkPeerMemoryFeatureFlags*>(buffer);
2747 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
2749 for (deUint32 heapIndex = 0; heapIndex < memProps.memoryHeapCount; heapIndex++)
2751 for (deUint32 localDeviceIndex = 0; localDeviceIndex < numPhysicalDevices; localDeviceIndex++)
2753 for (deUint32 remoteDeviceIndex = 0; remoteDeviceIndex < numPhysicalDevices; remoteDeviceIndex++)
2755 if (localDeviceIndex != remoteDeviceIndex)
2757 vk.getDeviceGroupPeerMemoryFeatures(deviceGroup.get(), heapIndex, localDeviceIndex, remoteDeviceIndex, peerMemFeatures);
2760 for (deInt32 ndx = 0; ndx < GUARD_SIZE; ndx++)
2762 if (buffer[ndx + sizeof(VkPeerMemoryFeatureFlags)] != GUARD_VALUE)
2764 log << TestLog::Message << "deviceGroupPeerMemoryFeatures - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
2765 return tcu::TestStatus::fail("deviceGroupPeerMemoryFeatures buffer overflow");
2769 VkPeerMemoryFeatureFlags requiredFlag = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT;
2770 VkPeerMemoryFeatureFlags maxValidFlag = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT|VK_PEER_MEMORY_FEATURE_COPY_DST_BIT|
2771 VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT|VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT;
2772 if ((!(*peerMemFeatures & requiredFlag)) ||
2773 *peerMemFeatures > maxValidFlag)
2774 return tcu::TestStatus::fail("deviceGroupPeerMemoryFeatures invalid flag");
2776 log << TestLog::Message << "deviceGroup = " << deviceGroup.get() << TestLog::EndMessage
2777 << TestLog::Message << "heapIndex = " << heapIndex << TestLog::EndMessage
2778 << TestLog::Message << "localDeviceIndex = " << localDeviceIndex << TestLog::EndMessage
2779 << TestLog::Message << "remoteDeviceIndex = " << remoteDeviceIndex << TestLog::EndMessage
2780 << TestLog::Message << "PeerMemoryFeatureFlags = " << *peerMemFeatures << TestLog::EndMessage;
2786 return tcu::TestStatus::pass("Querying deviceGroup peer memory features succeeded");
2789 tcu::TestStatus deviceMemoryBudgetProperties (Context& context)
2791 TestLog& log = context.getTestContext().getLog();
2792 deUint8 buffer[sizeof(VkPhysicalDeviceMemoryBudgetPropertiesEXT) + GUARD_SIZE];
2794 if (!context.isDeviceFunctionalitySupported("VK_EXT_memory_budget"))
2795 TCU_THROW(NotSupportedError, "VK_EXT_memory_budget is not supported");
2797 VkPhysicalDeviceMemoryBudgetPropertiesEXT *budgetProps = reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT *>(buffer);
2798 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
2800 budgetProps->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
2801 budgetProps->pNext = DE_NULL;
2803 VkPhysicalDeviceMemoryProperties2 memProps;
2804 deMemset(&memProps, 0, sizeof(memProps));
2805 memProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
2806 memProps.pNext = budgetProps;
2808 context.getInstanceInterface().getPhysicalDeviceMemoryProperties2(context.getPhysicalDevice(), &memProps);
2810 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
2811 << TestLog::Message << *budgetProps << TestLog::EndMessage;
2813 for (deInt32 ndx = 0; ndx < GUARD_SIZE; ndx++)
2815 if (buffer[ndx + sizeof(VkPhysicalDeviceMemoryBudgetPropertiesEXT)] != GUARD_VALUE)
2817 log << TestLog::Message << "deviceMemoryBudgetProperties - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
2818 return tcu::TestStatus::fail("deviceMemoryBudgetProperties buffer overflow");
2822 for (deUint32 i = 0; i < memProps.memoryProperties.memoryHeapCount; ++i)
2824 if (budgetProps->heapBudget[i] == 0)
2826 log << TestLog::Message << "deviceMemoryBudgetProperties - Supported heaps must report nonzero budget" << TestLog::EndMessage;
2827 return tcu::TestStatus::fail("deviceMemoryBudgetProperties invalid heap budget (zero)");
2829 if (budgetProps->heapBudget[i] > memProps.memoryProperties.memoryHeaps[i].size)
2831 log << TestLog::Message << "deviceMemoryBudgetProperties - Heap budget must be less than or equal to heap size" << TestLog::EndMessage;
2832 return tcu::TestStatus::fail("deviceMemoryBudgetProperties invalid heap budget (too large)");
2836 for (deUint32 i = memProps.memoryProperties.memoryHeapCount; i < VK_MAX_MEMORY_HEAPS; ++i)
2838 if (budgetProps->heapBudget[i] != 0 || budgetProps->heapUsage[i] != 0)
2840 log << TestLog::Message << "deviceMemoryBudgetProperties - Unused heaps must report budget/usage of zero" << TestLog::EndMessage;
2841 return tcu::TestStatus::fail("deviceMemoryBudgetProperties invalid unused heaps");
2845 return tcu::TestStatus::pass("Querying memory budget properties succeeded");
2851 #include "vkMandatoryFeatures.inl"
2855 tcu::TestStatus deviceMandatoryFeatures(Context& context)
2857 if ( checkMandatoryFeatures(context) )
2858 return tcu::TestStatus::pass("Passed");
2859 return tcu::TestStatus::fail("Not all mandatory features are supported ( see: vkspec.html#features-requirements )");
2862 VkFormatFeatureFlags getBaseRequiredOptimalTilingFeatures (VkFormat format)
2867 VkFormatFeatureFlags flags;
2872 SAIM = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT,
2873 BLSR = VK_FORMAT_FEATURE_BLIT_SRC_BIT,
2874 SIFL = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT,
2875 COAT = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT,
2876 BLDS = VK_FORMAT_FEATURE_BLIT_DST_BIT,
2877 CABL = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT,
2878 STIM = VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT,
2879 STIA = VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT,
2880 DSAT = VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT,
2881 TRSR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT,
2882 TRDS = VK_FORMAT_FEATURE_TRANSFER_DST_BIT
2885 static const Formatpair formatflags[] =
2887 { VK_FORMAT_B4G4R4A4_UNORM_PACK16, SAIM | BLSR | TRSR | TRDS | SIFL },
2888 { VK_FORMAT_R5G6B5_UNORM_PACK16, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2889 { VK_FORMAT_A1R5G5B5_UNORM_PACK16, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2890 { VK_FORMAT_R8_UNORM, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2891 { VK_FORMAT_R8_SNORM, SAIM | BLSR | TRSR | TRDS | SIFL },
2892 { VK_FORMAT_R8_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2893 { VK_FORMAT_R8_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2894 { VK_FORMAT_R8G8_UNORM, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2895 { VK_FORMAT_R8G8_SNORM, SAIM | BLSR | TRSR | TRDS | SIFL },
2896 { VK_FORMAT_R8G8_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2897 { VK_FORMAT_R8G8_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2898 { VK_FORMAT_R8G8B8A8_UNORM, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | STIM | CABL },
2899 { VK_FORMAT_R8G8B8A8_SNORM, SAIM | BLSR | TRSR | TRDS | SIFL | STIM },
2900 { VK_FORMAT_R8G8B8A8_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2901 { VK_FORMAT_R8G8B8A8_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2902 { VK_FORMAT_R8G8B8A8_SRGB, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2903 { VK_FORMAT_B8G8R8A8_UNORM, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2904 { VK_FORMAT_B8G8R8A8_SRGB, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2905 { VK_FORMAT_A8B8G8R8_UNORM_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2906 { VK_FORMAT_A8B8G8R8_SNORM_PACK32, SAIM | BLSR | TRSR | TRDS | SIFL },
2907 { VK_FORMAT_A8B8G8R8_UINT_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2908 { VK_FORMAT_A8B8G8R8_SINT_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2909 { VK_FORMAT_A8B8G8R8_SRGB_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2910 { VK_FORMAT_A2B10G10R10_UNORM_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2911 { VK_FORMAT_A2B10G10R10_UINT_PACK32, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2912 { VK_FORMAT_R16_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2913 { VK_FORMAT_R16_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2914 { VK_FORMAT_R16_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2915 { VK_FORMAT_R16G16_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2916 { VK_FORMAT_R16G16_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS },
2917 { VK_FORMAT_R16G16_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | CABL },
2918 { VK_FORMAT_R16G16B16A16_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2919 { VK_FORMAT_R16G16B16A16_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2920 { VK_FORMAT_R16G16B16A16_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | SIFL | STIM | CABL },
2921 { VK_FORMAT_R32_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM | STIA },
2922 { VK_FORMAT_R32_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM | STIA },
2923 { VK_FORMAT_R32_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2924 { VK_FORMAT_R32G32_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2925 { VK_FORMAT_R32G32_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2926 { VK_FORMAT_R32G32_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2927 { VK_FORMAT_R32G32B32A32_UINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2928 { VK_FORMAT_R32G32B32A32_SINT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2929 { VK_FORMAT_R32G32B32A32_SFLOAT, SAIM | BLSR | TRSR | TRDS | COAT | BLDS | STIM },
2930 { VK_FORMAT_B10G11R11_UFLOAT_PACK32, SAIM | BLSR | TRSR | TRDS | SIFL },
2931 { VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, SAIM | BLSR | TRSR | TRDS | SIFL },
2932 { VK_FORMAT_D16_UNORM, SAIM | BLSR | TRSR | TRDS | DSAT },
2935 size_t formatpairs = sizeof(formatflags) / sizeof(Formatpair);
2937 for (unsigned int i = 0; i < formatpairs; i++)
2938 if (formatflags[i].format == format)
2939 return formatflags[i].flags;
2943 VkFormatFeatureFlags getRequiredOptimalExtendedTilingFeatures (Context& context, VkFormat format, VkFormatFeatureFlags queriedFlags)
2945 VkFormatFeatureFlags flags = (VkFormatFeatureFlags)0;
2947 // VK_EXT_sampler_filter_minmax:
2948 // If filterMinmaxSingleComponentFormats is VK_TRUE, the following formats must
2949 // support the VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT feature with
2950 // VK_IMAGE_TILING_OPTIMAL, if they support VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT.
2952 static const VkFormat s_requiredSampledImageFilterMinMaxFormats[] =
2956 VK_FORMAT_R16_UNORM,
2957 VK_FORMAT_R16_SNORM,
2958 VK_FORMAT_R16_SFLOAT,
2959 VK_FORMAT_R32_SFLOAT,
2960 VK_FORMAT_D16_UNORM,
2961 VK_FORMAT_X8_D24_UNORM_PACK32,
2962 VK_FORMAT_D32_SFLOAT,
2963 VK_FORMAT_D16_UNORM_S8_UINT,
2964 VK_FORMAT_D24_UNORM_S8_UINT,
2965 VK_FORMAT_D32_SFLOAT_S8_UINT,
2968 if ((queriedFlags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0)
2970 if (de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_EXT_sampler_filter_minmax"))
2972 if (de::contains(DE_ARRAY_BEGIN(s_requiredSampledImageFilterMinMaxFormats), DE_ARRAY_END(s_requiredSampledImageFilterMinMaxFormats), format))
2974 VkPhysicalDeviceSamplerFilterMinmaxProperties physicalDeviceSamplerMinMaxProperties =
2976 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT,
2983 VkPhysicalDeviceProperties2 physicalDeviceProperties;
2984 physicalDeviceProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
2985 physicalDeviceProperties.pNext = &physicalDeviceSamplerMinMaxProperties;
2987 const InstanceInterface& vk = context.getInstanceInterface();
2988 vk.getPhysicalDeviceProperties2(context.getPhysicalDevice(), &physicalDeviceProperties);
2991 if (physicalDeviceSamplerMinMaxProperties.filterMinmaxSingleComponentFormats)
2993 flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT;
2999 // VK_EXT_filter_cubic:
3000 // If cubic filtering is supported, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT must be supported for the following image view types:
3001 // VK_IMAGE_VIEW_TYPE_2D, VK_IMAGE_VIEW_TYPE_2D_ARRAY
3002 static const VkFormat s_requiredSampledImageFilterCubicFormats[] =
3004 VK_FORMAT_R4G4_UNORM_PACK8,
3005 VK_FORMAT_R4G4B4A4_UNORM_PACK16,
3006 VK_FORMAT_B4G4R4A4_UNORM_PACK16,
3007 VK_FORMAT_R5G6B5_UNORM_PACK16,
3008 VK_FORMAT_B5G6R5_UNORM_PACK16,
3009 VK_FORMAT_R5G5B5A1_UNORM_PACK16,
3010 VK_FORMAT_B5G5R5A1_UNORM_PACK16,
3011 VK_FORMAT_A1R5G5B5_UNORM_PACK16,
3015 VK_FORMAT_R8G8_UNORM,
3016 VK_FORMAT_R8G8_SNORM,
3017 VK_FORMAT_R8G8_SRGB,
3018 VK_FORMAT_R8G8B8_UNORM,
3019 VK_FORMAT_R8G8B8_SNORM,
3020 VK_FORMAT_R8G8B8_SRGB,
3021 VK_FORMAT_B8G8R8_UNORM,
3022 VK_FORMAT_B8G8R8_SNORM,
3023 VK_FORMAT_B8G8R8_SRGB,
3024 VK_FORMAT_R8G8B8A8_UNORM,
3025 VK_FORMAT_R8G8B8A8_SNORM,
3026 VK_FORMAT_R8G8B8A8_SRGB,
3027 VK_FORMAT_B8G8R8A8_UNORM,
3028 VK_FORMAT_B8G8R8A8_SNORM,
3029 VK_FORMAT_B8G8R8A8_SRGB,
3030 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
3031 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
3032 VK_FORMAT_A8B8G8R8_SRGB_PACK32
3035 static const VkFormat s_requiredSampledImageFilterCubicFormatsETC2[] =
3037 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
3038 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
3039 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,
3040 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,
3041 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,
3042 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK
3045 if ( (queriedFlags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0 && de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_EXT_filter_cubic") )
3047 if ( de::contains(DE_ARRAY_BEGIN(s_requiredSampledImageFilterCubicFormats), DE_ARRAY_END(s_requiredSampledImageFilterCubicFormats), format) )
3048 flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT;
3050 VkPhysicalDeviceFeatures2 coreFeatures;
3051 deMemset(&coreFeatures, 0, sizeof(coreFeatures));
3053 coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
3054 coreFeatures.pNext = DE_NULL;
3055 context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &coreFeatures);
3056 if ( coreFeatures.features.textureCompressionETC2 && de::contains(DE_ARRAY_BEGIN(s_requiredSampledImageFilterCubicFormatsETC2), DE_ARRAY_END(s_requiredSampledImageFilterCubicFormatsETC2), format) )
3057 flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT;
3063 VkFormatFeatureFlags getRequiredBufferFeatures (VkFormat format)
3065 static const VkFormat s_requiredVertexBufferFormats[] =
3071 VK_FORMAT_R8G8_UNORM,
3072 VK_FORMAT_R8G8_SNORM,
3073 VK_FORMAT_R8G8_UINT,
3074 VK_FORMAT_R8G8_SINT,
3075 VK_FORMAT_R8G8B8A8_UNORM,
3076 VK_FORMAT_R8G8B8A8_SNORM,
3077 VK_FORMAT_R8G8B8A8_UINT,
3078 VK_FORMAT_R8G8B8A8_SINT,
3079 VK_FORMAT_B8G8R8A8_UNORM,
3080 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
3081 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
3082 VK_FORMAT_A8B8G8R8_UINT_PACK32,
3083 VK_FORMAT_A8B8G8R8_SINT_PACK32,
3084 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
3085 VK_FORMAT_R16_UNORM,
3086 VK_FORMAT_R16_SNORM,
3089 VK_FORMAT_R16_SFLOAT,
3090 VK_FORMAT_R16G16_UNORM,
3091 VK_FORMAT_R16G16_SNORM,
3092 VK_FORMAT_R16G16_UINT,
3093 VK_FORMAT_R16G16_SINT,
3094 VK_FORMAT_R16G16_SFLOAT,
3095 VK_FORMAT_R16G16B16A16_UNORM,
3096 VK_FORMAT_R16G16B16A16_SNORM,
3097 VK_FORMAT_R16G16B16A16_UINT,
3098 VK_FORMAT_R16G16B16A16_SINT,
3099 VK_FORMAT_R16G16B16A16_SFLOAT,
3102 VK_FORMAT_R32_SFLOAT,
3103 VK_FORMAT_R32G32_UINT,
3104 VK_FORMAT_R32G32_SINT,
3105 VK_FORMAT_R32G32_SFLOAT,
3106 VK_FORMAT_R32G32B32_UINT,
3107 VK_FORMAT_R32G32B32_SINT,
3108 VK_FORMAT_R32G32B32_SFLOAT,
3109 VK_FORMAT_R32G32B32A32_UINT,
3110 VK_FORMAT_R32G32B32A32_SINT,
3111 VK_FORMAT_R32G32B32A32_SFLOAT
3113 static const VkFormat s_requiredUniformTexelBufferFormats[] =
3119 VK_FORMAT_R8G8_UNORM,
3120 VK_FORMAT_R8G8_SNORM,
3121 VK_FORMAT_R8G8_UINT,
3122 VK_FORMAT_R8G8_SINT,
3123 VK_FORMAT_R8G8B8A8_UNORM,
3124 VK_FORMAT_R8G8B8A8_SNORM,
3125 VK_FORMAT_R8G8B8A8_UINT,
3126 VK_FORMAT_R8G8B8A8_SINT,
3127 VK_FORMAT_B8G8R8A8_UNORM,
3128 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
3129 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
3130 VK_FORMAT_A8B8G8R8_UINT_PACK32,
3131 VK_FORMAT_A8B8G8R8_SINT_PACK32,
3132 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
3133 VK_FORMAT_A2B10G10R10_UINT_PACK32,
3136 VK_FORMAT_R16_SFLOAT,
3137 VK_FORMAT_R16G16_UINT,
3138 VK_FORMAT_R16G16_SINT,
3139 VK_FORMAT_R16G16_SFLOAT,
3140 VK_FORMAT_R16G16B16A16_UINT,
3141 VK_FORMAT_R16G16B16A16_SINT,
3142 VK_FORMAT_R16G16B16A16_SFLOAT,
3145 VK_FORMAT_R32_SFLOAT,
3146 VK_FORMAT_R32G32_UINT,
3147 VK_FORMAT_R32G32_SINT,
3148 VK_FORMAT_R32G32_SFLOAT,
3149 VK_FORMAT_R32G32B32A32_UINT,
3150 VK_FORMAT_R32G32B32A32_SINT,
3151 VK_FORMAT_R32G32B32A32_SFLOAT,
3152 VK_FORMAT_B10G11R11_UFLOAT_PACK32
3154 static const VkFormat s_requiredStorageTexelBufferFormats[] =
3156 VK_FORMAT_R8G8B8A8_UNORM,
3157 VK_FORMAT_R8G8B8A8_SNORM,
3158 VK_FORMAT_R8G8B8A8_UINT,
3159 VK_FORMAT_R8G8B8A8_SINT,
3160 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
3161 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
3162 VK_FORMAT_A8B8G8R8_UINT_PACK32,
3163 VK_FORMAT_A8B8G8R8_SINT_PACK32,
3164 VK_FORMAT_R16G16B16A16_UINT,
3165 VK_FORMAT_R16G16B16A16_SINT,
3166 VK_FORMAT_R16G16B16A16_SFLOAT,
3169 VK_FORMAT_R32_SFLOAT,
3170 VK_FORMAT_R32G32_UINT,
3171 VK_FORMAT_R32G32_SINT,
3172 VK_FORMAT_R32G32_SFLOAT,
3173 VK_FORMAT_R32G32B32A32_UINT,
3174 VK_FORMAT_R32G32B32A32_SINT,
3175 VK_FORMAT_R32G32B32A32_SFLOAT
3177 static const VkFormat s_requiredStorageTexelBufferAtomicFormats[] =
3183 VkFormatFeatureFlags flags = (VkFormatFeatureFlags)0;
3185 if (de::contains(DE_ARRAY_BEGIN(s_requiredVertexBufferFormats), DE_ARRAY_END(s_requiredVertexBufferFormats), format))
3186 flags |= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT;
3188 if (de::contains(DE_ARRAY_BEGIN(s_requiredUniformTexelBufferFormats), DE_ARRAY_END(s_requiredUniformTexelBufferFormats), format))
3189 flags |= VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT;
3191 if (de::contains(DE_ARRAY_BEGIN(s_requiredStorageTexelBufferFormats), DE_ARRAY_END(s_requiredStorageTexelBufferFormats), format))
3192 flags |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT;
3194 if (de::contains(DE_ARRAY_BEGIN(s_requiredStorageTexelBufferAtomicFormats), DE_ARRAY_END(s_requiredStorageTexelBufferAtomicFormats), format))
3195 flags |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT;
3200 VkPhysicalDeviceSamplerYcbcrConversionFeatures getPhysicalDeviceSamplerYcbcrConversionFeatures (const InstanceInterface& vk, VkPhysicalDevice physicalDevice)
3202 VkPhysicalDeviceFeatures2 coreFeatures;
3203 VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcrFeatures;
3205 deMemset(&coreFeatures, 0, sizeof(coreFeatures));
3206 deMemset(&ycbcrFeatures, 0, sizeof(ycbcrFeatures));
3208 coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
3209 coreFeatures.pNext = &ycbcrFeatures;
3210 ycbcrFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES;
3212 vk.getPhysicalDeviceFeatures2(physicalDevice, &coreFeatures);
3214 return ycbcrFeatures;
3217 void checkYcbcrApiSupport (Context& context)
3219 // check if YCbcr API and are supported by implementation
3221 // the support for formats and YCbCr may still be optional - see isYcbcrConversionSupported below
3223 if (!vk::isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_sampler_ycbcr_conversion"))
3225 if (!context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"))
3226 TCU_THROW(NotSupportedError, "VK_KHR_sampler_ycbcr_conversion is not supported");
3228 // Hard dependency for ycbcr
3229 TCU_CHECK(de::contains(context.getInstanceExtensions().begin(), context.getInstanceExtensions().end(), "VK_KHR_get_physical_device_properties2"));
3233 bool isYcbcrConversionSupported (Context& context)
3235 checkYcbcrApiSupport(context);
3237 const VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcrFeatures = getPhysicalDeviceSamplerYcbcrConversionFeatures(context.getInstanceInterface(), context.getPhysicalDevice());
3239 return (ycbcrFeatures.samplerYcbcrConversion == VK_TRUE);
3242 VkFormatFeatureFlags getRequiredYcbcrFormatFeatures (Context& context, VkFormat format)
3244 bool req = isYcbcrConversionSupported(context) && ( format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM ||
3245 format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM);
3247 const VkFormatFeatureFlags required = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
3248 | VK_FORMAT_FEATURE_TRANSFER_SRC_BIT
3249 | VK_FORMAT_FEATURE_TRANSFER_DST_BIT
3250 | VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT;
3251 return req ? required : (VkFormatFeatureFlags)0;
3254 VkFormatFeatureFlags getRequiredOptimalTilingFeatures (Context& context, VkFormat format)
3256 if (isYCbCrFormat(format))
3257 return getRequiredYcbcrFormatFeatures(context, format);
3260 VkFormatFeatureFlags ret = getBaseRequiredOptimalTilingFeatures(format);
3262 // \todo [2017-05-16 pyry] This should be extended to cover for example COLOR_ATTACHMENT for depth formats etc.
3263 // \todo [2017-05-18 pyry] Any other color conversion related features that can't be supported by regular formats?
3264 ret |= getRequiredOptimalExtendedTilingFeatures(context, format, ret);
3266 // Compressed formats have optional support for some features
3267 // TODO: Is this really correct? It looks like it should be checking the different compressed features
3268 if (isCompressedFormat(format) && (ret & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT))
3269 ret |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
3270 VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
3271 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
3272 VK_FORMAT_FEATURE_BLIT_SRC_BIT;
3278 bool requiresYCbCrConversion(Context& context, VkFormat format)
3280 if (format == VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16)
3282 if (!context.isDeviceFunctionalitySupported("VK_EXT_rgba10x6_formats"))
3284 VkPhysicalDeviceFeatures2 coreFeatures;
3285 VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT rgba10x6features;
3287 deMemset(&coreFeatures, 0, sizeof(coreFeatures));
3288 deMemset(&rgba10x6features, 0, sizeof(rgba10x6features));
3290 coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
3291 coreFeatures.pNext = &rgba10x6features;
3292 rgba10x6features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT;
3294 const InstanceInterface &vk = context.getInstanceInterface();
3295 vk.getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &coreFeatures);
3297 return !rgba10x6features.formatRgba10x6WithoutYCbCrSampler;
3300 return isYCbCrFormat(format) &&
3301 format != VK_FORMAT_R10X6_UNORM_PACK16 && format != VK_FORMAT_R10X6G10X6_UNORM_2PACK16 &&
3302 format != VK_FORMAT_R12X4_UNORM_PACK16 && format != VK_FORMAT_R12X4G12X4_UNORM_2PACK16;
3305 VkFormatFeatureFlags getAllowedOptimalTilingFeatures (Context &context, VkFormat format)
3307 // YCbCr formats only support a subset of format feature flags
3308 const VkFormatFeatureFlags ycbcrAllows =
3309 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
3310 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT |
3311 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG |
3312 VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
3313 VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
3314 VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT |
3315 VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT |
3316 VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT |
3317 VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT |
3318 VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT |
3319 VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT |
3320 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT |
3321 VK_FORMAT_FEATURE_DISJOINT_BIT;
3323 // By default everything is allowed.
3324 VkFormatFeatureFlags allow = (VkFormatFeatureFlags)~0u;
3325 // Formats for which SamplerYCbCrConversion is required may not support certain features.
3326 if (requiresYCbCrConversion(context, format))
3327 allow &= ycbcrAllows;
3328 // single-plane formats *may not* support DISJOINT_BIT
3329 if (!isYCbCrFormat(format) || getPlaneCount(format) == 1)
3330 allow &= ~VK_FORMAT_FEATURE_DISJOINT_BIT;
3335 VkFormatFeatureFlags getAllowedBufferFeatures (Context &context, VkFormat format)
3337 // TODO: Do we allow non-buffer flags in the bufferFeatures?
3338 return requiresYCbCrConversion(context, format) ? (VkFormatFeatureFlags)0 : (VkFormatFeatureFlags)(~VK_FORMAT_FEATURE_DISJOINT_BIT);
3341 tcu::TestStatus formatProperties (Context& context, VkFormat format)
3343 // check if Ycbcr format enums are valid given the version and extensions
3344 if (isYCbCrFormat(format))
3345 checkYcbcrApiSupport(context);
3347 TestLog& log = context.getTestContext().getLog();
3348 const VkFormatProperties properties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
3351 const VkFormatFeatureFlags reqImg = getRequiredOptimalTilingFeatures(context, format);
3352 const VkFormatFeatureFlags reqBuf = getRequiredBufferFeatures(format);
3353 const VkFormatFeatureFlags allowImg = getAllowedOptimalTilingFeatures(context, format);
3354 const VkFormatFeatureFlags allowBuf = getAllowedBufferFeatures(context, format);
3356 const struct feature_req
3358 const char* fieldName;
3359 VkFormatFeatureFlags supportedFeatures;
3360 VkFormatFeatureFlags requiredFeatures;
3361 VkFormatFeatureFlags allowedFeatures;
3364 { "linearTilingFeatures", properties.linearTilingFeatures, (VkFormatFeatureFlags)0, allowImg },
3365 { "optimalTilingFeatures", properties.optimalTilingFeatures, reqImg, allowImg },
3366 { "bufferFeatures", properties.bufferFeatures, reqBuf, allowBuf }
3369 log << TestLog::Message << properties << TestLog::EndMessage;
3371 for (int fieldNdx = 0; fieldNdx < DE_LENGTH_OF_ARRAY(fields); fieldNdx++)
3373 const char* const fieldName = fields[fieldNdx].fieldName;
3374 const VkFormatFeatureFlags supported = fields[fieldNdx].supportedFeatures;
3375 const VkFormatFeatureFlags required = fields[fieldNdx].requiredFeatures;
3376 const VkFormatFeatureFlags allowed = fields[fieldNdx].allowedFeatures;
3378 if ((supported & required) != required)
3380 log << TestLog::Message << "ERROR in " << fieldName << ":\n"
3381 << " required: " << getFormatFeatureFlagsStr(required) << "\n "
3382 << " missing: " << getFormatFeatureFlagsStr(~supported & required)
3383 << TestLog::EndMessage;
3387 if ((supported & ~allowed) != 0)
3389 log << TestLog::Message << "ERROR in " << fieldName << ":\n"
3390 << " has: " << getFormatFeatureFlagsStr(supported & ~allowed)
3391 << TestLog::EndMessage;
3395 if (((supported & VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT) != 0) &&
3396 ((supported & VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT) == 0))
3398 log << TestLog::Message << "ERROR in " << fieldName << ":\n"
3399 << " supports VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT"
3400 << " but not VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT"
3401 << TestLog::EndMessage;
3407 return tcu::TestStatus::pass("Query and validation passed");
3409 return tcu::TestStatus::fail("Required features not supported");
3412 bool optimalTilingFeaturesSupported (Context& context, VkFormat format, VkFormatFeatureFlags features)
3414 const VkFormatProperties properties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
3416 return (properties.optimalTilingFeatures & features) == features;
3419 bool optimalTilingFeaturesSupportedForAll (Context& context, const VkFormat* begin, const VkFormat* end, VkFormatFeatureFlags features)
3421 for (const VkFormat* cur = begin; cur != end; ++cur)
3423 if (!optimalTilingFeaturesSupported(context, *cur, features))
3430 tcu::TestStatus testDepthStencilSupported (Context& context)
3432 if (!optimalTilingFeaturesSupported(context, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) &&
3433 !optimalTilingFeaturesSupported(context, VK_FORMAT_D32_SFLOAT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
3434 return tcu::TestStatus::fail("Doesn't support one of VK_FORMAT_X8_D24_UNORM_PACK32 or VK_FORMAT_D32_SFLOAT");
3436 if (!optimalTilingFeaturesSupported(context, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) &&
3437 !optimalTilingFeaturesSupported(context, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
3438 return tcu::TestStatus::fail("Doesn't support one of VK_FORMAT_D24_UNORM_S8_UINT or VK_FORMAT_D32_SFLOAT_S8_UINT");
3440 return tcu::TestStatus::pass("Required depth/stencil formats supported");
3443 tcu::TestStatus testCompressedFormatsSupported (Context& context)
3445 static const VkFormat s_allBcFormats[] =
3447 VK_FORMAT_BC1_RGB_UNORM_BLOCK,
3448 VK_FORMAT_BC1_RGB_SRGB_BLOCK,
3449 VK_FORMAT_BC1_RGBA_UNORM_BLOCK,
3450 VK_FORMAT_BC1_RGBA_SRGB_BLOCK,
3451 VK_FORMAT_BC2_UNORM_BLOCK,
3452 VK_FORMAT_BC2_SRGB_BLOCK,
3453 VK_FORMAT_BC3_UNORM_BLOCK,
3454 VK_FORMAT_BC3_SRGB_BLOCK,
3455 VK_FORMAT_BC4_UNORM_BLOCK,
3456 VK_FORMAT_BC4_SNORM_BLOCK,
3457 VK_FORMAT_BC5_UNORM_BLOCK,
3458 VK_FORMAT_BC5_SNORM_BLOCK,
3459 VK_FORMAT_BC6H_UFLOAT_BLOCK,
3460 VK_FORMAT_BC6H_SFLOAT_BLOCK,
3461 VK_FORMAT_BC7_UNORM_BLOCK,
3462 VK_FORMAT_BC7_SRGB_BLOCK,
3464 static const VkFormat s_allEtc2Formats[] =
3466 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
3467 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
3468 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,
3469 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,
3470 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,
3471 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,
3472 VK_FORMAT_EAC_R11_UNORM_BLOCK,
3473 VK_FORMAT_EAC_R11_SNORM_BLOCK,
3474 VK_FORMAT_EAC_R11G11_UNORM_BLOCK,
3475 VK_FORMAT_EAC_R11G11_SNORM_BLOCK,
3477 static const VkFormat s_allAstcLdrFormats[] =
3479 VK_FORMAT_ASTC_4x4_UNORM_BLOCK,
3480 VK_FORMAT_ASTC_4x4_SRGB_BLOCK,
3481 VK_FORMAT_ASTC_5x4_UNORM_BLOCK,
3482 VK_FORMAT_ASTC_5x4_SRGB_BLOCK,
3483 VK_FORMAT_ASTC_5x5_UNORM_BLOCK,
3484 VK_FORMAT_ASTC_5x5_SRGB_BLOCK,
3485 VK_FORMAT_ASTC_6x5_UNORM_BLOCK,
3486 VK_FORMAT_ASTC_6x5_SRGB_BLOCK,
3487 VK_FORMAT_ASTC_6x6_UNORM_BLOCK,
3488 VK_FORMAT_ASTC_6x6_SRGB_BLOCK,
3489 VK_FORMAT_ASTC_8x5_UNORM_BLOCK,
3490 VK_FORMAT_ASTC_8x5_SRGB_BLOCK,
3491 VK_FORMAT_ASTC_8x6_UNORM_BLOCK,
3492 VK_FORMAT_ASTC_8x6_SRGB_BLOCK,
3493 VK_FORMAT_ASTC_8x8_UNORM_BLOCK,
3494 VK_FORMAT_ASTC_8x8_SRGB_BLOCK,
3495 VK_FORMAT_ASTC_10x5_UNORM_BLOCK,
3496 VK_FORMAT_ASTC_10x5_SRGB_BLOCK,
3497 VK_FORMAT_ASTC_10x6_UNORM_BLOCK,
3498 VK_FORMAT_ASTC_10x6_SRGB_BLOCK,
3499 VK_FORMAT_ASTC_10x8_UNORM_BLOCK,
3500 VK_FORMAT_ASTC_10x8_SRGB_BLOCK,
3501 VK_FORMAT_ASTC_10x10_UNORM_BLOCK,
3502 VK_FORMAT_ASTC_10x10_SRGB_BLOCK,
3503 VK_FORMAT_ASTC_12x10_UNORM_BLOCK,
3504 VK_FORMAT_ASTC_12x10_SRGB_BLOCK,
3505 VK_FORMAT_ASTC_12x12_UNORM_BLOCK,
3506 VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
3511 const char* setName;
3512 const char* featureName;
3513 const VkBool32 VkPhysicalDeviceFeatures::* feature;
3514 const VkFormat* formatsBegin;
3515 const VkFormat* formatsEnd;
3516 } s_compressedFormatSets[] =
3518 { "BC", "textureCompressionBC", &VkPhysicalDeviceFeatures::textureCompressionBC, DE_ARRAY_BEGIN(s_allBcFormats), DE_ARRAY_END(s_allBcFormats) },
3519 { "ETC2", "textureCompressionETC2", &VkPhysicalDeviceFeatures::textureCompressionETC2, DE_ARRAY_BEGIN(s_allEtc2Formats), DE_ARRAY_END(s_allEtc2Formats) },
3520 { "ASTC LDR", "textureCompressionASTC_LDR", &VkPhysicalDeviceFeatures::textureCompressionASTC_LDR, DE_ARRAY_BEGIN(s_allAstcLdrFormats), DE_ARRAY_END(s_allAstcLdrFormats) },
3523 TestLog& log = context.getTestContext().getLog();
3524 const VkPhysicalDeviceFeatures& features = context.getDeviceFeatures();
3525 int numSupportedSets = 0;
3527 int numWarnings = 0;
3529 for (int setNdx = 0; setNdx < DE_LENGTH_OF_ARRAY(s_compressedFormatSets); ++setNdx)
3531 const char* const setName = s_compressedFormatSets[setNdx].setName;
3532 const char* const featureName = s_compressedFormatSets[setNdx].featureName;
3533 const bool featureBitSet = features.*s_compressedFormatSets[setNdx].feature == VK_TRUE;
3534 const VkFormatFeatureFlags requiredFeatures =
3535 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT |
3536 VK_FORMAT_FEATURE_TRANSFER_SRC_BIT | VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
3537 const bool allSupported = optimalTilingFeaturesSupportedForAll(context,
3538 s_compressedFormatSets[setNdx].formatsBegin,
3539 s_compressedFormatSets[setNdx].formatsEnd,
3542 if (featureBitSet && !allSupported)
3544 log << TestLog::Message << "ERROR: " << featureName << " = VK_TRUE but " << setName << " formats not supported" << TestLog::EndMessage;
3547 else if (allSupported && !featureBitSet)
3549 log << TestLog::Message << "WARNING: " << setName << " formats supported but " << featureName << " = VK_FALSE" << TestLog::EndMessage;
3555 log << TestLog::Message << "All " << setName << " formats are supported" << TestLog::EndMessage;
3556 numSupportedSets += 1;
3559 log << TestLog::Message << setName << " formats are not supported" << TestLog::EndMessage;
3562 if (numSupportedSets == 0)
3564 log << TestLog::Message << "No compressed format sets supported" << TestLog::EndMessage;
3569 return tcu::TestStatus::fail("Compressed format support not valid");
3570 else if (numWarnings > 0)
3571 return tcu::TestStatus(QP_TEST_RESULT_QUALITY_WARNING, "Found inconsistencies in compressed format support");
3573 return tcu::TestStatus::pass("Compressed texture format support is valid");
3576 void createFormatTests (tcu::TestCaseGroup* testGroup)
3578 DE_STATIC_ASSERT(VK_FORMAT_UNDEFINED == 0);
3584 } s_formatRanges[] =
3587 { (VkFormat)(VK_FORMAT_UNDEFINED+1), VK_CORE_FORMAT_LAST },
3590 { VK_FORMAT_G8B8G8R8_422_UNORM, (VkFormat)(VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM+1) },
3592 // YCbCr extended formats
3593 { VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT, (VkFormat)(VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT+1) },
3596 for (int rangeNdx = 0; rangeNdx < DE_LENGTH_OF_ARRAY(s_formatRanges); ++rangeNdx)
3598 const VkFormat rangeBegin = s_formatRanges[rangeNdx].begin;
3599 const VkFormat rangeEnd = s_formatRanges[rangeNdx].end;
3601 for (VkFormat format = rangeBegin; format != rangeEnd; format = (VkFormat)(format+1))
3603 const char* const enumName = getFormatName(format);
3604 const string caseName = de::toLower(string(enumName).substr(10));
3606 addFunctionCase(testGroup, caseName, enumName, formatProperties, format);
3610 addFunctionCase(testGroup, "depth_stencil", "", testDepthStencilSupported);
3611 addFunctionCase(testGroup, "compressed_formats", "", testCompressedFormatsSupported);
3614 VkImageUsageFlags getValidImageUsageFlags (const VkFormatFeatureFlags supportedFeatures, const bool useKhrMaintenance1Semantics)
3616 VkImageUsageFlags flags = (VkImageUsageFlags)0;
3618 if (useKhrMaintenance1Semantics)
3620 if ((supportedFeatures & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT) != 0)
3621 flags |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
3623 if ((supportedFeatures & VK_FORMAT_FEATURE_TRANSFER_DST_BIT) != 0)
3624 flags |= VK_IMAGE_USAGE_TRANSFER_DST_BIT;
3628 // If format is supported at all, it must be valid transfer src+dst
3629 if (supportedFeatures != 0)
3630 flags |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT;
3633 if ((supportedFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0)
3634 flags |= VK_IMAGE_USAGE_SAMPLED_BIT;
3636 if ((supportedFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) != 0)
3637 flags |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT|VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
3639 if ((supportedFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) != 0)
3640 flags |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
3642 if ((supportedFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) != 0)
3643 flags |= VK_IMAGE_USAGE_STORAGE_BIT;
3648 bool isValidImageUsageFlagCombination (VkImageUsageFlags usage)
3650 if ((usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) != 0)
3652 const VkImageUsageFlags allowedFlags = VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
3653 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
3654 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
3655 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
3657 // Only *_ATTACHMENT_BIT flags can be combined with TRANSIENT_ATTACHMENT_BIT
3658 if ((usage & ~allowedFlags) != 0)
3661 // TRANSIENT_ATTACHMENT_BIT is not valid without COLOR_ or DEPTH_STENCIL_ATTACHMENT_BIT
3662 if ((usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) == 0)
3669 VkImageCreateFlags getValidImageCreateFlags (const VkPhysicalDeviceFeatures& deviceFeatures, VkFormat format, VkFormatFeatureFlags formatFeatures, VkImageType type, VkImageUsageFlags usage)
3671 VkImageCreateFlags flags = (VkImageCreateFlags)0;
3673 if ((usage & VK_IMAGE_USAGE_SAMPLED_BIT) != 0)
3675 flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
3677 if (type == VK_IMAGE_TYPE_2D && !isYCbCrFormat(format))
3679 flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
3683 if (isYCbCrFormat(format) && getPlaneCount(format) > 1)
3685 if (formatFeatures & VK_FORMAT_FEATURE_DISJOINT_BIT_KHR)
3686 flags |= VK_IMAGE_CREATE_DISJOINT_BIT_KHR;
3689 if ((usage & (VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_STORAGE_BIT)) != 0 &&
3690 (usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) == 0)
3692 if (deviceFeatures.sparseBinding)
3693 flags |= VK_IMAGE_CREATE_SPARSE_BINDING_BIT|VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT;
3695 if (deviceFeatures.sparseResidencyAliased)
3696 flags |= VK_IMAGE_CREATE_SPARSE_ALIASED_BIT;
3702 bool isValidImageCreateFlagCombination (VkImageCreateFlags)
3707 bool isRequiredImageParameterCombination (const VkPhysicalDeviceFeatures& deviceFeatures,
3708 const VkFormat format,
3709 const VkFormatProperties& formatProperties,
3710 const VkImageType imageType,
3711 const VkImageTiling imageTiling,
3712 const VkImageUsageFlags usageFlags,
3713 const VkImageCreateFlags createFlags)
3715 DE_UNREF(deviceFeatures);
3716 DE_UNREF(formatProperties);
3717 DE_UNREF(createFlags);
3719 // Linear images can have arbitrary limitations
3720 if (imageTiling == VK_IMAGE_TILING_LINEAR)
3723 // Support for other usages for compressed formats is optional
3724 if (isCompressedFormat(format) &&
3725 (usageFlags & ~(VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT)) != 0)
3728 // Support for 1D, and sliced 3D compressed formats is optional
3729 if (isCompressedFormat(format) && (imageType == VK_IMAGE_TYPE_1D || imageType == VK_IMAGE_TYPE_3D))
3732 // Support for 1D and 3D depth/stencil textures is optional
3733 if (isDepthStencilFormat(format) && (imageType == VK_IMAGE_TYPE_1D || imageType == VK_IMAGE_TYPE_3D))
3736 DE_ASSERT(deviceFeatures.sparseBinding || (createFlags & (VK_IMAGE_CREATE_SPARSE_BINDING_BIT|VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT)) == 0);
3737 DE_ASSERT(deviceFeatures.sparseResidencyAliased || (createFlags & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) == 0);
3739 if (isYCbCrFormat(format) && (createFlags & (VK_IMAGE_CREATE_SPARSE_BINDING_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT)))
3742 if (createFlags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT)
3744 if (isCompressedFormat(format))
3747 if (isDepthStencilFormat(format))
3750 if (!deIsPowerOfTwo32(mapVkFormat(format).getPixelSize()))
3755 case VK_IMAGE_TYPE_2D:
3756 return (deviceFeatures.sparseResidencyImage2D == VK_TRUE);
3757 case VK_IMAGE_TYPE_3D:
3758 return (deviceFeatures.sparseResidencyImage3D == VK_TRUE);
3767 VkSampleCountFlags getRequiredOptimalTilingSampleCounts (const VkPhysicalDeviceLimits& deviceLimits,
3768 const VkFormat format,
3769 const VkImageUsageFlags usageFlags)
3771 if (isCompressedFormat(format))
3772 return VK_SAMPLE_COUNT_1_BIT;
3774 bool hasDepthComp = false;
3775 bool hasStencilComp = false;
3776 const bool isYCbCr = isYCbCrFormat(format);
3779 const tcu::TextureFormat tcuFormat = mapVkFormat(format);
3780 hasDepthComp = (tcuFormat.order == tcu::TextureFormat::D || tcuFormat.order == tcu::TextureFormat::DS);
3781 hasStencilComp = (tcuFormat.order == tcu::TextureFormat::S || tcuFormat.order == tcu::TextureFormat::DS);
3784 const bool isColorFormat = !hasDepthComp && !hasStencilComp;
3785 VkSampleCountFlags sampleCounts = ~(VkSampleCountFlags)0;
3787 DE_ASSERT((hasDepthComp || hasStencilComp) != isColorFormat);
3789 if ((usageFlags & VK_IMAGE_USAGE_STORAGE_BIT) != 0)
3790 sampleCounts &= deviceLimits.storageImageSampleCounts;
3792 if ((usageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) != 0)
3795 sampleCounts &= deviceLimits.sampledImageDepthSampleCounts;
3798 sampleCounts &= deviceLimits.sampledImageStencilSampleCounts;
3803 sampleCounts &= deviceLimits.sampledImageColorSampleCounts;
3806 const tcu::TextureFormat tcuFormat = mapVkFormat(format);
3807 const tcu::TextureChannelClass chnClass = tcu::getTextureChannelClass(tcuFormat.type);
3809 if (chnClass == tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER ||
3810 chnClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER)
3811 sampleCounts &= deviceLimits.sampledImageIntegerSampleCounts;
3813 sampleCounts &= deviceLimits.sampledImageColorSampleCounts;
3818 if ((usageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) != 0)
3819 sampleCounts &= deviceLimits.framebufferColorSampleCounts;
3821 if ((usageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) != 0)
3824 sampleCounts &= deviceLimits.framebufferDepthSampleCounts;
3827 sampleCounts &= deviceLimits.framebufferStencilSampleCounts;
3830 // If there is no usage flag set that would have corresponding device limit,
3831 // only VK_SAMPLE_COUNT_1_BIT is required.
3832 if (sampleCounts == ~(VkSampleCountFlags)0)
3833 sampleCounts &= VK_SAMPLE_COUNT_1_BIT;
3835 return sampleCounts;
3838 struct ImageFormatPropertyCase
3840 typedef tcu::TestStatus (*Function) (Context& context, const VkFormat format, const VkImageType imageType, const VkImageTiling tiling);
3842 Function testFunction;
3844 VkImageType imageType;
3845 VkImageTiling tiling;
3847 ImageFormatPropertyCase (Function testFunction_, VkFormat format_, VkImageType imageType_, VkImageTiling tiling_)
3848 : testFunction (testFunction_)
3850 , imageType (imageType_)
3854 ImageFormatPropertyCase (void)
3855 : testFunction ((Function)DE_NULL)
3856 , format (VK_FORMAT_UNDEFINED)
3857 , imageType (VK_CORE_IMAGE_TYPE_LAST)
3858 , tiling (VK_CORE_IMAGE_TILING_LAST)
3862 tcu::TestStatus imageFormatProperties (Context& context, const VkFormat format, const VkImageType imageType, const VkImageTiling tiling)
3864 if (isYCbCrFormat(format))
3865 // check if Ycbcr format enums are valid given the version and extensions
3866 checkYcbcrApiSupport(context);
3868 TestLog& log = context.getTestContext().getLog();
3869 const VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures();
3870 const VkPhysicalDeviceLimits& deviceLimits = context.getDeviceProperties().limits;
3871 const VkFormatProperties formatProperties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
3872 const bool hasKhrMaintenance1 = context.isDeviceFunctionalitySupported("VK_KHR_maintenance1");
3874 const VkFormatFeatureFlags supportedFeatures = tiling == VK_IMAGE_TILING_LINEAR ? formatProperties.linearTilingFeatures : formatProperties.optimalTilingFeatures;
3875 const VkImageUsageFlags usageFlagSet = getValidImageUsageFlags(supportedFeatures, hasKhrMaintenance1);
3877 tcu::ResultCollector results (log, "ERROR: ");
3879 if (hasKhrMaintenance1 && (supportedFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0)
3881 results.check((supportedFeatures & (VK_FORMAT_FEATURE_TRANSFER_SRC_BIT|VK_FORMAT_FEATURE_TRANSFER_DST_BIT)) != 0,
3882 "A sampled image format must have VK_FORMAT_FEATURE_TRANSFER_SRC_BIT and VK_FORMAT_FEATURE_TRANSFER_DST_BIT format feature flags set");
3885 if (isYcbcrConversionSupported(context) && (format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR || format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR))
3887 VkFormatFeatureFlags requiredFeatures = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR | VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
3888 if (tiling == VK_IMAGE_TILING_OPTIMAL)
3889 requiredFeatures |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR;
3891 results.check((supportedFeatures & requiredFeatures) == requiredFeatures,
3892 getFormatName(format) + string(" must support ") + de::toString(getFormatFeatureFlagsStr(requiredFeatures)));
3895 for (VkImageUsageFlags curUsageFlags = 0; curUsageFlags <= usageFlagSet; curUsageFlags++)
3897 if ((curUsageFlags & ~usageFlagSet) != 0 ||
3898 !isValidImageUsageFlagCombination(curUsageFlags))
3901 const VkImageCreateFlags createFlagSet = getValidImageCreateFlags(deviceFeatures, format, supportedFeatures, imageType, curUsageFlags);
3903 for (VkImageCreateFlags curCreateFlags = 0; curCreateFlags <= createFlagSet; curCreateFlags++)
3905 if ((curCreateFlags & ~createFlagSet) != 0 ||
3906 !isValidImageCreateFlagCombination(curCreateFlags))
3909 const bool isRequiredCombination = isRequiredImageParameterCombination(deviceFeatures,
3916 VkImageFormatProperties properties;
3917 VkResult queryResult;
3919 log << TestLog::Message << "Testing " << getImageTypeStr(imageType) << ", "
3920 << getImageTilingStr(tiling) << ", "
3921 << getImageUsageFlagsStr(curUsageFlags) << ", "
3922 << getImageCreateFlagsStr(curCreateFlags)
3923 << TestLog::EndMessage;
3925 // Set return value to known garbage
3926 deMemset(&properties, 0xcd, sizeof(properties));
3928 queryResult = context.getInstanceInterface().getPhysicalDeviceImageFormatProperties(context.getPhysicalDevice(),
3936 if (queryResult == VK_SUCCESS)
3938 const deUint32 fullMipPyramidSize = de::max(de::max(deLog2Floor32(properties.maxExtent.width),
3939 deLog2Floor32(properties.maxExtent.height)),
3940 deLog2Floor32(properties.maxExtent.depth)) + 1;
3942 log << TestLog::Message << properties << "\n" << TestLog::EndMessage;
3944 results.check(imageType != VK_IMAGE_TYPE_1D || (properties.maxExtent.width >= 1 && properties.maxExtent.height == 1 && properties.maxExtent.depth == 1), "Invalid dimensions for 1D image");
3945 results.check(imageType != VK_IMAGE_TYPE_2D || (properties.maxExtent.width >= 1 && properties.maxExtent.height >= 1 && properties.maxExtent.depth == 1), "Invalid dimensions for 2D image");
3946 results.check(imageType != VK_IMAGE_TYPE_3D || (properties.maxExtent.width >= 1 && properties.maxExtent.height >= 1 && properties.maxExtent.depth >= 1), "Invalid dimensions for 3D image");
3947 results.check(imageType != VK_IMAGE_TYPE_3D || properties.maxArrayLayers == 1, "Invalid maxArrayLayers for 3D image");
3949 if (tiling == VK_IMAGE_TILING_OPTIMAL && imageType == VK_IMAGE_TYPE_2D && !(curCreateFlags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) &&
3950 (supportedFeatures & (VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)))
3952 const VkSampleCountFlags requiredSampleCounts = getRequiredOptimalTilingSampleCounts(deviceLimits, format, curUsageFlags);
3953 results.check((properties.sampleCounts & requiredSampleCounts) == requiredSampleCounts, "Required sample counts not supported");
3956 results.check(properties.sampleCounts == VK_SAMPLE_COUNT_1_BIT, "sampleCounts != VK_SAMPLE_COUNT_1_BIT");
3958 if (isRequiredCombination)
3960 results.check(imageType != VK_IMAGE_TYPE_1D || (properties.maxExtent.width >= deviceLimits.maxImageDimension1D),
3961 "Reported dimensions smaller than device limits");
3962 results.check(imageType != VK_IMAGE_TYPE_2D || (properties.maxExtent.width >= deviceLimits.maxImageDimension2D &&
3963 properties.maxExtent.height >= deviceLimits.maxImageDimension2D),
3964 "Reported dimensions smaller than device limits");
3965 results.check(imageType != VK_IMAGE_TYPE_3D || (properties.maxExtent.width >= deviceLimits.maxImageDimension3D &&
3966 properties.maxExtent.height >= deviceLimits.maxImageDimension3D &&
3967 properties.maxExtent.depth >= deviceLimits.maxImageDimension3D),
3968 "Reported dimensions smaller than device limits");
3969 results.check((isYCbCrFormat(format) && (properties.maxMipLevels == 1)) || properties.maxMipLevels == fullMipPyramidSize,
3970 "Invalid mip pyramid size");
3971 results.check((isYCbCrFormat(format) && (properties.maxArrayLayers == 1)) || imageType == VK_IMAGE_TYPE_3D ||
3972 properties.maxArrayLayers >= deviceLimits.maxImageArrayLayers, "Invalid maxArrayLayers");
3976 results.check(properties.maxMipLevels == 1 || properties.maxMipLevels == fullMipPyramidSize, "Invalid mip pyramid size");
3977 results.check(properties.maxArrayLayers >= 1, "Invalid maxArrayLayers");
3980 results.check(properties.maxResourceSize >= (VkDeviceSize)MINIMUM_REQUIRED_IMAGE_RESOURCE_SIZE,
3981 "maxResourceSize smaller than minimum required size");
3983 else if (queryResult == VK_ERROR_FORMAT_NOT_SUPPORTED)
3985 log << TestLog::Message << "Got VK_ERROR_FORMAT_NOT_SUPPORTED" << TestLog::EndMessage;
3987 if (isRequiredCombination)
3988 results.fail("VK_ERROR_FORMAT_NOT_SUPPORTED returned for required image parameter combination");
3990 // Specification requires that all fields are set to 0
3991 results.check(properties.maxExtent.width == 0, "maxExtent.width != 0");
3992 results.check(properties.maxExtent.height == 0, "maxExtent.height != 0");
3993 results.check(properties.maxExtent.depth == 0, "maxExtent.depth != 0");
3994 results.check(properties.maxMipLevels == 0, "maxMipLevels != 0");
3995 results.check(properties.maxArrayLayers == 0, "maxArrayLayers != 0");
3996 results.check(properties.sampleCounts == 0, "sampleCounts != 0");
3997 results.check(properties.maxResourceSize == 0, "maxResourceSize != 0");
4001 results.fail("Got unexpected error" + de::toString(queryResult));
4006 return tcu::TestStatus(results.getResult(), results.getMessage());
4009 // VK_KHR_get_physical_device_properties2
4011 string toString(const VkPhysicalDevicePCIBusInfoPropertiesEXT& value)
4013 std::ostringstream s;
4014 s << "VkPhysicalDevicePCIBusInfoPropertiesEXT = {\n";
4015 s << "\tsType = " << value.sType << '\n';
4016 s << "\tpciDomain = " << value.pciDomain << '\n';
4017 s << "\tpciBus = " << value.pciBus << '\n';
4018 s << "\tpciDevice = " << value.pciDevice << '\n';
4019 s << "\tpciFunction = " << value.pciFunction << '\n';
4024 bool checkExtension (vector<VkExtensionProperties>& properties, const char* extension)
4026 for (size_t ndx = 0; ndx < properties.size(); ++ndx)
4028 if (strncmp(properties[ndx].extensionName, extension, VK_MAX_EXTENSION_NAME_SIZE) == 0)
4034 tcu::TestStatus deviceFeatures2 (Context& context)
4036 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4037 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4038 const InstanceDriver& vki (instance.getDriver());
4039 const int count = 2u;
4040 TestLog& log = context.getTestContext().getLog();
4041 VkPhysicalDeviceFeatures coreFeatures;
4042 VkPhysicalDeviceFeatures2 extFeatures;
4044 deMemset(&coreFeatures, 0xcd, sizeof(coreFeatures));
4045 deMemset(&extFeatures.features, 0xcd, sizeof(extFeatures.features));
4046 std::vector<std::string> instExtensions = context.getInstanceExtensions();
4048 extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
4049 extFeatures.pNext = DE_NULL;
4051 vki.getPhysicalDeviceFeatures(physicalDevice, &coreFeatures);
4052 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
4054 TCU_CHECK(extFeatures.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2);
4055 TCU_CHECK(extFeatures.pNext == DE_NULL);
4057 if (deMemCmp(&coreFeatures, &extFeatures.features, sizeof(VkPhysicalDeviceFeatures)) != 0)
4058 TCU_FAIL("Mismatch between features reported by vkGetPhysicalDeviceFeatures and vkGetPhysicalDeviceFeatures2");
4060 log << TestLog::Message << extFeatures << TestLog::EndMessage;
4062 vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
4064 #include "vkDeviceFeatures2.inl"
4066 return tcu::TestStatus::pass("Querying device features succeeded");
4069 tcu::TestStatus deviceProperties2 (Context& context)
4071 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4072 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4073 const InstanceDriver& vki (instance.getDriver());
4074 TestLog& log = context.getTestContext().getLog();
4075 VkPhysicalDeviceProperties coreProperties;
4076 VkPhysicalDeviceProperties2 extProperties;
4078 extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
4079 extProperties.pNext = DE_NULL;
4081 vki.getPhysicalDeviceProperties(physicalDevice, &coreProperties);
4082 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4084 TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2);
4085 TCU_CHECK(extProperties.pNext == DE_NULL);
4087 // We can't use memcmp() here because the structs may contain padding bytes that drivers may or may not
4088 // have written while writing the data and memcmp will compare them anyway, so we iterate through the
4089 // valid bytes for each field in the struct and compare only the valid bytes for each one.
4090 for (int propNdx = 0; propNdx < DE_LENGTH_OF_ARRAY(s_physicalDevicePropertiesOffsetTable); propNdx++)
4092 const size_t offset = s_physicalDevicePropertiesOffsetTable[propNdx].offset;
4093 const size_t size = s_physicalDevicePropertiesOffsetTable[propNdx].size;
4095 const deUint8* corePropertyBytes = reinterpret_cast<deUint8*>(&coreProperties) + offset;
4096 const deUint8* extPropertyBytes = reinterpret_cast<deUint8*>(&extProperties.properties) + offset;
4098 if (deMemCmp(corePropertyBytes, extPropertyBytes, size) != 0)
4099 TCU_FAIL("Mismatch between properties reported by vkGetPhysicalDeviceProperties and vkGetPhysicalDeviceProperties2");
4102 log << TestLog::Message << extProperties.properties << TestLog::EndMessage;
4104 const int count = 2u;
4106 vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
4107 const bool khr_external_fence_capabilities = checkExtension(properties, "VK_KHR_external_fence_capabilities") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4108 const bool khr_external_memory_capabilities = checkExtension(properties, "VK_KHR_external_memory_capabilities") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4109 const bool khr_external_semaphore_capabilities = checkExtension(properties, "VK_KHR_external_semaphore_capabilities") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4110 const bool khr_multiview = checkExtension(properties, "VK_KHR_multiview") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4111 const bool khr_device_protected_memory = context.contextSupports(vk::ApiVersion(1, 1, 0));
4112 const bool khr_device_subgroup = context.contextSupports(vk::ApiVersion(1, 1, 0));
4113 const bool khr_maintenance2 = checkExtension(properties, "VK_KHR_maintenance2") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4114 const bool khr_maintenance3 = checkExtension(properties, "VK_KHR_maintenance3") || context.contextSupports(vk::ApiVersion(1, 1, 0));
4115 const bool khr_depth_stencil_resolve = checkExtension(properties, "VK_KHR_depth_stencil_resolve") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4116 const bool khr_driver_properties = checkExtension(properties, "VK_KHR_driver_properties") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4117 const bool khr_shader_float_controls = checkExtension(properties, "VK_KHR_shader_float_controls") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4118 const bool khr_descriptor_indexing = checkExtension(properties, "VK_EXT_descriptor_indexing") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4119 const bool khr_sampler_filter_minmax = checkExtension(properties, "VK_EXT_sampler_filter_minmax") || context.contextSupports(vk::ApiVersion(1, 2, 0));
4120 const bool khr_integer_dot_product = checkExtension(properties, "VK_KHR_shader_integer_dot_product");
4122 VkPhysicalDeviceIDProperties idProperties[count];
4123 VkPhysicalDeviceMultiviewProperties multiviewProperties[count];
4124 VkPhysicalDeviceProtectedMemoryProperties protectedMemoryPropertiesKHR[count];
4125 VkPhysicalDeviceSubgroupProperties subgroupProperties[count];
4126 VkPhysicalDevicePointClippingProperties pointClippingProperties[count];
4127 VkPhysicalDeviceMaintenance3Properties maintenance3Properties[count];
4128 VkPhysicalDeviceDepthStencilResolveProperties depthStencilResolveProperties[count];
4129 VkPhysicalDeviceDriverProperties driverProperties[count];
4130 VkPhysicalDeviceFloatControlsProperties floatControlsProperties[count];
4131 VkPhysicalDeviceDescriptorIndexingProperties descriptorIndexingProperties[count];
4132 VkPhysicalDeviceSamplerFilterMinmaxProperties samplerFilterMinmaxProperties[count];
4133 VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR integerDotProductProperties[count];
4135 for (int ndx = 0; ndx < count; ++ndx)
4137 deMemset(&idProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceIDProperties ));
4138 deMemset(&multiviewProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceMultiviewProperties ));
4139 deMemset(&protectedMemoryPropertiesKHR[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceProtectedMemoryProperties ));
4140 deMemset(&subgroupProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceSubgroupProperties ));
4141 deMemset(&pointClippingProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDevicePointClippingProperties ));
4142 deMemset(&maintenance3Properties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceMaintenance3Properties ));
4143 deMemset(&depthStencilResolveProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceDepthStencilResolveProperties ));
4144 deMemset(&driverProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceDriverProperties ));
4145 deMemset(&floatControlsProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceFloatControlsProperties ));
4146 deMemset(&descriptorIndexingProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceDescriptorIndexingProperties ));
4147 deMemset(&samplerFilterMinmaxProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceSamplerFilterMinmaxProperties ));
4148 deMemset(&integerDotProductProperties[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR ));
4150 idProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
4151 idProperties[ndx].pNext = &multiviewProperties[ndx];
4153 multiviewProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES;
4154 multiviewProperties[ndx].pNext = &protectedMemoryPropertiesKHR[ndx];
4156 protectedMemoryPropertiesKHR[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES;
4157 protectedMemoryPropertiesKHR[ndx].pNext = &subgroupProperties[ndx];
4159 subgroupProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
4160 subgroupProperties[ndx].pNext = &pointClippingProperties[ndx];
4162 pointClippingProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES;
4163 pointClippingProperties[ndx].pNext = &maintenance3Properties[ndx];
4165 maintenance3Properties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES;
4166 maintenance3Properties[ndx].pNext = &depthStencilResolveProperties[ndx];
4168 depthStencilResolveProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES;
4169 depthStencilResolveProperties[ndx].pNext = &driverProperties[ndx];
4171 driverProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
4172 driverProperties[ndx].pNext = &floatControlsProperties[ndx];
4174 floatControlsProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR;
4175 floatControlsProperties[ndx].pNext = &descriptorIndexingProperties[ndx];
4177 descriptorIndexingProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES;
4178 descriptorIndexingProperties[ndx].pNext = &samplerFilterMinmaxProperties[ndx];
4180 samplerFilterMinmaxProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES;
4181 samplerFilterMinmaxProperties[ndx].pNext = &integerDotProductProperties[ndx];
4183 integerDotProductProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR;
4184 integerDotProductProperties[ndx].pNext = DE_NULL;
4186 extProperties.pNext = &idProperties[ndx];
4188 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4191 if ( khr_external_fence_capabilities || khr_external_memory_capabilities || khr_external_semaphore_capabilities )
4192 log << TestLog::Message << idProperties[0] << TestLog::EndMessage;
4194 log << TestLog::Message << multiviewProperties[0] << TestLog::EndMessage;
4195 if (khr_device_protected_memory)
4196 log << TestLog::Message << protectedMemoryPropertiesKHR[0] << TestLog::EndMessage;
4197 if (khr_device_subgroup)
4198 log << TestLog::Message << subgroupProperties[0] << TestLog::EndMessage;
4199 if (khr_maintenance2)
4200 log << TestLog::Message << pointClippingProperties[0] << TestLog::EndMessage;
4201 if (khr_maintenance3)
4202 log << TestLog::Message << maintenance3Properties[0] << TestLog::EndMessage;
4203 if (khr_depth_stencil_resolve)
4204 log << TestLog::Message << depthStencilResolveProperties[0] << TestLog::EndMessage;
4205 if (khr_driver_properties)
4206 log << TestLog::Message << driverProperties[0] << TestLog::EndMessage;
4207 if (khr_shader_float_controls)
4208 log << TestLog::Message << floatControlsProperties[0] << TestLog::EndMessage;
4209 if (khr_descriptor_indexing)
4210 log << TestLog::Message << descriptorIndexingProperties[0] << TestLog::EndMessage;
4211 if (khr_sampler_filter_minmax)
4212 log << TestLog::Message << samplerFilterMinmaxProperties[0] << TestLog::EndMessage;
4213 if (khr_integer_dot_product)
4214 log << TestLog::Message << integerDotProductProperties[0] << TestLog::EndMessage;
4216 if ( khr_external_fence_capabilities || khr_external_memory_capabilities || khr_external_semaphore_capabilities )
4218 if ((deMemCmp(idProperties[0].deviceUUID, idProperties[1].deviceUUID, VK_UUID_SIZE) != 0) ||
4219 (deMemCmp(idProperties[0].driverUUID, idProperties[1].driverUUID, VK_UUID_SIZE) != 0) ||
4220 (idProperties[0].deviceLUIDValid != idProperties[1].deviceLUIDValid))
4222 TCU_FAIL("Mismatch between VkPhysicalDeviceIDProperties");
4224 else if (idProperties[0].deviceLUIDValid)
4226 // If deviceLUIDValid is VK_FALSE, the contents of deviceLUID and deviceNodeMask are undefined
4227 // so thay can only be compared when deviceLUIDValid is VK_TRUE.
4228 if ((deMemCmp(idProperties[0].deviceLUID, idProperties[1].deviceLUID, VK_LUID_SIZE) != 0) ||
4229 (idProperties[0].deviceNodeMask != idProperties[1].deviceNodeMask))
4231 TCU_FAIL("Mismatch between VkPhysicalDeviceIDProperties");
4235 if (khr_multiview &&
4236 (multiviewProperties[0].maxMultiviewViewCount != multiviewProperties[1].maxMultiviewViewCount ||
4237 multiviewProperties[0].maxMultiviewInstanceIndex != multiviewProperties[1].maxMultiviewInstanceIndex))
4239 TCU_FAIL("Mismatch between VkPhysicalDeviceMultiviewProperties");
4241 if (khr_device_protected_memory &&
4242 (protectedMemoryPropertiesKHR[0].protectedNoFault != protectedMemoryPropertiesKHR[1].protectedNoFault))
4244 TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryProperties");
4246 if (khr_device_subgroup &&
4247 (subgroupProperties[0].subgroupSize != subgroupProperties[1].subgroupSize ||
4248 subgroupProperties[0].supportedStages != subgroupProperties[1].supportedStages ||
4249 subgroupProperties[0].supportedOperations != subgroupProperties[1].supportedOperations ||
4250 subgroupProperties[0].quadOperationsInAllStages != subgroupProperties[1].quadOperationsInAllStages ))
4252 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupProperties");
4254 if (khr_maintenance2 &&
4255 (pointClippingProperties[0].pointClippingBehavior != pointClippingProperties[1].pointClippingBehavior))
4257 TCU_FAIL("Mismatch between VkPhysicalDevicePointClippingProperties");
4259 if (khr_maintenance3 &&
4260 (maintenance3Properties[0].maxPerSetDescriptors != maintenance3Properties[1].maxPerSetDescriptors ||
4261 maintenance3Properties[0].maxMemoryAllocationSize != maintenance3Properties[1].maxMemoryAllocationSize))
4263 if (protectedMemoryPropertiesKHR[0].protectedNoFault != protectedMemoryPropertiesKHR[1].protectedNoFault)
4265 TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryProperties");
4267 if ((subgroupProperties[0].subgroupSize != subgroupProperties[1].subgroupSize) ||
4268 (subgroupProperties[0].supportedStages != subgroupProperties[1].supportedStages) ||
4269 (subgroupProperties[0].supportedOperations != subgroupProperties[1].supportedOperations) ||
4270 (subgroupProperties[0].quadOperationsInAllStages != subgroupProperties[1].quadOperationsInAllStages))
4272 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupProperties");
4274 TCU_FAIL("Mismatch between VkPhysicalDeviceMaintenance3Properties");
4276 if (khr_depth_stencil_resolve &&
4277 (depthStencilResolveProperties[0].supportedDepthResolveModes != depthStencilResolveProperties[1].supportedDepthResolveModes ||
4278 depthStencilResolveProperties[0].supportedStencilResolveModes != depthStencilResolveProperties[1].supportedStencilResolveModes ||
4279 depthStencilResolveProperties[0].independentResolveNone != depthStencilResolveProperties[1].independentResolveNone ||
4280 depthStencilResolveProperties[0].independentResolve != depthStencilResolveProperties[1].independentResolve))
4282 TCU_FAIL("Mismatch between VkPhysicalDeviceDepthStencilResolveProperties");
4284 if (khr_driver_properties &&
4285 (driverProperties[0].driverID != driverProperties[1].driverID ||
4286 strncmp(driverProperties[0].driverName, driverProperties[1].driverName, VK_MAX_DRIVER_NAME_SIZE) != 0 ||
4287 strncmp(driverProperties[0].driverInfo, driverProperties[1].driverInfo, VK_MAX_DRIVER_INFO_SIZE) != 0 ||
4288 driverProperties[0].conformanceVersion.major != driverProperties[1].conformanceVersion.major ||
4289 driverProperties[0].conformanceVersion.minor != driverProperties[1].conformanceVersion.minor ||
4290 driverProperties[0].conformanceVersion.subminor != driverProperties[1].conformanceVersion.subminor ||
4291 driverProperties[0].conformanceVersion.patch != driverProperties[1].conformanceVersion.patch))
4293 TCU_FAIL("Mismatch between VkPhysicalDeviceDriverProperties");
4295 if (khr_shader_float_controls &&
4296 (floatControlsProperties[0].denormBehaviorIndependence != floatControlsProperties[1].denormBehaviorIndependence ||
4297 floatControlsProperties[0].roundingModeIndependence != floatControlsProperties[1].roundingModeIndependence ||
4298 floatControlsProperties[0].shaderSignedZeroInfNanPreserveFloat16 != floatControlsProperties[1].shaderSignedZeroInfNanPreserveFloat16 ||
4299 floatControlsProperties[0].shaderSignedZeroInfNanPreserveFloat32 != floatControlsProperties[1].shaderSignedZeroInfNanPreserveFloat32 ||
4300 floatControlsProperties[0].shaderSignedZeroInfNanPreserveFloat64 != floatControlsProperties[1].shaderSignedZeroInfNanPreserveFloat64 ||
4301 floatControlsProperties[0].shaderDenormPreserveFloat16 != floatControlsProperties[1].shaderDenormPreserveFloat16 ||
4302 floatControlsProperties[0].shaderDenormPreserveFloat32 != floatControlsProperties[1].shaderDenormPreserveFloat32 ||
4303 floatControlsProperties[0].shaderDenormPreserveFloat64 != floatControlsProperties[1].shaderDenormPreserveFloat64 ||
4304 floatControlsProperties[0].shaderDenormFlushToZeroFloat16 != floatControlsProperties[1].shaderDenormFlushToZeroFloat16 ||
4305 floatControlsProperties[0].shaderDenormFlushToZeroFloat32 != floatControlsProperties[1].shaderDenormFlushToZeroFloat32 ||
4306 floatControlsProperties[0].shaderDenormFlushToZeroFloat64 != floatControlsProperties[1].shaderDenormFlushToZeroFloat64 ||
4307 floatControlsProperties[0].shaderRoundingModeRTEFloat16 != floatControlsProperties[1].shaderRoundingModeRTEFloat16 ||
4308 floatControlsProperties[0].shaderRoundingModeRTEFloat32 != floatControlsProperties[1].shaderRoundingModeRTEFloat32 ||
4309 floatControlsProperties[0].shaderRoundingModeRTEFloat64 != floatControlsProperties[1].shaderRoundingModeRTEFloat64 ||
4310 floatControlsProperties[0].shaderRoundingModeRTZFloat16 != floatControlsProperties[1].shaderRoundingModeRTZFloat16 ||
4311 floatControlsProperties[0].shaderRoundingModeRTZFloat32 != floatControlsProperties[1].shaderRoundingModeRTZFloat32 ||
4312 floatControlsProperties[0].shaderRoundingModeRTZFloat64 != floatControlsProperties[1].shaderRoundingModeRTZFloat64 ))
4314 TCU_FAIL("Mismatch between VkPhysicalDeviceFloatControlsProperties");
4316 if (khr_descriptor_indexing &&
4317 (descriptorIndexingProperties[0].maxUpdateAfterBindDescriptorsInAllPools != descriptorIndexingProperties[1].maxUpdateAfterBindDescriptorsInAllPools ||
4318 descriptorIndexingProperties[0].shaderUniformBufferArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderUniformBufferArrayNonUniformIndexingNative ||
4319 descriptorIndexingProperties[0].shaderSampledImageArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderSampledImageArrayNonUniformIndexingNative ||
4320 descriptorIndexingProperties[0].shaderStorageBufferArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderStorageBufferArrayNonUniformIndexingNative ||
4321 descriptorIndexingProperties[0].shaderStorageImageArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderStorageImageArrayNonUniformIndexingNative ||
4322 descriptorIndexingProperties[0].shaderInputAttachmentArrayNonUniformIndexingNative != descriptorIndexingProperties[1].shaderInputAttachmentArrayNonUniformIndexingNative ||
4323 descriptorIndexingProperties[0].robustBufferAccessUpdateAfterBind != descriptorIndexingProperties[1].robustBufferAccessUpdateAfterBind ||
4324 descriptorIndexingProperties[0].quadDivergentImplicitLod != descriptorIndexingProperties[1].quadDivergentImplicitLod ||
4325 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindSamplers != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindSamplers ||
4326 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindUniformBuffers != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindUniformBuffers ||
4327 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindStorageBuffers != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindStorageBuffers ||
4328 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindSampledImages != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindSampledImages ||
4329 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindStorageImages != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindStorageImages ||
4330 descriptorIndexingProperties[0].maxPerStageDescriptorUpdateAfterBindInputAttachments != descriptorIndexingProperties[1].maxPerStageDescriptorUpdateAfterBindInputAttachments ||
4331 descriptorIndexingProperties[0].maxPerStageUpdateAfterBindResources != descriptorIndexingProperties[1].maxPerStageUpdateAfterBindResources ||
4332 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindSamplers != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindSamplers ||
4333 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindUniformBuffers != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindUniformBuffers ||
4334 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindUniformBuffersDynamic != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindUniformBuffersDynamic ||
4335 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindStorageBuffers != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindStorageBuffers ||
4336 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindStorageBuffersDynamic != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindStorageBuffersDynamic ||
4337 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindSampledImages != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindSampledImages ||
4338 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindStorageImages != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindStorageImages ||
4339 descriptorIndexingProperties[0].maxDescriptorSetUpdateAfterBindInputAttachments != descriptorIndexingProperties[1].maxDescriptorSetUpdateAfterBindInputAttachments ))
4341 TCU_FAIL("Mismatch between VkPhysicalDeviceDescriptorIndexingProperties");
4343 if (khr_sampler_filter_minmax &&
4344 (samplerFilterMinmaxProperties[0].filterMinmaxSingleComponentFormats != samplerFilterMinmaxProperties[1].filterMinmaxSingleComponentFormats ||
4345 samplerFilterMinmaxProperties[0].filterMinmaxImageComponentMapping != samplerFilterMinmaxProperties[1].filterMinmaxImageComponentMapping))
4347 TCU_FAIL("Mismatch between VkPhysicalDeviceSamplerFilterMinmaxProperties");
4350 if (khr_integer_dot_product &&
4351 (integerDotProductProperties[0].integerDotProduct8BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct8BitUnsignedAccelerated ||
4352 integerDotProductProperties[0].integerDotProduct8BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct8BitSignedAccelerated ||
4353 integerDotProductProperties[0].integerDotProduct8BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct8BitMixedSignednessAccelerated ||
4354 integerDotProductProperties[0].integerDotProduct4x8BitPackedUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedUnsignedAccelerated ||
4355 integerDotProductProperties[0].integerDotProduct4x8BitPackedSignedAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedSignedAccelerated ||
4356 integerDotProductProperties[0].integerDotProduct4x8BitPackedMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct4x8BitPackedMixedSignednessAccelerated ||
4357 integerDotProductProperties[0].integerDotProduct16BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct16BitUnsignedAccelerated ||
4358 integerDotProductProperties[0].integerDotProduct16BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct16BitSignedAccelerated ||
4359 integerDotProductProperties[0].integerDotProduct16BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct16BitMixedSignednessAccelerated ||
4360 integerDotProductProperties[0].integerDotProduct32BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct32BitUnsignedAccelerated ||
4361 integerDotProductProperties[0].integerDotProduct32BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct32BitSignedAccelerated ||
4362 integerDotProductProperties[0].integerDotProduct32BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct32BitMixedSignednessAccelerated ||
4363 integerDotProductProperties[0].integerDotProduct64BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProduct64BitUnsignedAccelerated ||
4364 integerDotProductProperties[0].integerDotProduct64BitSignedAccelerated != integerDotProductProperties[1].integerDotProduct64BitSignedAccelerated ||
4365 integerDotProductProperties[0].integerDotProduct64BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProduct64BitMixedSignednessAccelerated ||
4366 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitUnsignedAccelerated ||
4367 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitSignedAccelerated ||
4368 integerDotProductProperties[0].integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated ||
4369 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated ||
4370 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated ||
4371 integerDotProductProperties[0].integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated ||
4372 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitUnsignedAccelerated ||
4373 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitSignedAccelerated ||
4374 integerDotProductProperties[0].integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated ||
4375 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitUnsignedAccelerated ||
4376 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitSignedAccelerated ||
4377 integerDotProductProperties[0].integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated ||
4378 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitUnsignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitUnsignedAccelerated ||
4379 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitSignedAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitSignedAccelerated ||
4380 integerDotProductProperties[0].integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated != integerDotProductProperties[1].integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated))
4382 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR");
4385 if (isExtensionSupported(properties, RequiredExtension("VK_KHR_push_descriptor")))
4387 VkPhysicalDevicePushDescriptorPropertiesKHR pushDescriptorProperties[count];
4389 for (int ndx = 0; ndx < count; ++ndx)
4391 deMemset(&pushDescriptorProperties[ndx], 0xFF * ndx, sizeof(VkPhysicalDevicePushDescriptorPropertiesKHR));
4393 pushDescriptorProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR;
4394 pushDescriptorProperties[ndx].pNext = DE_NULL;
4396 extProperties.pNext = &pushDescriptorProperties[ndx];
4398 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4400 pushDescriptorProperties[ndx].pNext = DE_NULL;
4403 log << TestLog::Message << pushDescriptorProperties[0] << TestLog::EndMessage;
4405 if ( pushDescriptorProperties[0].maxPushDescriptors != pushDescriptorProperties[1].maxPushDescriptors )
4407 TCU_FAIL("Mismatch between VkPhysicalDevicePushDescriptorPropertiesKHR ");
4409 if (pushDescriptorProperties[0].maxPushDescriptors < 32)
4411 TCU_FAIL("VkPhysicalDevicePushDescriptorPropertiesKHR.maxPushDescriptors must be at least 32");
4415 if (isExtensionSupported(properties, RequiredExtension("VK_KHR_performance_query")))
4417 VkPhysicalDevicePerformanceQueryPropertiesKHR performanceQueryProperties[count];
4419 for (int ndx = 0; ndx < count; ++ndx)
4421 deMemset(&performanceQueryProperties[ndx], 0xFF * ndx, sizeof(VkPhysicalDevicePerformanceQueryPropertiesKHR));
4422 performanceQueryProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR;
4423 performanceQueryProperties[ndx].pNext = DE_NULL;
4425 extProperties.pNext = &performanceQueryProperties[ndx];
4427 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4430 log << TestLog::Message << performanceQueryProperties[0] << TestLog::EndMessage;
4432 if (performanceQueryProperties[0].allowCommandBufferQueryCopies != performanceQueryProperties[1].allowCommandBufferQueryCopies)
4434 TCU_FAIL("Mismatch between VkPhysicalDevicePerformanceQueryPropertiesKHR");
4438 if (isExtensionSupported(properties, RequiredExtension("VK_EXT_pci_bus_info", 2, 2)))
4440 VkPhysicalDevicePCIBusInfoPropertiesEXT pciBusInfoProperties[count];
4442 for (int ndx = 0; ndx < count; ++ndx)
4444 // Each PCI device is identified by an 8-bit domain number, 5-bit
4445 // device number and 3-bit function number[1][2].
4447 // In addition, because PCI systems can be interconnected and
4448 // divided in segments, Linux assigns a 16-bit number to the device
4449 // as the "domain". In Windows, the segment or domain is stored in
4450 // the higher 24-bit section of the bus number.
4452 // This means the maximum unsigned 32-bit integer for these members
4453 // are invalid values and should change after querying properties.
4455 // [1] https://en.wikipedia.org/wiki/PCI_configuration_space
4456 // [2] PCI Express Base Specification Revision 3.0, section 2.2.4.2.
4457 deMemset(pciBusInfoProperties + ndx, 0xFF * ndx, sizeof(pciBusInfoProperties[ndx]));
4458 pciBusInfoProperties[ndx].pciDomain = DEUINT32_MAX;
4459 pciBusInfoProperties[ndx].pciBus = DEUINT32_MAX;
4460 pciBusInfoProperties[ndx].pciDevice = DEUINT32_MAX;
4461 pciBusInfoProperties[ndx].pciFunction = DEUINT32_MAX;
4463 pciBusInfoProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT;
4464 pciBusInfoProperties[ndx].pNext = DE_NULL;
4466 extProperties.pNext = pciBusInfoProperties + ndx;
4467 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4470 log << TestLog::Message << toString(pciBusInfoProperties[0]) << TestLog::EndMessage;
4472 if (pciBusInfoProperties[0].pciDomain != pciBusInfoProperties[1].pciDomain ||
4473 pciBusInfoProperties[0].pciBus != pciBusInfoProperties[1].pciBus ||
4474 pciBusInfoProperties[0].pciDevice != pciBusInfoProperties[1].pciDevice ||
4475 pciBusInfoProperties[0].pciFunction != pciBusInfoProperties[1].pciFunction)
4477 TCU_FAIL("Mismatch between VkPhysicalDevicePCIBusInfoPropertiesEXT");
4479 if (pciBusInfoProperties[0].pciDomain == DEUINT32_MAX ||
4480 pciBusInfoProperties[0].pciBus == DEUINT32_MAX ||
4481 pciBusInfoProperties[0].pciDevice == DEUINT32_MAX ||
4482 pciBusInfoProperties[0].pciFunction == DEUINT32_MAX)
4484 TCU_FAIL("Invalid information in VkPhysicalDevicePCIBusInfoPropertiesEXT");
4488 if (isExtensionSupported(properties, RequiredExtension("VK_KHR_portability_subset")))
4490 VkPhysicalDevicePortabilitySubsetPropertiesKHR portabilitySubsetProperties[count];
4492 for (int ndx = 0; ndx < count; ++ndx)
4494 deMemset(&portabilitySubsetProperties[ndx], 0xFF * ndx, sizeof(VkPhysicalDevicePortabilitySubsetPropertiesKHR));
4495 portabilitySubsetProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR;
4496 portabilitySubsetProperties[ndx].pNext = DE_NULL;
4498 extProperties.pNext = &portabilitySubsetProperties[ndx];
4500 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4503 log << TestLog::Message << portabilitySubsetProperties[0] << TestLog::EndMessage;
4505 if (portabilitySubsetProperties[0].minVertexInputBindingStrideAlignment != portabilitySubsetProperties[1].minVertexInputBindingStrideAlignment)
4507 TCU_FAIL("Mismatch between VkPhysicalDevicePortabilitySubsetPropertiesKHR");
4511 return tcu::TestStatus::pass("Querying device properties succeeded");
4514 string toString (const VkFormatProperties2& value)
4516 std::ostringstream s;
4517 s << "VkFormatProperties2 = {\n";
4518 s << "\tsType = " << value.sType << '\n';
4519 s << "\tformatProperties = {\n";
4520 s << "\tlinearTilingFeatures = " << getFormatFeatureFlagsStr(value.formatProperties.linearTilingFeatures) << '\n';
4521 s << "\toptimalTilingFeatures = " << getFormatFeatureFlagsStr(value.formatProperties.optimalTilingFeatures) << '\n';
4522 s << "\tbufferFeatures = " << getFormatFeatureFlagsStr(value.formatProperties.bufferFeatures) << '\n';
4528 tcu::TestStatus deviceFormatProperties2 (Context& context)
4530 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4531 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4532 const InstanceDriver& vki (instance.getDriver());
4533 TestLog& log = context.getTestContext().getLog();
4535 for (int formatNdx = 0; formatNdx < VK_CORE_FORMAT_LAST; ++formatNdx)
4537 const VkFormat format = (VkFormat)formatNdx;
4538 VkFormatProperties coreProperties;
4539 VkFormatProperties2 extProperties;
4541 deMemset(&coreProperties, 0xcd, sizeof(VkFormatProperties));
4542 deMemset(&extProperties, 0xcd, sizeof(VkFormatProperties2));
4544 extProperties.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
4545 extProperties.pNext = DE_NULL;
4547 vki.getPhysicalDeviceFormatProperties(physicalDevice, format, &coreProperties);
4548 vki.getPhysicalDeviceFormatProperties2(physicalDevice, format, &extProperties);
4550 TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2);
4551 TCU_CHECK(extProperties.pNext == DE_NULL);
4553 if (deMemCmp(&coreProperties, &extProperties.formatProperties, sizeof(VkFormatProperties)) != 0)
4554 TCU_FAIL("Mismatch between format properties reported by vkGetPhysicalDeviceFormatProperties and vkGetPhysicalDeviceFormatProperties2");
4556 log << TestLog::Message << toString (extProperties) << TestLog::EndMessage;
4559 return tcu::TestStatus::pass("Querying device format properties succeeded");
4562 tcu::TestStatus deviceQueueFamilyProperties2 (Context& context)
4564 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4565 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4566 const InstanceDriver& vki (instance.getDriver());
4567 TestLog& log = context.getTestContext().getLog();
4568 deUint32 numCoreQueueFamilies = ~0u;
4569 deUint32 numExtQueueFamilies = ~0u;
4571 vki.getPhysicalDeviceQueueFamilyProperties(physicalDevice, &numCoreQueueFamilies, DE_NULL);
4572 vki.getPhysicalDeviceQueueFamilyProperties2(physicalDevice, &numExtQueueFamilies, DE_NULL);
4574 TCU_CHECK_MSG(numCoreQueueFamilies == numExtQueueFamilies, "Different number of queue family properties reported");
4575 TCU_CHECK(numCoreQueueFamilies > 0);
4578 std::vector<VkQueueFamilyProperties> coreProperties (numCoreQueueFamilies);
4579 std::vector<VkQueueFamilyProperties2> extProperties (numExtQueueFamilies);
4581 deMemset(&coreProperties[0], 0xcd, sizeof(VkQueueFamilyProperties)*numCoreQueueFamilies);
4582 deMemset(&extProperties[0], 0xcd, sizeof(VkQueueFamilyProperties2)*numExtQueueFamilies);
4584 for (size_t ndx = 0; ndx < extProperties.size(); ++ndx)
4586 extProperties[ndx].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2;
4587 extProperties[ndx].pNext = DE_NULL;
4590 vki.getPhysicalDeviceQueueFamilyProperties(physicalDevice, &numCoreQueueFamilies, &coreProperties[0]);
4591 vki.getPhysicalDeviceQueueFamilyProperties2(physicalDevice, &numExtQueueFamilies, &extProperties[0]);
4593 TCU_CHECK((size_t)numCoreQueueFamilies == coreProperties.size());
4594 TCU_CHECK((size_t)numExtQueueFamilies == extProperties.size());
4595 DE_ASSERT(numCoreQueueFamilies == numExtQueueFamilies);
4597 for (size_t ndx = 0; ndx < extProperties.size(); ++ndx)
4599 TCU_CHECK(extProperties[ndx].sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2);
4600 TCU_CHECK(extProperties[ndx].pNext == DE_NULL);
4602 if (deMemCmp(&coreProperties[ndx], &extProperties[ndx].queueFamilyProperties, sizeof(VkQueueFamilyProperties)) != 0)
4603 TCU_FAIL("Mismatch between format properties reported by vkGetPhysicalDeviceQueueFamilyProperties and vkGetPhysicalDeviceQueueFamilyProperties2");
4605 log << TestLog::Message << " queueFamilyNdx = " << ndx <<TestLog::EndMessage
4606 << TestLog::Message << extProperties[ndx] << TestLog::EndMessage;
4610 return tcu::TestStatus::pass("Querying device queue family properties succeeded");
4613 tcu::TestStatus deviceMemoryProperties2 (Context& context)
4615 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4616 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4617 const InstanceDriver& vki (instance.getDriver());
4618 TestLog& log = context.getTestContext().getLog();
4619 VkPhysicalDeviceMemoryProperties coreProperties;
4620 VkPhysicalDeviceMemoryProperties2 extProperties;
4622 deMemset(&coreProperties, 0xcd, sizeof(VkPhysicalDeviceMemoryProperties));
4623 deMemset(&extProperties, 0xcd, sizeof(VkPhysicalDeviceMemoryProperties2));
4625 extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
4626 extProperties.pNext = DE_NULL;
4628 vki.getPhysicalDeviceMemoryProperties(physicalDevice, &coreProperties);
4629 vki.getPhysicalDeviceMemoryProperties2(physicalDevice, &extProperties);
4631 TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2);
4632 TCU_CHECK(extProperties.pNext == DE_NULL);
4634 if (deMemCmp(&coreProperties, &extProperties.memoryProperties, sizeof(VkPhysicalDeviceMemoryProperties)) != 0)
4635 TCU_FAIL("Mismatch between properties reported by vkGetPhysicalDeviceMemoryProperties and vkGetPhysicalDeviceMemoryProperties2");
4637 log << TestLog::Message << extProperties << TestLog::EndMessage;
4639 return tcu::TestStatus::pass("Querying device memory properties succeeded");
4642 tcu::TestStatus deviceFeaturesVulkan12 (Context& context)
4644 using namespace ValidateQueryBits;
4646 const QueryMemberTableEntry feature11OffsetTable[] =
4648 // VkPhysicalDevice16BitStorageFeatures
4649 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, storageBuffer16BitAccess),
4650 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, uniformAndStorageBuffer16BitAccess),
4651 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, storagePushConstant16),
4652 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, storageInputOutput16),
4654 // VkPhysicalDeviceMultiviewFeatures
4655 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, multiview),
4656 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, multiviewGeometryShader),
4657 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, multiviewTessellationShader),
4659 // VkPhysicalDeviceVariablePointersFeatures
4660 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, variablePointersStorageBuffer),
4661 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, variablePointers),
4663 // VkPhysicalDeviceProtectedMemoryFeatures
4664 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, protectedMemory),
4666 // VkPhysicalDeviceSamplerYcbcrConversionFeatures
4667 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, samplerYcbcrConversion),
4669 // VkPhysicalDeviceShaderDrawParametersFeatures
4670 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Features, shaderDrawParameters),
4673 const QueryMemberTableEntry feature12OffsetTable[] =
4676 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, samplerMirrorClampToEdge),
4677 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, drawIndirectCount),
4679 // VkPhysicalDevice8BitStorageFeatures
4680 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, storageBuffer8BitAccess),
4681 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, uniformAndStorageBuffer8BitAccess),
4682 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, storagePushConstant8),
4684 // VkPhysicalDeviceShaderAtomicInt64Features
4685 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderBufferInt64Atomics),
4686 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderSharedInt64Atomics),
4688 // VkPhysicalDeviceShaderFloat16Int8Features
4689 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderFloat16),
4690 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderInt8),
4692 // VkPhysicalDeviceDescriptorIndexingFeatures
4693 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorIndexing),
4694 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderInputAttachmentArrayDynamicIndexing),
4695 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderUniformTexelBufferArrayDynamicIndexing),
4696 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderStorageTexelBufferArrayDynamicIndexing),
4697 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderUniformBufferArrayNonUniformIndexing),
4698 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderSampledImageArrayNonUniformIndexing),
4699 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderStorageBufferArrayNonUniformIndexing),
4700 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderStorageImageArrayNonUniformIndexing),
4701 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderInputAttachmentArrayNonUniformIndexing),
4702 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderUniformTexelBufferArrayNonUniformIndexing),
4703 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderStorageTexelBufferArrayNonUniformIndexing),
4704 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingUniformBufferUpdateAfterBind),
4705 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingSampledImageUpdateAfterBind),
4706 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingStorageImageUpdateAfterBind),
4707 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingStorageBufferUpdateAfterBind),
4708 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingUniformTexelBufferUpdateAfterBind),
4709 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingStorageTexelBufferUpdateAfterBind),
4710 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingUpdateUnusedWhilePending),
4711 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingPartiallyBound),
4712 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, descriptorBindingVariableDescriptorCount),
4713 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, runtimeDescriptorArray),
4716 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, samplerFilterMinmax),
4718 // VkPhysicalDeviceScalarBlockLayoutFeatures
4719 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, scalarBlockLayout),
4721 // VkPhysicalDeviceImagelessFramebufferFeatures
4722 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, imagelessFramebuffer),
4724 // VkPhysicalDeviceUniformBufferStandardLayoutFeatures
4725 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, uniformBufferStandardLayout),
4727 // VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures
4728 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderSubgroupExtendedTypes),
4730 // VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures
4731 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, separateDepthStencilLayouts),
4733 // VkPhysicalDeviceHostQueryResetFeatures
4734 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, hostQueryReset),
4736 // VkPhysicalDeviceTimelineSemaphoreFeatures
4737 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, timelineSemaphore),
4739 // VkPhysicalDeviceBufferDeviceAddressFeatures
4740 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, bufferDeviceAddress),
4741 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, bufferDeviceAddressCaptureReplay),
4742 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, bufferDeviceAddressMultiDevice),
4744 // VkPhysicalDeviceVulkanMemoryModelFeatures
4745 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, vulkanMemoryModel),
4746 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, vulkanMemoryModelDeviceScope),
4747 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, vulkanMemoryModelAvailabilityVisibilityChains),
4750 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderOutputViewportIndex),
4751 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, shaderOutputLayer),
4752 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Features, subgroupBroadcastDynamicId),
4755 TestLog& log = context.getTestContext().getLog();
4756 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4757 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4758 const InstanceDriver& vki = instance.getDriver();
4759 const deUint32 vulkan11FeaturesBufferSize = sizeof(VkPhysicalDeviceVulkan11Features) + GUARD_SIZE;
4760 const deUint32 vulkan12FeaturesBufferSize = sizeof(VkPhysicalDeviceVulkan12Features) + GUARD_SIZE;
4761 VkPhysicalDeviceFeatures2 extFeatures;
4762 deUint8 buffer11a[vulkan11FeaturesBufferSize];
4763 deUint8 buffer11b[vulkan11FeaturesBufferSize];
4764 deUint8 buffer12a[vulkan12FeaturesBufferSize];
4765 deUint8 buffer12b[vulkan12FeaturesBufferSize];
4766 const int count = 2u;
4767 VkPhysicalDeviceVulkan11Features* vulkan11Features[count] = { (VkPhysicalDeviceVulkan11Features*)(buffer11a), (VkPhysicalDeviceVulkan11Features*)(buffer11b)};
4768 VkPhysicalDeviceVulkan12Features* vulkan12Features[count] = { (VkPhysicalDeviceVulkan12Features*)(buffer12a), (VkPhysicalDeviceVulkan12Features*)(buffer12b)};
4770 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
4771 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
4773 deMemset(buffer11b, GUARD_VALUE, sizeof(buffer11b));
4774 deMemset(buffer12a, GUARD_VALUE, sizeof(buffer12a));
4775 deMemset(buffer12b, GUARD_VALUE, sizeof(buffer12b));
4776 deMemset(buffer11a, GUARD_VALUE, sizeof(buffer11a));
4778 // Validate all fields initialized
4779 for (int ndx = 0; ndx < count; ++ndx)
4781 deMemset(&extFeatures.features, 0x00, sizeof(extFeatures.features));
4782 extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
4783 extFeatures.pNext = vulkan11Features[ndx];
4785 deMemset(vulkan11Features[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan11Features));
4786 vulkan11Features[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
4787 vulkan11Features[ndx]->pNext = vulkan12Features[ndx];
4789 deMemset(vulkan12Features[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan12Features));
4790 vulkan12Features[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
4791 vulkan12Features[ndx]->pNext = DE_NULL;
4793 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
4796 log << TestLog::Message << *vulkan11Features[0] << TestLog::EndMessage;
4797 log << TestLog::Message << *vulkan12Features[0] << TestLog::EndMessage;
4799 if (!validateStructsWithGuard(feature11OffsetTable, vulkan11Features, GUARD_VALUE, GUARD_SIZE))
4801 log << TestLog::Message << "deviceFeatures - VkPhysicalDeviceVulkan11Features initialization failure" << TestLog::EndMessage;
4803 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan11Features initialization failure");
4806 if (!validateStructsWithGuard(feature12OffsetTable, vulkan12Features, GUARD_VALUE, GUARD_SIZE))
4808 log << TestLog::Message << "deviceFeatures - VkPhysicalDeviceVulkan12Features initialization failure" << TestLog::EndMessage;
4810 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan12Features initialization failure");
4813 return tcu::TestStatus::pass("Querying Vulkan 1.2 device features succeeded");
4816 tcu::TestStatus devicePropertiesVulkan12 (Context& context)
4818 using namespace ValidateQueryBits;
4820 const QueryMemberTableEntry properties11OffsetTable[] =
4822 // VkPhysicalDeviceIDProperties
4823 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, deviceUUID),
4824 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, driverUUID),
4825 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, deviceLUID),
4826 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, deviceNodeMask),
4827 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, deviceLUIDValid),
4829 // VkPhysicalDeviceSubgroupProperties
4830 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, subgroupSize),
4831 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, subgroupSupportedStages),
4832 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, subgroupSupportedOperations),
4833 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, subgroupQuadOperationsInAllStages),
4835 // VkPhysicalDevicePointClippingProperties
4836 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, pointClippingBehavior),
4838 // VkPhysicalDeviceMultiviewProperties
4839 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, maxMultiviewViewCount),
4840 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, maxMultiviewInstanceIndex),
4842 // VkPhysicalDeviceProtectedMemoryProperties
4843 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, protectedNoFault),
4845 // VkPhysicalDeviceMaintenance3Properties
4846 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, maxPerSetDescriptors),
4847 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan11Properties, maxMemoryAllocationSize),
4850 const QueryMemberTableEntry properties12OffsetTable[] =
4852 // VkPhysicalDeviceDriverProperties
4853 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, driverID),
4854 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, conformanceVersion),
4856 // VkPhysicalDeviceFloatControlsProperties
4857 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, denormBehaviorIndependence),
4858 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, roundingModeIndependence),
4859 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderSignedZeroInfNanPreserveFloat16),
4860 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderSignedZeroInfNanPreserveFloat32),
4861 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderSignedZeroInfNanPreserveFloat64),
4862 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormPreserveFloat16),
4863 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormPreserveFloat32),
4864 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormPreserveFloat64),
4865 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormFlushToZeroFloat16),
4866 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormFlushToZeroFloat32),
4867 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderDenormFlushToZeroFloat64),
4868 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTEFloat16),
4869 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTEFloat32),
4870 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTEFloat64),
4871 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTZFloat16),
4872 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTZFloat32),
4873 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderRoundingModeRTZFloat64),
4875 // VkPhysicalDeviceDescriptorIndexingProperties
4876 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxUpdateAfterBindDescriptorsInAllPools),
4877 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderUniformBufferArrayNonUniformIndexingNative),
4878 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderSampledImageArrayNonUniformIndexingNative),
4879 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderStorageBufferArrayNonUniformIndexingNative),
4880 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderStorageImageArrayNonUniformIndexingNative),
4881 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, shaderInputAttachmentArrayNonUniformIndexingNative),
4882 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, robustBufferAccessUpdateAfterBind),
4883 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, quadDivergentImplicitLod),
4884 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindSamplers),
4885 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindUniformBuffers),
4886 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindStorageBuffers),
4887 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindSampledImages),
4888 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindStorageImages),
4889 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageDescriptorUpdateAfterBindInputAttachments),
4890 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxPerStageUpdateAfterBindResources),
4891 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindSamplers),
4892 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindUniformBuffers),
4893 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindUniformBuffersDynamic),
4894 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindStorageBuffers),
4895 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindStorageBuffersDynamic),
4896 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindSampledImages),
4897 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindStorageImages),
4898 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxDescriptorSetUpdateAfterBindInputAttachments),
4900 // VkPhysicalDeviceDepthStencilResolveProperties
4901 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, supportedDepthResolveModes),
4902 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, supportedStencilResolveModes),
4903 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, independentResolveNone),
4904 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, independentResolve),
4906 // VkPhysicalDeviceSamplerFilterMinmaxProperties
4907 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, filterMinmaxSingleComponentFormats),
4908 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, filterMinmaxImageComponentMapping),
4910 // VkPhysicalDeviceTimelineSemaphoreProperties
4911 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, maxTimelineSemaphoreValueDifference),
4914 OFFSET_TABLE_ENTRY(VkPhysicalDeviceVulkan12Properties, framebufferIntegerColorSampleCounts),
4917 TestLog& log = context.getTestContext().getLog();
4918 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4919 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4920 const InstanceDriver& vki = instance.getDriver();
4921 const deUint32 vulkan11PropertiesBufferSize = sizeof(VkPhysicalDeviceVulkan11Properties) + GUARD_SIZE;
4922 const deUint32 vulkan12PropertiesBufferSize = sizeof(VkPhysicalDeviceVulkan12Properties) + GUARD_SIZE;
4923 VkPhysicalDeviceProperties2 extProperties;
4924 deUint8 buffer11a[vulkan11PropertiesBufferSize];
4925 deUint8 buffer11b[vulkan11PropertiesBufferSize];
4926 deUint8 buffer12a[vulkan12PropertiesBufferSize];
4927 deUint8 buffer12b[vulkan12PropertiesBufferSize];
4928 const int count = 2u;
4929 VkPhysicalDeviceVulkan11Properties* vulkan11Properties[count] = { (VkPhysicalDeviceVulkan11Properties*)(buffer11a), (VkPhysicalDeviceVulkan11Properties*)(buffer11b)};
4930 VkPhysicalDeviceVulkan12Properties* vulkan12Properties[count] = { (VkPhysicalDeviceVulkan12Properties*)(buffer12a), (VkPhysicalDeviceVulkan12Properties*)(buffer12b)};
4932 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
4933 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
4935 deMemset(buffer11a, GUARD_VALUE, sizeof(buffer11a));
4936 deMemset(buffer11b, GUARD_VALUE, sizeof(buffer11b));
4937 deMemset(buffer12a, GUARD_VALUE, sizeof(buffer12a));
4938 deMemset(buffer12b, GUARD_VALUE, sizeof(buffer12b));
4940 for (int ndx = 0; ndx < count; ++ndx)
4942 deMemset(&extProperties.properties, 0x00, sizeof(extProperties.properties));
4943 extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
4944 extProperties.pNext = vulkan11Properties[ndx];
4946 deMemset(vulkan11Properties[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan11Properties));
4947 vulkan11Properties[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES;
4948 vulkan11Properties[ndx]->pNext = vulkan12Properties[ndx];
4950 deMemset(vulkan12Properties[ndx], 0xFF * ndx, sizeof(VkPhysicalDeviceVulkan12Properties));
4951 vulkan12Properties[ndx]->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES;
4952 vulkan12Properties[ndx]->pNext = DE_NULL;
4954 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
4957 log << TestLog::Message << *vulkan11Properties[0] << TestLog::EndMessage;
4958 log << TestLog::Message << *vulkan12Properties[0] << TestLog::EndMessage;
4960 if (!validateStructsWithGuard(properties11OffsetTable, vulkan11Properties, GUARD_VALUE, GUARD_SIZE))
4962 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceVulkan11Properties initialization failure" << TestLog::EndMessage;
4964 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan11Properties initialization failure");
4967 if (!validateStructsWithGuard(properties12OffsetTable, vulkan12Properties, GUARD_VALUE, GUARD_SIZE) ||
4968 strncmp(vulkan12Properties[0]->driverName, vulkan12Properties[1]->driverName, VK_MAX_DRIVER_NAME_SIZE) != 0 ||
4969 strncmp(vulkan12Properties[0]->driverInfo, vulkan12Properties[1]->driverInfo, VK_MAX_DRIVER_INFO_SIZE) != 0 )
4971 log << TestLog::Message << "deviceProperties - VkPhysicalDeviceVulkan12Properties initialization failure" << TestLog::EndMessage;
4973 return tcu::TestStatus::fail("VkPhysicalDeviceVulkan12Properties initialization failure");
4976 return tcu::TestStatus::pass("Querying Vulkan 1.2 device properties succeeded");
4979 tcu::TestStatus deviceFeatureExtensionsConsistencyVulkan12(Context& context)
4981 TestLog& log = context.getTestContext().getLog();
4982 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
4983 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
4984 const InstanceDriver& vki = instance.getDriver();
4986 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
4987 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
4989 VkPhysicalDeviceVulkan12Features vulkan12Features = initVulkanStructure();
4990 VkPhysicalDeviceVulkan11Features vulkan11Features = initVulkanStructure(&vulkan12Features);
4991 VkPhysicalDeviceFeatures2 extFeatures = initVulkanStructure(&vulkan11Features);
4993 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
4995 log << TestLog::Message << vulkan11Features << TestLog::EndMessage;
4996 log << TestLog::Message << vulkan12Features << TestLog::EndMessage;
4998 // Validate if proper VkPhysicalDeviceVulkanXXFeatures fields are set when corresponding extensions are present
4999 std::pair<std::pair<const char*,const char*>, VkBool32> extensions2validate[] =
5001 { { "VK_KHR_sampler_mirror_clamp_to_edge", "VkPhysicalDeviceVulkan12Features.samplerMirrorClampToEdge" }, vulkan12Features.samplerMirrorClampToEdge },
5002 { { "VK_KHR_draw_indirect_count", "VkPhysicalDeviceVulkan12Features.drawIndirectCount" }, vulkan12Features.drawIndirectCount },
5003 { { "VK_EXT_descriptor_indexing", "VkPhysicalDeviceVulkan12Features.descriptorIndexing" }, vulkan12Features.descriptorIndexing },
5004 { { "VK_EXT_sampler_filter_minmax", "VkPhysicalDeviceVulkan12Features.samplerFilterMinmax" }, vulkan12Features.samplerFilterMinmax },
5005 { { "VK_EXT_shader_viewport_index_layer", "VkPhysicalDeviceVulkan12Features.shaderOutputViewportIndex" }, vulkan12Features.shaderOutputViewportIndex },
5006 { { "VK_EXT_shader_viewport_index_layer", "VkPhysicalDeviceVulkan12Features.shaderOutputLayer" }, vulkan12Features.shaderOutputLayer }
5008 vector<VkExtensionProperties> extensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
5009 for (const auto& ext : extensions2validate)
5010 if (checkExtension(extensionProperties, ext.first.first) && !ext.second)
5011 TCU_FAIL(string("Mismatch between extension ") + ext.first.first + " and " + ext.first.second);
5013 // collect all extension features
5015 VkPhysicalDevice16BitStorageFeatures device16BitStorageFeatures = initVulkanStructure();
5016 VkPhysicalDeviceMultiviewFeatures deviceMultiviewFeatures = initVulkanStructure(&device16BitStorageFeatures);
5017 VkPhysicalDeviceProtectedMemoryFeatures protectedMemoryFeatures = initVulkanStructure(&deviceMultiviewFeatures);
5018 VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYcbcrConversionFeatures = initVulkanStructure(&protectedMemoryFeatures);
5019 VkPhysicalDeviceShaderDrawParametersFeatures shaderDrawParametersFeatures = initVulkanStructure(&samplerYcbcrConversionFeatures);
5020 VkPhysicalDeviceVariablePointersFeatures variablePointerFeatures = initVulkanStructure(&shaderDrawParametersFeatures);
5021 VkPhysicalDevice8BitStorageFeatures device8BitStorageFeatures = initVulkanStructure(&variablePointerFeatures);
5022 VkPhysicalDeviceShaderAtomicInt64Features shaderAtomicInt64Features = initVulkanStructure(&device8BitStorageFeatures);
5023 VkPhysicalDeviceShaderFloat16Int8Features shaderFloat16Int8Features = initVulkanStructure(&shaderAtomicInt64Features);
5024 VkPhysicalDeviceDescriptorIndexingFeatures descriptorIndexingFeatures = initVulkanStructure(&shaderFloat16Int8Features);
5025 VkPhysicalDeviceScalarBlockLayoutFeatures scalarBlockLayoutFeatures = initVulkanStructure(&descriptorIndexingFeatures);
5026 VkPhysicalDeviceImagelessFramebufferFeatures imagelessFramebufferFeatures = initVulkanStructure(&scalarBlockLayoutFeatures);
5027 VkPhysicalDeviceUniformBufferStandardLayoutFeatures uniformBufferStandardLayoutFeatures = initVulkanStructure(&imagelessFramebufferFeatures);
5028 VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures shaderSubgroupExtendedTypesFeatures = initVulkanStructure(&uniformBufferStandardLayoutFeatures);
5029 VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures separateDepthStencilLayoutsFeatures = initVulkanStructure(&shaderSubgroupExtendedTypesFeatures);
5030 VkPhysicalDeviceHostQueryResetFeatures hostQueryResetFeatures = initVulkanStructure(&separateDepthStencilLayoutsFeatures);
5031 VkPhysicalDeviceTimelineSemaphoreFeatures timelineSemaphoreFeatures = initVulkanStructure(&hostQueryResetFeatures);
5032 VkPhysicalDeviceBufferDeviceAddressFeatures bufferDeviceAddressFeatures = initVulkanStructure(&timelineSemaphoreFeatures);
5033 VkPhysicalDeviceVulkanMemoryModelFeatures vulkanMemoryModelFeatures = initVulkanStructure(&bufferDeviceAddressFeatures);
5034 extFeatures = initVulkanStructure(&vulkanMemoryModelFeatures);
5036 vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
5038 log << TestLog::Message << extFeatures << TestLog::EndMessage;
5039 log << TestLog::Message << device16BitStorageFeatures << TestLog::EndMessage;
5040 log << TestLog::Message << deviceMultiviewFeatures << TestLog::EndMessage;
5041 log << TestLog::Message << protectedMemoryFeatures << TestLog::EndMessage;
5042 log << TestLog::Message << samplerYcbcrConversionFeatures << TestLog::EndMessage;
5043 log << TestLog::Message << shaderDrawParametersFeatures << TestLog::EndMessage;
5044 log << TestLog::Message << variablePointerFeatures << TestLog::EndMessage;
5045 log << TestLog::Message << device8BitStorageFeatures << TestLog::EndMessage;
5046 log << TestLog::Message << shaderAtomicInt64Features << TestLog::EndMessage;
5047 log << TestLog::Message << shaderFloat16Int8Features << TestLog::EndMessage;
5048 log << TestLog::Message << descriptorIndexingFeatures << TestLog::EndMessage;
5049 log << TestLog::Message << scalarBlockLayoutFeatures << TestLog::EndMessage;
5050 log << TestLog::Message << imagelessFramebufferFeatures << TestLog::EndMessage;
5051 log << TestLog::Message << uniformBufferStandardLayoutFeatures << TestLog::EndMessage;
5052 log << TestLog::Message << shaderSubgroupExtendedTypesFeatures << TestLog::EndMessage;
5053 log << TestLog::Message << separateDepthStencilLayoutsFeatures << TestLog::EndMessage;
5054 log << TestLog::Message << hostQueryResetFeatures << TestLog::EndMessage;
5055 log << TestLog::Message << timelineSemaphoreFeatures << TestLog::EndMessage;
5056 log << TestLog::Message << bufferDeviceAddressFeatures << TestLog::EndMessage;
5057 log << TestLog::Message << vulkanMemoryModelFeatures << TestLog::EndMessage;
5059 if (( device16BitStorageFeatures.storageBuffer16BitAccess != vulkan11Features.storageBuffer16BitAccess ||
5060 device16BitStorageFeatures.uniformAndStorageBuffer16BitAccess != vulkan11Features.uniformAndStorageBuffer16BitAccess ||
5061 device16BitStorageFeatures.storagePushConstant16 != vulkan11Features.storagePushConstant16 ||
5062 device16BitStorageFeatures.storageInputOutput16 != vulkan11Features.storageInputOutput16 ))
5064 TCU_FAIL("Mismatch between VkPhysicalDevice16BitStorageFeatures and VkPhysicalDeviceVulkan11Features");
5067 if (( deviceMultiviewFeatures.multiview != vulkan11Features.multiview ||
5068 deviceMultiviewFeatures.multiviewGeometryShader != vulkan11Features.multiviewGeometryShader ||
5069 deviceMultiviewFeatures.multiviewTessellationShader != vulkan11Features.multiviewTessellationShader ))
5071 TCU_FAIL("Mismatch between VkPhysicalDeviceMultiviewFeatures and VkPhysicalDeviceVulkan11Features");
5074 if ( (protectedMemoryFeatures.protectedMemory != vulkan11Features.protectedMemory ))
5076 TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryFeatures and VkPhysicalDeviceVulkan11Features");
5079 if ( (samplerYcbcrConversionFeatures.samplerYcbcrConversion != vulkan11Features.samplerYcbcrConversion ))
5081 TCU_FAIL("Mismatch between VkPhysicalDeviceSamplerYcbcrConversionFeatures and VkPhysicalDeviceVulkan11Features");
5084 if ( (shaderDrawParametersFeatures.shaderDrawParameters != vulkan11Features.shaderDrawParameters ))
5086 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderDrawParametersFeatures and VkPhysicalDeviceVulkan11Features");
5089 if (( variablePointerFeatures.variablePointersStorageBuffer != vulkan11Features.variablePointersStorageBuffer ||
5090 variablePointerFeatures.variablePointers != vulkan11Features.variablePointers))
5092 TCU_FAIL("Mismatch between VkPhysicalDeviceVariablePointersFeatures and VkPhysicalDeviceVulkan11Features");
5095 if (( device8BitStorageFeatures.storageBuffer8BitAccess != vulkan12Features.storageBuffer8BitAccess ||
5096 device8BitStorageFeatures.uniformAndStorageBuffer8BitAccess != vulkan12Features.uniformAndStorageBuffer8BitAccess ||
5097 device8BitStorageFeatures.storagePushConstant8 != vulkan12Features.storagePushConstant8 ))
5099 TCU_FAIL("Mismatch between VkPhysicalDevice8BitStorageFeatures and VkPhysicalDeviceVulkan12Features");
5102 if (( shaderAtomicInt64Features.shaderBufferInt64Atomics != vulkan12Features.shaderBufferInt64Atomics ||
5103 shaderAtomicInt64Features.shaderSharedInt64Atomics != vulkan12Features.shaderSharedInt64Atomics ))
5105 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderAtomicInt64Features and VkPhysicalDeviceVulkan12Features");
5108 if (( shaderFloat16Int8Features.shaderFloat16 != vulkan12Features.shaderFloat16 ||
5109 shaderFloat16Int8Features.shaderInt8 != vulkan12Features.shaderInt8 ))
5111 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderFloat16Int8Features and VkPhysicalDeviceVulkan12Features");
5114 if ((vulkan12Features.descriptorIndexing) &&
5115 ( descriptorIndexingFeatures.shaderInputAttachmentArrayDynamicIndexing != vulkan12Features.shaderInputAttachmentArrayDynamicIndexing ||
5116 descriptorIndexingFeatures.shaderUniformTexelBufferArrayDynamicIndexing != vulkan12Features.shaderUniformTexelBufferArrayDynamicIndexing ||
5117 descriptorIndexingFeatures.shaderStorageTexelBufferArrayDynamicIndexing != vulkan12Features.shaderStorageTexelBufferArrayDynamicIndexing ||
5118 descriptorIndexingFeatures.shaderUniformBufferArrayNonUniformIndexing != vulkan12Features.shaderUniformBufferArrayNonUniformIndexing ||
5119 descriptorIndexingFeatures.shaderSampledImageArrayNonUniformIndexing != vulkan12Features.shaderSampledImageArrayNonUniformIndexing ||
5120 descriptorIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing != vulkan12Features.shaderStorageBufferArrayNonUniformIndexing ||
5121 descriptorIndexingFeatures.shaderStorageImageArrayNonUniformIndexing != vulkan12Features.shaderStorageImageArrayNonUniformIndexing ||
5122 descriptorIndexingFeatures.shaderInputAttachmentArrayNonUniformIndexing != vulkan12Features.shaderInputAttachmentArrayNonUniformIndexing ||
5123 descriptorIndexingFeatures.shaderUniformTexelBufferArrayNonUniformIndexing != vulkan12Features.shaderUniformTexelBufferArrayNonUniformIndexing ||
5124 descriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing != vulkan12Features.shaderStorageTexelBufferArrayNonUniformIndexing ||
5125 descriptorIndexingFeatures.descriptorBindingUniformBufferUpdateAfterBind != vulkan12Features.descriptorBindingUniformBufferUpdateAfterBind ||
5126 descriptorIndexingFeatures.descriptorBindingSampledImageUpdateAfterBind != vulkan12Features.descriptorBindingSampledImageUpdateAfterBind ||
5127 descriptorIndexingFeatures.descriptorBindingStorageImageUpdateAfterBind != vulkan12Features.descriptorBindingStorageImageUpdateAfterBind ||
5128 descriptorIndexingFeatures.descriptorBindingStorageBufferUpdateAfterBind != vulkan12Features.descriptorBindingStorageBufferUpdateAfterBind ||
5129 descriptorIndexingFeatures.descriptorBindingUniformTexelBufferUpdateAfterBind != vulkan12Features.descriptorBindingUniformTexelBufferUpdateAfterBind ||
5130 descriptorIndexingFeatures.descriptorBindingStorageTexelBufferUpdateAfterBind != vulkan12Features.descriptorBindingStorageTexelBufferUpdateAfterBind ||
5131 descriptorIndexingFeatures.descriptorBindingUpdateUnusedWhilePending != vulkan12Features.descriptorBindingUpdateUnusedWhilePending ||
5132 descriptorIndexingFeatures.descriptorBindingPartiallyBound != vulkan12Features.descriptorBindingPartiallyBound ||
5133 descriptorIndexingFeatures.descriptorBindingVariableDescriptorCount != vulkan12Features.descriptorBindingVariableDescriptorCount ||
5134 descriptorIndexingFeatures.runtimeDescriptorArray != vulkan12Features.runtimeDescriptorArray ))
5136 TCU_FAIL("Mismatch between VkPhysicalDeviceDescriptorIndexingFeatures and VkPhysicalDeviceVulkan12Features");
5139 if (( scalarBlockLayoutFeatures.scalarBlockLayout != vulkan12Features.scalarBlockLayout ))
5141 TCU_FAIL("Mismatch between VkPhysicalDeviceScalarBlockLayoutFeatures and VkPhysicalDeviceVulkan12Features");
5144 if (( imagelessFramebufferFeatures.imagelessFramebuffer != vulkan12Features.imagelessFramebuffer ))
5146 TCU_FAIL("Mismatch between VkPhysicalDeviceImagelessFramebufferFeatures and VkPhysicalDeviceVulkan12Features");
5149 if (( uniformBufferStandardLayoutFeatures.uniformBufferStandardLayout != vulkan12Features.uniformBufferStandardLayout ))
5151 TCU_FAIL("Mismatch between VkPhysicalDeviceUniformBufferStandardLayoutFeatures and VkPhysicalDeviceVulkan12Features");
5154 if (( shaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes != vulkan12Features.shaderSubgroupExtendedTypes ))
5156 TCU_FAIL("Mismatch between VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures and VkPhysicalDeviceVulkan12Features");
5159 if (( separateDepthStencilLayoutsFeatures.separateDepthStencilLayouts != vulkan12Features.separateDepthStencilLayouts ))
5161 TCU_FAIL("Mismatch between VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures and VkPhysicalDeviceVulkan12Features");
5164 if (( hostQueryResetFeatures.hostQueryReset != vulkan12Features.hostQueryReset ))
5166 TCU_FAIL("Mismatch between VkPhysicalDeviceHostQueryResetFeatures and VkPhysicalDeviceVulkan12Features");
5169 if (( timelineSemaphoreFeatures.timelineSemaphore != vulkan12Features.timelineSemaphore ))
5171 TCU_FAIL("Mismatch between VkPhysicalDeviceTimelineSemaphoreFeatures and VkPhysicalDeviceVulkan12Features");
5174 if (( bufferDeviceAddressFeatures.bufferDeviceAddress != vulkan12Features.bufferDeviceAddress ||
5175 bufferDeviceAddressFeatures.bufferDeviceAddressCaptureReplay != vulkan12Features.bufferDeviceAddressCaptureReplay ||
5176 bufferDeviceAddressFeatures.bufferDeviceAddressMultiDevice != vulkan12Features.bufferDeviceAddressMultiDevice ))
5178 TCU_FAIL("Mismatch between VkPhysicalDeviceBufferDeviceAddressFeatures and VkPhysicalDeviceVulkan12Features");
5181 if (( vulkanMemoryModelFeatures.vulkanMemoryModel != vulkan12Features.vulkanMemoryModel ||
5182 vulkanMemoryModelFeatures.vulkanMemoryModelDeviceScope != vulkan12Features.vulkanMemoryModelDeviceScope ||
5183 vulkanMemoryModelFeatures.vulkanMemoryModelAvailabilityVisibilityChains != vulkan12Features.vulkanMemoryModelAvailabilityVisibilityChains ))
5185 TCU_FAIL("Mismatch between VkPhysicalDeviceVulkanMemoryModelFeatures and VkPhysicalDeviceVulkan12Features");
5189 return tcu::TestStatus::pass("Vulkan 1.2 device features are consistent with extensions");
5192 tcu::TestStatus devicePropertyExtensionsConsistencyVulkan12(Context& context)
5194 TestLog& log = context.getTestContext().getLog();
5195 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
5196 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5197 const InstanceDriver& vki = instance.getDriver();
5199 if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
5200 TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
5202 VkPhysicalDeviceVulkan12Properties vulkan12Properties = initVulkanStructure();
5203 VkPhysicalDeviceVulkan11Properties vulkan11Properties = initVulkanStructure(&vulkan12Properties);
5204 VkPhysicalDeviceProperties2 extProperties = initVulkanStructure(&vulkan11Properties);
5206 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
5208 log << TestLog::Message << vulkan11Properties << TestLog::EndMessage;
5209 log << TestLog::Message << vulkan12Properties << TestLog::EndMessage;
5211 // Validate all fields initialized matching to extension structures
5213 VkPhysicalDeviceIDProperties idProperties = initVulkanStructure();
5214 VkPhysicalDeviceSubgroupProperties subgroupProperties = initVulkanStructure(&idProperties);
5215 VkPhysicalDevicePointClippingProperties pointClippingProperties = initVulkanStructure(&subgroupProperties);
5216 VkPhysicalDeviceMultiviewProperties multiviewProperties = initVulkanStructure(&pointClippingProperties);
5217 VkPhysicalDeviceProtectedMemoryProperties protectedMemoryPropertiesKHR = initVulkanStructure(&multiviewProperties);
5218 VkPhysicalDeviceMaintenance3Properties maintenance3Properties = initVulkanStructure(&protectedMemoryPropertiesKHR);
5219 VkPhysicalDeviceDriverProperties driverProperties = initVulkanStructure(&maintenance3Properties);
5220 VkPhysicalDeviceFloatControlsProperties floatControlsProperties = initVulkanStructure(&driverProperties);
5221 VkPhysicalDeviceDescriptorIndexingProperties descriptorIndexingProperties = initVulkanStructure(&floatControlsProperties);
5222 VkPhysicalDeviceDepthStencilResolveProperties depthStencilResolveProperties = initVulkanStructure(&descriptorIndexingProperties);
5223 VkPhysicalDeviceSamplerFilterMinmaxProperties samplerFilterMinmaxProperties = initVulkanStructure(&depthStencilResolveProperties);
5224 VkPhysicalDeviceTimelineSemaphoreProperties timelineSemaphoreProperties = initVulkanStructure(&samplerFilterMinmaxProperties);
5225 extProperties = initVulkanStructure(&timelineSemaphoreProperties);
5227 vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
5229 if ((deMemCmp(idProperties.deviceUUID, vulkan11Properties.deviceUUID, VK_UUID_SIZE) != 0) ||
5230 (deMemCmp(idProperties.driverUUID, vulkan11Properties.driverUUID, VK_UUID_SIZE) != 0) ||
5231 (idProperties.deviceLUIDValid != vulkan11Properties.deviceLUIDValid))
5233 TCU_FAIL("Mismatch between VkPhysicalDeviceIDProperties and VkPhysicalDeviceVulkan11Properties");
5235 else if (idProperties.deviceLUIDValid)
5237 // If deviceLUIDValid is VK_FALSE, the contents of deviceLUID and deviceNodeMask are undefined
5238 // so thay can only be compared when deviceLUIDValid is VK_TRUE.
5239 if ((deMemCmp(idProperties.deviceLUID, vulkan11Properties.deviceLUID, VK_LUID_SIZE) != 0) ||
5240 (idProperties.deviceNodeMask != vulkan11Properties.deviceNodeMask))
5242 TCU_FAIL("Mismatch between VkPhysicalDeviceIDProperties and VkPhysicalDeviceVulkan11Properties");
5246 if ((subgroupProperties.subgroupSize != vulkan11Properties.subgroupSize ||
5247 subgroupProperties.supportedStages != vulkan11Properties.subgroupSupportedStages ||
5248 subgroupProperties.supportedOperations != vulkan11Properties.subgroupSupportedOperations ||
5249 subgroupProperties.quadOperationsInAllStages != vulkan11Properties.subgroupQuadOperationsInAllStages))
5251 TCU_FAIL("Mismatch between VkPhysicalDeviceSubgroupProperties and VkPhysicalDeviceVulkan11Properties");
5254 if ((pointClippingProperties.pointClippingBehavior != vulkan11Properties.pointClippingBehavior))
5256 TCU_FAIL("Mismatch between VkPhysicalDevicePointClippingProperties and VkPhysicalDeviceVulkan11Properties");
5259 if ((multiviewProperties.maxMultiviewViewCount != vulkan11Properties.maxMultiviewViewCount ||
5260 multiviewProperties.maxMultiviewInstanceIndex != vulkan11Properties.maxMultiviewInstanceIndex))
5262 TCU_FAIL("Mismatch between VkPhysicalDeviceMultiviewProperties and VkPhysicalDeviceVulkan11Properties");
5265 if ((protectedMemoryPropertiesKHR.protectedNoFault != vulkan11Properties.protectedNoFault))
5267 TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryProperties and VkPhysicalDeviceVulkan11Properties");
5270 if ((maintenance3Properties.maxPerSetDescriptors != vulkan11Properties.maxPerSetDescriptors ||
5271 maintenance3Properties.maxMemoryAllocationSize != vulkan11Properties.maxMemoryAllocationSize))
5273 TCU_FAIL("Mismatch between VkPhysicalDeviceMaintenance3Properties and VkPhysicalDeviceVulkan11Properties");
5276 if ((driverProperties.driverID != vulkan12Properties.driverID ||
5277 strncmp(driverProperties.driverName, vulkan12Properties.driverName, VK_MAX_DRIVER_NAME_SIZE) != 0 ||
5278 strncmp(driverProperties.driverInfo, vulkan12Properties.driverInfo, VK_MAX_DRIVER_INFO_SIZE) != 0 ||
5279 driverProperties.conformanceVersion.major != vulkan12Properties.conformanceVersion.major ||
5280 driverProperties.conformanceVersion.minor != vulkan12Properties.conformanceVersion.minor ||
5281 driverProperties.conformanceVersion.subminor != vulkan12Properties.conformanceVersion.subminor ||
5282 driverProperties.conformanceVersion.patch != vulkan12Properties.conformanceVersion.patch))
5284 TCU_FAIL("Mismatch between VkPhysicalDeviceDriverProperties and VkPhysicalDeviceVulkan12Properties");
5287 if ((floatControlsProperties.denormBehaviorIndependence != vulkan12Properties.denormBehaviorIndependence ||
5288 floatControlsProperties.roundingModeIndependence != vulkan12Properties.roundingModeIndependence ||
5289 floatControlsProperties.shaderSignedZeroInfNanPreserveFloat16 != vulkan12Properties.shaderSignedZeroInfNanPreserveFloat16 ||
5290 floatControlsProperties.shaderSignedZeroInfNanPreserveFloat32 != vulkan12Properties.shaderSignedZeroInfNanPreserveFloat32 ||
5291 floatControlsProperties.shaderSignedZeroInfNanPreserveFloat64 != vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64 ||
5292 floatControlsProperties.shaderDenormPreserveFloat16 != vulkan12Properties.shaderDenormPreserveFloat16 ||
5293 floatControlsProperties.shaderDenormPreserveFloat32 != vulkan12Properties.shaderDenormPreserveFloat32 ||
5294 floatControlsProperties.shaderDenormPreserveFloat64 != vulkan12Properties.shaderDenormPreserveFloat64 ||
5295 floatControlsProperties.shaderDenormFlushToZeroFloat16 != vulkan12Properties.shaderDenormFlushToZeroFloat16 ||
5296 floatControlsProperties.shaderDenormFlushToZeroFloat32 != vulkan12Properties.shaderDenormFlushToZeroFloat32 ||
5297 floatControlsProperties.shaderDenormFlushToZeroFloat64 != vulkan12Properties.shaderDenormFlushToZeroFloat64 ||
5298 floatControlsProperties.shaderRoundingModeRTEFloat16 != vulkan12Properties.shaderRoundingModeRTEFloat16 ||
5299 floatControlsProperties.shaderRoundingModeRTEFloat32 != vulkan12Properties.shaderRoundingModeRTEFloat32 ||
5300 floatControlsProperties.shaderRoundingModeRTEFloat64 != vulkan12Properties.shaderRoundingModeRTEFloat64 ||
5301 floatControlsProperties.shaderRoundingModeRTZFloat16 != vulkan12Properties.shaderRoundingModeRTZFloat16 ||
5302 floatControlsProperties.shaderRoundingModeRTZFloat32 != vulkan12Properties.shaderRoundingModeRTZFloat32 ||
5303 floatControlsProperties.shaderRoundingModeRTZFloat64 != vulkan12Properties.shaderRoundingModeRTZFloat64 ))
5305 TCU_FAIL("Mismatch between VkPhysicalDeviceFloatControlsProperties and VkPhysicalDeviceVulkan12Properties");
5308 if ((descriptorIndexingProperties.maxUpdateAfterBindDescriptorsInAllPools != vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools ||
5309 descriptorIndexingProperties.shaderUniformBufferArrayNonUniformIndexingNative != vulkan12Properties.shaderUniformBufferArrayNonUniformIndexingNative ||
5310 descriptorIndexingProperties.shaderSampledImageArrayNonUniformIndexingNative != vulkan12Properties.shaderSampledImageArrayNonUniformIndexingNative ||
5311 descriptorIndexingProperties.shaderStorageBufferArrayNonUniformIndexingNative != vulkan12Properties.shaderStorageBufferArrayNonUniformIndexingNative ||
5312 descriptorIndexingProperties.shaderStorageImageArrayNonUniformIndexingNative != vulkan12Properties.shaderStorageImageArrayNonUniformIndexingNative ||
5313 descriptorIndexingProperties.shaderInputAttachmentArrayNonUniformIndexingNative != vulkan12Properties.shaderInputAttachmentArrayNonUniformIndexingNative ||
5314 descriptorIndexingProperties.robustBufferAccessUpdateAfterBind != vulkan12Properties.robustBufferAccessUpdateAfterBind ||
5315 descriptorIndexingProperties.quadDivergentImplicitLod != vulkan12Properties.quadDivergentImplicitLod ||
5316 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindSamplers != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers ||
5317 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindUniformBuffers != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers ||
5318 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindStorageBuffers != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers ||
5319 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindSampledImages != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages ||
5320 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindStorageImages != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages ||
5321 descriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindInputAttachments != vulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments ||
5322 descriptorIndexingProperties.maxPerStageUpdateAfterBindResources != vulkan12Properties.maxPerStageUpdateAfterBindResources ||
5323 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindSamplers != vulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers ||
5324 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindUniformBuffers != vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers ||
5325 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic != vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic ||
5326 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageBuffers != vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers ||
5327 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic != vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic ||
5328 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindSampledImages != vulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages ||
5329 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageImages != vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages ||
5330 descriptorIndexingProperties.maxDescriptorSetUpdateAfterBindInputAttachments != vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments ))
5332 TCU_FAIL("Mismatch between VkPhysicalDeviceDescriptorIndexingProperties and VkPhysicalDeviceVulkan12Properties");
5335 if ((depthStencilResolveProperties.supportedDepthResolveModes != vulkan12Properties.supportedDepthResolveModes ||
5336 depthStencilResolveProperties.supportedStencilResolveModes != vulkan12Properties.supportedStencilResolveModes ||
5337 depthStencilResolveProperties.independentResolveNone != vulkan12Properties.independentResolveNone ||
5338 depthStencilResolveProperties.independentResolve != vulkan12Properties.independentResolve))
5340 TCU_FAIL("Mismatch between VkPhysicalDeviceDepthStencilResolveProperties and VkPhysicalDeviceVulkan12Properties");
5343 if ((samplerFilterMinmaxProperties.filterMinmaxSingleComponentFormats != vulkan12Properties.filterMinmaxSingleComponentFormats ||
5344 samplerFilterMinmaxProperties.filterMinmaxImageComponentMapping != vulkan12Properties.filterMinmaxImageComponentMapping))
5346 TCU_FAIL("Mismatch between VkPhysicalDeviceSamplerFilterMinmaxProperties and VkPhysicalDeviceVulkan12Properties");
5349 if ((timelineSemaphoreProperties.maxTimelineSemaphoreValueDifference != vulkan12Properties.maxTimelineSemaphoreValueDifference))
5351 TCU_FAIL("Mismatch between VkPhysicalDeviceTimelineSemaphoreProperties and VkPhysicalDeviceVulkan12Properties");
5355 return tcu::TestStatus::pass("Vulkan 1.2 device properties are consistent with extension properties");
5358 tcu::TestStatus imageFormatProperties2 (Context& context, const VkFormat format, const VkImageType imageType, const VkImageTiling tiling)
5360 if (isYCbCrFormat(format))
5361 // check if Ycbcr format enums are valid given the version and extensions
5362 checkYcbcrApiSupport(context);
5364 TestLog& log = context.getTestContext().getLog();
5366 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
5367 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5368 const InstanceDriver& vki (instance.getDriver());
5370 const VkImageCreateFlags ycbcrFlags = isYCbCrFormat(format) ? (VkImageCreateFlags)VK_IMAGE_CREATE_DISJOINT_BIT_KHR : (VkImageCreateFlags)0u;
5371 const VkImageUsageFlags allUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT
5372 | VK_IMAGE_USAGE_TRANSFER_DST_BIT
5373 | VK_IMAGE_USAGE_SAMPLED_BIT
5374 | VK_IMAGE_USAGE_STORAGE_BIT
5375 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
5376 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
5377 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
5378 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
5379 const VkImageCreateFlags allCreateFlags = VK_IMAGE_CREATE_SPARSE_BINDING_BIT
5380 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
5381 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT
5382 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
5383 | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
5386 for (VkImageUsageFlags curUsageFlags = (VkImageUsageFlags)1; curUsageFlags <= allUsageFlags; curUsageFlags++)
5388 if (!isValidImageUsageFlagCombination(curUsageFlags))
5391 for (VkImageCreateFlags curCreateFlags = 0; curCreateFlags <= allCreateFlags; curCreateFlags++)
5393 const VkPhysicalDeviceImageFormatInfo2 imageFormatInfo =
5395 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
5404 VkImageFormatProperties coreProperties;
5405 VkImageFormatProperties2 extProperties;
5406 VkResult coreResult;
5409 deMemset(&coreProperties, 0xcd, sizeof(VkImageFormatProperties));
5410 deMemset(&extProperties, 0xcd, sizeof(VkImageFormatProperties2));
5412 extProperties.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
5413 extProperties.pNext = DE_NULL;
5415 coreResult = vki.getPhysicalDeviceImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.tiling, imageFormatInfo.usage, imageFormatInfo.flags, &coreProperties);
5416 extResult = vki.getPhysicalDeviceImageFormatProperties2(physicalDevice, &imageFormatInfo, &extProperties);
5418 TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2);
5419 TCU_CHECK(extProperties.pNext == DE_NULL);
5421 if ((coreResult != extResult) ||
5422 (deMemCmp(&coreProperties, &extProperties.imageFormatProperties, sizeof(VkImageFormatProperties)) != 0))
5424 log << TestLog::Message << "ERROR: device mismatch with query " << imageFormatInfo << TestLog::EndMessage
5425 << TestLog::Message << "vkGetPhysicalDeviceImageFormatProperties() returned " << coreResult << ", " << coreProperties << TestLog::EndMessage
5426 << TestLog::Message << "vkGetPhysicalDeviceImageFormatProperties2() returned " << extResult << ", " << extProperties << TestLog::EndMessage;
5427 TCU_FAIL("Mismatch between image format properties reported by vkGetPhysicalDeviceImageFormatProperties and vkGetPhysicalDeviceImageFormatProperties2");
5432 return tcu::TestStatus::pass("Querying image format properties succeeded");
5435 tcu::TestStatus sparseImageFormatProperties2 (Context& context, const VkFormat format, const VkImageType imageType, const VkImageTiling tiling)
5437 TestLog& log = context.getTestContext().getLog();
5439 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
5440 const CustomInstance instance (createCustomInstanceWithExtension(context, "VK_KHR_get_physical_device_properties2"));
5441 const InstanceDriver& vki (instance.getDriver());
5443 const VkImageUsageFlags allUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT
5444 | VK_IMAGE_USAGE_TRANSFER_DST_BIT
5445 | VK_IMAGE_USAGE_SAMPLED_BIT
5446 | VK_IMAGE_USAGE_STORAGE_BIT
5447 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
5448 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
5449 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
5450 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
5452 for (deUint32 sampleCountBit = VK_SAMPLE_COUNT_1_BIT; sampleCountBit <= VK_SAMPLE_COUNT_64_BIT; sampleCountBit = (sampleCountBit << 1u))
5454 for (VkImageUsageFlags curUsageFlags = (VkImageUsageFlags)1; curUsageFlags <= allUsageFlags; curUsageFlags++)
5456 if (!isValidImageUsageFlagCombination(curUsageFlags))
5459 const VkPhysicalDeviceSparseImageFormatInfo2 imageFormatInfo =
5461 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2,
5465 (VkSampleCountFlagBits)sampleCountBit,
5470 deUint32 numCoreProperties = 0u;
5471 deUint32 numExtProperties = 0u;
5474 vki.getPhysicalDeviceSparseImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.samples, imageFormatInfo.usage, imageFormatInfo.tiling, &numCoreProperties, DE_NULL);
5475 vki.getPhysicalDeviceSparseImageFormatProperties2(physicalDevice, &imageFormatInfo, &numExtProperties, DE_NULL);
5477 if (numCoreProperties != numExtProperties)
5479 log << TestLog::Message << "ERROR: different number of properties reported for " << imageFormatInfo << TestLog::EndMessage;
5480 TCU_FAIL("Mismatch in reported property count");
5483 if (!context.getDeviceFeatures().sparseBinding)
5485 // There is no support for sparse binding, getPhysicalDeviceSparseImageFormatProperties* MUST report no properties
5486 // Only have to check one of the entrypoints as a mismatch in count is already caught.
5487 if (numCoreProperties > 0)
5489 log << TestLog::Message << "ERROR: device does not support sparse binding but claims support for " << numCoreProperties << " properties in vkGetPhysicalDeviceSparseImageFormatProperties with parameters " << imageFormatInfo << TestLog::EndMessage;
5490 TCU_FAIL("Claimed format properties inconsistent with overall sparseBinding feature");
5494 if (numCoreProperties > 0)
5496 std::vector<VkSparseImageFormatProperties> coreProperties (numCoreProperties);
5497 std::vector<VkSparseImageFormatProperties2> extProperties (numExtProperties);
5499 deMemset(&coreProperties[0], 0xcd, sizeof(VkSparseImageFormatProperties)*numCoreProperties);
5500 deMemset(&extProperties[0], 0xcd, sizeof(VkSparseImageFormatProperties2)*numExtProperties);
5502 for (deUint32 ndx = 0; ndx < numExtProperties; ++ndx)
5504 extProperties[ndx].sType = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2;
5505 extProperties[ndx].pNext = DE_NULL;
5508 vki.getPhysicalDeviceSparseImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.samples, imageFormatInfo.usage, imageFormatInfo.tiling, &numCoreProperties, &coreProperties[0]);
5509 vki.getPhysicalDeviceSparseImageFormatProperties2(physicalDevice, &imageFormatInfo, &numExtProperties, &extProperties[0]);
5511 TCU_CHECK((size_t)numCoreProperties == coreProperties.size());
5512 TCU_CHECK((size_t)numExtProperties == extProperties.size());
5514 for (deUint32 ndx = 0; ndx < numCoreProperties; ++ndx)
5516 TCU_CHECK(extProperties[ndx].sType == VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2);
5517 TCU_CHECK(extProperties[ndx].pNext == DE_NULL);
5519 if ((deMemCmp(&coreProperties[ndx], &extProperties[ndx].properties, sizeof(VkSparseImageFormatProperties)) != 0))
5521 log << TestLog::Message << "ERROR: device mismatch with query " << imageFormatInfo << " property " << ndx << TestLog::EndMessage
5522 << TestLog::Message << "vkGetPhysicalDeviceSparseImageFormatProperties() returned " << coreProperties[ndx] << TestLog::EndMessage
5523 << TestLog::Message << "vkGetPhysicalDeviceSparseImageFormatProperties2() returned " << extProperties[ndx] << TestLog::EndMessage;
5524 TCU_FAIL("Mismatch between image format properties reported by vkGetPhysicalDeviceSparseImageFormatProperties and vkGetPhysicalDeviceSparseImageFormatProperties2");
5531 return tcu::TestStatus::pass("Querying sparse image format properties succeeded");
5534 tcu::TestStatus execImageFormatTest (Context& context, ImageFormatPropertyCase testCase)
5536 return testCase.testFunction(context, testCase.format, testCase.imageType, testCase.tiling);
5539 void createImageFormatTypeTilingTests (tcu::TestCaseGroup* testGroup, ImageFormatPropertyCase params)
5541 DE_ASSERT(params.format == VK_FORMAT_UNDEFINED);
5547 ImageFormatPropertyCase params;
5548 } s_formatRanges[] =
5551 { (VkFormat)(VK_FORMAT_UNDEFINED + 1), VK_CORE_FORMAT_LAST, params },
5554 { VK_FORMAT_G8B8G8R8_422_UNORM_KHR, (VkFormat)(VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR + 1), params },
5556 // YCbCr extended formats
5557 { VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT, (VkFormat)(VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT+1), params },
5560 for (int rangeNdx = 0; rangeNdx < DE_LENGTH_OF_ARRAY(s_formatRanges); ++rangeNdx)
5562 const VkFormat rangeBegin = s_formatRanges[rangeNdx].begin;
5563 const VkFormat rangeEnd = s_formatRanges[rangeNdx].end;
5565 for (VkFormat format = rangeBegin; format != rangeEnd; format = (VkFormat)(format+1))
5567 const bool isYCbCr = isYCbCrFormat(format);
5568 const bool isSparse = (params.testFunction == sparseImageFormatProperties2);
5570 if (isYCbCr && isSparse)
5573 if (isYCbCr && params.imageType != VK_IMAGE_TYPE_2D)
5576 const char* const enumName = getFormatName(format);
5577 const string caseName = de::toLower(string(enumName).substr(10));
5579 params.format = format;
5581 addFunctionCase(testGroup, caseName, enumName, execImageFormatTest, params);
5586 void createImageFormatTypeTests (tcu::TestCaseGroup* testGroup, ImageFormatPropertyCase params)
5588 DE_ASSERT(params.tiling == VK_CORE_IMAGE_TILING_LAST);
5590 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "optimal", "", createImageFormatTypeTilingTests, ImageFormatPropertyCase(params.testFunction, VK_FORMAT_UNDEFINED, params.imageType, VK_IMAGE_TILING_OPTIMAL)));
5591 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "linear", "", createImageFormatTypeTilingTests, ImageFormatPropertyCase(params.testFunction, VK_FORMAT_UNDEFINED, params.imageType, VK_IMAGE_TILING_LINEAR)));
5594 void createImageFormatTests (tcu::TestCaseGroup* testGroup, ImageFormatPropertyCase::Function testFunction)
5596 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "1d", "", createImageFormatTypeTests, ImageFormatPropertyCase(testFunction, VK_FORMAT_UNDEFINED, VK_IMAGE_TYPE_1D, VK_CORE_IMAGE_TILING_LAST)));
5597 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "2d", "", createImageFormatTypeTests, ImageFormatPropertyCase(testFunction, VK_FORMAT_UNDEFINED, VK_IMAGE_TYPE_2D, VK_CORE_IMAGE_TILING_LAST)));
5598 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "3d", "", createImageFormatTypeTests, ImageFormatPropertyCase(testFunction, VK_FORMAT_UNDEFINED, VK_IMAGE_TYPE_3D, VK_CORE_IMAGE_TILING_LAST)));
5602 // Android CTS -specific tests
5607 void checkExtensions (tcu::ResultCollector& results, const set<string>& allowedExtensions, const vector<VkExtensionProperties>& reportedExtensions)
5609 for (vector<VkExtensionProperties>::const_iterator extension = reportedExtensions.begin(); extension != reportedExtensions.end(); ++extension)
5611 const string extensionName (extension->extensionName);
5612 const bool mustBeKnown = de::beginsWith(extensionName, "VK_GOOGLE_") ||
5613 de::beginsWith(extensionName, "VK_ANDROID_");
5615 if (mustBeKnown && !de::contains(allowedExtensions, extensionName))
5616 results.fail("Unknown extension: " + extensionName);
5620 tcu::TestStatus testNoUnknownExtensions (Context& context)
5622 TestLog& log = context.getTestContext().getLog();
5623 tcu::ResultCollector results (log);
5624 set<string> allowedInstanceExtensions;
5625 set<string> allowedDeviceExtensions;
5627 // All known extensions should be added to allowedExtensions:
5628 // allowedExtensions.insert("VK_GOOGLE_extension1");
5629 allowedDeviceExtensions.insert("VK_ANDROID_external_memory_android_hardware_buffer");
5630 allowedDeviceExtensions.insert("VK_GOOGLE_display_timing");
5631 allowedDeviceExtensions.insert("VK_GOOGLE_decorate_string");
5632 allowedDeviceExtensions.insert("VK_GOOGLE_hlsl_functionality1");
5634 // Instance extensions
5635 checkExtensions(results,
5636 allowedInstanceExtensions,
5637 enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL));
5639 // Extensions exposed by instance layers
5641 const vector<VkLayerProperties> layers = enumerateInstanceLayerProperties(context.getPlatformInterface());
5643 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
5645 checkExtensions(results,
5646 allowedInstanceExtensions,
5647 enumerateInstanceExtensionProperties(context.getPlatformInterface(), layer->layerName));
5651 // Device extensions
5652 checkExtensions(results,
5653 allowedDeviceExtensions,
5654 enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL));
5656 // Extensions exposed by device layers
5658 const vector<VkLayerProperties> layers = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
5660 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
5662 checkExtensions(results,
5663 allowedDeviceExtensions,
5664 enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), layer->layerName));
5668 return tcu::TestStatus(results.getResult(), results.getMessage());
5671 tcu::TestStatus testNoLayers (Context& context)
5673 TestLog& log = context.getTestContext().getLog();
5674 tcu::ResultCollector results (log);
5677 const vector<VkLayerProperties> layers = enumerateInstanceLayerProperties(context.getPlatformInterface());
5679 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
5680 results.fail(string("Instance layer enumerated: ") + layer->layerName);
5684 const vector<VkLayerProperties> layers = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
5686 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
5687 results.fail(string("Device layer enumerated: ") + layer->layerName);
5690 return tcu::TestStatus(results.getResult(), results.getMessage());
5693 tcu::TestStatus testMandatoryExtensions (Context& context)
5695 TestLog& log = context.getTestContext().getLog();
5696 tcu::ResultCollector results (log);
5698 // Instance extensions
5700 static const string mandatoryExtensions[] =
5702 "VK_KHR_get_physical_device_properties2",
5705 for (const auto &ext : mandatoryExtensions)
5707 if (!context.isInstanceFunctionalitySupported(ext))
5708 results.fail(ext + " is not supported");
5712 // Device extensions
5714 static const string mandatoryExtensions[] =
5716 "VK_KHR_maintenance1",
5719 for (const auto &ext : mandatoryExtensions)
5721 if (!context.isDeviceFunctionalitySupported(ext))
5722 results.fail(ext + " is not supported");
5726 return tcu::TestStatus(results.getResult(), results.getMessage());
5733 tcu::TestCaseGroup* createFeatureInfoTests (tcu::TestContext& testCtx)
5735 de::MovePtr<tcu::TestCaseGroup> infoTests (new tcu::TestCaseGroup(testCtx, "info", "Platform Information Tests"));
5737 infoTests->addChild(createTestGroup(testCtx, "format_properties", "VkGetPhysicalDeviceFormatProperties() Tests", createFormatTests));
5738 infoTests->addChild(createTestGroup(testCtx, "image_format_properties", "VkGetPhysicalDeviceImageFormatProperties() Tests", createImageFormatTests, imageFormatProperties));
5741 de::MovePtr<tcu::TestCaseGroup> extCoreVersionGrp (new tcu::TestCaseGroup(testCtx, "extension_core_versions", "Tests checking extension required core versions"));
5743 addFunctionCase(extCoreVersionGrp.get(), "extension_core_versions", "", extensionCoreVersions);
5745 infoTests->addChild(extCoreVersionGrp.release());
5749 de::MovePtr<tcu::TestCaseGroup> extendedPropertiesTests (new tcu::TestCaseGroup(testCtx, "get_physical_device_properties2", "VK_KHR_get_physical_device_properties2"));
5751 addFunctionCase(extendedPropertiesTests.get(), "features", "Extended Device Features", deviceFeatures2);
5752 addFunctionCase(extendedPropertiesTests.get(), "properties", "Extended Device Properties", deviceProperties2);
5753 addFunctionCase(extendedPropertiesTests.get(), "format_properties", "Extended Device Format Properties", deviceFormatProperties2);
5754 addFunctionCase(extendedPropertiesTests.get(), "queue_family_properties", "Extended Device Queue Family Properties", deviceQueueFamilyProperties2);
5755 addFunctionCase(extendedPropertiesTests.get(), "memory_properties", "Extended Device Memory Properties", deviceMemoryProperties2);
5757 infoTests->addChild(extendedPropertiesTests.release());
5761 de::MovePtr<tcu::TestCaseGroup> extendedPropertiesTests (new tcu::TestCaseGroup(testCtx, "vulkan1p2", "Vulkan 1.2 related tests"));
5763 addFunctionCase(extendedPropertiesTests.get(), "features", "Extended Vulkan 1.2 Device Features", deviceFeaturesVulkan12);
5764 addFunctionCase(extendedPropertiesTests.get(), "properties", "Extended Vulkan 1.2 Device Properties", devicePropertiesVulkan12);
5765 addFunctionCase(extendedPropertiesTests.get(), "feature_extensions_consistency", "Vulkan 1.2 consistency between Features and Extensions", deviceFeatureExtensionsConsistencyVulkan12);
5766 addFunctionCase(extendedPropertiesTests.get(), "property_extensions_consistency", "Vulkan 1.2 consistency between Properties and Extensions", devicePropertyExtensionsConsistencyVulkan12);
5767 addFunctionCase(extendedPropertiesTests.get(), "feature_bits_influence", "Validate feature bits influence on feature activation", checkSupportFeatureBitInfluence, featureBitInfluenceOnDeviceCreate);
5769 infoTests->addChild(extendedPropertiesTests.release());
5773 de::MovePtr<tcu::TestCaseGroup> limitsValidationTests (new tcu::TestCaseGroup(testCtx, "vulkan1p2_limits_validation", "Vulkan 1.2 and core extensions limits validation"));
5775 addFunctionCase(limitsValidationTests.get(), "general", "Vulkan 1.2 Limit validation", validateLimitsCheckSupport, validateLimits12);
5776 addFunctionCase(limitsValidationTests.get(), "khr_push_descriptor", "VK_KHR_push_descriptor limit validation", checkSupportKhrPushDescriptor, validateLimitsKhrPushDescriptor);
5777 addFunctionCase(limitsValidationTests.get(), "khr_multiview", "VK_KHR_multiview limit validation", checkSupportKhrMultiview, validateLimitsKhrMultiview);
5778 addFunctionCase(limitsValidationTests.get(), "ext_discard_rectangles", "VK_EXT_discard_rectangles limit validation", checkSupportExtDiscardRectangles, validateLimitsExtDiscardRectangles);
5779 addFunctionCase(limitsValidationTests.get(), "ext_sample_locations", "VK_EXT_sample_locations limit validation", checkSupportExtSampleLocations, validateLimitsExtSampleLocations);
5780 addFunctionCase(limitsValidationTests.get(), "ext_external_memory_host", "VK_EXT_external_memory_host limit validation", checkSupportExtExternalMemoryHost, validateLimitsExtExternalMemoryHost);
5781 addFunctionCase(limitsValidationTests.get(), "ext_blend_operation_advanced", "VK_EXT_blend_operation_advanced limit validation", checkSupportExtBlendOperationAdvanced, validateLimitsExtBlendOperationAdvanced);
5782 addFunctionCase(limitsValidationTests.get(), "khr_maintenance_3", "VK_KHR_maintenance3 limit validation", checkSupportKhrMaintenance3, validateLimitsKhrMaintenance3);
5783 addFunctionCase(limitsValidationTests.get(), "ext_conservative_rasterization", "VK_EXT_conservative_rasterization limit validation", checkSupportExtConservativeRasterization, validateLimitsExtConservativeRasterization);
5784 addFunctionCase(limitsValidationTests.get(), "ext_descriptor_indexing", "VK_EXT_descriptor_indexing limit validation", checkSupportExtDescriptorIndexing, validateLimitsExtDescriptorIndexing);
5785 addFunctionCase(limitsValidationTests.get(), "ext_inline_uniform_block", "VK_EXT_inline_uniform_block limit validation", checkSupportExtInlineUniformBlock, validateLimitsExtInlineUniformBlock);
5786 addFunctionCase(limitsValidationTests.get(), "ext_vertex_attribute_divisor", "VK_EXT_vertex_attribute_divisor limit validation", checkSupportExtVertexAttributeDivisor, validateLimitsExtVertexAttributeDivisor);
5787 addFunctionCase(limitsValidationTests.get(), "nv_mesh_shader", "VK_NV_mesh_shader limit validation", checkSupportNvMeshShader, validateLimitsNvMeshShader);
5788 addFunctionCase(limitsValidationTests.get(), "ext_transform_feedback", "VK_EXT_transform_feedback limit validation", checkSupportExtTransformFeedback, validateLimitsExtTransformFeedback);
5789 addFunctionCase(limitsValidationTests.get(), "fragment_density_map", "VK_EXT_fragment_density_map limit validation", checkSupportExtFragmentDensityMap, validateLimitsExtFragmentDensityMap);
5790 addFunctionCase(limitsValidationTests.get(), "nv_ray_tracing", "VK_NV_ray_tracing limit validation", checkSupportNvRayTracing, validateLimitsNvRayTracing);
5791 addFunctionCase(limitsValidationTests.get(), "timeline_semaphore", "VK_KHR_timeline_semaphore limit validation", checkSupportKhrTimelineSemaphore, validateLimitsKhrTimelineSemaphore);
5792 addFunctionCase(limitsValidationTests.get(), "ext_line_rasterization", "VK_EXT_line_rasterization limit validation", checkSupportExtLineRasterization, validateLimitsExtLineRasterization);
5794 infoTests->addChild(limitsValidationTests.release());
5797 infoTests->addChild(createTestGroup(testCtx, "image_format_properties2", "VkGetPhysicalDeviceImageFormatProperties2() Tests", createImageFormatTests, imageFormatProperties2));
5798 infoTests->addChild(createTestGroup(testCtx, "sparse_image_format_properties2", "VkGetPhysicalDeviceSparseImageFormatProperties2() Tests", createImageFormatTests, sparseImageFormatProperties2));
5801 de::MovePtr<tcu::TestCaseGroup> androidTests (new tcu::TestCaseGroup(testCtx, "android", "Android CTS Tests"));
5803 addFunctionCase(androidTests.get(), "mandatory_extensions", "Test that all mandatory extensions are supported", android::testMandatoryExtensions);
5804 addFunctionCase(androidTests.get(), "no_unknown_extensions", "Test for unknown device or instance extensions", android::testNoUnknownExtensions);
5805 addFunctionCase(androidTests.get(), "no_layers", "Test that no layers are enumerated", android::testNoLayers);
5807 infoTests->addChild(androidTests.release());
5810 return infoTests.release();
5813 void createFeatureInfoInstanceTests(tcu::TestCaseGroup* testGroup)
5815 addFunctionCase(testGroup, "physical_devices", "Physical devices", enumeratePhysicalDevices);
5816 addFunctionCase(testGroup, "physical_device_groups", "Physical devices Groups", enumeratePhysicalDeviceGroups);
5817 addFunctionCase(testGroup, "instance_layers", "Layers", enumerateInstanceLayers);
5818 addFunctionCase(testGroup, "instance_extensions", "Extensions", enumerateInstanceExtensions);
5821 void createFeatureInfoDeviceTests(tcu::TestCaseGroup* testGroup)
5823 addFunctionCase(testGroup, "device_features", "Device Features", deviceFeatures);
5824 addFunctionCase(testGroup, "device_properties", "Device Properties", deviceProperties);
5825 addFunctionCase(testGroup, "device_queue_family_properties", "Queue family properties", deviceQueueFamilyProperties);
5826 addFunctionCase(testGroup, "device_memory_properties", "Memory properties", deviceMemoryProperties);
5827 addFunctionCase(testGroup, "device_layers", "Layers", enumerateDeviceLayers);
5828 addFunctionCase(testGroup, "device_extensions", "Extensions", enumerateDeviceExtensions);
5829 addFunctionCase(testGroup, "device_no_khx_extensions", "KHX extensions", testNoKhxExtensions);
5830 addFunctionCase(testGroup, "device_memory_budget", "Memory budget", deviceMemoryBudgetProperties);
5831 addFunctionCase(testGroup, "device_mandatory_features", "Mandatory features", deviceMandatoryFeatures);
5834 void createFeatureInfoDeviceGroupTests(tcu::TestCaseGroup* testGroup)
5836 addFunctionCase(testGroup, "device_group_peer_memory_features", "Device Group peer memory features", deviceGroupPeerMemoryFeatures);