Vulkan: Remove deprecated VK_MAKE_VERSION

This patch replaces VK_MAKE_VERSION with VK_API_VERSION_1_x as
VK_MAKE_VERSION has been deprecated in vulkan_core.h.

Bug: tint:1497
Change-Id: I9e9d1d39a139aad687d1f2c7671b562b46e83768
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91800
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Jiawei Shao 2022-05-27 16:35:16 +00:00 committed by Dawn LUCI CQ
parent e0557484e3
commit 5958c36b31
5 changed files with 10 additions and 10 deletions

View File

@ -329,7 +329,7 @@ ResultOrError<VulkanGlobalKnobs> VulkanInstance::CreateVkInstance(const Instance
appInfo.applicationVersion = 0;
appInfo.pEngineName = nullptr;
appInfo.engineVersion = 0;
appInfo.apiVersion = std::min(mGlobalInfo.apiVersion, VK_MAKE_VERSION(1, 3, 0));
appInfo.apiVersion = std::min(mGlobalInfo.apiVersion, VK_API_VERSION_1_3);
VkInstanceCreateInfo createInfo;
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;

View File

@ -22,9 +22,9 @@
namespace dawn::native::vulkan {
static constexpr uint32_t VulkanVersion_1_1 = VK_MAKE_VERSION(1, 1, 0);
static constexpr uint32_t VulkanVersion_1_2 = VK_MAKE_VERSION(1, 2, 0);
static constexpr uint32_t VulkanVersion_1_3 = VK_MAKE_VERSION(1, 3, 0);
static constexpr uint32_t VulkanVersion_1_1 = VK_API_VERSION_1_1;
static constexpr uint32_t VulkanVersion_1_2 = VK_API_VERSION_1_2;
static constexpr uint32_t VulkanVersion_1_3 = VK_API_VERSION_1_3;
static constexpr uint32_t NeverPromoted = std::numeric_limits<uint32_t>::max();
// A static array for InstanceExtInfo that can be indexed with InstanceExts.

View File

@ -54,7 +54,7 @@ using InstanceExtSet = ityp::bitset<InstanceExt, static_cast<uint32_t>(InstanceE
struct InstanceExtInfo {
InstanceExt index;
const char* name;
// The version in which this extension was promoted as built with VK_MAKE_VERSION,
// The version in which this extension was promoted as built with VK_API_VERSION_1_x,
// or NeverPromoted if it was never promoted.
uint32_t versionPromoted;
};
@ -117,7 +117,7 @@ using DeviceExtSet = ityp::bitset<DeviceExt, static_cast<uint32_t>(DeviceExt::En
struct DeviceExtInfo {
DeviceExt index;
const char* name;
// The version in which this extension was promoted as built with VK_MAKE_VERSION,
// The version in which this extension was promoted as built with VK_API_VERSION_1_x,
// or NeverPromoted if it was never promoted.
uint32_t versionPromoted;
};

View File

@ -138,19 +138,19 @@ MaybeError VulkanFunctions::LoadInstanceProcs(VkInstance instance,
// Vulkan 1.1 is not required to report promoted extensions from 1.0 and is not required to
// support the vendor entrypoint in GetProcAddress.
if (globalInfo.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
if (globalInfo.apiVersion >= VK_API_VERSION_1_1) {
GET_INSTANCE_PROC(GetPhysicalDeviceExternalBufferProperties);
} else if (globalInfo.HasExt(InstanceExt::ExternalMemoryCapabilities)) {
GET_INSTANCE_PROC_VENDOR(GetPhysicalDeviceExternalBufferProperties, KHR);
}
if (globalInfo.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
if (globalInfo.apiVersion >= VK_API_VERSION_1_1) {
GET_INSTANCE_PROC(GetPhysicalDeviceExternalSemaphoreProperties);
} else if (globalInfo.HasExt(InstanceExt::ExternalSemaphoreCapabilities)) {
GET_INSTANCE_PROC_VENDOR(GetPhysicalDeviceExternalSemaphoreProperties, KHR);
}
if (globalInfo.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
if (globalInfo.apiVersion >= VK_API_VERSION_1_1) {
GET_INSTANCE_PROC(GetPhysicalDeviceFeatures2);
GET_INSTANCE_PROC(GetPhysicalDeviceProperties2);
GET_INSTANCE_PROC(GetPhysicalDeviceFormatProperties2);

View File

@ -68,7 +68,7 @@ ResultOrError<VulkanGlobalInfo> GatherGlobalInfo(const VulkanFunctions& vkFuncti
VulkanGlobalInfo info = {};
// Gather info on available API version
{
info.apiVersion = VK_MAKE_VERSION(1, 0, 0);
info.apiVersion = VK_API_VERSION_1_0;
if (vkFunctions.EnumerateInstanceVersion != nullptr) {
DAWN_TRY(CheckVkSuccess(vkFunctions.EnumerateInstanceVersion(&info.apiVersion),
"vkEnumerateInstanceVersion"));