--- /dev/null
+/* WARNING: This is auto-generated file. Do not modify, since changes will
+ * be lost! Modify the generating script instead.
+ */
+static const struct
+{
+ std::string driver;
+ deUint32 id;
+} driverIds [] =
+{
+ {"VK_DRIVER_ID_AMD_PROPRIETARY", 1},
+ {"VK_DRIVER_ID_AMD_OPEN_SOURCE", 2},
+ {"VK_DRIVER_ID_MESA_RADV", 3},
+ {"VK_DRIVER_ID_NVIDIA_PROPRIETARY", 4},
+ {"VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS", 5},
+ {"VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA", 6},
+ {"VK_DRIVER_ID_IMAGINATION_PROPRIETARY", 7},
+ {"VK_DRIVER_ID_QUALCOMM_PROPRIETARY", 8},
+ {"VK_DRIVER_ID_ARM_PROPRIETARY", 9},
+ {"VK_DRIVER_ID_GOOGLE_SWIFTSHADER", 10},
+ {"VK_DRIVER_ID_GGP_PROPRIETARY", 11},
+ {"VK_DRIVER_ID_BROADCOM_PROPRIETARY", 12},
+ {"VK_DRIVER_ID_MESA_LLVMPIPE", 13},
+ {"VK_DRIVER_ID_AMD_PROPRIETARY_KHR", 1}, // VK_DRIVER_ID_AMD_PROPRIETARY
+ {"VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR", 2}, // VK_DRIVER_ID_AMD_OPEN_SOURCE
+ {"VK_DRIVER_ID_MESA_RADV_KHR", 3}, // VK_DRIVER_ID_MESA_RADV
+ {"VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR", 4}, // VK_DRIVER_ID_NVIDIA_PROPRIETARY
+ {"VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR", 5}, // VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS
+ {"VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR", 6}, // VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA
+ {"VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR", 7}, // VK_DRIVER_ID_IMAGINATION_PROPRIETARY
+ {"VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR", 8}, // VK_DRIVER_ID_QUALCOMM_PROPRIETARY
+ {"VK_DRIVER_ID_ARM_PROPRIETARY_KHR", 9}, // VK_DRIVER_ID_ARM_PROPRIETARY
+ {"VK_DRIVER_ID_GOOGLE_SWIFTSHADER_KHR", 10}, // VK_DRIVER_ID_GOOGLE_SWIFTSHADER
+ {"VK_DRIVER_ID_GGP_PROPRIETARY_KHR", 11}, // VK_DRIVER_ID_GGP_PROPRIETARY
+ {"VK_DRIVER_ID_BROADCOM_PROPRIETARY_KHR", 12}, // VK_DRIVER_ID_BROADCOM_PROPRIETARY
+ {"VK_DRIVER_ID_MAX_ENUM", 0x7FFFFFFF}
+};
#include "vktTestCaseUtil.hpp"
#include "vkQueryUtil.hpp"
#include "vkTypeUtil.hpp"
+#include "vkKnownDriverIds.inl"
using namespace vk;
TEST_TYPE_VERSION,
};
-static const deUint32 knownDriverIds[] =
-{
- // Specified in the Vulkan registry (vk.xml)
- 1, // author = "Advanced Micro Devices, Inc." comment = "AMD proprietary driver"
- 2, // author = "Advanced Micro Devices, Inc." comment = "AMD open-source driver"
- 3, // author = "Mesa open source project" comment = "Mesa RADV driver"
- 4, // author = "NVIDIA Corporation" comment = "NVIDIA proprietary driver"
- 5, // author = "Intel Corporation" comment = "Intel proprietary Windows driver"
- 6, // author = "Intel Corporation" comment = "Intel open-source Mesa driver"
- 7, // author = "Imagination Technologies" comment = "Imagination proprietary driver"
- 8, // author = "Qualcomm Technologies, Inc." comment = "Qualcomm proprietary driver"
- 9, // author = "Arm Limited" comment = "Arm proprietary driver"
- 10, // <enum value="10" name="VK_DRIVER_ID_GOOGLE_SWIFTSHADER_KHR" comment="Google LLC"/>
- 11, // <enum value="11" name="VK_DRIVER_ID_GGP_PROPRIETARY_KHR" comment="Google LLC"/>
- 12, // <enum value="12" name="VK_DRIVER_ID_BROADCOM_PROPRIETARY_KHR" comment="Broadcom Inc."/>
-};
-
static const VkConformanceVersionKHR knownConformanceVersions[] =
{
makeConformanceVersion(1, 2, 3, 0),
void testDriverMatch (const VkPhysicalDeviceDriverPropertiesKHR& deviceDriverProperties)
{
- for (const deUint32* pDriverId = knownDriverIds; pDriverId != DE_ARRAY_END(knownDriverIds); ++pDriverId)
+ for (deUint32 driverNdx = 0; driverNdx < DE_LENGTH_OF_ARRAY(driverIds); driverNdx++)
{
- if (deviceDriverProperties.driverID == *pDriverId)
+ if (deviceDriverProperties.driverID == driverIds[driverNdx].id)
return;
}
writeInlFile(filename, INL_HEADER, gen())
+def writeDriverIds(filename):
+
+ driverIdsString = []
+ driverIdsString.append("static const struct\n"
+ "{\n"
+ "\tstd::string driver;\n"
+ "\tdeUint32 id;\n"
+ "} driverIds [] =\n"
+ "{")
+
+ vulkanCore = readFile(os.path.join(VULKAN_H_DIR, "vulkan_core.h"))
+
+ items = re.search(r'(?:typedef\s+enum\s+VkDriverId\s*{)((.*\n)*)(?:}\s*VkDriverId\s*;)', vulkanCore).group(1).split(',')
+ driverItems = dict()
+ for item in items:
+ item.strip()
+ splitted = item.split('=')
+ key = splitted[0].strip()
+ value_str = splitted[1].strip()
+ try: # is this previously defined value?
+ value = driverItems[value_str]
+ except:
+ value = value_str
+ value_str = ""
+ if value_str:
+ value_str = "\t// " + value_str
+ driverItems[key] = value
+ if not item == items[-1]:
+ driverIdsString.append("\t{\"" + key + "\"" + ", " + value + "}," + value_str)
+ else:
+ driverIdsString.append("\t{\"" + key + "\"" + ", " + value + "}" + value_str)
+ driverItems[key] = value
+
+ driverIdsString.append("};")
+
+ writeInlFile(filename, INL_HEADER, driverIdsString)
+
+
def writeSupportedExtenions(api, filename):
def writeExtensionsForVersions(map):
writeMandatoryFeatures ( os.path.join(VULKAN_DIR, "vkMandatoryFeatures.inl"))
writeExtensionList ( os.path.join(VULKAN_DIR, "vkInstanceExtensions.inl"), 'INSTANCE')
writeExtensionList ( os.path.join(VULKAN_DIR, "vkDeviceExtensions.inl"), 'DEVICE')
+ writeDriverIds ( os.path.join(VULKAN_DIR, "vkKnownDriverIds.inl"))