Merge vk-gl-cts/vulkan-cts-1.3.2 into vk-gl-cts/main
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / framework / vulkan / generated / vulkansc / vkDeviceFeatureTest.inl
1 /* WARNING: This is auto-generated file. Do not modify, since changes will
2  * be lost! Modify the generating script instead.
3  * This file was generated by /scripts/gen_framework.py
4  */
5
6
7
8 tcu::TestStatus createDeviceWithUnsupportedFeaturesTest16BitStorageFeatures (Context& context)
9 {
10         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
11         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
12         tcu::ResultCollector                                    resultCollector                 (log);
13         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
14         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
15         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
16         const deUint32                                                  queueFamilyIndex                = 0;
17         const deUint32                                                  queueCount                              = 1;
18         const float                                                             queuePriority                   = 1.0f;
19         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
20         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
21         int                                                                             numErrors                               = 0;
22         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
23         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
24
25         VkPhysicalDeviceFeatures emptyDeviceFeatures;
26         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
27
28         // Only non-core extensions will be used when creating the device.
29         vector<const char*>     coreExtensions;
30         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
31         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
32
33         vector<const char*> extensionNames;
34         extensionNames.reserve(nonCoreExtensions.size());
35         for (const string& extension : nonCoreExtensions)
36                 extensionNames.push_back(extension.c_str());
37
38         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDevice16BitStorageFeatures>()))
39         {
40                 static const Feature features[] =
41                 {
42                 FEATURE_ITEM (VkPhysicalDevice16BitStorageFeatures, storageBuffer16BitAccess),
43                 FEATURE_ITEM (VkPhysicalDevice16BitStorageFeatures, uniformAndStorageBuffer16BitAccess),
44                 FEATURE_ITEM (VkPhysicalDevice16BitStorageFeatures, storagePushConstant16),
45                 FEATURE_ITEM (VkPhysicalDevice16BitStorageFeatures, storageInputOutput16),
46                 };
47                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDevice16BitStorageFeatures*>(featuresStruct);
48                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 4, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
49         }
50
51         if (numErrors > 0)
52                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
53         else
54                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
55 }
56
57
58 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestMultiviewFeatures (Context& context)
59 {
60         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
61         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
62         tcu::ResultCollector                                    resultCollector                 (log);
63         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
64         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
65         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
66         const deUint32                                                  queueFamilyIndex                = 0;
67         const deUint32                                                  queueCount                              = 1;
68         const float                                                             queuePriority                   = 1.0f;
69         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
70         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
71         int                                                                             numErrors                               = 0;
72         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
73         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
74
75         VkPhysicalDeviceFeatures emptyDeviceFeatures;
76         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
77
78         // Only non-core extensions will be used when creating the device.
79         vector<const char*>     coreExtensions;
80         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
81         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
82
83         vector<const char*> extensionNames;
84         extensionNames.reserve(nonCoreExtensions.size());
85         for (const string& extension : nonCoreExtensions)
86                 extensionNames.push_back(extension.c_str());
87
88         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceMultiviewFeatures>()))
89         {
90                 static const Feature features[] =
91                 {
92                 FEATURE_ITEM (VkPhysicalDeviceMultiviewFeatures, multiview),
93                 FEATURE_ITEM (VkPhysicalDeviceMultiviewFeatures, multiviewGeometryShader),
94                 FEATURE_ITEM (VkPhysicalDeviceMultiviewFeatures, multiviewTessellationShader),
95                 };
96                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceMultiviewFeatures*>(featuresStruct);
97                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 3, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
98         }
99
100         if (numErrors > 0)
101                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
102         else
103                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
104 }
105
106
107 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestVariablePointersFeatures (Context& context)
108 {
109         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
110         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
111         tcu::ResultCollector                                    resultCollector                 (log);
112         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
113         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
114         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
115         const deUint32                                                  queueFamilyIndex                = 0;
116         const deUint32                                                  queueCount                              = 1;
117         const float                                                             queuePriority                   = 1.0f;
118         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
119         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
120         int                                                                             numErrors                               = 0;
121         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
122         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
123
124         VkPhysicalDeviceFeatures emptyDeviceFeatures;
125         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
126
127         // Only non-core extensions will be used when creating the device.
128         vector<const char*>     coreExtensions;
129         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
130         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
131
132         vector<const char*> extensionNames;
133         extensionNames.reserve(nonCoreExtensions.size());
134         for (const string& extension : nonCoreExtensions)
135                 extensionNames.push_back(extension.c_str());
136
137         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceVariablePointersFeatures>()))
138         {
139                 static const Feature features[] =
140                 {
141                 FEATURE_ITEM (VkPhysicalDeviceVariablePointersFeatures, variablePointersStorageBuffer),
142                 FEATURE_ITEM (VkPhysicalDeviceVariablePointersFeatures, variablePointers),
143                 };
144                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceVariablePointersFeatures*>(featuresStruct);
145                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
146         }
147
148         if (numErrors > 0)
149                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
150         else
151                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
152 }
153
154
155 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestProtectedMemoryFeatures (Context& context)
156 {
157         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
158         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
159         tcu::ResultCollector                                    resultCollector                 (log);
160         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
161         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
162         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
163         const deUint32                                                  queueFamilyIndex                = 0;
164         const deUint32                                                  queueCount                              = 1;
165         const float                                                             queuePriority                   = 1.0f;
166         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
167         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
168         int                                                                             numErrors                               = 0;
169         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
170         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
171
172         VkPhysicalDeviceFeatures emptyDeviceFeatures;
173         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
174
175         // Only non-core extensions will be used when creating the device.
176         vector<const char*>     coreExtensions;
177         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
178         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
179
180         vector<const char*> extensionNames;
181         extensionNames.reserve(nonCoreExtensions.size());
182         for (const string& extension : nonCoreExtensions)
183                 extensionNames.push_back(extension.c_str());
184
185         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceProtectedMemoryFeatures>()))
186         {
187                 static const Feature features[] =
188                 {
189                 FEATURE_ITEM (VkPhysicalDeviceProtectedMemoryFeatures, protectedMemory),
190                 };
191                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceProtectedMemoryFeatures*>(featuresStruct);
192                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
193         }
194
195         if (numErrors > 0)
196                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
197         else
198                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
199 }
200
201
202 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestSamplerYcbcrConversionFeatures (Context& context)
203 {
204         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
205         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
206         tcu::ResultCollector                                    resultCollector                 (log);
207         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
208         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
209         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
210         const deUint32                                                  queueFamilyIndex                = 0;
211         const deUint32                                                  queueCount                              = 1;
212         const float                                                             queuePriority                   = 1.0f;
213         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
214         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
215         int                                                                             numErrors                               = 0;
216         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
217         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
218
219         VkPhysicalDeviceFeatures emptyDeviceFeatures;
220         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
221
222         // Only non-core extensions will be used when creating the device.
223         vector<const char*>     coreExtensions;
224         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
225         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
226
227         vector<const char*> extensionNames;
228         extensionNames.reserve(nonCoreExtensions.size());
229         for (const string& extension : nonCoreExtensions)
230                 extensionNames.push_back(extension.c_str());
231
232         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceSamplerYcbcrConversionFeatures>()))
233         {
234                 static const Feature features[] =
235                 {
236                 FEATURE_ITEM (VkPhysicalDeviceSamplerYcbcrConversionFeatures, samplerYcbcrConversion),
237                 };
238                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(featuresStruct);
239                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
240         }
241
242         if (numErrors > 0)
243                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
244         else
245                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
246 }
247
248
249 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderDrawParametersFeatures (Context& context)
250 {
251         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
252         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
253         tcu::ResultCollector                                    resultCollector                 (log);
254         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
255         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
256         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
257         const deUint32                                                  queueFamilyIndex                = 0;
258         const deUint32                                                  queueCount                              = 1;
259         const float                                                             queuePriority                   = 1.0f;
260         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
261         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
262         int                                                                             numErrors                               = 0;
263         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
264         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
265
266         VkPhysicalDeviceFeatures emptyDeviceFeatures;
267         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
268
269         // Only non-core extensions will be used when creating the device.
270         vector<const char*>     coreExtensions;
271         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
272         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
273
274         vector<const char*> extensionNames;
275         extensionNames.reserve(nonCoreExtensions.size());
276         for (const string& extension : nonCoreExtensions)
277                 extensionNames.push_back(extension.c_str());
278
279         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderDrawParametersFeatures>()))
280         {
281                 static const Feature features[] =
282                 {
283                 FEATURE_ITEM (VkPhysicalDeviceShaderDrawParametersFeatures, shaderDrawParameters),
284                 };
285                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderDrawParametersFeatures*>(featuresStruct);
286                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
287         }
288
289         if (numErrors > 0)
290                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
291         else
292                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
293 }
294
295
296 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestVulkan11Features (Context& context)
297 {
298         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
299         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
300         tcu::ResultCollector                                    resultCollector                 (log);
301         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
302         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
303         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
304         const deUint32                                                  queueFamilyIndex                = 0;
305         const deUint32                                                  queueCount                              = 1;
306         const float                                                             queuePriority                   = 1.0f;
307         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
308         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
309         int                                                                             numErrors                               = 0;
310         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
311         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
312
313         VkPhysicalDeviceFeatures emptyDeviceFeatures;
314         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
315
316         // Only non-core extensions will be used when creating the device.
317         vector<const char*>     coreExtensions;
318         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
319         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
320
321         vector<const char*> extensionNames;
322         extensionNames.reserve(nonCoreExtensions.size());
323         for (const string& extension : nonCoreExtensions)
324                 extensionNames.push_back(extension.c_str());
325
326         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceVulkan11Features>()))
327         {
328                 static const Feature features[] =
329                 {
330                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, storageBuffer16BitAccess),
331                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, uniformAndStorageBuffer16BitAccess),
332                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, storagePushConstant16),
333                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, storageInputOutput16),
334                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, multiview),
335                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, multiviewGeometryShader),
336                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, multiviewTessellationShader),
337                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, variablePointersStorageBuffer),
338                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, variablePointers),
339                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, protectedMemory),
340                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, samplerYcbcrConversion),
341                 FEATURE_ITEM (VkPhysicalDeviceVulkan11Features, shaderDrawParameters),
342                 };
343                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceVulkan11Features*>(featuresStruct);
344                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 12, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, DE_NULL, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
345         }
346
347         if (numErrors > 0)
348                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
349         else
350                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
351 }
352
353
354 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestVulkan12Features (Context& context)
355 {
356         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
357         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
358         tcu::ResultCollector                                    resultCollector                 (log);
359         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
360         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
361         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
362         const deUint32                                                  queueFamilyIndex                = 0;
363         const deUint32                                                  queueCount                              = 1;
364         const float                                                             queuePriority                   = 1.0f;
365         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
366         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
367         int                                                                             numErrors                               = 0;
368         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
369         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
370
371         VkPhysicalDeviceFeatures emptyDeviceFeatures;
372         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
373
374         // Only non-core extensions will be used when creating the device.
375         vector<const char*>     coreExtensions;
376         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
377         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
378
379         vector<const char*> extensionNames;
380         extensionNames.reserve(nonCoreExtensions.size());
381         for (const string& extension : nonCoreExtensions)
382                 extensionNames.push_back(extension.c_str());
383
384         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceVulkan12Features>()))
385         {
386                 static const Feature features[] =
387                 {
388                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, samplerMirrorClampToEdge),
389                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, drawIndirectCount),
390                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, storageBuffer8BitAccess),
391                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, uniformAndStorageBuffer8BitAccess),
392                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, storagePushConstant8),
393                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderBufferInt64Atomics),
394                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderSharedInt64Atomics),
395                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderFloat16),
396                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderInt8),
397                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorIndexing),
398                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderInputAttachmentArrayDynamicIndexing),
399                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderUniformTexelBufferArrayDynamicIndexing),
400                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderStorageTexelBufferArrayDynamicIndexing),
401                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderUniformBufferArrayNonUniformIndexing),
402                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderSampledImageArrayNonUniformIndexing),
403                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderStorageBufferArrayNonUniformIndexing),
404                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderStorageImageArrayNonUniformIndexing),
405                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderInputAttachmentArrayNonUniformIndexing),
406                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderUniformTexelBufferArrayNonUniformIndexing),
407                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderStorageTexelBufferArrayNonUniformIndexing),
408                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingUniformBufferUpdateAfterBind),
409                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingSampledImageUpdateAfterBind),
410                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingStorageImageUpdateAfterBind),
411                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingStorageBufferUpdateAfterBind),
412                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingUniformTexelBufferUpdateAfterBind),
413                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingStorageTexelBufferUpdateAfterBind),
414                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingUpdateUnusedWhilePending),
415                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingPartiallyBound),
416                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, descriptorBindingVariableDescriptorCount),
417                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, runtimeDescriptorArray),
418                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, samplerFilterMinmax),
419                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, scalarBlockLayout),
420                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, imagelessFramebuffer),
421                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, uniformBufferStandardLayout),
422                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderSubgroupExtendedTypes),
423                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, separateDepthStencilLayouts),
424                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, hostQueryReset),
425                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, timelineSemaphore),
426                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, bufferDeviceAddress),
427                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, bufferDeviceAddressCaptureReplay),
428                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, bufferDeviceAddressMultiDevice),
429                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, vulkanMemoryModel),
430                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, vulkanMemoryModelDeviceScope),
431                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, vulkanMemoryModelAvailabilityVisibilityChains),
432                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderOutputViewportIndex),
433                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, shaderOutputLayer),
434                 FEATURE_ITEM (VkPhysicalDeviceVulkan12Features, subgroupBroadcastDynamicId),
435                 };
436                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceVulkan12Features*>(featuresStruct);
437                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 47, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, DE_NULL, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
438         }
439
440         if (numErrors > 0)
441                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
442         else
443                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
444 }
445
446
447 tcu::TestStatus createDeviceWithUnsupportedFeaturesTest8BitStorageFeatures (Context& context)
448 {
449         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
450         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
451         tcu::ResultCollector                                    resultCollector                 (log);
452         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
453         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
454         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
455         const deUint32                                                  queueFamilyIndex                = 0;
456         const deUint32                                                  queueCount                              = 1;
457         const float                                                             queuePriority                   = 1.0f;
458         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
459         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
460         int                                                                             numErrors                               = 0;
461         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
462         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
463
464         VkPhysicalDeviceFeatures emptyDeviceFeatures;
465         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
466
467         // Only non-core extensions will be used when creating the device.
468         vector<const char*>     coreExtensions;
469         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
470         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
471
472         vector<const char*> extensionNames;
473         extensionNames.reserve(nonCoreExtensions.size());
474         for (const string& extension : nonCoreExtensions)
475                 extensionNames.push_back(extension.c_str());
476
477         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDevice8BitStorageFeatures>()))
478         {
479                 static const Feature features[] =
480                 {
481                 FEATURE_ITEM (VkPhysicalDevice8BitStorageFeatures, storageBuffer8BitAccess),
482                 FEATURE_ITEM (VkPhysicalDevice8BitStorageFeatures, uniformAndStorageBuffer8BitAccess),
483                 FEATURE_ITEM (VkPhysicalDevice8BitStorageFeatures, storagePushConstant8),
484                 };
485                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDevice8BitStorageFeatures*>(featuresStruct);
486                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 3, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
487         }
488
489         if (numErrors > 0)
490                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
491         else
492                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
493 }
494
495
496 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderAtomicInt64Features (Context& context)
497 {
498         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
499         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
500         tcu::ResultCollector                                    resultCollector                 (log);
501         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
502         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
503         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
504         const deUint32                                                  queueFamilyIndex                = 0;
505         const deUint32                                                  queueCount                              = 1;
506         const float                                                             queuePriority                   = 1.0f;
507         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
508         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
509         int                                                                             numErrors                               = 0;
510         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
511         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
512
513         VkPhysicalDeviceFeatures emptyDeviceFeatures;
514         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
515
516         // Only non-core extensions will be used when creating the device.
517         vector<const char*>     coreExtensions;
518         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
519         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
520
521         vector<const char*> extensionNames;
522         extensionNames.reserve(nonCoreExtensions.size());
523         for (const string& extension : nonCoreExtensions)
524                 extensionNames.push_back(extension.c_str());
525
526         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderAtomicInt64Features>()))
527         {
528                 static const Feature features[] =
529                 {
530                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicInt64Features, shaderBufferInt64Atomics),
531                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicInt64Features, shaderSharedInt64Atomics),
532                 };
533                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderAtomicInt64Features*>(featuresStruct);
534                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
535         }
536
537         if (numErrors > 0)
538                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
539         else
540                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
541 }
542
543
544 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderFloat16Int8Features (Context& context)
545 {
546         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
547         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
548         tcu::ResultCollector                                    resultCollector                 (log);
549         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
550         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
551         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
552         const deUint32                                                  queueFamilyIndex                = 0;
553         const deUint32                                                  queueCount                              = 1;
554         const float                                                             queuePriority                   = 1.0f;
555         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
556         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
557         int                                                                             numErrors                               = 0;
558         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
559         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
560
561         VkPhysicalDeviceFeatures emptyDeviceFeatures;
562         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
563
564         // Only non-core extensions will be used when creating the device.
565         vector<const char*>     coreExtensions;
566         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
567         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
568
569         vector<const char*> extensionNames;
570         extensionNames.reserve(nonCoreExtensions.size());
571         for (const string& extension : nonCoreExtensions)
572                 extensionNames.push_back(extension.c_str());
573
574         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderFloat16Int8Features>()))
575         {
576                 static const Feature features[] =
577                 {
578                 FEATURE_ITEM (VkPhysicalDeviceShaderFloat16Int8Features, shaderFloat16),
579                 FEATURE_ITEM (VkPhysicalDeviceShaderFloat16Int8Features, shaderInt8),
580                 };
581                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderFloat16Int8Features*>(featuresStruct);
582                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
583         }
584
585         if (numErrors > 0)
586                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
587         else
588                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
589 }
590
591
592 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestDescriptorIndexingFeatures (Context& context)
593 {
594         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
595         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
596         tcu::ResultCollector                                    resultCollector                 (log);
597         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
598         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
599         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
600         const deUint32                                                  queueFamilyIndex                = 0;
601         const deUint32                                                  queueCount                              = 1;
602         const float                                                             queuePriority                   = 1.0f;
603         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
604         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
605         int                                                                             numErrors                               = 0;
606         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
607         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
608
609         VkPhysicalDeviceFeatures emptyDeviceFeatures;
610         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
611
612         // Only non-core extensions will be used when creating the device.
613         vector<const char*>     coreExtensions;
614         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
615         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
616
617         vector<const char*> extensionNames;
618         extensionNames.reserve(nonCoreExtensions.size());
619         for (const string& extension : nonCoreExtensions)
620                 extensionNames.push_back(extension.c_str());
621
622         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceDescriptorIndexingFeatures>()))
623         {
624                 static const Feature features[] =
625                 {
626                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderInputAttachmentArrayDynamicIndexing),
627                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderUniformTexelBufferArrayDynamicIndexing),
628                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderStorageTexelBufferArrayDynamicIndexing),
629                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderUniformBufferArrayNonUniformIndexing),
630                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderSampledImageArrayNonUniformIndexing),
631                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderStorageBufferArrayNonUniformIndexing),
632                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderStorageImageArrayNonUniformIndexing),
633                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderInputAttachmentArrayNonUniformIndexing),
634                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderUniformTexelBufferArrayNonUniformIndexing),
635                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, shaderStorageTexelBufferArrayNonUniformIndexing),
636                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingUniformBufferUpdateAfterBind),
637                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingSampledImageUpdateAfterBind),
638                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingStorageImageUpdateAfterBind),
639                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingStorageBufferUpdateAfterBind),
640                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingUniformTexelBufferUpdateAfterBind),
641                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingStorageTexelBufferUpdateAfterBind),
642                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingUpdateUnusedWhilePending),
643                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingPartiallyBound),
644                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, descriptorBindingVariableDescriptorCount),
645                 FEATURE_ITEM (VkPhysicalDeviceDescriptorIndexingFeatures, runtimeDescriptorArray),
646                 };
647                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingFeatures*>(featuresStruct);
648                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 20, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
649         }
650
651         if (numErrors > 0)
652                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
653         else
654                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
655 }
656
657
658 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestScalarBlockLayoutFeatures (Context& context)
659 {
660         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
661         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
662         tcu::ResultCollector                                    resultCollector                 (log);
663         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
664         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
665         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
666         const deUint32                                                  queueFamilyIndex                = 0;
667         const deUint32                                                  queueCount                              = 1;
668         const float                                                             queuePriority                   = 1.0f;
669         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
670         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
671         int                                                                             numErrors                               = 0;
672         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
673         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
674
675         VkPhysicalDeviceFeatures emptyDeviceFeatures;
676         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
677
678         // Only non-core extensions will be used when creating the device.
679         vector<const char*>     coreExtensions;
680         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
681         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
682
683         vector<const char*> extensionNames;
684         extensionNames.reserve(nonCoreExtensions.size());
685         for (const string& extension : nonCoreExtensions)
686                 extensionNames.push_back(extension.c_str());
687
688         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceScalarBlockLayoutFeatures>()))
689         {
690                 static const Feature features[] =
691                 {
692                 FEATURE_ITEM (VkPhysicalDeviceScalarBlockLayoutFeatures, scalarBlockLayout),
693                 };
694                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceScalarBlockLayoutFeatures*>(featuresStruct);
695                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
696         }
697
698         if (numErrors > 0)
699                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
700         else
701                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
702 }
703
704
705 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestVulkanMemoryModelFeatures (Context& context)
706 {
707         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
708         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
709         tcu::ResultCollector                                    resultCollector                 (log);
710         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
711         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
712         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
713         const deUint32                                                  queueFamilyIndex                = 0;
714         const deUint32                                                  queueCount                              = 1;
715         const float                                                             queuePriority                   = 1.0f;
716         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
717         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
718         int                                                                             numErrors                               = 0;
719         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
720         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
721
722         VkPhysicalDeviceFeatures emptyDeviceFeatures;
723         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
724
725         // Only non-core extensions will be used when creating the device.
726         vector<const char*>     coreExtensions;
727         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
728         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
729
730         vector<const char*> extensionNames;
731         extensionNames.reserve(nonCoreExtensions.size());
732         for (const string& extension : nonCoreExtensions)
733                 extensionNames.push_back(extension.c_str());
734
735         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceVulkanMemoryModelFeatures>()))
736         {
737                 static const Feature features[] =
738                 {
739                 FEATURE_ITEM (VkPhysicalDeviceVulkanMemoryModelFeatures, vulkanMemoryModel),
740                 FEATURE_ITEM (VkPhysicalDeviceVulkanMemoryModelFeatures, vulkanMemoryModelDeviceScope),
741                 FEATURE_ITEM (VkPhysicalDeviceVulkanMemoryModelFeatures, vulkanMemoryModelAvailabilityVisibilityChains),
742                 };
743                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceVulkanMemoryModelFeatures*>(featuresStruct);
744                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 3, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
745         }
746
747         if (numErrors > 0)
748                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
749         else
750                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
751 }
752
753
754 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestImagelessFramebufferFeatures (Context& context)
755 {
756         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
757         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
758         tcu::ResultCollector                                    resultCollector                 (log);
759         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
760         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
761         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
762         const deUint32                                                  queueFamilyIndex                = 0;
763         const deUint32                                                  queueCount                              = 1;
764         const float                                                             queuePriority                   = 1.0f;
765         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
766         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
767         int                                                                             numErrors                               = 0;
768         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
769         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
770
771         VkPhysicalDeviceFeatures emptyDeviceFeatures;
772         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
773
774         // Only non-core extensions will be used when creating the device.
775         vector<const char*>     coreExtensions;
776         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
777         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
778
779         vector<const char*> extensionNames;
780         extensionNames.reserve(nonCoreExtensions.size());
781         for (const string& extension : nonCoreExtensions)
782                 extensionNames.push_back(extension.c_str());
783
784         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceImagelessFramebufferFeatures>()))
785         {
786                 static const Feature features[] =
787                 {
788                 FEATURE_ITEM (VkPhysicalDeviceImagelessFramebufferFeatures, imagelessFramebuffer),
789                 };
790                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceImagelessFramebufferFeatures*>(featuresStruct);
791                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
792         }
793
794         if (numErrors > 0)
795                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
796         else
797                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
798 }
799
800
801 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestUniformBufferStandardLayoutFeatures (Context& context)
802 {
803         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
804         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
805         tcu::ResultCollector                                    resultCollector                 (log);
806         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
807         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
808         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
809         const deUint32                                                  queueFamilyIndex                = 0;
810         const deUint32                                                  queueCount                              = 1;
811         const float                                                             queuePriority                   = 1.0f;
812         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
813         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
814         int                                                                             numErrors                               = 0;
815         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
816         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
817
818         VkPhysicalDeviceFeatures emptyDeviceFeatures;
819         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
820
821         // Only non-core extensions will be used when creating the device.
822         vector<const char*>     coreExtensions;
823         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
824         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
825
826         vector<const char*> extensionNames;
827         extensionNames.reserve(nonCoreExtensions.size());
828         for (const string& extension : nonCoreExtensions)
829                 extensionNames.push_back(extension.c_str());
830
831         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceUniformBufferStandardLayoutFeatures>()))
832         {
833                 static const Feature features[] =
834                 {
835                 FEATURE_ITEM (VkPhysicalDeviceUniformBufferStandardLayoutFeatures, uniformBufferStandardLayout),
836                 };
837                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(featuresStruct);
838                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
839         }
840
841         if (numErrors > 0)
842                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
843         else
844                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
845 }
846
847
848 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderSubgroupExtendedTypesFeatures (Context& context)
849 {
850         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
851         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
852         tcu::ResultCollector                                    resultCollector                 (log);
853         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
854         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
855         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
856         const deUint32                                                  queueFamilyIndex                = 0;
857         const deUint32                                                  queueCount                              = 1;
858         const float                                                             queuePriority                   = 1.0f;
859         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
860         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
861         int                                                                             numErrors                               = 0;
862         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
863         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
864
865         VkPhysicalDeviceFeatures emptyDeviceFeatures;
866         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
867
868         // Only non-core extensions will be used when creating the device.
869         vector<const char*>     coreExtensions;
870         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
871         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
872
873         vector<const char*> extensionNames;
874         extensionNames.reserve(nonCoreExtensions.size());
875         for (const string& extension : nonCoreExtensions)
876                 extensionNames.push_back(extension.c_str());
877
878         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures>()))
879         {
880                 static const Feature features[] =
881                 {
882                 FEATURE_ITEM (VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures, shaderSubgroupExtendedTypes),
883                 };
884                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(featuresStruct);
885                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
886         }
887
888         if (numErrors > 0)
889                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
890         else
891                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
892 }
893
894
895 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestSeparateDepthStencilLayoutsFeatures (Context& context)
896 {
897         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
898         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
899         tcu::ResultCollector                                    resultCollector                 (log);
900         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
901         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
902         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
903         const deUint32                                                  queueFamilyIndex                = 0;
904         const deUint32                                                  queueCount                              = 1;
905         const float                                                             queuePriority                   = 1.0f;
906         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
907         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
908         int                                                                             numErrors                               = 0;
909         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
910         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
911
912         VkPhysicalDeviceFeatures emptyDeviceFeatures;
913         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
914
915         // Only non-core extensions will be used when creating the device.
916         vector<const char*>     coreExtensions;
917         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
918         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
919
920         vector<const char*> extensionNames;
921         extensionNames.reserve(nonCoreExtensions.size());
922         for (const string& extension : nonCoreExtensions)
923                 extensionNames.push_back(extension.c_str());
924
925         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures>()))
926         {
927                 static const Feature features[] =
928                 {
929                 FEATURE_ITEM (VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures, separateDepthStencilLayouts),
930                 };
931                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(featuresStruct);
932                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
933         }
934
935         if (numErrors > 0)
936                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
937         else
938                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
939 }
940
941
942 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestHostQueryResetFeatures (Context& context)
943 {
944         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
945         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
946         tcu::ResultCollector                                    resultCollector                 (log);
947         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
948         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
949         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
950         const deUint32                                                  queueFamilyIndex                = 0;
951         const deUint32                                                  queueCount                              = 1;
952         const float                                                             queuePriority                   = 1.0f;
953         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
954         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
955         int                                                                             numErrors                               = 0;
956         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
957         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
958
959         VkPhysicalDeviceFeatures emptyDeviceFeatures;
960         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
961
962         // Only non-core extensions will be used when creating the device.
963         vector<const char*>     coreExtensions;
964         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
965         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
966
967         vector<const char*> extensionNames;
968         extensionNames.reserve(nonCoreExtensions.size());
969         for (const string& extension : nonCoreExtensions)
970                 extensionNames.push_back(extension.c_str());
971
972         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceHostQueryResetFeatures>()))
973         {
974                 static const Feature features[] =
975                 {
976                 FEATURE_ITEM (VkPhysicalDeviceHostQueryResetFeatures, hostQueryReset),
977                 };
978                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceHostQueryResetFeatures*>(featuresStruct);
979                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
980         }
981
982         if (numErrors > 0)
983                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
984         else
985                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
986 }
987
988
989 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestTimelineSemaphoreFeatures (Context& context)
990 {
991         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
992         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
993         tcu::ResultCollector                                    resultCollector                 (log);
994         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
995         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
996         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
997         const deUint32                                                  queueFamilyIndex                = 0;
998         const deUint32                                                  queueCount                              = 1;
999         const float                                                             queuePriority                   = 1.0f;
1000         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1001         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1002         int                                                                             numErrors                               = 0;
1003         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1004         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1005
1006         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1007         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1008
1009         // Only non-core extensions will be used when creating the device.
1010         vector<const char*>     coreExtensions;
1011         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1012         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1013
1014         vector<const char*> extensionNames;
1015         extensionNames.reserve(nonCoreExtensions.size());
1016         for (const string& extension : nonCoreExtensions)
1017                 extensionNames.push_back(extension.c_str());
1018
1019         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceTimelineSemaphoreFeatures>()))
1020         {
1021                 static const Feature features[] =
1022                 {
1023                 FEATURE_ITEM (VkPhysicalDeviceTimelineSemaphoreFeatures, timelineSemaphore),
1024                 };
1025                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreFeatures*>(featuresStruct);
1026                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1027         }
1028
1029         if (numErrors > 0)
1030                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1031         else
1032                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1033 }
1034
1035
1036 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestBufferDeviceAddressFeatures (Context& context)
1037 {
1038         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1039         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1040         tcu::ResultCollector                                    resultCollector                 (log);
1041         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1042         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1043         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1044         const deUint32                                                  queueFamilyIndex                = 0;
1045         const deUint32                                                  queueCount                              = 1;
1046         const float                                                             queuePriority                   = 1.0f;
1047         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1048         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1049         int                                                                             numErrors                               = 0;
1050         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1051         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1052
1053         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1054         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1055
1056         // Only non-core extensions will be used when creating the device.
1057         vector<const char*>     coreExtensions;
1058         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1059         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1060
1061         vector<const char*> extensionNames;
1062         extensionNames.reserve(nonCoreExtensions.size());
1063         for (const string& extension : nonCoreExtensions)
1064                 extensionNames.push_back(extension.c_str());
1065
1066         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceBufferDeviceAddressFeatures>()))
1067         {
1068                 static const Feature features[] =
1069                 {
1070                 FEATURE_ITEM (VkPhysicalDeviceBufferDeviceAddressFeatures, bufferDeviceAddress),
1071                 FEATURE_ITEM (VkPhysicalDeviceBufferDeviceAddressFeatures, bufferDeviceAddressCaptureReplay),
1072                 FEATURE_ITEM (VkPhysicalDeviceBufferDeviceAddressFeatures, bufferDeviceAddressMultiDevice),
1073                 };
1074                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeatures*>(featuresStruct);
1075                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 3, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1076         }
1077
1078         if (numErrors > 0)
1079                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1080         else
1081                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1082 }
1083
1084
1085 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestVulkanSC10Features (Context& context)
1086 {
1087         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1088         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1089         tcu::ResultCollector                                    resultCollector                 (log);
1090         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1091         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1092         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1093         const deUint32                                                  queueFamilyIndex                = 0;
1094         const deUint32                                                  queueCount                              = 1;
1095         const float                                                             queuePriority                   = 1.0f;
1096         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1097         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1098         int                                                                             numErrors                               = 0;
1099         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1100         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1101
1102         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1103         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1104
1105         // Only non-core extensions will be used when creating the device.
1106         vector<const char*>     coreExtensions;
1107         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1108         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1109
1110         vector<const char*> extensionNames;
1111         extensionNames.reserve(nonCoreExtensions.size());
1112         for (const string& extension : nonCoreExtensions)
1113                 extensionNames.push_back(extension.c_str());
1114
1115         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceVulkanSC10Features>()))
1116         {
1117                 static const Feature features[] =
1118                 {
1119                 FEATURE_ITEM (VkPhysicalDeviceVulkanSC10Features, shaderAtomicInstructions),
1120                 };
1121                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceVulkanSC10Features*>(featuresStruct);
1122                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1123         }
1124
1125         if (numErrors > 0)
1126                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1127         else
1128                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1129 }
1130
1131
1132 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestPerformanceQueryFeaturesKHR (Context& context)
1133 {
1134         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1135         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1136         tcu::ResultCollector                                    resultCollector                 (log);
1137         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1138         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1139         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1140         const deUint32                                                  queueFamilyIndex                = 0;
1141         const deUint32                                                  queueCount                              = 1;
1142         const float                                                             queuePriority                   = 1.0f;
1143         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1144         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1145         int                                                                             numErrors                               = 0;
1146         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1147         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1148
1149         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1150         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1151
1152         // Only non-core extensions will be used when creating the device.
1153         vector<const char*>     coreExtensions;
1154         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1155         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1156
1157         vector<const char*> extensionNames;
1158         extensionNames.reserve(nonCoreExtensions.size());
1159         for (const string& extension : nonCoreExtensions)
1160                 extensionNames.push_back(extension.c_str());
1161
1162         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDevicePerformanceQueryFeaturesKHR>()))
1163         {
1164                 static const Feature features[] =
1165                 {
1166                 FEATURE_ITEM (VkPhysicalDevicePerformanceQueryFeaturesKHR, performanceCounterQueryPools),
1167                 FEATURE_ITEM (VkPhysicalDevicePerformanceQueryFeaturesKHR, performanceCounterMultipleQueryPools),
1168                 };
1169                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDevicePerformanceQueryFeaturesKHR*>(featuresStruct);
1170                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1171         }
1172
1173         if (numErrors > 0)
1174                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1175         else
1176                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1177 }
1178
1179
1180 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderClockFeaturesKHR (Context& context)
1181 {
1182         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1183         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1184         tcu::ResultCollector                                    resultCollector                 (log);
1185         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1186         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1187         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1188         const deUint32                                                  queueFamilyIndex                = 0;
1189         const deUint32                                                  queueCount                              = 1;
1190         const float                                                             queuePriority                   = 1.0f;
1191         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1192         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1193         int                                                                             numErrors                               = 0;
1194         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1195         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1196
1197         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1198         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1199
1200         // Only non-core extensions will be used when creating the device.
1201         vector<const char*>     coreExtensions;
1202         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1203         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1204
1205         vector<const char*> extensionNames;
1206         extensionNames.reserve(nonCoreExtensions.size());
1207         for (const string& extension : nonCoreExtensions)
1208                 extensionNames.push_back(extension.c_str());
1209
1210         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderClockFeaturesKHR>()))
1211         {
1212                 static const Feature features[] =
1213                 {
1214                 FEATURE_ITEM (VkPhysicalDeviceShaderClockFeaturesKHR, shaderSubgroupClock),
1215                 FEATURE_ITEM (VkPhysicalDeviceShaderClockFeaturesKHR, shaderDeviceClock),
1216                 };
1217                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderClockFeaturesKHR*>(featuresStruct);
1218                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1219         }
1220
1221         if (numErrors > 0)
1222                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1223         else
1224                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1225 }
1226
1227
1228 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderTerminateInvocationFeaturesKHR (Context& context)
1229 {
1230         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1231         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1232         tcu::ResultCollector                                    resultCollector                 (log);
1233         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1234         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1235         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1236         const deUint32                                                  queueFamilyIndex                = 0;
1237         const deUint32                                                  queueCount                              = 1;
1238         const float                                                             queuePriority                   = 1.0f;
1239         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1240         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1241         int                                                                             numErrors                               = 0;
1242         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1243         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1244
1245         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1246         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1247
1248         // Only non-core extensions will be used when creating the device.
1249         vector<const char*>     coreExtensions;
1250         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1251         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1252
1253         vector<const char*> extensionNames;
1254         extensionNames.reserve(nonCoreExtensions.size());
1255         for (const string& extension : nonCoreExtensions)
1256                 extensionNames.push_back(extension.c_str());
1257
1258         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR>()))
1259         {
1260                 static const Feature features[] =
1261                 {
1262                 FEATURE_ITEM (VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR, shaderTerminateInvocation),
1263                 };
1264                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(featuresStruct);
1265                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1266         }
1267
1268         if (numErrors > 0)
1269                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1270         else
1271                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1272 }
1273
1274
1275 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestFragmentShadingRateFeaturesKHR (Context& context)
1276 {
1277         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1278         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1279         tcu::ResultCollector                                    resultCollector                 (log);
1280         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1281         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1282         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1283         const deUint32                                                  queueFamilyIndex                = 0;
1284         const deUint32                                                  queueCount                              = 1;
1285         const float                                                             queuePriority                   = 1.0f;
1286         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1287         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1288         int                                                                             numErrors                               = 0;
1289         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1290         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1291
1292         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1293         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1294
1295         // Only non-core extensions will be used when creating the device.
1296         vector<const char*>     coreExtensions;
1297         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1298         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1299
1300         vector<const char*> extensionNames;
1301         extensionNames.reserve(nonCoreExtensions.size());
1302         for (const string& extension : nonCoreExtensions)
1303                 extensionNames.push_back(extension.c_str());
1304
1305         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceFragmentShadingRateFeaturesKHR>()))
1306         {
1307                 static const Feature features[] =
1308                 {
1309                 FEATURE_ITEM (VkPhysicalDeviceFragmentShadingRateFeaturesKHR, pipelineFragmentShadingRate),
1310                 FEATURE_ITEM (VkPhysicalDeviceFragmentShadingRateFeaturesKHR, primitiveFragmentShadingRate),
1311                 FEATURE_ITEM (VkPhysicalDeviceFragmentShadingRateFeaturesKHR, attachmentFragmentShadingRate),
1312                 };
1313                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(featuresStruct);
1314                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 3, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1315         }
1316
1317         if (numErrors > 0)
1318                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1319         else
1320                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1321 }
1322
1323
1324 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestSynchronization2FeaturesKHR (Context& context)
1325 {
1326         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1327         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1328         tcu::ResultCollector                                    resultCollector                 (log);
1329         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1330         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1331         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1332         const deUint32                                                  queueFamilyIndex                = 0;
1333         const deUint32                                                  queueCount                              = 1;
1334         const float                                                             queuePriority                   = 1.0f;
1335         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1336         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1337         int                                                                             numErrors                               = 0;
1338         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1339         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1340
1341         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1342         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1343
1344         // Only non-core extensions will be used when creating the device.
1345         vector<const char*>     coreExtensions;
1346         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1347         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1348
1349         vector<const char*> extensionNames;
1350         extensionNames.reserve(nonCoreExtensions.size());
1351         for (const string& extension : nonCoreExtensions)
1352                 extensionNames.push_back(extension.c_str());
1353
1354         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceSynchronization2FeaturesKHR>()))
1355         {
1356                 static const Feature features[] =
1357                 {
1358                 FEATURE_ITEM (VkPhysicalDeviceSynchronization2FeaturesKHR, synchronization2),
1359                 };
1360                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceSynchronization2FeaturesKHR*>(featuresStruct);
1361                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1362         }
1363
1364         if (numErrors > 0)
1365                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1366         else
1367                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1368 }
1369
1370
1371 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestTextureCompressionASTCHDRFeaturesEXT (Context& context)
1372 {
1373         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1374         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1375         tcu::ResultCollector                                    resultCollector                 (log);
1376         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1377         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1378         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1379         const deUint32                                                  queueFamilyIndex                = 0;
1380         const deUint32                                                  queueCount                              = 1;
1381         const float                                                             queuePriority                   = 1.0f;
1382         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1383         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1384         int                                                                             numErrors                               = 0;
1385         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1386         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1387
1388         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1389         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1390
1391         // Only non-core extensions will be used when creating the device.
1392         vector<const char*>     coreExtensions;
1393         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1394         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1395
1396         vector<const char*> extensionNames;
1397         extensionNames.reserve(nonCoreExtensions.size());
1398         for (const string& extension : nonCoreExtensions)
1399                 extensionNames.push_back(extension.c_str());
1400
1401         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT>()))
1402         {
1403                 static const Feature features[] =
1404                 {
1405                 FEATURE_ITEM (VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT, textureCompressionASTC_HDR),
1406                 };
1407                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(featuresStruct);
1408                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1409         }
1410
1411         if (numErrors > 0)
1412                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1413         else
1414                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1415 }
1416
1417
1418 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestASTCDecodeFeaturesEXT (Context& context)
1419 {
1420         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1421         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1422         tcu::ResultCollector                                    resultCollector                 (log);
1423         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1424         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1425         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1426         const deUint32                                                  queueFamilyIndex                = 0;
1427         const deUint32                                                  queueCount                              = 1;
1428         const float                                                             queuePriority                   = 1.0f;
1429         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1430         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1431         int                                                                             numErrors                               = 0;
1432         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1433         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1434
1435         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1436         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1437
1438         // Only non-core extensions will be used when creating the device.
1439         vector<const char*>     coreExtensions;
1440         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1441         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1442
1443         vector<const char*> extensionNames;
1444         extensionNames.reserve(nonCoreExtensions.size());
1445         for (const string& extension : nonCoreExtensions)
1446                 extensionNames.push_back(extension.c_str());
1447
1448         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceASTCDecodeFeaturesEXT>()))
1449         {
1450                 static const Feature features[] =
1451                 {
1452                 FEATURE_ITEM (VkPhysicalDeviceASTCDecodeFeaturesEXT, decodeModeSharedExponent),
1453                 };
1454                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceASTCDecodeFeaturesEXT*>(featuresStruct);
1455                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1456         }
1457
1458         if (numErrors > 0)
1459                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1460         else
1461                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1462 }
1463
1464
1465 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestDepthClipEnableFeaturesEXT (Context& context)
1466 {
1467         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1468         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1469         tcu::ResultCollector                                    resultCollector                 (log);
1470         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1471         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1472         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1473         const deUint32                                                  queueFamilyIndex                = 0;
1474         const deUint32                                                  queueCount                              = 1;
1475         const float                                                             queuePriority                   = 1.0f;
1476         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1477         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1478         int                                                                             numErrors                               = 0;
1479         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1480         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1481
1482         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1483         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1484
1485         // Only non-core extensions will be used when creating the device.
1486         vector<const char*>     coreExtensions;
1487         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1488         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1489
1490         vector<const char*> extensionNames;
1491         extensionNames.reserve(nonCoreExtensions.size());
1492         for (const string& extension : nonCoreExtensions)
1493                 extensionNames.push_back(extension.c_str());
1494
1495         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceDepthClipEnableFeaturesEXT>()))
1496         {
1497                 static const Feature features[] =
1498                 {
1499                 FEATURE_ITEM (VkPhysicalDeviceDepthClipEnableFeaturesEXT, depthClipEnable),
1500                 };
1501                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(featuresStruct);
1502                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1503         }
1504
1505         if (numErrors > 0)
1506                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1507         else
1508                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1509 }
1510
1511
1512 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestBlendOperationAdvancedFeaturesEXT (Context& context)
1513 {
1514         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1515         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1516         tcu::ResultCollector                                    resultCollector                 (log);
1517         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1518         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1519         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1520         const deUint32                                                  queueFamilyIndex                = 0;
1521         const deUint32                                                  queueCount                              = 1;
1522         const float                                                             queuePriority                   = 1.0f;
1523         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1524         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1525         int                                                                             numErrors                               = 0;
1526         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1527         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1528
1529         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1530         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1531
1532         // Only non-core extensions will be used when creating the device.
1533         vector<const char*>     coreExtensions;
1534         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1535         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1536
1537         vector<const char*> extensionNames;
1538         extensionNames.reserve(nonCoreExtensions.size());
1539         for (const string& extension : nonCoreExtensions)
1540                 extensionNames.push_back(extension.c_str());
1541
1542         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT>()))
1543         {
1544                 static const Feature features[] =
1545                 {
1546                 FEATURE_ITEM (VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT, advancedBlendCoherentOperations),
1547                 };
1548                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(featuresStruct);
1549                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1550         }
1551
1552         if (numErrors > 0)
1553                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1554         else
1555                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1556 }
1557
1558
1559 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestVertexAttributeDivisorFeaturesEXT (Context& context)
1560 {
1561         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1562         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1563         tcu::ResultCollector                                    resultCollector                 (log);
1564         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1565         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1566         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1567         const deUint32                                                  queueFamilyIndex                = 0;
1568         const deUint32                                                  queueCount                              = 1;
1569         const float                                                             queuePriority                   = 1.0f;
1570         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1571         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1572         int                                                                             numErrors                               = 0;
1573         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1574         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1575
1576         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1577         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1578
1579         // Only non-core extensions will be used when creating the device.
1580         vector<const char*>     coreExtensions;
1581         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1582         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1583
1584         vector<const char*> extensionNames;
1585         extensionNames.reserve(nonCoreExtensions.size());
1586         for (const string& extension : nonCoreExtensions)
1587                 extensionNames.push_back(extension.c_str());
1588
1589         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT>()))
1590         {
1591                 static const Feature features[] =
1592                 {
1593                 FEATURE_ITEM (VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT, vertexAttributeInstanceRateDivisor),
1594                 FEATURE_ITEM (VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT, vertexAttributeInstanceRateZeroDivisor),
1595                 };
1596                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(featuresStruct);
1597                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1598         }
1599
1600         if (numErrors > 0)
1601                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1602         else
1603                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1604 }
1605
1606
1607 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestSubgroupSizeControlFeaturesEXT (Context& context)
1608 {
1609         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1610         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1611         tcu::ResultCollector                                    resultCollector                 (log);
1612         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1613         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1614         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1615         const deUint32                                                  queueFamilyIndex                = 0;
1616         const deUint32                                                  queueCount                              = 1;
1617         const float                                                             queuePriority                   = 1.0f;
1618         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1619         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1620         int                                                                             numErrors                               = 0;
1621         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1622         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1623
1624         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1625         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1626
1627         // Only non-core extensions will be used when creating the device.
1628         vector<const char*>     coreExtensions;
1629         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1630         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1631
1632         vector<const char*> extensionNames;
1633         extensionNames.reserve(nonCoreExtensions.size());
1634         for (const string& extension : nonCoreExtensions)
1635                 extensionNames.push_back(extension.c_str());
1636
1637         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceSubgroupSizeControlFeaturesEXT>()))
1638         {
1639                 static const Feature features[] =
1640                 {
1641                 FEATURE_ITEM (VkPhysicalDeviceSubgroupSizeControlFeaturesEXT, subgroupSizeControl),
1642                 FEATURE_ITEM (VkPhysicalDeviceSubgroupSizeControlFeaturesEXT, computeFullSubgroups),
1643                 };
1644                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(featuresStruct);
1645                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1646         }
1647
1648         if (numErrors > 0)
1649                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1650         else
1651                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1652 }
1653
1654
1655 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderImageAtomicInt64FeaturesEXT (Context& context)
1656 {
1657         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1658         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1659         tcu::ResultCollector                                    resultCollector                 (log);
1660         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1661         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1662         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1663         const deUint32                                                  queueFamilyIndex                = 0;
1664         const deUint32                                                  queueCount                              = 1;
1665         const float                                                             queuePriority                   = 1.0f;
1666         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1667         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1668         int                                                                             numErrors                               = 0;
1669         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1670         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1671
1672         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1673         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1674
1675         // Only non-core extensions will be used when creating the device.
1676         vector<const char*>     coreExtensions;
1677         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1678         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1679
1680         vector<const char*> extensionNames;
1681         extensionNames.reserve(nonCoreExtensions.size());
1682         for (const string& extension : nonCoreExtensions)
1683                 extensionNames.push_back(extension.c_str());
1684
1685         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT>()))
1686         {
1687                 static const Feature features[] =
1688                 {
1689                 FEATURE_ITEM (VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT, shaderImageInt64Atomics),
1690                 FEATURE_ITEM (VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT, sparseImageInt64Atomics),
1691                 };
1692                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(featuresStruct);
1693                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1694         }
1695
1696         if (numErrors > 0)
1697                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1698         else
1699                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1700 }
1701
1702
1703 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestFragmentShaderInterlockFeaturesEXT (Context& context)
1704 {
1705         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1706         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1707         tcu::ResultCollector                                    resultCollector                 (log);
1708         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1709         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1710         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1711         const deUint32                                                  queueFamilyIndex                = 0;
1712         const deUint32                                                  queueCount                              = 1;
1713         const float                                                             queuePriority                   = 1.0f;
1714         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1715         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1716         int                                                                             numErrors                               = 0;
1717         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1718         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1719
1720         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1721         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1722
1723         // Only non-core extensions will be used when creating the device.
1724         vector<const char*>     coreExtensions;
1725         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1726         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1727
1728         vector<const char*> extensionNames;
1729         extensionNames.reserve(nonCoreExtensions.size());
1730         for (const string& extension : nonCoreExtensions)
1731                 extensionNames.push_back(extension.c_str());
1732
1733         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT>()))
1734         {
1735                 static const Feature features[] =
1736                 {
1737                 FEATURE_ITEM (VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT, fragmentShaderSampleInterlock),
1738                 FEATURE_ITEM (VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT, fragmentShaderPixelInterlock),
1739                 FEATURE_ITEM (VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT, fragmentShaderShadingRateInterlock),
1740                 };
1741                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(featuresStruct);
1742                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 3, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1743         }
1744
1745         if (numErrors > 0)
1746                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1747         else
1748                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1749 }
1750
1751
1752 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestYcbcrImageArraysFeaturesEXT (Context& context)
1753 {
1754         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1755         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1756         tcu::ResultCollector                                    resultCollector                 (log);
1757         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1758         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1759         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1760         const deUint32                                                  queueFamilyIndex                = 0;
1761         const deUint32                                                  queueCount                              = 1;
1762         const float                                                             queuePriority                   = 1.0f;
1763         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1764         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1765         int                                                                             numErrors                               = 0;
1766         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1767         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1768
1769         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1770         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1771
1772         // Only non-core extensions will be used when creating the device.
1773         vector<const char*>     coreExtensions;
1774         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1775         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1776
1777         vector<const char*> extensionNames;
1778         extensionNames.reserve(nonCoreExtensions.size());
1779         for (const string& extension : nonCoreExtensions)
1780                 extensionNames.push_back(extension.c_str());
1781
1782         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceYcbcrImageArraysFeaturesEXT>()))
1783         {
1784                 static const Feature features[] =
1785                 {
1786                 FEATURE_ITEM (VkPhysicalDeviceYcbcrImageArraysFeaturesEXT, ycbcrImageArrays),
1787                 };
1788                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(featuresStruct);
1789                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1790         }
1791
1792         if (numErrors > 0)
1793                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1794         else
1795                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1796 }
1797
1798
1799 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestLineRasterizationFeaturesEXT (Context& context)
1800 {
1801         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1802         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1803         tcu::ResultCollector                                    resultCollector                 (log);
1804         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1805         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1806         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1807         const deUint32                                                  queueFamilyIndex                = 0;
1808         const deUint32                                                  queueCount                              = 1;
1809         const float                                                             queuePriority                   = 1.0f;
1810         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1811         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1812         int                                                                             numErrors                               = 0;
1813         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1814         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1815
1816         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1817         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1818
1819         // Only non-core extensions will be used when creating the device.
1820         vector<const char*>     coreExtensions;
1821         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1822         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1823
1824         vector<const char*> extensionNames;
1825         extensionNames.reserve(nonCoreExtensions.size());
1826         for (const string& extension : nonCoreExtensions)
1827                 extensionNames.push_back(extension.c_str());
1828
1829         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceLineRasterizationFeaturesEXT>()))
1830         {
1831                 static const Feature features[] =
1832                 {
1833                 FEATURE_ITEM (VkPhysicalDeviceLineRasterizationFeaturesEXT, rectangularLines),
1834                 FEATURE_ITEM (VkPhysicalDeviceLineRasterizationFeaturesEXT, bresenhamLines),
1835                 FEATURE_ITEM (VkPhysicalDeviceLineRasterizationFeaturesEXT, smoothLines),
1836                 FEATURE_ITEM (VkPhysicalDeviceLineRasterizationFeaturesEXT, stippledRectangularLines),
1837                 FEATURE_ITEM (VkPhysicalDeviceLineRasterizationFeaturesEXT, stippledBresenhamLines),
1838                 FEATURE_ITEM (VkPhysicalDeviceLineRasterizationFeaturesEXT, stippledSmoothLines),
1839                 };
1840                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceLineRasterizationFeaturesEXT*>(featuresStruct);
1841                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 6, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1842         }
1843
1844         if (numErrors > 0)
1845                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1846         else
1847                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1848 }
1849
1850
1851 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderAtomicFloatFeaturesEXT (Context& context)
1852 {
1853         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1854         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1855         tcu::ResultCollector                                    resultCollector                 (log);
1856         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1857         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1858         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1859         const deUint32                                                  queueFamilyIndex                = 0;
1860         const deUint32                                                  queueCount                              = 1;
1861         const float                                                             queuePriority                   = 1.0f;
1862         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1863         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1864         int                                                                             numErrors                               = 0;
1865         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1866         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1867
1868         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1869         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1870
1871         // Only non-core extensions will be used when creating the device.
1872         vector<const char*>     coreExtensions;
1873         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1874         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1875
1876         vector<const char*> extensionNames;
1877         extensionNames.reserve(nonCoreExtensions.size());
1878         for (const string& extension : nonCoreExtensions)
1879                 extensionNames.push_back(extension.c_str());
1880
1881         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderAtomicFloatFeaturesEXT>()))
1882         {
1883                 static const Feature features[] =
1884                 {
1885                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderBufferFloat32Atomics),
1886                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderBufferFloat32AtomicAdd),
1887                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderBufferFloat64Atomics),
1888                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderBufferFloat64AtomicAdd),
1889                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderSharedFloat32Atomics),
1890                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderSharedFloat32AtomicAdd),
1891                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderSharedFloat64Atomics),
1892                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderSharedFloat64AtomicAdd),
1893                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderImageFloat32Atomics),
1894                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, shaderImageFloat32AtomicAdd),
1895                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, sparseImageFloat32Atomics),
1896                 FEATURE_ITEM (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, sparseImageFloat32AtomicAdd),
1897                 };
1898                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(featuresStruct);
1899                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 12, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1900         }
1901
1902         if (numErrors > 0)
1903                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1904         else
1905                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1906 }
1907
1908
1909 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestIndexTypeUint8FeaturesEXT (Context& context)
1910 {
1911         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1912         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1913         tcu::ResultCollector                                    resultCollector                 (log);
1914         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1915         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1916         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1917         const deUint32                                                  queueFamilyIndex                = 0;
1918         const deUint32                                                  queueCount                              = 1;
1919         const float                                                             queuePriority                   = 1.0f;
1920         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1921         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1922         int                                                                             numErrors                               = 0;
1923         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1924         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1925
1926         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1927         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1928
1929         // Only non-core extensions will be used when creating the device.
1930         vector<const char*>     coreExtensions;
1931         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1932         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1933
1934         vector<const char*> extensionNames;
1935         extensionNames.reserve(nonCoreExtensions.size());
1936         for (const string& extension : nonCoreExtensions)
1937                 extensionNames.push_back(extension.c_str());
1938
1939         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceIndexTypeUint8FeaturesEXT>()))
1940         {
1941                 static const Feature features[] =
1942                 {
1943                 FEATURE_ITEM (VkPhysicalDeviceIndexTypeUint8FeaturesEXT, indexTypeUint8),
1944                 };
1945                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(featuresStruct);
1946                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1947         }
1948
1949         if (numErrors > 0)
1950                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1951         else
1952                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
1953 }
1954
1955
1956 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestExtendedDynamicStateFeaturesEXT (Context& context)
1957 {
1958         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
1959         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
1960         tcu::ResultCollector                                    resultCollector                 (log);
1961         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
1962         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
1963         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
1964         const deUint32                                                  queueFamilyIndex                = 0;
1965         const deUint32                                                  queueCount                              = 1;
1966         const float                                                             queuePriority                   = 1.0f;
1967         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
1968         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
1969         int                                                                             numErrors                               = 0;
1970         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
1971         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
1972
1973         VkPhysicalDeviceFeatures emptyDeviceFeatures;
1974         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
1975
1976         // Only non-core extensions will be used when creating the device.
1977         vector<const char*>     coreExtensions;
1978         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
1979         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
1980
1981         vector<const char*> extensionNames;
1982         extensionNames.reserve(nonCoreExtensions.size());
1983         for (const string& extension : nonCoreExtensions)
1984                 extensionNames.push_back(extension.c_str());
1985
1986         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceExtendedDynamicStateFeaturesEXT>()))
1987         {
1988                 static const Feature features[] =
1989                 {
1990                 FEATURE_ITEM (VkPhysicalDeviceExtendedDynamicStateFeaturesEXT, extendedDynamicState),
1991                 };
1992                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(featuresStruct);
1993                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
1994         }
1995
1996         if (numErrors > 0)
1997                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
1998         else
1999                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2000 }
2001
2002
2003 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestShaderDemoteToHelperInvocationFeaturesEXT (Context& context)
2004 {
2005         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2006         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2007         tcu::ResultCollector                                    resultCollector                 (log);
2008         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2009         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2010         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2011         const deUint32                                                  queueFamilyIndex                = 0;
2012         const deUint32                                                  queueCount                              = 1;
2013         const float                                                             queuePriority                   = 1.0f;
2014         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2015         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2016         int                                                                             numErrors                               = 0;
2017         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2018         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2019
2020         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2021         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2022
2023         // Only non-core extensions will be used when creating the device.
2024         vector<const char*>     coreExtensions;
2025         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2026         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2027
2028         vector<const char*> extensionNames;
2029         extensionNames.reserve(nonCoreExtensions.size());
2030         for (const string& extension : nonCoreExtensions)
2031                 extensionNames.push_back(extension.c_str());
2032
2033         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT>()))
2034         {
2035                 static const Feature features[] =
2036                 {
2037                 FEATURE_ITEM (VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT, shaderDemoteToHelperInvocation),
2038                 };
2039                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(featuresStruct);
2040                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2041         }
2042
2043         if (numErrors > 0)
2044                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2045         else
2046                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2047 }
2048
2049
2050 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestTexelBufferAlignmentFeaturesEXT (Context& context)
2051 {
2052         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2053         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2054         tcu::ResultCollector                                    resultCollector                 (log);
2055         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2056         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2057         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2058         const deUint32                                                  queueFamilyIndex                = 0;
2059         const deUint32                                                  queueCount                              = 1;
2060         const float                                                             queuePriority                   = 1.0f;
2061         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2062         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2063         int                                                                             numErrors                               = 0;
2064         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2065         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2066
2067         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2068         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2069
2070         // Only non-core extensions will be used when creating the device.
2071         vector<const char*>     coreExtensions;
2072         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2073         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2074
2075         vector<const char*> extensionNames;
2076         extensionNames.reserve(nonCoreExtensions.size());
2077         for (const string& extension : nonCoreExtensions)
2078                 extensionNames.push_back(extension.c_str());
2079
2080         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT>()))
2081         {
2082                 static const Feature features[] =
2083                 {
2084                 FEATURE_ITEM (VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT, texelBufferAlignment),
2085                 };
2086                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(featuresStruct);
2087                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2088         }
2089
2090         if (numErrors > 0)
2091                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2092         else
2093                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2094 }
2095
2096
2097 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestRobustness2FeaturesEXT (Context& context)
2098 {
2099         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2100         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2101         tcu::ResultCollector                                    resultCollector                 (log);
2102         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2103         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2104         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2105         const deUint32                                                  queueFamilyIndex                = 0;
2106         const deUint32                                                  queueCount                              = 1;
2107         const float                                                             queuePriority                   = 1.0f;
2108         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2109         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2110         int                                                                             numErrors                               = 0;
2111         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2112         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2113
2114         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2115         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2116
2117         // Only non-core extensions will be used when creating the device.
2118         vector<const char*>     coreExtensions;
2119         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2120         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2121
2122         vector<const char*> extensionNames;
2123         extensionNames.reserve(nonCoreExtensions.size());
2124         for (const string& extension : nonCoreExtensions)
2125                 extensionNames.push_back(extension.c_str());
2126
2127         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceRobustness2FeaturesEXT>()))
2128         {
2129                 static const Feature features[] =
2130                 {
2131                 FEATURE_ITEM (VkPhysicalDeviceRobustness2FeaturesEXT, robustBufferAccess2),
2132                 FEATURE_ITEM (VkPhysicalDeviceRobustness2FeaturesEXT, robustImageAccess2),
2133                 FEATURE_ITEM (VkPhysicalDeviceRobustness2FeaturesEXT, nullDescriptor),
2134                 };
2135                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceRobustness2FeaturesEXT*>(featuresStruct);
2136                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 3, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2137         }
2138
2139         if (numErrors > 0)
2140                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2141         else
2142                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2143 }
2144
2145
2146 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestCustomBorderColorFeaturesEXT (Context& context)
2147 {
2148         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2149         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2150         tcu::ResultCollector                                    resultCollector                 (log);
2151         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2152         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2153         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2154         const deUint32                                                  queueFamilyIndex                = 0;
2155         const deUint32                                                  queueCount                              = 1;
2156         const float                                                             queuePriority                   = 1.0f;
2157         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2158         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2159         int                                                                             numErrors                               = 0;
2160         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2161         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2162
2163         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2164         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2165
2166         // Only non-core extensions will be used when creating the device.
2167         vector<const char*>     coreExtensions;
2168         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2169         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2170
2171         vector<const char*> extensionNames;
2172         extensionNames.reserve(nonCoreExtensions.size());
2173         for (const string& extension : nonCoreExtensions)
2174                 extensionNames.push_back(extension.c_str());
2175
2176         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceCustomBorderColorFeaturesEXT>()))
2177         {
2178                 static const Feature features[] =
2179                 {
2180                 FEATURE_ITEM (VkPhysicalDeviceCustomBorderColorFeaturesEXT, customBorderColors),
2181                 FEATURE_ITEM (VkPhysicalDeviceCustomBorderColorFeaturesEXT, customBorderColorWithoutFormat),
2182                 };
2183                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(featuresStruct);
2184                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2185         }
2186
2187         if (numErrors > 0)
2188                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2189         else
2190                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2191 }
2192
2193
2194 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestYcbcr2Plane444FormatsFeaturesEXT (Context& context)
2195 {
2196         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2197         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2198         tcu::ResultCollector                                    resultCollector                 (log);
2199         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2200         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2201         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2202         const deUint32                                                  queueFamilyIndex                = 0;
2203         const deUint32                                                  queueCount                              = 1;
2204         const float                                                             queuePriority                   = 1.0f;
2205         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2206         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2207         int                                                                             numErrors                               = 0;
2208         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2209         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2210
2211         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2212         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2213
2214         // Only non-core extensions will be used when creating the device.
2215         vector<const char*>     coreExtensions;
2216         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2217         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2218
2219         vector<const char*> extensionNames;
2220         extensionNames.reserve(nonCoreExtensions.size());
2221         for (const string& extension : nonCoreExtensions)
2222                 extensionNames.push_back(extension.c_str());
2223
2224         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT>()))
2225         {
2226                 static const Feature features[] =
2227                 {
2228                 FEATURE_ITEM (VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT, ycbcr2plane444Formats),
2229                 };
2230                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(featuresStruct);
2231                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2232         }
2233
2234         if (numErrors > 0)
2235                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2236         else
2237                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2238 }
2239
2240
2241 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestImageRobustnessFeaturesEXT (Context& context)
2242 {
2243         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2244         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2245         tcu::ResultCollector                                    resultCollector                 (log);
2246         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2247         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2248         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2249         const deUint32                                                  queueFamilyIndex                = 0;
2250         const deUint32                                                  queueCount                              = 1;
2251         const float                                                             queuePriority                   = 1.0f;
2252         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2253         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2254         int                                                                             numErrors                               = 0;
2255         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2256         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2257
2258         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2259         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2260
2261         // Only non-core extensions will be used when creating the device.
2262         vector<const char*>     coreExtensions;
2263         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2264         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2265
2266         vector<const char*> extensionNames;
2267         extensionNames.reserve(nonCoreExtensions.size());
2268         for (const string& extension : nonCoreExtensions)
2269                 extensionNames.push_back(extension.c_str());
2270
2271         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceImageRobustnessFeaturesEXT>()))
2272         {
2273                 static const Feature features[] =
2274                 {
2275                 FEATURE_ITEM (VkPhysicalDeviceImageRobustnessFeaturesEXT, robustImageAccess),
2276                 };
2277                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceImageRobustnessFeaturesEXT*>(featuresStruct);
2278                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2279         }
2280
2281         if (numErrors > 0)
2282                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2283         else
2284                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2285 }
2286
2287
2288 tcu::TestStatus createDeviceWithUnsupportedFeaturesTest4444FormatsFeaturesEXT (Context& context)
2289 {
2290         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2291         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2292         tcu::ResultCollector                                    resultCollector                 (log);
2293         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2294         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2295         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2296         const deUint32                                                  queueFamilyIndex                = 0;
2297         const deUint32                                                  queueCount                              = 1;
2298         const float                                                             queuePriority                   = 1.0f;
2299         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2300         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2301         int                                                                             numErrors                               = 0;
2302         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2303         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2304
2305         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2306         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2307
2308         // Only non-core extensions will be used when creating the device.
2309         vector<const char*>     coreExtensions;
2310         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2311         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2312
2313         vector<const char*> extensionNames;
2314         extensionNames.reserve(nonCoreExtensions.size());
2315         for (const string& extension : nonCoreExtensions)
2316                 extensionNames.push_back(extension.c_str());
2317
2318         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDevice4444FormatsFeaturesEXT>()))
2319         {
2320                 static const Feature features[] =
2321                 {
2322                 FEATURE_ITEM (VkPhysicalDevice4444FormatsFeaturesEXT, formatA4R4G4B4),
2323                 FEATURE_ITEM (VkPhysicalDevice4444FormatsFeaturesEXT, formatA4B4G4R4),
2324                 };
2325                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDevice4444FormatsFeaturesEXT*>(featuresStruct);
2326                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 2, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2327         }
2328
2329         if (numErrors > 0)
2330                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2331         else
2332                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2333 }
2334
2335
2336 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestVertexInputDynamicStateFeaturesEXT (Context& context)
2337 {
2338         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2339         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2340         tcu::ResultCollector                                    resultCollector                 (log);
2341         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2342         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2343         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2344         const deUint32                                                  queueFamilyIndex                = 0;
2345         const deUint32                                                  queueCount                              = 1;
2346         const float                                                             queuePriority                   = 1.0f;
2347         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2348         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2349         int                                                                             numErrors                               = 0;
2350         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2351         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2352
2353         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2354         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2355
2356         // Only non-core extensions will be used when creating the device.
2357         vector<const char*>     coreExtensions;
2358         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2359         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2360
2361         vector<const char*> extensionNames;
2362         extensionNames.reserve(nonCoreExtensions.size());
2363         for (const string& extension : nonCoreExtensions)
2364                 extensionNames.push_back(extension.c_str());
2365
2366         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT>()))
2367         {
2368                 static const Feature features[] =
2369                 {
2370                 FEATURE_ITEM (VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT, vertexInputDynamicState),
2371                 };
2372                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(featuresStruct);
2373                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2374         }
2375
2376         if (numErrors > 0)
2377                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2378         else
2379                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2380 }
2381
2382
2383 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestExtendedDynamicState2FeaturesEXT (Context& context)
2384 {
2385         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2386         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2387         tcu::ResultCollector                                    resultCollector                 (log);
2388         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2389         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2390         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2391         const deUint32                                                  queueFamilyIndex                = 0;
2392         const deUint32                                                  queueCount                              = 1;
2393         const float                                                             queuePriority                   = 1.0f;
2394         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2395         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2396         int                                                                             numErrors                               = 0;
2397         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2398         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2399
2400         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2401         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2402
2403         // Only non-core extensions will be used when creating the device.
2404         vector<const char*>     coreExtensions;
2405         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2406         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2407
2408         vector<const char*> extensionNames;
2409         extensionNames.reserve(nonCoreExtensions.size());
2410         for (const string& extension : nonCoreExtensions)
2411                 extensionNames.push_back(extension.c_str());
2412
2413         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceExtendedDynamicState2FeaturesEXT>()))
2414         {
2415                 static const Feature features[] =
2416                 {
2417                 FEATURE_ITEM (VkPhysicalDeviceExtendedDynamicState2FeaturesEXT, extendedDynamicState2),
2418                 FEATURE_ITEM (VkPhysicalDeviceExtendedDynamicState2FeaturesEXT, extendedDynamicState2LogicOp),
2419                 FEATURE_ITEM (VkPhysicalDeviceExtendedDynamicState2FeaturesEXT, extendedDynamicState2PatchControlPoints),
2420                 };
2421                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(featuresStruct);
2422                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 3, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2423         }
2424
2425         if (numErrors > 0)
2426                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2427         else
2428                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2429 }
2430
2431
2432 tcu::TestStatus createDeviceWithUnsupportedFeaturesTestColorWriteEnableFeaturesEXT (Context& context)
2433 {
2434         const PlatformInterface&                                vkp                                             = context.getPlatformInterface();
2435         tcu::TestLog&                                                   log                                             = context.getTestContext().getLog();
2436         tcu::ResultCollector                                    resultCollector                 (log);
2437         const CustomInstance                                    instance                                (createCustomInstanceWithExtensions(context, context.getInstanceExtensions(), DE_NULL, true));
2438         const InstanceDriver&                                   instanceDriver                  (instance.getDriver());
2439         const VkPhysicalDevice                                  physicalDevice                  = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine());
2440         const deUint32                                                  queueFamilyIndex                = 0;
2441         const deUint32                                                  queueCount                              = 1;
2442         const float                                                             queuePriority                   = 1.0f;
2443         const DeviceFeatures                                    deviceFeaturesAll               (context.getInstanceInterface(), context.getUsedApiVersion(), physicalDevice, context.getInstanceExtensions(), context.getDeviceExtensions(), DE_TRUE);
2444         const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
2445         int                                                                             numErrors                               = 0;
2446         bool                                                                    isSubProcess                    = context.getTestContext().getCommandLine().isSubProcess();
2447         VkDeviceObjectReservationCreateInfo memReservationStatMax = context.getResourceInterface()->getStatMax();
2448
2449         VkPhysicalDeviceFeatures emptyDeviceFeatures;
2450         deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures));
2451
2452         // Only non-core extensions will be used when creating the device.
2453         vector<const char*>     coreExtensions;
2454         getCoreDeviceExtensions(context.getUsedApiVersion(), coreExtensions);
2455         vector<string> nonCoreExtensions(removeExtensions(context.getDeviceExtensions(), coreExtensions));
2456
2457         vector<const char*> extensionNames;
2458         extensionNames.reserve(nonCoreExtensions.size());
2459         for (const string& extension : nonCoreExtensions)
2460                 extensionNames.push_back(extension.c_str());
2461
2462         if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceColorWriteEnableFeaturesEXT>()))
2463         {
2464                 static const Feature features[] =
2465                 {
2466                 FEATURE_ITEM (VkPhysicalDeviceColorWriteEnableFeaturesEXT, colorWriteEnable),
2467                 };
2468                 auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(featuresStruct);
2469                 checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures, memReservationStatMax, isSubProcess);
2470         }
2471
2472         if (numErrors > 0)
2473                 return tcu::TestStatus(resultCollector.getResult(), "Enabling unsupported features didn't return VK_ERROR_FEATURE_NOT_PRESENT.");
2474         else
2475                 return tcu::TestStatus(resultCollector.getResult(), resultCollector.getMessage());
2476 }
2477
2478
2479 void addSeparateUnsupportedFeatureTests (tcu::TestCaseGroup* testGroup)
2480 {
2481
2482         addFunctionCase(testGroup, "16_bit_storage_features", "createDeviceWithUnsupportedFeaturesTest16BitStorageFeatures", createDeviceWithUnsupportedFeaturesTest16BitStorageFeatures);
2483         addFunctionCase(testGroup, "multiview_features", "createDeviceWithUnsupportedFeaturesTestMultiviewFeatures", createDeviceWithUnsupportedFeaturesTestMultiviewFeatures);
2484         addFunctionCase(testGroup, "variable_pointers_features", "createDeviceWithUnsupportedFeaturesTestVariablePointersFeatures", createDeviceWithUnsupportedFeaturesTestVariablePointersFeatures);
2485         addFunctionCase(testGroup, "protected_memory_features", "createDeviceWithUnsupportedFeaturesTestProtectedMemoryFeatures", createDeviceWithUnsupportedFeaturesTestProtectedMemoryFeatures);
2486         addFunctionCase(testGroup, "sampler_ycbcr_conversion_features", "createDeviceWithUnsupportedFeaturesTestSamplerYcbcrConversionFeatures", createDeviceWithUnsupportedFeaturesTestSamplerYcbcrConversionFeatures);
2487         addFunctionCase(testGroup, "shader_draw_parameters_features", "createDeviceWithUnsupportedFeaturesTestShaderDrawParametersFeatures", createDeviceWithUnsupportedFeaturesTestShaderDrawParametersFeatures);
2488         addFunctionCase(testGroup, "vulkan11_features", "createDeviceWithUnsupportedFeaturesTestVulkan11Features", createDeviceWithUnsupportedFeaturesTestVulkan11Features);
2489         addFunctionCase(testGroup, "vulkan12_features", "createDeviceWithUnsupportedFeaturesTestVulkan12Features", createDeviceWithUnsupportedFeaturesTestVulkan12Features);
2490         addFunctionCase(testGroup, "8_bit_storage_features", "createDeviceWithUnsupportedFeaturesTest8BitStorageFeatures", createDeviceWithUnsupportedFeaturesTest8BitStorageFeatures);
2491         addFunctionCase(testGroup, "shader_atomic_int64_features", "createDeviceWithUnsupportedFeaturesTestShaderAtomicInt64Features", createDeviceWithUnsupportedFeaturesTestShaderAtomicInt64Features);
2492         addFunctionCase(testGroup, "shader_float16_int8_features", "createDeviceWithUnsupportedFeaturesTestShaderFloat16Int8Features", createDeviceWithUnsupportedFeaturesTestShaderFloat16Int8Features);
2493         addFunctionCase(testGroup, "descriptor_indexing_features", "createDeviceWithUnsupportedFeaturesTestDescriptorIndexingFeatures", createDeviceWithUnsupportedFeaturesTestDescriptorIndexingFeatures);
2494         addFunctionCase(testGroup, "scalar_block_layout_features", "createDeviceWithUnsupportedFeaturesTestScalarBlockLayoutFeatures", createDeviceWithUnsupportedFeaturesTestScalarBlockLayoutFeatures);
2495         addFunctionCase(testGroup, "vulkan_memory_model_features", "createDeviceWithUnsupportedFeaturesTestVulkanMemoryModelFeatures", createDeviceWithUnsupportedFeaturesTestVulkanMemoryModelFeatures);
2496         addFunctionCase(testGroup, "imageless_framebuffer_features", "createDeviceWithUnsupportedFeaturesTestImagelessFramebufferFeatures", createDeviceWithUnsupportedFeaturesTestImagelessFramebufferFeatures);
2497         addFunctionCase(testGroup, "uniform_buffer_standard_layout_features", "createDeviceWithUnsupportedFeaturesTestUniformBufferStandardLayoutFeatures", createDeviceWithUnsupportedFeaturesTestUniformBufferStandardLayoutFeatures);
2498         addFunctionCase(testGroup, "shader_subgroup_extended_types_features", "createDeviceWithUnsupportedFeaturesTestShaderSubgroupExtendedTypesFeatures", createDeviceWithUnsupportedFeaturesTestShaderSubgroupExtendedTypesFeatures);
2499         addFunctionCase(testGroup, "separate_depth_stencil_layouts_features", "createDeviceWithUnsupportedFeaturesTestSeparateDepthStencilLayoutsFeatures", createDeviceWithUnsupportedFeaturesTestSeparateDepthStencilLayoutsFeatures);
2500         addFunctionCase(testGroup, "host_query_reset_features", "createDeviceWithUnsupportedFeaturesTestHostQueryResetFeatures", createDeviceWithUnsupportedFeaturesTestHostQueryResetFeatures);
2501         addFunctionCase(testGroup, "timeline_semaphore_features", "createDeviceWithUnsupportedFeaturesTestTimelineSemaphoreFeatures", createDeviceWithUnsupportedFeaturesTestTimelineSemaphoreFeatures);
2502         addFunctionCase(testGroup, "buffer_device_address_features", "createDeviceWithUnsupportedFeaturesTestBufferDeviceAddressFeatures", createDeviceWithUnsupportedFeaturesTestBufferDeviceAddressFeatures);
2503         addFunctionCase(testGroup, "vulkan_sc10_features", "createDeviceWithUnsupportedFeaturesTestVulkanSC10Features", createDeviceWithUnsupportedFeaturesTestVulkanSC10Features);
2504         addFunctionCase(testGroup, "performance_query_features_khr", "createDeviceWithUnsupportedFeaturesTestPerformanceQueryFeaturesKHR", createDeviceWithUnsupportedFeaturesTestPerformanceQueryFeaturesKHR);
2505         addFunctionCase(testGroup, "shader_clock_features_khr", "createDeviceWithUnsupportedFeaturesTestShaderClockFeaturesKHR", createDeviceWithUnsupportedFeaturesTestShaderClockFeaturesKHR);
2506         addFunctionCase(testGroup, "shader_terminate_invocation_features_khr", "createDeviceWithUnsupportedFeaturesTestShaderTerminateInvocationFeaturesKHR", createDeviceWithUnsupportedFeaturesTestShaderTerminateInvocationFeaturesKHR);
2507         addFunctionCase(testGroup, "fragment_shading_rate_features_khr", "createDeviceWithUnsupportedFeaturesTestFragmentShadingRateFeaturesKHR", createDeviceWithUnsupportedFeaturesTestFragmentShadingRateFeaturesKHR);
2508         addFunctionCase(testGroup, "synchronization2_features_khr", "createDeviceWithUnsupportedFeaturesTestSynchronization2FeaturesKHR", createDeviceWithUnsupportedFeaturesTestSynchronization2FeaturesKHR);
2509         addFunctionCase(testGroup, "texture_compression_astchdr_features_ext", "createDeviceWithUnsupportedFeaturesTestTextureCompressionASTCHDRFeaturesEXT", createDeviceWithUnsupportedFeaturesTestTextureCompressionASTCHDRFeaturesEXT);
2510         addFunctionCase(testGroup, "astc_decode_features_ext", "createDeviceWithUnsupportedFeaturesTestASTCDecodeFeaturesEXT", createDeviceWithUnsupportedFeaturesTestASTCDecodeFeaturesEXT);
2511         addFunctionCase(testGroup, "depth_clip_enable_features_ext", "createDeviceWithUnsupportedFeaturesTestDepthClipEnableFeaturesEXT", createDeviceWithUnsupportedFeaturesTestDepthClipEnableFeaturesEXT);
2512         addFunctionCase(testGroup, "blend_operation_advanced_features_ext", "createDeviceWithUnsupportedFeaturesTestBlendOperationAdvancedFeaturesEXT", createDeviceWithUnsupportedFeaturesTestBlendOperationAdvancedFeaturesEXT);
2513         addFunctionCase(testGroup, "vertex_attribute_divisor_features_ext", "createDeviceWithUnsupportedFeaturesTestVertexAttributeDivisorFeaturesEXT", createDeviceWithUnsupportedFeaturesTestVertexAttributeDivisorFeaturesEXT);
2514         addFunctionCase(testGroup, "subgroup_size_control_features_ext", "createDeviceWithUnsupportedFeaturesTestSubgroupSizeControlFeaturesEXT", createDeviceWithUnsupportedFeaturesTestSubgroupSizeControlFeaturesEXT);
2515         addFunctionCase(testGroup, "shader_image_atomic_int64_features_ext", "createDeviceWithUnsupportedFeaturesTestShaderImageAtomicInt64FeaturesEXT", createDeviceWithUnsupportedFeaturesTestShaderImageAtomicInt64FeaturesEXT);
2516         addFunctionCase(testGroup, "fragment_shader_interlock_features_ext", "createDeviceWithUnsupportedFeaturesTestFragmentShaderInterlockFeaturesEXT", createDeviceWithUnsupportedFeaturesTestFragmentShaderInterlockFeaturesEXT);
2517         addFunctionCase(testGroup, "ycbcr_image_arrays_features_ext", "createDeviceWithUnsupportedFeaturesTestYcbcrImageArraysFeaturesEXT", createDeviceWithUnsupportedFeaturesTestYcbcrImageArraysFeaturesEXT);
2518         addFunctionCase(testGroup, "line_rasterization_features_ext", "createDeviceWithUnsupportedFeaturesTestLineRasterizationFeaturesEXT", createDeviceWithUnsupportedFeaturesTestLineRasterizationFeaturesEXT);
2519         addFunctionCase(testGroup, "shader_atomic_float_features_ext", "createDeviceWithUnsupportedFeaturesTestShaderAtomicFloatFeaturesEXT", createDeviceWithUnsupportedFeaturesTestShaderAtomicFloatFeaturesEXT);
2520         addFunctionCase(testGroup, "index_type_uint8_features_ext", "createDeviceWithUnsupportedFeaturesTestIndexTypeUint8FeaturesEXT", createDeviceWithUnsupportedFeaturesTestIndexTypeUint8FeaturesEXT);
2521         addFunctionCase(testGroup, "extended_dynamic_state_features_ext", "createDeviceWithUnsupportedFeaturesTestExtendedDynamicStateFeaturesEXT", createDeviceWithUnsupportedFeaturesTestExtendedDynamicStateFeaturesEXT);
2522         addFunctionCase(testGroup, "shader_demote_to_helper_invocation_features_ext", "createDeviceWithUnsupportedFeaturesTestShaderDemoteToHelperInvocationFeaturesEXT", createDeviceWithUnsupportedFeaturesTestShaderDemoteToHelperInvocationFeaturesEXT);
2523         addFunctionCase(testGroup, "texel_buffer_alignment_features_ext", "createDeviceWithUnsupportedFeaturesTestTexelBufferAlignmentFeaturesEXT", createDeviceWithUnsupportedFeaturesTestTexelBufferAlignmentFeaturesEXT);
2524         addFunctionCase(testGroup, "robustness2_features_ext", "createDeviceWithUnsupportedFeaturesTestRobustness2FeaturesEXT", createDeviceWithUnsupportedFeaturesTestRobustness2FeaturesEXT);
2525         addFunctionCase(testGroup, "custom_border_color_features_ext", "createDeviceWithUnsupportedFeaturesTestCustomBorderColorFeaturesEXT", createDeviceWithUnsupportedFeaturesTestCustomBorderColorFeaturesEXT);
2526         addFunctionCase(testGroup, "ycbcr2_plane444_formats_features_ext", "createDeviceWithUnsupportedFeaturesTestYcbcr2Plane444FormatsFeaturesEXT", createDeviceWithUnsupportedFeaturesTestYcbcr2Plane444FormatsFeaturesEXT);
2527         addFunctionCase(testGroup, "image_robustness_features_ext", "createDeviceWithUnsupportedFeaturesTestImageRobustnessFeaturesEXT", createDeviceWithUnsupportedFeaturesTestImageRobustnessFeaturesEXT);
2528         addFunctionCase(testGroup, "4444_formats_features_ext", "createDeviceWithUnsupportedFeaturesTest4444FormatsFeaturesEXT", createDeviceWithUnsupportedFeaturesTest4444FormatsFeaturesEXT);
2529         addFunctionCase(testGroup, "vertex_input_dynamic_state_features_ext", "createDeviceWithUnsupportedFeaturesTestVertexInputDynamicStateFeaturesEXT", createDeviceWithUnsupportedFeaturesTestVertexInputDynamicStateFeaturesEXT);
2530         addFunctionCase(testGroup, "extended_dynamic_state2_features_ext", "createDeviceWithUnsupportedFeaturesTestExtendedDynamicState2FeaturesEXT", createDeviceWithUnsupportedFeaturesTestExtendedDynamicState2FeaturesEXT);
2531         addFunctionCase(testGroup, "color_write_enable_features_ext", "createDeviceWithUnsupportedFeaturesTestColorWriteEnableFeaturesEXT", createDeviceWithUnsupportedFeaturesTestColorWriteEnableFeaturesEXT);
2532 }
2533