Move vulkan_platform.h to common/
This file changes the non-dispatchable Vulkan handle types. We want to use some of these handles in utils/VulkanSwapChain.cpp so it needs to have access to it. The file could include backend/vulkan/vulkan_platform.h but it seems a bit cleaner to move the header in common/ instead with a warning if the Vulkan backend isn't enabled.
This commit is contained in:
parent
cc407ae787
commit
c0f5ca1f5a
|
@ -288,7 +288,6 @@ if (NXT_ENABLE_VULKAN)
|
|||
target_include_directories(vulkan_autogen PUBLIC ${SRC_DIR})
|
||||
|
||||
list(APPEND BACKEND_SOURCES
|
||||
${VULKAN_DIR}/vulkan_platform.h
|
||||
${VULKAN_DIR}/BufferUploader.cpp
|
||||
${VULKAN_DIR}/BufferUploader.h
|
||||
${VULKAN_DIR}/BufferVk.cpp
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#ifndef BACKEND_VULKAN_BUFFERUPLOADER_H_
|
||||
#define BACKEND_VULKAN_BUFFERUPLOADER_H_
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/SerialQueue.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
#include "backend/Buffer.h"
|
||||
|
||||
#include "backend/vulkan/MemoryAllocator.h"
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/SerialQueue.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "backend/CommandBuffer.h"
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#ifndef BACKEND_VULKAN_FENCEDDELETER_H_
|
||||
#define BACKEND_VULKAN_FENCEDDELETER_H_
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/SerialQueue.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "backend/Framebuffer.h"
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "backend/InputState.h"
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#ifndef BACKEND_VULKAN_MEMORYALLOCATOR_H_
|
||||
#define BACKEND_VULKAN_MEMORYALLOCATOR_H_
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/SerialQueue.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "backend/PipelineLayout.h"
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "backend/RenderPass.h"
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "backend/RenderPipeline.h"
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "backend/ShaderModule.h"
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "backend/Texture.h"
|
||||
|
||||
#include "backend/vulkan/MemoryAllocator.h"
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
namespace backend { namespace vulkan {
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#ifndef BACKEND_VULKAN_VULKANFUNCTIONS_H_
|
||||
#define BACKEND_VULKAN_VULKANFUNCTIONS_H_
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
class DynamicLib;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#ifndef BACKEND_VULKAN_VULKANINFO_H_
|
||||
#define BACKEND_VULKAN_VULKANINFO_H_
|
||||
|
||||
#include "backend/vulkan/vulkan_platform.h"
|
||||
#include "common/vulkan_platform.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ list(APPEND COMMON_SOURCES
|
|||
${COMMON_DIR}/Serial.h
|
||||
${COMMON_DIR}/SerialQueue.h
|
||||
${COMMON_DIR}/SwapChainUtils.h
|
||||
${COMMON_DIR}/vulkan_platform.h
|
||||
)
|
||||
|
||||
add_library(nxt_common STATIC ${COMMON_SOURCES})
|
||||
|
|
|
@ -12,8 +12,12 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef BACKEND_VULKAN_VULKANPLATFORM_H_
|
||||
#define BACKEND_VULKAN_VULKANPLATFORM_H_
|
||||
#ifndef COMMON_VULKANPLATFORM_H_
|
||||
#define COMMON_VULKANPLATFORM_H_
|
||||
|
||||
#if !defined(NXT_ENABLE_BACKEND_VULKAN)
|
||||
# error "vulkan_platform.h included without the Vulkan backend enabled"
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
@ -72,4 +76,4 @@ class VkNonDispatchableHandle {
|
|||
# undef VK_NULL_HANDLE
|
||||
# define VK_NULL_HANDLE nullptr
|
||||
|
||||
#endif // BACKEND_VULKAN_VULKANPLATFORM_H_
|
||||
#endif // COMMON_VULKANPLATFORM_H_
|
Loading…
Reference in New Issue