WSI: sed-generated changes to WSI code (not all that's needed).
Conflicts:
demos/cube.c
demos/tri.c
demos/vulkaninfo.c
icd/common/icd.h
loader/loader.h
diff --git a/demos/cube.c b/demos/cube.c
index 34bb6a9..f0e393a 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -41,9 +41,10 @@
#endif // _WIN32
#include <vulkan/vulkan.h>
-#include <vulkan/vk_ext_khr_swapchain.h>
-#include <vulkan/vk_ext_khr_device_swapchain.h>
-#include <vulkan/vk_lunarg_debug_report.h>
+
+#include <vulkan/VK_KHR_surface.h>
+#include <vulkan/VK_KHR_swapchain.h>
+#include "vulkan/vk_lunarg_debug_report.h"
#include <vulkan/vk_sdk_platform.h>
#include "linmath.h"
@@ -338,9 +339,9 @@
VkColorSpaceKHR color_space;
PFN_vkGetPhysicalDeviceSurfaceSupportKHR fpGetPhysicalDeviceSurfaceSupportKHR;
- PFN_vkGetSurfacePropertiesKHR fpGetSurfacePropertiesKHR;
- PFN_vkGetSurfaceFormatsKHR fpGetSurfaceFormatsKHR;
- PFN_vkGetSurfacePresentModesKHR fpGetSurfacePresentModesKHR;
+ PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR fpGetPhysicalDeviceSurfaceCapabilitiesKHR;
+ PFN_vkGetPhysicalDeviceSurfaceFormatsKHR fpGetPhysicalDeviceSurfaceFormatsKHR;
+ PFN_vkGetPhysicalDeviceSurfacePresentModesKHR fpGetPhysicalDeviceSurfacePresentModesKHR;
PFN_vkCreateSwapchainKHR fpCreateSwapchainKHR;
PFN_vkDestroySwapchainKHR fpDestroySwapchainKHR;
PFN_vkGetSwapchainImagesKHR fpGetSwapchainImagesKHR;
@@ -600,7 +601,7 @@
.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
.dstAccessMask = 0,
.oldLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
- .newLayout = VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR,
+ .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.subresourceRange = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }
@@ -679,7 +680,7 @@
// we need to set the image layout back to COLOR_ATTACHMENT_OPTIMAL
demo_set_image_layout(demo, demo->buffers[demo->current_buffer].image,
VK_IMAGE_ASPECT_COLOR_BIT,
- VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR,
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
demo_flush_init_cmd(demo);
@@ -688,7 +689,7 @@
// engine has fully released ownership to the application, and it is
// okay to render to the image.
-// FIXME/TODO: DEAL WITH VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR
+// FIXME/TODO: DEAL WITH VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
VkSubmitInfo submit_info = {
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
.pNext = NULL,
@@ -736,21 +737,21 @@
VkSwapchainKHR oldSwapchain = demo->swapchain;
// Check the surface properties and formats
- VkSurfacePropertiesKHR surfProperties;
- err = demo->fpGetSurfacePropertiesKHR(demo->device,
+ VkSurfaceCapabilitiesKHR surfProperties;
+ err = demo->fpGetPhysicalDeviceSurfaceCapabilitiesKHR(demo->device,
(const VkSurfaceDescriptionKHR *)&demo->surface_description,
&surfProperties);
assert(!err);
uint32_t presentModeCount;
- err = demo->fpGetSurfacePresentModesKHR(demo->device,
+ err = demo->fpGetPhysicalDeviceSurfacePresentModesKHR(demo->device,
(const VkSurfaceDescriptionKHR *)&demo->surface_description,
&presentModeCount, NULL);
assert(!err);
VkPresentModeKHR *presentModes =
(VkPresentModeKHR *)malloc(presentModeCount * sizeof(VkPresentModeKHR));
assert(presentModes);
- err = demo->fpGetSurfacePresentModesKHR(demo->device,
+ err = demo->fpGetPhysicalDeviceSurfacePresentModesKHR(demo->device,
(const VkSurfaceDescriptionKHR *)&demo->surface_description,
&presentModeCount, presentModes);
assert(!err);
@@ -879,12 +880,12 @@
demo->buffers[i].image = swapchainImages[i];
- // Render loop will expect image to have been used before and in VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR
+ // Render loop will expect image to have been used before and in VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
// layout and will change to COLOR_ATTACHMENT_OPTIMAL, so init the image to that state
demo_set_image_layout(demo, demo->buffers[i].image,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_UNDEFINED,
- VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR);
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
color_image_view.image = demo->buffers[i].image;
@@ -2167,9 +2168,9 @@
err = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, instance_extensions);
assert(!err);
for (uint32_t i = 0; i < instance_extension_count; i++) {
- if (!strcmp("VK_EXT_KHR_swapchain", instance_extensions[i].extensionName)) {
+ if (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {
swapchainExtFound = 1;
- extension_names[enabled_extension_count++] = "VK_EXT_KHR_swapchain";
+ extension_names[enabled_extension_count++] = VK_KHR_SURFACE_EXTENSION_NAME;
}
if (!strcmp(VK_DEBUG_REPORT_EXTENSION_NAME, instance_extensions[i].extensionName)) {
if (demo->validate) {
@@ -2180,7 +2181,7 @@
}
if (!swapchainExtFound) {
ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the "
- "\"VK_EXT_KHR_swapchain\" extension.\n\nDo you have a compatible "
+ VK_KHR_SURFACE_EXTENSION_NAME" extension.\n\nDo you have a compatible "
"Vulkan installable client driver (ICD) installed?\nPlease "
"look at the Getting Started guide for additional "
"information.\n",
@@ -2276,15 +2277,15 @@
assert(!err);
for (uint32_t i = 0; i < device_extension_count; i++) {
- if (!strcmp("VK_EXT_KHR_device_swapchain", device_extensions[i].extensionName)) {
+ if (!strcmp(VK_KHR_SWAPCHAIN_EXTENSION_NAME, device_extensions[i].extensionName)) {
swapchainExtFound = 1;
- extension_names[enabled_extension_count++] = "VK_EXT_KHR_device_swapchain";
+ extension_names[enabled_extension_count++] = VK_KHR_SWAPCHAIN_EXTENSION_NAME;
}
assert(enabled_extension_count < 64);
}
if (!swapchainExtFound) {
ERR_EXIT("vkEnumerateDeviceExtensionProperties failed to find the "
- "\"VK_EXT_KHR_device_swapchain\" extension.\n\nDo you have a compatible "
+ VK_KHR_SWAPCHAIN_EXTENSION_NAME" extension.\n\nDo you have a compatible "
"Vulkan installable client driver (ICD) installed?\nPlease "
"look at the Getting Started guide for additional "
"information.\n",
@@ -2380,9 +2381,9 @@
free(device_layers);
GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfaceSupportKHR);
- GET_DEVICE_PROC_ADDR(demo->device, GetSurfacePropertiesKHR);
- GET_DEVICE_PROC_ADDR(demo->device, GetSurfaceFormatsKHR);
- GET_DEVICE_PROC_ADDR(demo->device, GetSurfacePresentModesKHR);
+ GET_DEVICE_PROC_ADDR(demo->device, GetPhysicalDeviceSurfaceCapabilitiesKHR);
+ GET_DEVICE_PROC_ADDR(demo->device, GetPhysicalDeviceSurfaceFormatsKHR);
+ GET_DEVICE_PROC_ADDR(demo->device, GetPhysicalDeviceSurfacePresentModesKHR);
GET_DEVICE_PROC_ADDR(demo->device, CreateSwapchainKHR);
GET_DEVICE_PROC_ADDR(demo->device, DestroySwapchainKHR);
GET_DEVICE_PROC_ADDR(demo->device, GetSwapchainImagesKHR);
@@ -2469,13 +2470,13 @@
// Get the list of VkFormat's that are supported:
uint32_t formatCount;
- err = demo->fpGetSurfaceFormatsKHR(demo->device,
+ err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->device,
(VkSurfaceDescriptionKHR *) &demo->surface_description,
&formatCount, NULL);
assert(!err);
VkSurfaceFormatKHR *surfFormats =
(VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR));
- err = demo->fpGetSurfaceFormatsKHR(demo->device,
+ err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->device,
(VkSurfaceDescriptionKHR *) &demo->surface_description,
&formatCount, surfFormats);
assert(!err);
diff --git a/demos/tri.c b/demos/tri.c
index bd3cc6f..ea35ee6 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -48,9 +48,10 @@
#endif // _WIN32
#include <vulkan/vulkan.h>
-#include <vulkan/vk_lunarg_debug_report.h>
-#include <vulkan/vk_ext_khr_swapchain.h>
-#include <vulkan/vk_ext_khr_device_swapchain.h>
+
+#include "vulkan/vk_lunarg_debug_report.h"
+#include <vulkan/VK_KHR_surface.h>
+#include <vulkan/VK_KHR_swapchain.h>
#define DEMO_TEXTURE_COUNT 1
#define VERTEX_BUFFER_BIND_ID 0
@@ -187,9 +188,9 @@
VkColorSpaceKHR color_space;
PFN_vkGetPhysicalDeviceSurfaceSupportKHR fpGetPhysicalDeviceSurfaceSupportKHR;
- PFN_vkGetSurfacePropertiesKHR fpGetSurfacePropertiesKHR;
- PFN_vkGetSurfaceFormatsKHR fpGetSurfaceFormatsKHR;
- PFN_vkGetSurfacePresentModesKHR fpGetSurfacePresentModesKHR;
+ PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR fpGetPhysicalDeviceSurfaceCapabilitiesKHR;
+ PFN_vkGetPhysicalDeviceSurfaceFormatsKHR fpGetPhysicalDeviceSurfaceFormatsKHR;
+ PFN_vkGetPhysicalDeviceSurfacePresentModesKHR fpGetPhysicalDeviceSurfacePresentModesKHR;
PFN_vkCreateSwapchainKHR fpCreateSwapchainKHR;
PFN_vkDestroySwapchainKHR fpDestroySwapchainKHR;
PFN_vkGetSwapchainImagesKHR fpGetSwapchainImagesKHR;
@@ -446,7 +447,7 @@
.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
.dstAccessMask = 0,
.oldLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
- .newLayout = VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR,
+ .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.subresourceRange = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }
@@ -500,7 +501,7 @@
// we need to set the image layout back to COLOR_ATTACHMENT_OPTIMAL
demo_set_image_layout(demo, demo->buffers[demo->current_buffer].image,
VK_IMAGE_ASPECT_COLOR_BIT,
- VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR,
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
demo_flush_init_cmd(demo);
@@ -509,7 +510,7 @@
// engine has fully released ownership to the application, and it is
// okay to render to the image.
-// FIXME/TODO: DEAL WITH VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR
+// FIXME/TODO: DEAL WITH VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
demo_draw_build_cmd(demo);
VkFence nullFence = VK_NULL_HANDLE;
@@ -560,21 +561,21 @@
VkSwapchainKHR oldSwapchain = demo->swapchain;
// Check the surface proprties and formats
- VkSurfacePropertiesKHR surfProperties;
- err = demo->fpGetSurfacePropertiesKHR(demo->device,
+ VkSurfaceCapabilitiesKHR surfProperties;
+ err = demo->fpGetPhysicalDeviceSurfaceCapabilitiesKHR(demo->device,
(const VkSurfaceDescriptionKHR *)&demo->surface_description,
&surfProperties);
assert(!err);
uint32_t presentModeCount;
- err = demo->fpGetSurfacePresentModesKHR(demo->device,
+ err = demo->fpGetPhysicalDeviceSurfacePresentModesKHR(demo->device,
(const VkSurfaceDescriptionKHR *)&demo->surface_description,
&presentModeCount, NULL);
assert(!err);
VkPresentModeKHR *presentModes =
(VkPresentModeKHR *)malloc(presentModeCount * sizeof(VkPresentModeKHR));
assert(presentModes);
- err = demo->fpGetSurfacePresentModesKHR(demo->device,
+ err = demo->fpGetPhysicalDeviceSurfacePresentModesKHR(demo->device,
(const VkSurfaceDescriptionKHR *)&demo->surface_description,
&presentModeCount, presentModes);
assert(!err);
@@ -689,12 +690,12 @@
demo->buffers[i].image = swapchainImages[i];
- // Render loop will expect image to have been used before and in VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR
+ // Render loop will expect image to have been used before and in VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
// layout and will change to COLOR_ATTACHMENT_OPTIMAL, so init the image to that state
demo_set_image_layout(demo, demo->buffers[i].image,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_UNDEFINED,
- VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR);
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
color_attachment_view.image = demo->buffers[i].image;
@@ -1763,9 +1764,9 @@
err = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, instance_extensions);
assert(!err);
for (uint32_t i = 0; i < instance_extension_count; i++) {
- if (!strcmp("VK_EXT_KHR_swapchain", instance_extensions[i].extensionName)) {
+ if (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {
swapchainExtFound = 1;
- extension_names[enabled_extension_count++] = "VK_EXT_KHR_swapchain";
+ extension_names[enabled_extension_count++] = VK_KHR_SURFACE_EXTENSION_NAME;
}
if (!strcmp(VK_DEBUG_REPORT_EXTENSION_NAME, instance_extensions[i].extensionName)) {
if (demo->validate) {
@@ -1776,7 +1777,7 @@
}
if (!swapchainExtFound) {
ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the "
- "\"VK_EXT_KHR_swapchain\" extension.\n\nDo you have a compatible "
+ VK_KHR_SURFACE_EXTENSION_NAME" extension.\n\nDo you have a compatible "
"Vulkan installable client driver (ICD) installed?\nPlease "
"look at the Getting Started guide for additional "
"information.\n",
@@ -1882,15 +1883,15 @@
assert(!err);
for (uint32_t i = 0; i < device_extension_count; i++) {
- if (!strcmp("VK_EXT_KHR_device_swapchain", device_extensions[i].extensionName)) {
+ if (!strcmp(VK_KHR_SWAPCHAIN_EXTENSION_NAME, device_extensions[i].extensionName)) {
swapchainExtFound = 1;
- extension_names[enabled_extension_count++] = "VK_EXT_KHR_device_swapchain";
+ extension_names[enabled_extension_count++] = VK_KHR_SWAPCHAIN_EXTENSION_NAME;
}
assert(enabled_extension_count < 64);
}
if (!swapchainExtFound) {
ERR_EXIT("vkEnumerateDeviceExtensionProperties failed to find the "
- "\"VK_EXT_KHR_device_swapchain\" extension.\n\nDo you have a compatible "
+ VK_KHR_SWAPCHAIN_EXTENSION_NAME" extension.\n\nDo you have a compatible "
"Vulkan installable client driver (ICD) installed?\nPlease "
"look at the Getting Started guide for additional "
"information.\n",
@@ -1935,15 +1936,14 @@
// Having these GIPA queries of device extension entry points both
// BEFORE and AFTER vkCreateDevice is a good test for the loader
- GET_INSTANCE_PROC_ADDR(demo->inst, GetSurfacePropertiesKHR);
- GET_INSTANCE_PROC_ADDR(demo->inst, GetSurfaceFormatsKHR);
- GET_INSTANCE_PROC_ADDR(demo->inst, GetSurfacePresentModesKHR);
+ GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfaceCapabilitiesKHR);
+ GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfaceFormatsKHR);
+ GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfacePresentModesKHR);
err = vkCreateDevice(demo->gpu, &device, NULL, &demo->device);
assert(!err);
GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfaceSupportKHR);
-
GET_INSTANCE_PROC_ADDR(demo->inst, CreateSwapchainKHR);
GET_INSTANCE_PROC_ADDR(demo->inst, DestroySwapchainKHR);
GET_INSTANCE_PROC_ADDR(demo->inst, GetSwapchainImagesKHR);
@@ -2043,13 +2043,13 @@
// Get the list of VkFormat's that are supported:
uint32_t formatCount;
- err = demo->fpGetSurfaceFormatsKHR(demo->device,
+ err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->device,
(VkSurfaceDescriptionKHR *) &demo->surface_description,
&formatCount, NULL);
assert(!err);
VkSurfaceFormatKHR *surfFormats =
(VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR));
- err = demo->fpGetSurfaceFormatsKHR(demo->device,
+ err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->device,
(VkSurfaceDescriptionKHR *) &demo->surface_description,
&formatCount, surfFormats);
assert(!err);
diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c
index d56239b..95a60d6 100644
--- a/demos/vulkaninfo.c
+++ b/demos/vulkaninfo.c
@@ -37,8 +37,9 @@
#include <io.h>
#endif
-#include <vulkan/vk_ext_khr_swapchain.h>
-#include <vulkan/vk_ext_khr_device_swapchain.h>
+
+#include "vulkan/VK_KHR_surface.h"
+#include "vulkan/VK_KHR_swapchain.h"
#include <vulkan/vulkan.h>
@@ -414,7 +415,7 @@
VkResult U_ASSERT_ONLY err;
// Extensions to enable
static const char *known_extensions[] = {
- VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NAME,
+ VK_KHR_SWAPCHAIN_EXTENSION_NAME,
};
uint32_t count = 0;
@@ -556,7 +557,7 @@
VkResult U_ASSERT_ONLY err;
// Global Extensions to enable
static char *known_extensions[] = {
- "VK_EXT_KHR_swapchain",
+ VK_KHR_SURFACE_EXTENSION_NAME,
};
uint32_t global_extension_count = 0;