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"
29 #include "vkPlatform.hpp"
30 #include "vkStrUtil.hpp"
32 #include "vkDeviceUtil.hpp"
33 #include "vkQueryUtil.hpp"
35 #include "tcuTestLog.hpp"
36 #include "tcuFormatUtil.hpp"
38 #include "deUniquePtr.hpp"
39 #include "deStringUtil.hpp"
40 #include "deSTLUtil.hpp"
55 using tcu::ScopedLogSection;
59 GUARD_SIZE = 0x20, //!< Number of bytes to check
60 GUARD_VALUE = 0xcd, //!< Data pattern
65 LIMIT_FORMAT_SIGNED_INT,
66 LIMIT_FORMAT_UNSIGNED_INT,
68 LIMIT_FORMAT_DEVICE_SIZE,
81 #define LIMIT(_X_) DE_OFFSET_OF(VkPhysicalDeviceLimits, _X_),(char*)(#_X_)
82 #define FEATURE(_X_) DE_OFFSET_OF(VkPhysicalDeviceFeatures, _X_)
84 bool validateFeatureLimits(VkPhysicalDeviceProperties* properties, VkPhysicalDeviceFeatures* features, TestLog& log)
87 VkPhysicalDeviceLimits* limits = &properties->limits;
88 struct FeatureLimitTable
92 deUint32 uintVal; //!< Format is UNSIGNED_INT
93 deInt32 intVal; //!< Format is SIGNED_INT
94 deUint64 deviceSizeVal; //!< Format is DEVICE_SIZE
95 float floatVal; //!< Format is FLOAT
98 deInt32 unsuppTableNdx;
99 } featureLimitTable[] = //!< From gitlab.khronos.org/vulkan/vulkan.git:doc/specs/vulkan/chapters/features.txt@63b23f3bb3ecd211cd6e448e2001ce1088dacd35
101 { LIMIT(maxImageDimension1D), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
102 { LIMIT(maxImageDimension2D), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
103 { LIMIT(maxImageDimension3D), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
104 { LIMIT(maxImageDimensionCube), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
105 { LIMIT(maxImageArrayLayers), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
106 { LIMIT(maxTexelBufferElements), 65536, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
107 { LIMIT(maxUniformBufferRange), 16384, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
108 { LIMIT(maxPushConstantsSize), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
109 { LIMIT(maxMemoryAllocationCount), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
110 { LIMIT(bufferImageGranularity), 0, 0, 131072, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1 },
111 { LIMIT(sparseAddressSpaceSize), 0, 0, 2UL*1024*1024*1024, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MIN, -1 },
112 { LIMIT(maxBoundDescriptorSets), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
113 { LIMIT(maxPerStageDescriptorSamplers), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
114 { LIMIT(maxPerStageDescriptorUniformBuffers), 12, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
115 { LIMIT(maxPerStageDescriptorStorageBuffers), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
116 { LIMIT(maxPerStageDescriptorSampledImages), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
117 { LIMIT(maxPerStageDescriptorStorageImages), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
118 { LIMIT(maxPerStageDescriptorInputAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
119 { LIMIT(maxDescriptorSetSamplers), 96, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
120 { LIMIT(maxDescriptorSetUniformBuffers), 72, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
121 { LIMIT(maxDescriptorSetUniformBuffersDynamic), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
122 { LIMIT(maxDescriptorSetStorageBuffers), 24, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
123 { LIMIT(maxDescriptorSetStorageBuffersDynamic), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
124 { LIMIT(maxDescriptorSetSampledImages), 96, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
125 { LIMIT(maxDescriptorSetStorageImages), 24, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
126 { LIMIT(maxVertexInputAttributes), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
127 { LIMIT(maxVertexInputBindings), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
128 { LIMIT(maxVertexInputAttributeOffset), 2047, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
129 { LIMIT(maxVertexInputBindingStride), 2048, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
130 { LIMIT(maxVertexOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
131 { LIMIT(maxTessellationGenerationLevel), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
132 { LIMIT(maxTessellationPatchSize), 32, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
133 { LIMIT(maxTessellationControlPerVertexInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
134 { LIMIT(maxTessellationControlPerVertexOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
135 { LIMIT(maxTessellationControlPerPatchOutputComponents), 120, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
136 { LIMIT(maxTessellationControlTotalOutputComponents), 2048, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
137 { LIMIT(maxTessellationEvaluationInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
138 { LIMIT(maxTessellationEvaluationOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
139 { LIMIT(maxGeometryShaderInvocations), 32, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
140 { LIMIT(maxGeometryInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
141 { LIMIT(maxGeometryOutputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
142 { LIMIT(maxGeometryOutputVertices), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
143 { LIMIT(maxGeometryTotalOutputComponents), 1024, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
144 { LIMIT(maxFragmentInputComponents), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
145 { LIMIT(maxFragmentOutputAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
146 { LIMIT(maxFragmentDualSrcAttachments), 1, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
147 { LIMIT(maxFragmentCombinedOutputResources), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
148 { LIMIT(maxComputeSharedMemorySize), 16384, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
149 { LIMIT(maxComputeWorkGroupCount[0]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
150 { LIMIT(maxComputeWorkGroupCount[1]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
151 { LIMIT(maxComputeWorkGroupCount[2]), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
152 { LIMIT(maxComputeWorkGroupInvocations), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
153 { LIMIT(maxComputeWorkGroupSize[0]), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
154 { LIMIT(maxComputeWorkGroupSize[1]), 128, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
155 { LIMIT(maxComputeWorkGroupSize[2]), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
156 { LIMIT(subPixelPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
157 { LIMIT(subTexelPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
158 { LIMIT(mipmapPrecisionBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
159 { LIMIT(maxDrawIndexedIndexValue), (deUint32)~0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
160 { LIMIT(maxDrawIndirectCount), 65535, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
161 { LIMIT(maxSamplerLodBias), 0, 0, 0, 2.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
162 { LIMIT(maxSamplerAnisotropy), 0, 0, 0, 16.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
163 { LIMIT(maxViewports), 16, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
164 { LIMIT(maxViewportDimensions[0]), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
165 { LIMIT(maxViewportDimensions[1]), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN , -1 },
166 { LIMIT(viewportBoundsRange[0]), 0, 0, 0, -8192.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
167 { LIMIT(viewportBoundsRange[1]), 0, 0, 0, 8191.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
168 { LIMIT(viewportSubPixelBits), 0, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
169 { LIMIT(minMemoryMapAlignment), 64, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
170 { LIMIT(minTexelBufferOffsetAlignment), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MAX, -1 },
171 { LIMIT(minUniformBufferOffsetAlignment), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MAX, -1 },
172 { LIMIT(minStorageBufferOffsetAlignment), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MAX, -1 },
173 { LIMIT(minTexelOffset), 0, -8, 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MAX, -1 },
174 { LIMIT(maxTexelOffset), 7, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
175 { LIMIT(minTexelGatherOffset), 0, -8, 0, 0.0f, LIMIT_FORMAT_SIGNED_INT, LIMIT_TYPE_MAX, -1 },
176 { LIMIT(maxTexelGatherOffset), 7, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
177 { LIMIT(minInterpolationOffset), 0, 0, 0, -0.5f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
178 { LIMIT(maxInterpolationOffset), 0, 0, 0, 0.5f - (1.0f/deFloatPow(2.0f, (float)limits->subPixelInterpolationOffsetBits)), LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
179 { LIMIT(subPixelInterpolationOffsetBits), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
180 { LIMIT(maxFramebufferWidth), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
181 { LIMIT(maxFramebufferHeight), 4096, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
182 { LIMIT(maxFramebufferLayers), 256, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
183 { LIMIT(maxColorAttachments), 4, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
184 { LIMIT(maxSampleMaskWords), 1, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
185 { LIMIT(maxClipDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
186 { LIMIT(maxCullDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
187 { LIMIT(maxCombinedClipAndCullDistances), 8, 0, 0, 0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN, -1 },
188 { LIMIT(pointSizeRange[0]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
189 { LIMIT(pointSizeRange[1]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
190 { LIMIT(pointSizeRange[0]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
191 { LIMIT(pointSizeRange[1]), 0, 0, 0, 64.0f - limits->pointSizeGranularity , LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
192 { LIMIT(lineWidthRange[0]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
193 { LIMIT(lineWidthRange[1]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
194 { LIMIT(lineWidthRange[0]), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
195 { LIMIT(lineWidthRange[1]), 0, 0, 0, 8.0f - limits->lineWidthGranularity, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MIN, -1 },
196 { LIMIT(pointSizeGranularity), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
197 { LIMIT(lineWidthGranularity), 0, 0, 0, 1.0f, LIMIT_FORMAT_FLOAT, LIMIT_TYPE_MAX, -1 },
198 { LIMIT(nonCoherentAtomSize), 0, 0, 128, 0.0f, LIMIT_FORMAT_DEVICE_SIZE, LIMIT_TYPE_MAX, -1 },
201 struct UnsupportedFeatureLimitTable
203 deUint32 limitOffset;
205 deUint32 featureOffset;
206 deUint32 uintVal; //!< Format is UNSIGNED_INT
207 deInt32 intVal; //!< Format is SIGNED_INT
208 deUint64 deviceSizeVal; //!< Format is DEVICE_SIZE
209 float floatVal; //!< Format is FLOAT
210 } unsupportedFeatureTable[] =
212 { LIMIT(sparseAddressSpaceSize), FEATURE(sparseBinding), 0, 0, 0, 0.0f },
213 { LIMIT(maxTessellationGenerationLevel), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
214 { LIMIT(maxTessellationPatchSize), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
215 { LIMIT(maxTessellationControlPerVertexInputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
216 { LIMIT(maxTessellationControlPerVertexOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
217 { LIMIT(maxTessellationControlPerPatchOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
218 { LIMIT(maxTessellationControlTotalOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
219 { LIMIT(maxTessellationEvaluationInputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
220 { LIMIT(maxTessellationEvaluationOutputComponents), FEATURE(tessellationShader), 0, 0, 0, 0.0f },
221 { LIMIT(maxGeometryShaderInvocations), FEATURE(geometryShader), 0, 0, 0, 0.0f },
222 { LIMIT(maxGeometryInputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
223 { LIMIT(maxGeometryOutputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
224 { LIMIT(maxGeometryOutputVertices), FEATURE(geometryShader), 0, 0, 0, 0.0f },
225 { LIMIT(maxGeometryTotalOutputComponents), FEATURE(geometryShader), 0, 0, 0, 0.0f },
226 { LIMIT(maxFragmentDualSrcAttachments), FEATURE(dualSrcBlend), 0, 0, 0, 0.0f },
227 { LIMIT(maxDrawIndexedIndexValue), FEATURE(fullDrawIndexUint32), (1<<24)-1, 0, 0, 0.0f },
228 { LIMIT(maxDrawIndirectCount), FEATURE(multiDrawIndirect), 1, 0, 0, 0.0f },
229 { LIMIT(maxSamplerAnisotropy), FEATURE(samplerAnisotropy), 1, 0, 0, 0.0f },
230 { LIMIT(maxViewports), FEATURE(multiViewport), 1, 0, 0, 0.0f },
231 { LIMIT(minTexelGatherOffset), FEATURE(shaderImageGatherExtended), 0, 0, 0, 0.0f },
232 { LIMIT(maxTexelGatherOffset), FEATURE(shaderImageGatherExtended), 0, 0, 0, 0.0f },
233 { LIMIT(minInterpolationOffset), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
234 { LIMIT(maxInterpolationOffset), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
235 { LIMIT(subPixelInterpolationOffsetBits), FEATURE(sampleRateShading), 0, 0, 0, 0.0f },
236 { LIMIT(storageImageSampleCounts), FEATURE(shaderStorageImageMultisample), 0, 0, 0, 0.0f },
237 { LIMIT(maxClipDistances), FEATURE(shaderClipDistance), 0, 0, 0, 0.0f },
238 { LIMIT(maxCullDistances), FEATURE(shaderClipDistance), 0, 0, 0, 0.0f },
239 { LIMIT(maxCombinedClipAndCullDistances), FEATURE(shaderClipDistance), 0, 0, 0, 0.0f },
240 { LIMIT(pointSizeRange[0]), FEATURE(largePoints), 0, 0, 0, 1.0f },
241 { LIMIT(pointSizeRange[1]), FEATURE(largePoints), 0, 0, 0, 1.0f },
242 { LIMIT(lineWidthRange[0]), FEATURE(wideLines), 0, 0, 0, 1.0f },
243 { LIMIT(lineWidthRange[1]), FEATURE(wideLines), 0, 0, 0, 1.0f },
244 { LIMIT(pointSizeGranularity), FEATURE(largePoints), 0, 0, 0, 0.0f },
245 { LIMIT(lineWidthGranularity), FEATURE(wideLines), 0, 0, 0, 0.0f }
248 log << TestLog::Message << *limits << TestLog::EndMessage;
250 //!< First build a map from limit to unsupported table index
251 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
253 for (deUint32 unsuppNdx = 0; unsuppNdx < DE_LENGTH_OF_ARRAY(unsupportedFeatureTable); unsuppNdx++)
255 if (unsupportedFeatureTable[unsuppNdx].limitOffset == featureLimitTable[ndx].offset)
257 featureLimitTable[ndx].unsuppTableNdx = unsuppNdx;
263 for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
265 switch (featureLimitTable[ndx].format)
267 case LIMIT_FORMAT_UNSIGNED_INT:
269 deUint32 limitToCheck = featureLimitTable[ndx].uintVal;
270 if (featureLimitTable[ndx].unsuppTableNdx != -1)
272 if (*((VkBool32*)((char*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
273 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].uintVal;
276 if ( featureLimitTable[ndx].type == LIMIT_TYPE_MIN )
279 if (*((deUint32*)((char*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
281 log << TestLog::Message << "limit Validation failed " << featureLimitTable[ndx].name
282 << " not valid-limit type MIN - actual is "
283 << *((deUint32*)((char*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
289 if (*((deUint32*)((char*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
291 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
292 << " not valid-limit type MAX - actual is "
293 << *((deUint32*)((char*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
300 case LIMIT_FORMAT_FLOAT:
302 float limitToCheck = featureLimitTable[ndx].floatVal;
303 if (featureLimitTable[ndx].unsuppTableNdx != -1)
305 if (*((VkBool32*)((char*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
306 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].floatVal;
309 if ( featureLimitTable[ndx].type == LIMIT_TYPE_MIN )
311 if (*((float*)((char*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
313 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
314 << " not valid-limit type MIN - actual is "
315 << *((float*)((char*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
321 if (*((float*)((char*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
323 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
324 << " not valid-limit type MAX actual is "
325 << *((float*)((char*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
332 case LIMIT_FORMAT_SIGNED_INT:
334 deInt32 limitToCheck = featureLimitTable[ndx].intVal;
335 if (featureLimitTable[ndx].unsuppTableNdx != -1)
337 if (*((VkBool32*)((char*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
338 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].intVal;
340 if (featureLimitTable[ndx].type == LIMIT_TYPE_MIN)
342 if (*((deInt32*)((char*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
344 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
345 << " not valid-limit type MIN actual is "
346 << *((deInt32*)((char*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
352 if (*((deInt32*)((char*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
354 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
355 << " not valid-limit type MAX actual is "
356 << *((deInt32*)((char*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
363 case LIMIT_FORMAT_DEVICE_SIZE:
365 deUint64 limitToCheck = featureLimitTable[ndx].deviceSizeVal;
366 if (featureLimitTable[ndx].unsuppTableNdx != -1)
368 if (*((VkBool32*)((char*)features+unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].featureOffset)) == VK_FALSE)
369 limitToCheck = unsupportedFeatureTable[featureLimitTable[ndx].unsuppTableNdx].deviceSizeVal;
372 if ( featureLimitTable[ndx].type == LIMIT_TYPE_MIN )
374 if (*((deUint64*)((char*)limits+featureLimitTable[ndx].offset)) < limitToCheck)
376 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
377 << " not valid-limit type MIN actual is "
378 << *((deUint64*)((char*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
384 if (*((deUint64*)((char*)limits+featureLimitTable[ndx].offset)) > limitToCheck)
386 log << TestLog::Message << "limit validation failed, " << featureLimitTable[ndx].name
387 << " not valid-limit type MAX actual is "
388 << *((deUint64*)((char*)limits + featureLimitTable[ndx].offset)) << TestLog::EndMessage;
404 tcu::TestStatus enumeratePhysicalDevices (Context& context)
406 TestLog& log = context.getTestContext().getLog();
407 const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(context.getInstanceInterface(), context.getInstance());
409 log << TestLog::Integer("NumDevices", "Number of devices", "", QP_KEY_TAG_NONE, deInt64(devices.size()));
411 for (size_t ndx = 0; ndx < devices.size(); ndx++)
412 log << TestLog::Message << ndx << ": " << devices[ndx] << TestLog::EndMessage;
414 return tcu::TestStatus::pass("Enumerating devices succeeded");
417 tcu::TestStatus enumerateInstanceLayers (Context& context)
419 TestLog& log = context.getTestContext().getLog();
420 const vector<VkLayerProperties> properties = enumerateInstanceLayerProperties(context.getPlatformInterface());
422 for (size_t ndx = 0; ndx < properties.size(); ndx++)
423 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
425 return tcu::TestStatus::pass("Enumerating layers succeeded");
428 tcu::TestStatus enumerateInstanceExtensions (Context& context)
430 TestLog& log = context.getTestContext().getLog();
433 const ScopedLogSection section (log, "Global", "Global Extensions");
434 const vector<VkExtensionProperties> properties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
436 for (size_t ndx = 0; ndx < properties.size(); ndx++)
437 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
441 const vector<VkLayerProperties> layers = enumerateInstanceLayerProperties(context.getPlatformInterface());
443 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
445 const ScopedLogSection section (log, layer->layerName, string("Layer: ") + layer->layerName);
446 const vector<VkExtensionProperties> properties = enumerateInstanceExtensionProperties(context.getPlatformInterface(), layer->layerName);
448 for (size_t extNdx = 0; extNdx < properties.size(); extNdx++)
449 log << TestLog::Message << extNdx << ": " << properties[extNdx] << TestLog::EndMessage;
453 return tcu::TestStatus::pass("Enumerating extensions succeeded");
456 tcu::TestStatus enumerateDeviceLayers (Context& context)
458 TestLog& log = context.getTestContext().getLog();
459 const vector<VkLayerProperties> properties = vk::enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
461 for (size_t ndx = 0; ndx < properties.size(); ndx++)
462 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
464 return tcu::TestStatus::pass("Enumerating layers succeeded");
467 tcu::TestStatus enumerateDeviceExtensions (Context& context)
469 TestLog& log = context.getTestContext().getLog();
472 const ScopedLogSection section (log, "Global", "Global Extensions");
473 const vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
475 for (size_t ndx = 0; ndx < properties.size(); ndx++)
476 log << TestLog::Message << ndx << ": " << properties[ndx] << TestLog::EndMessage;
480 const vector<VkLayerProperties> layers = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice());
482 for (vector<VkLayerProperties>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
484 const ScopedLogSection section (log, layer->layerName, string("Layer: ") + layer->layerName);
485 const vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), layer->layerName);
487 for (size_t extNdx = 0; extNdx < properties.size(); extNdx++)
488 log << TestLog::Message << extNdx << ": " << properties[extNdx] << TestLog::EndMessage;
492 return tcu::TestStatus::pass("Enumerating extensions succeeded");
495 tcu::TestStatus deviceFeatures (Context& context)
497 TestLog& log = context.getTestContext().getLog();
498 VkPhysicalDeviceFeatures* features;
499 deUint8 buffer[sizeof(VkPhysicalDeviceFeatures) + GUARD_SIZE];
501 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
502 features = reinterpret_cast<VkPhysicalDeviceFeatures*>(buffer);
504 context.getInstanceInterface().getPhysicalDeviceFeatures(context.getPhysicalDevice(), features);
506 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
507 << TestLog::Message << *features << TestLog::EndMessage;
509 for (int ndx = 0; ndx < GUARD_SIZE; ndx++)
511 if (buffer[ndx + sizeof(VkPhysicalDeviceFeatures)] != GUARD_VALUE)
513 log << TestLog::Message << "deviceFeatures - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
514 return tcu::TestStatus::fail("deviceFeatures buffer overflow");
518 return tcu::TestStatus::pass("Query succeeded");
521 tcu::TestStatus deviceProperties (Context& context)
523 TestLog& log = context.getTestContext().getLog();
524 VkPhysicalDeviceProperties* props;
525 VkPhysicalDeviceFeatures features;
526 deUint8 buffer[sizeof(VkPhysicalDeviceProperties) + GUARD_SIZE];
528 props = reinterpret_cast<VkPhysicalDeviceProperties*>(buffer);
529 deMemset(props, GUARD_VALUE, sizeof(buffer));
531 context.getInstanceInterface().getPhysicalDeviceProperties(context.getPhysicalDevice(), props);
532 context.getInstanceInterface().getPhysicalDeviceFeatures(context.getPhysicalDevice(), &features);
534 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
535 << TestLog::Message << *props << TestLog::EndMessage;
537 if (!validateFeatureLimits(props, &features, log))
538 return tcu::TestStatus::fail("deviceProperties - feature limits failed");
540 for (int ndx = 0; ndx < GUARD_SIZE; ndx++)
542 if (buffer[ndx + sizeof(VkPhysicalDeviceProperties)] != GUARD_VALUE)
544 log << TestLog::Message << "deviceProperties - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
545 return tcu::TestStatus::fail("deviceProperties buffer overflow");
549 return tcu::TestStatus::pass("DeviceProperites query succeeded");
552 tcu::TestStatus deviceQueueFamilyProperties (Context& context)
554 TestLog& log = context.getTestContext().getLog();
555 const vector<VkQueueFamilyProperties> queueProperties = getPhysicalDeviceQueueFamilyProperties(context.getInstanceInterface(), context.getPhysicalDevice());
557 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage;
559 for (size_t queueNdx = 0; queueNdx < queueProperties.size(); queueNdx++)
560 log << TestLog::Message << queueNdx << ": " << queueProperties[queueNdx] << TestLog::EndMessage;
562 return tcu::TestStatus::pass("Querying queue properties succeeded");
565 tcu::TestStatus deviceMemoryProperties (Context& context)
567 TestLog& log = context.getTestContext().getLog();
568 VkPhysicalDeviceMemoryProperties* memProps;
569 deUint8 buffer[sizeof(VkPhysicalDeviceMemoryProperties) + GUARD_SIZE];
571 memProps = reinterpret_cast<VkPhysicalDeviceMemoryProperties*>(buffer);
572 deMemset(buffer, GUARD_VALUE, sizeof(buffer));
574 context.getInstanceInterface().getPhysicalDeviceMemoryProperties(context.getPhysicalDevice(), memProps);
576 log << TestLog::Message << "device = " << context.getPhysicalDevice() << TestLog::EndMessage
577 << TestLog::Message << *memProps << TestLog::EndMessage;
579 for (deInt32 ndx = 0; ndx < GUARD_SIZE; ndx++)
581 if (buffer[ndx + sizeof(VkPhysicalDeviceMemoryProperties)] != GUARD_VALUE)
583 log << TestLog::Message << "deviceMemoryProperties - Guard offset " << ndx << " not valid" << TestLog::EndMessage;
584 return tcu::TestStatus::fail("deviceMemoryProperties buffer overflow");
588 return tcu::TestStatus::pass("Querying memory properties succeeded");
591 // \todo [2016-01-22 pyry] Optimize by doing format -> flags mapping instead
593 VkFormatFeatureFlags getRequiredOptimalTilingFeatures (VkFormat format)
595 static const VkFormat s_requiredSampledImageBlitSrcFormats[] =
597 VK_FORMAT_B4G4R4A4_UNORM_PACK16,
598 VK_FORMAT_R5G6B5_UNORM_PACK16,
599 VK_FORMAT_A1R5G5B5_UNORM_PACK16,
604 VK_FORMAT_R8G8_UNORM,
605 VK_FORMAT_R8G8_SNORM,
608 VK_FORMAT_R8G8B8A8_UNORM,
609 VK_FORMAT_R8G8B8A8_SNORM,
610 VK_FORMAT_R8G8B8A8_UINT,
611 VK_FORMAT_R8G8B8A8_SINT,
612 VK_FORMAT_R8G8B8A8_SRGB,
613 VK_FORMAT_B8G8R8A8_UNORM,
614 VK_FORMAT_B8G8R8A8_SRGB,
615 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
616 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
617 VK_FORMAT_A8B8G8R8_UINT_PACK32,
618 VK_FORMAT_A8B8G8R8_SINT_PACK32,
619 VK_FORMAT_A8B8G8R8_SRGB_PACK32,
620 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
621 VK_FORMAT_A2B10G10R10_UINT_PACK32,
624 VK_FORMAT_R16_SFLOAT,
625 VK_FORMAT_R16G16_UINT,
626 VK_FORMAT_R16G16_SINT,
627 VK_FORMAT_R16G16_SFLOAT,
628 VK_FORMAT_R16G16B16A16_UINT,
629 VK_FORMAT_R16G16B16A16_SINT,
630 VK_FORMAT_R16G16B16A16_SFLOAT,
633 VK_FORMAT_R32_SFLOAT,
634 VK_FORMAT_R32G32_UINT,
635 VK_FORMAT_R32G32_SINT,
636 VK_FORMAT_R32G32_SFLOAT,
637 VK_FORMAT_R32G32B32A32_UINT,
638 VK_FORMAT_R32G32B32A32_SINT,
639 VK_FORMAT_R32G32B32A32_SFLOAT,
640 VK_FORMAT_B10G11R11_UFLOAT_PACK32,
641 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,
645 static const VkFormat s_requiredStorageImageFormats[] =
647 VK_FORMAT_R8G8B8A8_UNORM,
648 VK_FORMAT_R8G8B8A8_SNORM,
649 VK_FORMAT_R8G8B8A8_UINT,
650 VK_FORMAT_R8G8B8A8_SINT,
651 VK_FORMAT_R16G16B16A16_UINT,
652 VK_FORMAT_R16G16B16A16_SINT,
653 VK_FORMAT_R16G16B16A16_SFLOAT,
656 VK_FORMAT_R32_SFLOAT,
657 VK_FORMAT_R32G32_UINT,
658 VK_FORMAT_R32G32_SINT,
659 VK_FORMAT_R32G32_SFLOAT,
660 VK_FORMAT_R32G32B32A32_UINT,
661 VK_FORMAT_R32G32B32A32_SINT,
662 VK_FORMAT_R32G32B32A32_SFLOAT
664 static const VkFormat s_requiredStorageImageAtomicFormats[] =
669 static const VkFormat s_requiredColorAttachmentBlitDstFormats[] =
671 VK_FORMAT_R5G6B5_UNORM_PACK16,
672 VK_FORMAT_A1R5G5B5_UNORM_PACK16,
676 VK_FORMAT_R8G8_UNORM,
679 VK_FORMAT_R8G8B8A8_UNORM,
680 VK_FORMAT_R8G8B8A8_UINT,
681 VK_FORMAT_R8G8B8A8_SINT,
682 VK_FORMAT_R8G8B8A8_SRGB,
683 VK_FORMAT_B8G8R8A8_UNORM,
684 VK_FORMAT_B8G8R8A8_SRGB,
685 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
686 VK_FORMAT_A8B8G8R8_UINT_PACK32,
687 VK_FORMAT_A8B8G8R8_SINT_PACK32,
688 VK_FORMAT_A8B8G8R8_SRGB_PACK32,
689 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
690 VK_FORMAT_A2B10G10R10_UINT_PACK32,
693 VK_FORMAT_R16_SFLOAT,
694 VK_FORMAT_R16G16_UINT,
695 VK_FORMAT_R16G16_SINT,
696 VK_FORMAT_R16G16_SFLOAT,
697 VK_FORMAT_R16G16B16A16_UINT,
698 VK_FORMAT_R16G16B16A16_SINT,
699 VK_FORMAT_R16G16B16A16_SFLOAT,
702 VK_FORMAT_R32_SFLOAT,
703 VK_FORMAT_R32G32_UINT,
704 VK_FORMAT_R32G32_SINT,
705 VK_FORMAT_R32G32_SFLOAT,
706 VK_FORMAT_R32G32B32A32_UINT,
707 VK_FORMAT_R32G32B32A32_SINT,
708 VK_FORMAT_R32G32B32A32_SFLOAT
710 static const VkFormat s_requiredColorAttachmentBlendFormats[] =
712 VK_FORMAT_R5G6B5_UNORM_PACK16,
713 VK_FORMAT_A1R5G5B5_UNORM_PACK16,
715 VK_FORMAT_R8G8_UNORM,
716 VK_FORMAT_R8G8B8A8_UNORM,
717 VK_FORMAT_R8G8B8A8_SRGB,
718 VK_FORMAT_B8G8R8A8_UNORM,
719 VK_FORMAT_B8G8R8A8_SRGB,
720 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
721 VK_FORMAT_A8B8G8R8_SRGB_PACK32,
722 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
723 VK_FORMAT_R16_SFLOAT,
724 VK_FORMAT_R16G16_SFLOAT,
725 VK_FORMAT_R16G16B16A16_SFLOAT
727 static const VkFormat s_requiredDepthStencilAttachmentFormats[] =
732 VkFormatFeatureFlags flags = (VkFormatFeatureFlags)0;
734 if (de::contains(DE_ARRAY_BEGIN(s_requiredSampledImageBlitSrcFormats), DE_ARRAY_END(s_requiredSampledImageBlitSrcFormats), format))
735 flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT|VK_FORMAT_FEATURE_BLIT_SRC_BIT;
737 if (de::contains(DE_ARRAY_BEGIN(s_requiredStorageImageFormats), DE_ARRAY_END(s_requiredStorageImageFormats), format))
738 flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
740 if (de::contains(DE_ARRAY_BEGIN(s_requiredStorageImageAtomicFormats), DE_ARRAY_END(s_requiredStorageImageAtomicFormats), format))
741 flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT;
743 if (de::contains(DE_ARRAY_BEGIN(s_requiredColorAttachmentBlitDstFormats), DE_ARRAY_END(s_requiredColorAttachmentBlitDstFormats), format))
744 flags |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT|VK_FORMAT_FEATURE_BLIT_DST_BIT;
746 if (de::contains(DE_ARRAY_BEGIN(s_requiredColorAttachmentBlendFormats), DE_ARRAY_END(s_requiredColorAttachmentBlendFormats), format))
747 flags |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT;
749 if (de::contains(DE_ARRAY_BEGIN(s_requiredDepthStencilAttachmentFormats), DE_ARRAY_END(s_requiredDepthStencilAttachmentFormats), format))
750 flags |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT;
755 VkFormatFeatureFlags getRequiredBufferFeatures (VkFormat format)
757 static const VkFormat s_requiredVertexBufferFormats[] =
763 VK_FORMAT_R8G8_UNORM,
764 VK_FORMAT_R8G8_SNORM,
767 VK_FORMAT_R8G8B8A8_UNORM,
768 VK_FORMAT_R8G8B8A8_SNORM,
769 VK_FORMAT_R8G8B8A8_UINT,
770 VK_FORMAT_R8G8B8A8_SINT,
771 VK_FORMAT_B8G8R8A8_UNORM,
772 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
773 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
774 VK_FORMAT_A8B8G8R8_UINT_PACK32,
775 VK_FORMAT_A8B8G8R8_SINT_PACK32,
776 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
781 VK_FORMAT_R16_SFLOAT,
782 VK_FORMAT_R16G16_UNORM,
783 VK_FORMAT_R16G16_SNORM,
784 VK_FORMAT_R16G16_UINT,
785 VK_FORMAT_R16G16_SINT,
786 VK_FORMAT_R16G16_SFLOAT,
787 VK_FORMAT_R16G16B16A16_UNORM,
788 VK_FORMAT_R16G16B16A16_SNORM,
789 VK_FORMAT_R16G16B16A16_UINT,
790 VK_FORMAT_R16G16B16A16_SINT,
791 VK_FORMAT_R16G16B16A16_SFLOAT,
794 VK_FORMAT_R32_SFLOAT,
795 VK_FORMAT_R32G32_UINT,
796 VK_FORMAT_R32G32_SINT,
797 VK_FORMAT_R32G32_SFLOAT,
798 VK_FORMAT_R32G32B32_UINT,
799 VK_FORMAT_R32G32B32_SINT,
800 VK_FORMAT_R32G32B32_SFLOAT,
801 VK_FORMAT_R32G32B32A32_UINT,
802 VK_FORMAT_R32G32B32A32_SINT,
803 VK_FORMAT_R32G32B32A32_SFLOAT
805 static const VkFormat s_requiredUniformTexelBufferFormats[] =
811 VK_FORMAT_R8G8_UNORM,
812 VK_FORMAT_R8G8_SNORM,
815 VK_FORMAT_R8G8B8A8_UNORM,
816 VK_FORMAT_R8G8B8A8_SNORM,
817 VK_FORMAT_R8G8B8A8_UINT,
818 VK_FORMAT_R8G8B8A8_SINT,
819 VK_FORMAT_B8G8R8A8_UNORM,
820 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
821 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
822 VK_FORMAT_A8B8G8R8_UINT_PACK32,
823 VK_FORMAT_A8B8G8R8_SINT_PACK32,
824 VK_FORMAT_A2B10G10R10_UNORM_PACK32,
825 VK_FORMAT_A2B10G10R10_UINT_PACK32,
828 VK_FORMAT_R16_SFLOAT,
829 VK_FORMAT_R16G16_UINT,
830 VK_FORMAT_R16G16_SINT,
831 VK_FORMAT_R16G16_SFLOAT,
832 VK_FORMAT_R16G16B16A16_UINT,
833 VK_FORMAT_R16G16B16A16_SINT,
834 VK_FORMAT_R16G16B16A16_SFLOAT,
837 VK_FORMAT_R32_SFLOAT,
838 VK_FORMAT_R32G32_UINT,
839 VK_FORMAT_R32G32_SINT,
840 VK_FORMAT_R32G32_SFLOAT,
841 VK_FORMAT_R32G32B32A32_UINT,
842 VK_FORMAT_R32G32B32A32_SINT,
843 VK_FORMAT_R32G32B32A32_SFLOAT,
844 VK_FORMAT_B10G11R11_UFLOAT_PACK32
846 static const VkFormat s_requiredStorageTexelBufferFormats[] =
848 VK_FORMAT_R8G8B8A8_UNORM,
849 VK_FORMAT_R8G8B8A8_SNORM,
850 VK_FORMAT_R8G8B8A8_UINT,
851 VK_FORMAT_R8G8B8A8_SINT,
852 VK_FORMAT_A8B8G8R8_UNORM_PACK32,
853 VK_FORMAT_A8B8G8R8_SNORM_PACK32,
854 VK_FORMAT_A8B8G8R8_UINT_PACK32,
855 VK_FORMAT_A8B8G8R8_SINT_PACK32,
856 VK_FORMAT_R16G16B16A16_UINT,
857 VK_FORMAT_R16G16B16A16_SINT,
858 VK_FORMAT_R16G16B16A16_SFLOAT,
861 VK_FORMAT_R32_SFLOAT,
862 VK_FORMAT_R32G32_UINT,
863 VK_FORMAT_R32G32_SINT,
864 VK_FORMAT_R32G32_SFLOAT,
865 VK_FORMAT_R32G32B32A32_UINT,
866 VK_FORMAT_R32G32B32A32_SINT,
867 VK_FORMAT_R32G32B32A32_SFLOAT
869 static const VkFormat s_requiredStorageTexelBufferAtomicFormats[] =
875 VkFormatFeatureFlags flags = (VkFormatFeatureFlags)0;
877 if (de::contains(DE_ARRAY_BEGIN(s_requiredVertexBufferFormats), DE_ARRAY_END(s_requiredVertexBufferFormats), format))
878 flags |= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT;
880 if (de::contains(DE_ARRAY_BEGIN(s_requiredUniformTexelBufferFormats), DE_ARRAY_END(s_requiredUniformTexelBufferFormats), format))
881 flags |= VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT;
883 if (de::contains(DE_ARRAY_BEGIN(s_requiredStorageTexelBufferFormats), DE_ARRAY_END(s_requiredStorageTexelBufferFormats), format))
884 flags |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT;
886 if (de::contains(DE_ARRAY_BEGIN(s_requiredStorageTexelBufferAtomicFormats), DE_ARRAY_END(s_requiredStorageTexelBufferAtomicFormats), format))
887 flags |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT;
892 tcu::TestStatus formatProperties (Context& context, VkFormat format)
894 TestLog& log = context.getTestContext().getLog();
895 const VkFormatProperties properties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
900 VkFormatFeatureFlags VkFormatProperties::* field;
901 const char* fieldName;
902 VkFormatFeatureFlags requiredFeatures;
905 { &VkFormatProperties::linearTilingFeatures, "linearTilingFeatures", (VkFormatFeatureFlags)0 },
906 { &VkFormatProperties::optimalTilingFeatures, "optimalTilingFeatures", getRequiredOptimalTilingFeatures(format) },
907 { &VkFormatProperties::bufferFeatures, "buffeFeatures", getRequiredBufferFeatures(format) }
910 log << TestLog::Message << properties << TestLog::EndMessage;
912 for (int fieldNdx = 0; fieldNdx < DE_LENGTH_OF_ARRAY(fields); fieldNdx++)
914 const char* const fieldName = fields[fieldNdx].fieldName;
915 const VkFormatFeatureFlags supported = properties.*fields[fieldNdx].field;
916 const VkFormatFeatureFlags required = fields[fieldNdx].requiredFeatures;
918 if ((supported & required) != required)
920 log << TestLog::Message << "ERROR in " << fieldName << ":\n"
921 << " required: " << getFormatFeatureFlagsStr(required) << "\n "
922 << " missing: " << getFormatFeatureFlagsStr(~supported & required)
923 << TestLog::EndMessage;
929 return tcu::TestStatus::pass("Query and validation passed");
931 return tcu::TestStatus::fail("Required features not supported");
934 bool optimalTilingFeaturesSupported (Context& context, VkFormat format, VkFormatFeatureFlags features)
936 const VkFormatProperties properties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
938 return (properties.optimalTilingFeatures & features) == features;
941 bool optimalTilingFeaturesSupportedForAll (Context& context, const VkFormat* begin, const VkFormat* end, VkFormatFeatureFlags features)
943 for (const VkFormat* cur = begin; cur != end; ++cur)
945 if (!optimalTilingFeaturesSupported(context, *cur, features))
952 tcu::TestStatus testDepthStencilSupported (Context& context)
954 if (!optimalTilingFeaturesSupported(context, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) &&
955 !optimalTilingFeaturesSupported(context, VK_FORMAT_D32_SFLOAT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
956 return tcu::TestStatus::fail("Doesn't support one of VK_FORMAT_X8_D24_UNORM_PACK32 or VK_FORMAT_D32_SFLOAT");
958 if (!optimalTilingFeaturesSupported(context, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) &&
959 !optimalTilingFeaturesSupported(context, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
960 return tcu::TestStatus::fail("Doesn't support one of VK_FORMAT_D24_UNORM_S8_UINT or VK_FORMAT_D32_SFLOAT_S8_UINT");
962 return tcu::TestStatus::pass("Required depth/stencil formats supported");
965 tcu::TestStatus testCompressedFormatsSupported (Context& context)
967 static const VkFormat s_allBcFormats[] =
969 VK_FORMAT_BC1_RGB_UNORM_BLOCK,
970 VK_FORMAT_BC1_RGB_SRGB_BLOCK,
971 VK_FORMAT_BC1_RGBA_UNORM_BLOCK,
972 VK_FORMAT_BC1_RGBA_SRGB_BLOCK,
973 VK_FORMAT_BC2_UNORM_BLOCK,
974 VK_FORMAT_BC2_SRGB_BLOCK,
975 VK_FORMAT_BC3_UNORM_BLOCK,
976 VK_FORMAT_BC3_SRGB_BLOCK,
977 VK_FORMAT_BC4_UNORM_BLOCK,
978 VK_FORMAT_BC4_SNORM_BLOCK,
979 VK_FORMAT_BC5_UNORM_BLOCK,
980 VK_FORMAT_BC5_SNORM_BLOCK,
981 VK_FORMAT_BC6H_UFLOAT_BLOCK,
982 VK_FORMAT_BC6H_SFLOAT_BLOCK,
983 VK_FORMAT_BC7_UNORM_BLOCK,
984 VK_FORMAT_BC7_SRGB_BLOCK,
986 static const VkFormat s_allEtcEacFormats[] =
988 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
989 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
990 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,
991 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,
992 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,
993 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,
994 VK_FORMAT_EAC_R11_UNORM_BLOCK,
995 VK_FORMAT_EAC_R11_SNORM_BLOCK,
996 VK_FORMAT_EAC_R11G11_UNORM_BLOCK,
997 VK_FORMAT_EAC_R11G11_SNORM_BLOCK,
999 static const VkFormat s_allAstcFormats[] =
1001 VK_FORMAT_ASTC_4x4_UNORM_BLOCK,
1002 VK_FORMAT_ASTC_4x4_SRGB_BLOCK,
1003 VK_FORMAT_ASTC_5x4_UNORM_BLOCK,
1004 VK_FORMAT_ASTC_5x4_SRGB_BLOCK,
1005 VK_FORMAT_ASTC_5x5_UNORM_BLOCK,
1006 VK_FORMAT_ASTC_5x5_SRGB_BLOCK,
1007 VK_FORMAT_ASTC_6x5_UNORM_BLOCK,
1008 VK_FORMAT_ASTC_6x5_SRGB_BLOCK,
1009 VK_FORMAT_ASTC_6x6_UNORM_BLOCK,
1010 VK_FORMAT_ASTC_6x6_SRGB_BLOCK,
1011 VK_FORMAT_ASTC_8x5_UNORM_BLOCK,
1012 VK_FORMAT_ASTC_8x5_SRGB_BLOCK,
1013 VK_FORMAT_ASTC_8x6_UNORM_BLOCK,
1014 VK_FORMAT_ASTC_8x6_SRGB_BLOCK,
1015 VK_FORMAT_ASTC_8x8_UNORM_BLOCK,
1016 VK_FORMAT_ASTC_8x8_SRGB_BLOCK,
1017 VK_FORMAT_ASTC_10x5_UNORM_BLOCK,
1018 VK_FORMAT_ASTC_10x5_SRGB_BLOCK,
1019 VK_FORMAT_ASTC_10x6_UNORM_BLOCK,
1020 VK_FORMAT_ASTC_10x6_SRGB_BLOCK,
1021 VK_FORMAT_ASTC_10x8_UNORM_BLOCK,
1022 VK_FORMAT_ASTC_10x8_SRGB_BLOCK,
1023 VK_FORMAT_ASTC_10x10_UNORM_BLOCK,
1024 VK_FORMAT_ASTC_10x10_SRGB_BLOCK,
1025 VK_FORMAT_ASTC_12x10_UNORM_BLOCK,
1026 VK_FORMAT_ASTC_12x10_SRGB_BLOCK,
1027 VK_FORMAT_ASTC_12x12_UNORM_BLOCK,
1028 VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
1031 const bool bcFormatsSupported = optimalTilingFeaturesSupportedForAll(context,
1032 DE_ARRAY_BEGIN(s_allBcFormats),
1033 DE_ARRAY_END(s_allBcFormats),
1034 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT);
1035 const bool etcEacFormatsSupported = optimalTilingFeaturesSupportedForAll(context,
1036 DE_ARRAY_BEGIN(s_allEtcEacFormats),
1037 DE_ARRAY_END(s_allEtcEacFormats),
1038 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT);
1039 const bool astcFormatsSupported = optimalTilingFeaturesSupportedForAll(context,
1040 DE_ARRAY_BEGIN(s_allAstcFormats),
1041 DE_ARRAY_END(s_allAstcFormats),
1042 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT);
1043 TestLog& log = context.getTestContext().getLog();
1045 log << TestLog::Message << "All BC* formats supported: " << (bcFormatsSupported ? "true" : "false") << TestLog::EndMessage;
1046 log << TestLog::Message << "All ETC2/EAC formats supported: " << (etcEacFormatsSupported ? "true" : "false") << TestLog::EndMessage;
1047 log << TestLog::Message << "All ASTC formats supported: " << (astcFormatsSupported ? "true" : "false") << TestLog::EndMessage;
1049 if (bcFormatsSupported || etcEacFormatsSupported || astcFormatsSupported)
1050 return tcu::TestStatus::pass("At least one set of compressed formats supported");
1052 return tcu::TestStatus::fail("Compressed formats not supported");
1055 void createFormatTests (tcu::TestCaseGroup* testGroup)
1057 DE_STATIC_ASSERT(VK_FORMAT_UNDEFINED == 0);
1059 for (deUint32 formatNdx = VK_FORMAT_UNDEFINED+1; formatNdx < VK_FORMAT_LAST; ++formatNdx)
1061 const VkFormat format = (VkFormat)formatNdx;
1062 const char* const enumName = getFormatName(format);
1063 const string caseName = de::toLower(string(enumName).substr(10));
1065 addFunctionCase(testGroup, caseName, enumName, formatProperties, format);
1068 addFunctionCase(testGroup, "depth_stencil", "", testDepthStencilSupported);
1069 addFunctionCase(testGroup, "compressed_formats", "", testCompressedFormatsSupported);
1072 VkImageUsageFlags getValidImageUsageFlags (VkFormat, VkFormatFeatureFlags supportedFeatures)
1074 VkImageUsageFlags flags = (VkImageUsageFlags)0;
1076 // If format is supported at all, it must be valid transfer src+dst
1077 if (supportedFeatures != 0)
1078 flags |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT;
1080 if ((supportedFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0)
1081 flags |= VK_IMAGE_USAGE_SAMPLED_BIT;
1083 if ((supportedFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) != 0)
1084 flags |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT|VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
1086 if ((supportedFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) != 0)
1087 flags |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
1089 if ((supportedFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) != 0)
1090 flags |= VK_IMAGE_USAGE_STORAGE_BIT;
1095 bool isValidImageUsageFlagCombination (VkImageUsageFlags usage)
1100 VkImageCreateFlags getValidImageCreateFlags (const VkPhysicalDeviceFeatures& deviceFeatures, VkFormat, VkFormatFeatureFlags, VkImageType type, VkImageUsageFlags usage)
1102 VkImageCreateFlags flags = (VkImageCreateFlags)0;
1104 if ((usage & VK_IMAGE_USAGE_SAMPLED_BIT) != 0)
1106 flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
1108 if (type == VK_IMAGE_TYPE_2D)
1109 flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
1112 if ((usage & (VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_STORAGE_BIT)) != 0 &&
1113 (usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) == 0)
1115 if (deviceFeatures.sparseBinding)
1116 flags |= VK_IMAGE_CREATE_SPARSE_BINDING_BIT|VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT;
1118 if (deviceFeatures.sparseResidencyAliased)
1119 flags |= VK_IMAGE_CREATE_SPARSE_ALIASED_BIT;
1125 bool isValidImageCreateFlagCombination (VkImageCreateFlags)
1130 struct ImageFormatPropertyCase
1133 VkImageType imageType;
1134 VkImageTiling tiling;
1136 ImageFormatPropertyCase (VkFormat format_, VkImageType imageType_, VkImageTiling tiling_)
1138 , imageType (imageType_)
1142 ImageFormatPropertyCase (void)
1143 : format (VK_FORMAT_LAST)
1144 , imageType (VK_IMAGE_TYPE_LAST)
1145 , tiling (VK_IMAGE_TILING_LAST)
1149 tcu::TestStatus imageFormatProperties (Context& context, ImageFormatPropertyCase params)
1151 TestLog& log = context.getTestContext().getLog();
1152 const VkFormat format = params.format;
1153 const VkImageType imageType = params.imageType;
1154 const VkImageTiling tiling = params.tiling;
1155 const VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures();
1156 const VkFormatProperties formatProperties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
1158 const VkFormatFeatureFlags supportedFeatures = tiling == VK_IMAGE_TILING_LINEAR ? formatProperties.linearTilingFeatures : formatProperties.optimalTilingFeatures;
1159 const VkImageUsageFlags usageFlagSet = getValidImageUsageFlags(format, supportedFeatures);
1161 for (VkImageUsageFlags curUsageFlags = 0; curUsageFlags <= usageFlagSet; curUsageFlags++)
1163 if ((curUsageFlags & ~usageFlagSet) != 0 ||
1164 !isValidImageUsageFlagCombination(curUsageFlags))
1167 const VkImageCreateFlags createFlagSet = getValidImageCreateFlags(deviceFeatures, format, supportedFeatures, imageType, curUsageFlags);
1169 for (VkImageCreateFlags curCreateFlags = 0; curCreateFlags <= createFlagSet; curCreateFlags++)
1171 if ((curCreateFlags & ~createFlagSet) != 0 ||
1172 !isValidImageCreateFlagCombination(curCreateFlags))
1175 log << TestLog::Message << "Testing " << getImageTypeStr(imageType) << ", "
1176 << getImageTilingStr(tiling) << ", "
1177 << getImageUsageFlagsStr(curUsageFlags) << ", "
1178 << getImageCreateFlagsStr(curCreateFlags)
1179 << TestLog::EndMessage;
1183 const VkImageFormatProperties properties = getPhysicalDeviceImageFormatProperties(context.getInstanceInterface(),
1184 context.getPhysicalDevice(),
1190 log << TestLog::Message << properties << "\n" << TestLog::EndMessage;
1192 // \todo [2016-01-24 pyry] Expand validation
1193 TCU_CHECK((properties.sampleCounts & VK_SAMPLE_COUNT_1_BIT) != 0);
1194 TCU_CHECK(imageType != VK_IMAGE_TYPE_1D || (properties.maxExtent.width >= 1 && properties.maxExtent.height == 1 && properties.maxExtent.depth == 1));
1195 TCU_CHECK(imageType != VK_IMAGE_TYPE_2D || (properties.maxExtent.width >= 1 && properties.maxExtent.height >= 1 && properties.maxExtent.depth == 1));
1196 TCU_CHECK(imageType != VK_IMAGE_TYPE_3D || (properties.maxExtent.width >= 1 && properties.maxExtent.height >= 1 && properties.maxExtent.depth >= 1));
1198 catch (const Error& error)
1200 // \todo [2016-01-22 pyry] Check if this is indeed optional image type / flag combination
1201 if (error.getError() == VK_ERROR_FORMAT_NOT_SUPPORTED)
1202 log << TestLog::Message << "Got VK_ERROR_FORMAT_NOT_SUPPORTED" << TestLog::EndMessage;
1209 return tcu::TestStatus::pass("All queries succeeded");
1212 void createImageFormatTypeTilingTests (tcu::TestCaseGroup* testGroup, ImageFormatPropertyCase params)
1214 DE_ASSERT(params.format == VK_FORMAT_LAST);
1216 for (deUint32 formatNdx = VK_FORMAT_UNDEFINED+1; formatNdx < VK_FORMAT_LAST; ++formatNdx)
1218 const VkFormat format = (VkFormat)formatNdx;
1219 const char* const enumName = getFormatName(format);
1220 const string caseName = de::toLower(string(enumName).substr(10));
1222 params.format = format;
1224 addFunctionCase(testGroup, caseName, enumName, imageFormatProperties, params);
1228 void createImageFormatTypeTests (tcu::TestCaseGroup* testGroup, ImageFormatPropertyCase params)
1230 DE_ASSERT(params.tiling == VK_IMAGE_TILING_LAST);
1232 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "optimal", "", createImageFormatTypeTilingTests, ImageFormatPropertyCase(VK_FORMAT_LAST, params.imageType, VK_IMAGE_TILING_OPTIMAL)));
1233 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "linear", "", createImageFormatTypeTilingTests, ImageFormatPropertyCase(VK_FORMAT_LAST, params.imageType, VK_IMAGE_TILING_LINEAR)));
1236 void createImageFormatTests (tcu::TestCaseGroup* testGroup)
1238 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "1d", "", createImageFormatTypeTests, ImageFormatPropertyCase(VK_FORMAT_LAST, VK_IMAGE_TYPE_1D, VK_IMAGE_TILING_LAST)));
1239 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "2d", "", createImageFormatTypeTests, ImageFormatPropertyCase(VK_FORMAT_LAST, VK_IMAGE_TYPE_2D, VK_IMAGE_TILING_LAST)));
1240 testGroup->addChild(createTestGroup(testGroup->getTestContext(), "3d", "", createImageFormatTypeTests, ImageFormatPropertyCase(VK_FORMAT_LAST, VK_IMAGE_TYPE_3D, VK_IMAGE_TILING_LAST)));
1245 tcu::TestCaseGroup* createFeatureInfoTests (tcu::TestContext& testCtx)
1247 de::MovePtr<tcu::TestCaseGroup> infoTests (new tcu::TestCaseGroup(testCtx, "info", "Platform Information Tests"));
1250 de::MovePtr<tcu::TestCaseGroup> instanceInfoTests (new tcu::TestCaseGroup(testCtx, "instance", "Instance Information Tests"));
1252 addFunctionCase(instanceInfoTests.get(), "physical_devices", "Physical devices", enumeratePhysicalDevices);
1253 addFunctionCase(instanceInfoTests.get(), "layers", "Layers", enumerateInstanceLayers);
1254 addFunctionCase(instanceInfoTests.get(), "extensions", "Extensions", enumerateInstanceExtensions);
1256 infoTests->addChild(instanceInfoTests.release());
1260 de::MovePtr<tcu::TestCaseGroup> deviceInfoTests (new tcu::TestCaseGroup(testCtx, "device", "Device Information Tests"));
1262 addFunctionCase(deviceInfoTests.get(), "features", "Device Features", deviceFeatures);
1263 addFunctionCase(deviceInfoTests.get(), "properties", "Device Properties", deviceProperties);
1264 addFunctionCase(deviceInfoTests.get(), "queue_family_properties", "Queue family properties", deviceQueueFamilyProperties);
1265 addFunctionCase(deviceInfoTests.get(), "memory_properties", "Memory properties", deviceMemoryProperties);
1266 addFunctionCase(deviceInfoTests.get(), "layers", "Layers", enumerateDeviceLayers);
1267 addFunctionCase(deviceInfoTests.get(), "extensions", "Extensions", enumerateDeviceExtensions);
1269 infoTests->addChild(deviceInfoTests.release());
1272 infoTests->addChild(createTestGroup(testCtx, "format_properties", "VkGetPhysicalDeviceFormatProperties() Tests", createFormatTests));
1273 infoTests->addChild(createTestGroup(testCtx, "image_format_properties", "VkGetPhysicalDeviceImageFormatProperties() Tests", createImageFormatTests));
1275 return infoTests.release();