Expose Vulkan 1.2 support
Also update the unittests to expect version 1.2.
Bug: b/147825369
Tests: dEQP-VK.*
Change-Id: Ib3bb07662140fa976ec2532124ab2d7337f34c55
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/47348
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Sean Risser <srisser@google.com>
Commit-Queue: Sean Risser <srisser@google.com>
diff --git a/src/Vulkan/VkConfig.hpp b/src/Vulkan/VkConfig.hpp
index edcf38c..8fffde2 100644
--- a/src/Vulkan/VkConfig.hpp
+++ b/src/Vulkan/VkConfig.hpp
@@ -31,7 +31,7 @@
enum
{
- API_VERSION = VK_API_VERSION_1_1,
+ API_VERSION = VK_API_VERSION_1_2,
DRIVER_VERSION = VK_MAKE_VERSION(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION),
VENDOR_ID = 0x1AE0, // Google, Inc.: https://pcisig.com/google-inc-1
DEVICE_ID = 0xC0DE, // SwiftShader (placeholder)
diff --git a/tests/VulkanUnitTests/BasicTests.cpp b/tests/VulkanUnitTests/BasicTests.cpp
index b71348d..4e9312c 100644
--- a/tests/VulkanUnitTests/BasicTests.cpp
+++ b/tests/VulkanUnitTests/BasicTests.cpp
@@ -62,8 +62,9 @@
TEST_F(BasicTest, Version)
{
uint32_t apiVersion = 0;
+ uint32_t expectedVersion = static_cast<uint32_t>(VK_API_VERSION_1_2);
VkResult result = driver.vkEnumerateInstanceVersion(&apiVersion);
- EXPECT_EQ(apiVersion, (uint32_t)VK_API_VERSION_1_1);
+ EXPECT_EQ(apiVersion, expectedVersion);
const VkInstanceCreateInfo createInfo = {
VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, // sType
@@ -93,7 +94,7 @@
VkPhysicalDeviceProperties physicalDeviceProperties;
driver.vkGetPhysicalDeviceProperties(pPhysicalDevice, &physicalDeviceProperties);
- EXPECT_EQ(physicalDeviceProperties.apiVersion, (uint32_t)VK_API_VERSION_1_1);
+ EXPECT_EQ(physicalDeviceProperties.apiVersion, expectedVersion);
EXPECT_EQ(physicalDeviceProperties.deviceID, 0xC0DEU);
EXPECT_EQ(physicalDeviceProperties.deviceType, VK_PHYSICAL_DEVICE_TYPE_CPU);
@@ -116,7 +117,6 @@
{
uint32_t apiVersion = 0;
VkResult result = driver.vkEnumerateInstanceVersion(&apiVersion);
- EXPECT_EQ(apiVersion, (uint32_t)VK_API_VERSION_1_1);
const VkInstanceCreateInfo createInfo = {
VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, // sType