Add timelineSempahore to mandatory ext features
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / framework / vulkan / vkMandatoryFeatures.inl
1 /* WARNING: This is auto-generated file. Do not modify, since changes will
2  * be lost! Modify the generating script instead.
3  */
4 bool checkMandatoryFeatures(const vkt::Context& context)
5 {
6         if ( !vk::isInstanceExtensionSupported(context.getUsedApiVersion(), context.getInstanceExtensions(), "VK_KHR_get_physical_device_properties2") )
7                 TCU_THROW(NotSupportedError, "Extension VK_KHR_get_physical_device_properties2 is not present");
8
9         VkPhysicalDevice                                        physicalDevice          = context.getPhysicalDevice();
10         const InstanceInterface&                        vki                                     = context.getInstanceInterface();
11         const vector<VkExtensionProperties>     deviceExtensions        = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
12
13         tcu::TestLog& log = context.getTestContext().getLog();
14         vk::VkPhysicalDeviceFeatures2 coreFeatures;
15         deMemset(&coreFeatures, 0, sizeof(coreFeatures));
16         coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
17         void** nextPtr = &coreFeatures.pNext;
18
19         vk::VkPhysicalDevice8BitStorageFeaturesKHR physicalDevice8BitStorageFeaturesKHR;
20         deMemset(&physicalDevice8BitStorageFeaturesKHR, 0, sizeof(physicalDevice8BitStorageFeaturesKHR));
21
22         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_8bit_storage")) )
23         {
24                 physicalDevice8BitStorageFeaturesKHR.sType = getStructureType<VkPhysicalDevice8BitStorageFeaturesKHR>();
25                 *nextPtr = &physicalDevice8BitStorageFeaturesKHR;
26                 nextPtr  = &physicalDevice8BitStorageFeaturesKHR.pNext;
27         }
28
29         vk::VkPhysicalDeviceDescriptorIndexingFeaturesEXT physicalDeviceDescriptorIndexingFeaturesEXT;
30         deMemset(&physicalDeviceDescriptorIndexingFeaturesEXT, 0, sizeof(physicalDeviceDescriptorIndexingFeaturesEXT));
31
32         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
33         {
34                 physicalDeviceDescriptorIndexingFeaturesEXT.sType = getStructureType<VkPhysicalDeviceDescriptorIndexingFeaturesEXT>();
35                 *nextPtr = &physicalDeviceDescriptorIndexingFeaturesEXT;
36                 nextPtr  = &physicalDeviceDescriptorIndexingFeaturesEXT.pNext;
37         }
38
39         vk::VkPhysicalDeviceInlineUniformBlockFeaturesEXT physicalDeviceInlineUniformBlockFeaturesEXT;
40         deMemset(&physicalDeviceInlineUniformBlockFeaturesEXT, 0, sizeof(physicalDeviceInlineUniformBlockFeaturesEXT));
41
42         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_inline_uniform_block")) )
43         {
44                 physicalDeviceInlineUniformBlockFeaturesEXT.sType = getStructureType<VkPhysicalDeviceInlineUniformBlockFeaturesEXT>();
45                 *nextPtr = &physicalDeviceInlineUniformBlockFeaturesEXT;
46                 nextPtr  = &physicalDeviceInlineUniformBlockFeaturesEXT.pNext;
47         }
48
49         vk::VkPhysicalDeviceMultiviewFeatures physicalDeviceMultiviewFeatures;
50         deMemset(&physicalDeviceMultiviewFeatures, 0, sizeof(physicalDeviceMultiviewFeatures));
51
52         if ( context.contextSupports(vk::ApiVersion(1, 1, 0)) || isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_multiview")) )
53         {
54                 physicalDeviceMultiviewFeatures.sType = getStructureType<VkPhysicalDeviceMultiviewFeatures>();
55                 *nextPtr = &physicalDeviceMultiviewFeatures;
56                 nextPtr  = &physicalDeviceMultiviewFeatures.pNext;
57         }
58
59         vk::VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR physicalDevicePipelineExecutablePropertiesFeaturesKHR;
60         deMemset(&physicalDevicePipelineExecutablePropertiesFeaturesKHR, 0, sizeof(physicalDevicePipelineExecutablePropertiesFeaturesKHR));
61
62         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_pipeline_executable_properties")) )
63         {
64                 physicalDevicePipelineExecutablePropertiesFeaturesKHR.sType = getStructureType<VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR>();
65                 *nextPtr = &physicalDevicePipelineExecutablePropertiesFeaturesKHR;
66                 nextPtr  = &physicalDevicePipelineExecutablePropertiesFeaturesKHR.pNext;
67         }
68
69         vk::VkPhysicalDeviceScalarBlockLayoutFeaturesEXT physicalDeviceScalarBlockLayoutFeaturesEXT;
70         deMemset(&physicalDeviceScalarBlockLayoutFeaturesEXT, 0, sizeof(physicalDeviceScalarBlockLayoutFeaturesEXT));
71
72         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_scalar_block_layout")) )
73         {
74                 physicalDeviceScalarBlockLayoutFeaturesEXT.sType = getStructureType<VkPhysicalDeviceScalarBlockLayoutFeaturesEXT>();
75                 *nextPtr = &physicalDeviceScalarBlockLayoutFeaturesEXT;
76                 nextPtr  = &physicalDeviceScalarBlockLayoutFeaturesEXT.pNext;
77         }
78
79         vk::VkPhysicalDeviceTimelineSemaphoreFeaturesKHR physicalDeviceTimelineSemaphoreFeaturesKHR;
80         deMemset(&physicalDeviceTimelineSemaphoreFeaturesKHR, 0, sizeof(physicalDeviceTimelineSemaphoreFeaturesKHR));
81
82         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_timeline_semaphore")) )
83         {
84                 physicalDeviceTimelineSemaphoreFeaturesKHR.sType = getStructureType<VkPhysicalDeviceTimelineSemaphoreFeaturesKHR>();
85                 *nextPtr = &physicalDeviceTimelineSemaphoreFeaturesKHR;
86                 nextPtr  = &physicalDeviceTimelineSemaphoreFeaturesKHR.pNext;
87         }
88
89         vk::VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR physicalDeviceUniformBufferStandardLayoutFeaturesKHR;
90         deMemset(&physicalDeviceUniformBufferStandardLayoutFeaturesKHR, 0, sizeof(physicalDeviceUniformBufferStandardLayoutFeaturesKHR));
91
92         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_uniform_buffer_standard_layout")) )
93         {
94                 physicalDeviceUniformBufferStandardLayoutFeaturesKHR.sType = getStructureType<VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR>();
95                 *nextPtr = &physicalDeviceUniformBufferStandardLayoutFeaturesKHR;
96                 nextPtr  = &physicalDeviceUniformBufferStandardLayoutFeaturesKHR.pNext;
97         }
98
99         vk::VkPhysicalDeviceVariablePointersFeatures physicalDeviceVariablePointersFeatures;
100         deMemset(&physicalDeviceVariablePointersFeatures, 0, sizeof(physicalDeviceVariablePointersFeatures));
101
102         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_variable_pointers")) )
103         {
104                 physicalDeviceVariablePointersFeatures.sType = getStructureType<VkPhysicalDeviceVariablePointersFeatures>();
105                 *nextPtr = &physicalDeviceVariablePointersFeatures;
106                 nextPtr  = &physicalDeviceVariablePointersFeatures.pNext;
107         }
108
109         context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &coreFeatures);
110         bool result = true;
111
112         {
113                 if ( coreFeatures.features.robustBufferAccess == VK_FALSE )
114                 {
115                         log << tcu::TestLog::Message << "Mandatory feature robustBufferAccess not supported" << tcu::TestLog::EndMessage;
116                         result = false;
117                 }
118         }
119
120         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
121         {
122                 if ( coreFeatures.features.shaderSampledImageArrayDynamicIndexing == VK_FALSE )
123                 {
124                         log << tcu::TestLog::Message << "Mandatory feature shaderSampledImageArrayDynamicIndexing not supported" << tcu::TestLog::EndMessage;
125                         result = false;
126                 }
127         }
128
129         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
130         {
131                 if ( coreFeatures.features.shaderStorageBufferArrayDynamicIndexing == VK_FALSE )
132                 {
133                         log << tcu::TestLog::Message << "Mandatory feature shaderStorageBufferArrayDynamicIndexing not supported" << tcu::TestLog::EndMessage;
134                         result = false;
135                 }
136         }
137
138         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_8bit_storage")) )
139         {
140                 if ( physicalDevice8BitStorageFeaturesKHR.storageBuffer8BitAccess == VK_FALSE )
141                 {
142                         log << tcu::TestLog::Message << "Mandatory feature storageBuffer8BitAccess not supported" << tcu::TestLog::EndMessage;
143                         result = false;
144                 }
145         }
146
147         if ( context.contextSupports(vk::ApiVersion(1, 1, 0)) )
148         {
149                 if ( physicalDeviceMultiviewFeatures.multiview == VK_FALSE )
150                 {
151                         log << tcu::TestLog::Message << "Mandatory feature multiview not supported" << tcu::TestLog::EndMessage;
152                         result = false;
153                 }
154         }
155
156         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_multiview")) )
157         {
158                 if ( physicalDeviceMultiviewFeatures.multiview == VK_FALSE )
159                 {
160                         log << tcu::TestLog::Message << "Mandatory feature multiview not supported" << tcu::TestLog::EndMessage;
161                         result = false;
162                 }
163         }
164
165         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_variable_pointers")) )
166         {
167                 if ( physicalDeviceVariablePointersFeatures.variablePointersStorageBuffer == VK_FALSE )
168                 {
169                         log << tcu::TestLog::Message << "Mandatory feature variablePointersStorageBuffer not supported" << tcu::TestLog::EndMessage;
170                         result = false;
171                 }
172         }
173
174         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
175         {
176                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderUniformTexelBufferArrayDynamicIndexing == VK_FALSE )
177                 {
178                         log << tcu::TestLog::Message << "Mandatory feature shaderUniformTexelBufferArrayDynamicIndexing not supported" << tcu::TestLog::EndMessage;
179                         result = false;
180                 }
181         }
182
183         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
184         {
185                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderStorageTexelBufferArrayDynamicIndexing == VK_FALSE )
186                 {
187                         log << tcu::TestLog::Message << "Mandatory feature shaderStorageTexelBufferArrayDynamicIndexing not supported" << tcu::TestLog::EndMessage;
188                         result = false;
189                 }
190         }
191
192         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
193         {
194                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderSampledImageArrayNonUniformIndexing == VK_FALSE )
195                 {
196                         log << tcu::TestLog::Message << "Mandatory feature shaderSampledImageArrayNonUniformIndexing not supported" << tcu::TestLog::EndMessage;
197                         result = false;
198                 }
199         }
200
201         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
202         {
203                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderStorageBufferArrayNonUniformIndexing == VK_FALSE )
204                 {
205                         log << tcu::TestLog::Message << "Mandatory feature shaderStorageBufferArrayNonUniformIndexing not supported" << tcu::TestLog::EndMessage;
206                         result = false;
207                 }
208         }
209
210         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
211         {
212                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderUniformTexelBufferArrayNonUniformIndexing == VK_FALSE )
213                 {
214                         log << tcu::TestLog::Message << "Mandatory feature shaderUniformTexelBufferArrayNonUniformIndexing not supported" << tcu::TestLog::EndMessage;
215                         result = false;
216                 }
217         }
218
219         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
220         {
221                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingSampledImageUpdateAfterBind == VK_FALSE )
222                 {
223                         log << tcu::TestLog::Message << "Mandatory feature descriptorBindingSampledImageUpdateAfterBind not supported" << tcu::TestLog::EndMessage;
224                         result = false;
225                 }
226         }
227
228         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
229         {
230                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingStorageImageUpdateAfterBind == VK_FALSE )
231                 {
232                         log << tcu::TestLog::Message << "Mandatory feature descriptorBindingStorageImageUpdateAfterBind not supported" << tcu::TestLog::EndMessage;
233                         result = false;
234                 }
235         }
236
237         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
238         {
239                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingStorageBufferUpdateAfterBind == VK_FALSE )
240                 {
241                         log << tcu::TestLog::Message << "Mandatory feature descriptorBindingStorageBufferUpdateAfterBind not supported" << tcu::TestLog::EndMessage;
242                         result = false;
243                 }
244         }
245
246         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
247         {
248                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingUniformTexelBufferUpdateAfterBind == VK_FALSE )
249                 {
250                         log << tcu::TestLog::Message << "Mandatory feature descriptorBindingUniformTexelBufferUpdateAfterBind not supported" << tcu::TestLog::EndMessage;
251                         result = false;
252                 }
253         }
254
255         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
256         {
257                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingStorageTexelBufferUpdateAfterBind == VK_FALSE )
258                 {
259                         log << tcu::TestLog::Message << "Mandatory feature descriptorBindingStorageTexelBufferUpdateAfterBind not supported" << tcu::TestLog::EndMessage;
260                         result = false;
261                 }
262         }
263
264         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
265         {
266                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingUpdateUnusedWhilePending == VK_FALSE )
267                 {
268                         log << tcu::TestLog::Message << "Mandatory feature descriptorBindingUpdateUnusedWhilePending not supported" << tcu::TestLog::EndMessage;
269                         result = false;
270                 }
271         }
272
273         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
274         {
275                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingPartiallyBound == VK_FALSE )
276                 {
277                         log << tcu::TestLog::Message << "Mandatory feature descriptorBindingPartiallyBound not supported" << tcu::TestLog::EndMessage;
278                         result = false;
279                 }
280         }
281
282         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
283         {
284                 if ( physicalDeviceDescriptorIndexingFeaturesEXT.runtimeDescriptorArray == VK_FALSE )
285                 {
286                         log << tcu::TestLog::Message << "Mandatory feature runtimeDescriptorArray not supported" << tcu::TestLog::EndMessage;
287                         result = false;
288                 }
289         }
290
291         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_inline_uniform_block")) )
292         {
293                 if ( physicalDeviceInlineUniformBlockFeaturesEXT.inlineUniformBlock == VK_FALSE )
294                 {
295                         log << tcu::TestLog::Message << "Mandatory feature inlineUniformBlock not supported" << tcu::TestLog::EndMessage;
296                         result = false;
297                 }
298         }
299
300         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_inline_uniform_block")) && isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
301         {
302                 if ( physicalDeviceInlineUniformBlockFeaturesEXT.descriptorBindingInlineUniformBlockUpdateAfterBind == VK_FALSE )
303                 {
304                         log << tcu::TestLog::Message << "Mandatory feature descriptorBindingInlineUniformBlockUpdateAfterBind not supported" << tcu::TestLog::EndMessage;
305                         result = false;
306                 }
307         }
308
309         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_scalar_block_layout")) )
310         {
311                 if ( physicalDeviceScalarBlockLayoutFeaturesEXT.scalarBlockLayout == VK_FALSE )
312                 {
313                         log << tcu::TestLog::Message << "Mandatory feature scalarBlockLayout not supported" << tcu::TestLog::EndMessage;
314                         result = false;
315                 }
316         }
317
318         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_uniform_buffer_standard_layout")) )
319         {
320                 if ( physicalDeviceUniformBufferStandardLayoutFeaturesKHR.uniformBufferStandardLayout == VK_FALSE )
321                 {
322                         log << tcu::TestLog::Message << "Mandatory feature uniformBufferStandardLayout not supported" << tcu::TestLog::EndMessage;
323                         result = false;
324                 }
325         }
326
327         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_pipeline_executable_properties")) )
328         {
329                 if ( physicalDevicePipelineExecutablePropertiesFeaturesKHR.pipelineExecutableInfo == VK_FALSE )
330                 {
331                         log << tcu::TestLog::Message << "Mandatory feature pipelineExecutableInfo not supported" << tcu::TestLog::EndMessage;
332                         result = false;
333                 }
334         }
335
336         if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_timeline_semaphore")) )
337         {
338                 if ( physicalDeviceTimelineSemaphoreFeaturesKHR.timelineSemaphore == VK_FALSE )
339                 {
340                         log << tcu::TestLog::Message << "Mandatory feature timelineSemaphore not supported" << tcu::TestLog::EndMessage;
341                         result = false;
342                 }
343         }
344
345         return result;
346 }
347