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:
parent
e0557484e3
commit
5958c36b31
|
@ -329,7 +329,7 @@ ResultOrError<VulkanGlobalKnobs> VulkanInstance::CreateVkInstance(const Instance
|
||||||
appInfo.applicationVersion = 0;
|
appInfo.applicationVersion = 0;
|
||||||
appInfo.pEngineName = nullptr;
|
appInfo.pEngineName = nullptr;
|
||||||
appInfo.engineVersion = 0;
|
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;
|
VkInstanceCreateInfo createInfo;
|
||||||
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
|
|
||||||
namespace dawn::native::vulkan {
|
namespace dawn::native::vulkan {
|
||||||
|
|
||||||
static constexpr uint32_t VulkanVersion_1_1 = VK_MAKE_VERSION(1, 1, 0);
|
static constexpr uint32_t VulkanVersion_1_1 = VK_API_VERSION_1_1;
|
||||||
static constexpr uint32_t VulkanVersion_1_2 = VK_MAKE_VERSION(1, 2, 0);
|
static constexpr uint32_t VulkanVersion_1_2 = VK_API_VERSION_1_2;
|
||||||
static constexpr uint32_t VulkanVersion_1_3 = VK_MAKE_VERSION(1, 3, 0);
|
static constexpr uint32_t VulkanVersion_1_3 = VK_API_VERSION_1_3;
|
||||||
static constexpr uint32_t NeverPromoted = std::numeric_limits<uint32_t>::max();
|
static constexpr uint32_t NeverPromoted = std::numeric_limits<uint32_t>::max();
|
||||||
|
|
||||||
// A static array for InstanceExtInfo that can be indexed with InstanceExts.
|
// A static array for InstanceExtInfo that can be indexed with InstanceExts.
|
||||||
|
|
|
@ -54,7 +54,7 @@ using InstanceExtSet = ityp::bitset<InstanceExt, static_cast<uint32_t>(InstanceE
|
||||||
struct InstanceExtInfo {
|
struct InstanceExtInfo {
|
||||||
InstanceExt index;
|
InstanceExt index;
|
||||||
const char* name;
|
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.
|
// or NeverPromoted if it was never promoted.
|
||||||
uint32_t versionPromoted;
|
uint32_t versionPromoted;
|
||||||
};
|
};
|
||||||
|
@ -117,7 +117,7 @@ using DeviceExtSet = ityp::bitset<DeviceExt, static_cast<uint32_t>(DeviceExt::En
|
||||||
struct DeviceExtInfo {
|
struct DeviceExtInfo {
|
||||||
DeviceExt index;
|
DeviceExt index;
|
||||||
const char* name;
|
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.
|
// or NeverPromoted if it was never promoted.
|
||||||
uint32_t versionPromoted;
|
uint32_t versionPromoted;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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
|
// Vulkan 1.1 is not required to report promoted extensions from 1.0 and is not required to
|
||||||
// support the vendor entrypoint in GetProcAddress.
|
// 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);
|
GET_INSTANCE_PROC(GetPhysicalDeviceExternalBufferProperties);
|
||||||
} else if (globalInfo.HasExt(InstanceExt::ExternalMemoryCapabilities)) {
|
} else if (globalInfo.HasExt(InstanceExt::ExternalMemoryCapabilities)) {
|
||||||
GET_INSTANCE_PROC_VENDOR(GetPhysicalDeviceExternalBufferProperties, KHR);
|
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);
|
GET_INSTANCE_PROC(GetPhysicalDeviceExternalSemaphoreProperties);
|
||||||
} else if (globalInfo.HasExt(InstanceExt::ExternalSemaphoreCapabilities)) {
|
} else if (globalInfo.HasExt(InstanceExt::ExternalSemaphoreCapabilities)) {
|
||||||
GET_INSTANCE_PROC_VENDOR(GetPhysicalDeviceExternalSemaphoreProperties, KHR);
|
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(GetPhysicalDeviceFeatures2);
|
||||||
GET_INSTANCE_PROC(GetPhysicalDeviceProperties2);
|
GET_INSTANCE_PROC(GetPhysicalDeviceProperties2);
|
||||||
GET_INSTANCE_PROC(GetPhysicalDeviceFormatProperties2);
|
GET_INSTANCE_PROC(GetPhysicalDeviceFormatProperties2);
|
||||||
|
|
|
@ -68,7 +68,7 @@ ResultOrError<VulkanGlobalInfo> GatherGlobalInfo(const VulkanFunctions& vkFuncti
|
||||||
VulkanGlobalInfo info = {};
|
VulkanGlobalInfo info = {};
|
||||||
// Gather info on available API version
|
// 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) {
|
if (vkFunctions.EnumerateInstanceVersion != nullptr) {
|
||||||
DAWN_TRY(CheckVkSuccess(vkFunctions.EnumerateInstanceVersion(&info.apiVersion),
|
DAWN_TRY(CheckVkSuccess(vkFunctions.EnumerateInstanceVersion(&info.apiVersion),
|
||||||
"vkEnumerateInstanceVersion"));
|
"vkEnumerateInstanceVersion"));
|
||||||
|
|
Loading…
Reference in New Issue