Rename CTS "build" Python module to "ctsbuild"
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / scripts / gen_framework_sc.py
index 33a1b30..d736114 100644 (file)
@@ -32,7 +32,7 @@ from collections import OrderedDict
 
 sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "scripts"))
 
-from build.common import DEQP_DIR, execute
+from ctsbuild.common import DEQP_DIR, execute
 from khr_util.format import indentLines, writeInlFile
 
 VULKAN_HEADERS_INCLUDE_DIR     = os.path.join(os.path.dirname(__file__), "..", "..", "vulkan-docs", "src", "include")
@@ -2823,15 +2823,17 @@ def writeMandatoryFeatures(api, filename):
                                        ''])
                reqs = v[0][1:]
                if len(reqs) > 0 :
-                       cond = 'if ( '
+                       cond = ''
                        for i, req in enumerate(reqs) :
+                               if len(cond) > 0:
+                                       cond += ' || '
                                if (req.startswith("ApiVersion")):
                                        cond = cond + 'context.contextSupports(vk::' + req + ')'
-                               else:
+                               elif (req.startswith("VK_")):
                                        cond = cond + 'isExtensionStructSupported(deviceExtensions, RequiredExtension("' + req + '"))'
-                               if i+1 < len(reqs) :
-                                       cond = cond + ' || '
-                       cond = cond + ' )'
+                       if len(cond) == 0:
+                               cond = 'false'
+                       cond = 'if ( ' + cond + ' )'
                        stream.append('\t' + cond)
                stream.extend(['\t{',
                                           '\t\t' + v[0][0] + '.sType = getStructureType<' + k + '>();',