Commit de16f327 by Nicolas Capens Committed by Nicolas Capens

Replace vulkan.h includes with vulkan_core.h

vulkan_core.h only includes 'core' Vulkan declarations, while vulkan.h consists of vulkan_core.h plus platform-specific headers. Only Window System Integration (WSI) and closely related source files should have a need to include vulkan.h. Everything else, in particular our back-end, should not require anything Vulkan platform-specific. This avoids issues such as Xlib defining global macros which clash with C++ type and variable names. Bug b/124265819 Change-Id: I6c250f27aef39b98a2a8b677c169df060698f104 Reviewed-on: https://swiftshader-review.googlesource.com/c/24709Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 73c3124c
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "Color.hpp" #include "Color.hpp"
#include "Device/Config.hpp" #include "Device/Config.hpp"
#include "System/Resource.hpp" #include "System/Resource.hpp"
#include <vulkan/vulkan.h> #include <vulkan/vulkan_core.h>
namespace sw namespace sw
{ {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#ifndef VK_UTILS_HPP_ #ifndef VK_UTILS_HPP_
#define VK_UTILS_HPP_ #define VK_UTILS_HPP_
#include <vulkan/vulkan.h> #include <vulkan/vulkan_core.h>
namespace vk namespace vk
{ {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#ifndef VK_MEMORY_HPP_ #ifndef VK_MEMORY_HPP_
#define VK_MEMORY_HPP_ #define VK_MEMORY_HPP_
#include <vulkan/vulkan.h> #include <vulkan/vulkan_core.h>
namespace vk namespace vk
{ {
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
#include "VkConfig.h" #include "VkConfig.h"
#include "VkDebug.hpp" #include "VkDebug.hpp"
#include "VkMemory.h" #include "VkMemory.h"
#include <vulkan/vulkan.h>
#include <vulkan/vulkan_core.h>
#include <vulkan/vk_icd.h> #include <vulkan/vk_icd.h>
namespace vk namespace vk
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
// VK_KHR_storage_buffer_storage_class (no functions in this extension) // VK_KHR_storage_buffer_storage_class (no functions in this extension)
// VK_KHR_variable_pointers (no functions in this extension) // VK_KHR_variable_pointers (no functions in this extension)
#include <vulkan/vulkan.h> #include <vulkan/vulkan_core.h>
extern "C" extern "C"
{ {
......
...@@ -467,22 +467,22 @@ VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount ...@@ -467,22 +467,22 @@ VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue)
{ {
TRACE("(VkQueue queue = 0x%X)", queue); TRACE("(VkQueue queue = 0x%X)", queue);
vk::Cast(queue)->waitIdle(); vk::Cast(queue)->waitIdle();
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device)
{ {
TRACE("(VkDevice device = 0x%X)", device); TRACE("(VkDevice device = 0x%X)", device);
vk::Cast(device)->waitIdle(); vk::Cast(device)->waitIdle();
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory)
...@@ -1209,8 +1209,8 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool c ...@@ -1209,8 +1209,8 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool c
VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags)
{ {
TRACE("(VkDevice device = 0x%X, VkCommandPool commandPool = 0x%X, VkCommandPoolResetFlags flags = %d )", TRACE("(VkDevice device = 0x%X, VkCommandPool commandPool = 0x%X, VkCommandPoolResetFlags flags = %d )",
device, commandPool, flags); device, commandPool, flags);
return vk::Cast(commandPool)->reset(flags); return vk::Cast(commandPool)->reset(flags);
} }
...@@ -1923,9 +1923,9 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhy ...@@ -1923,9 +1923,9 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhy
VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags)
{ {
TRACE("(VkDevice device = 0x%X, VkCommandPool commandPool = 0x%X, VkCommandPoolTrimFlags flags = %d)", TRACE("(VkDevice device = 0x%X, VkCommandPool commandPool = 0x%X, VkCommandPoolTrimFlags flags = %d)",
device, commandPool, flags); device, commandPool, flags);
vk::Cast(commandPool)->trim(flags); vk::Cast(commandPool)->trim(flags);
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include <vulkan/vulkan.h> #include <vulkan/vulkan_core.h>
#include <vulkan/vk_icd.h> #include <vulkan/vk_icd.h>
#include <cstring> #include <cstring>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment