From 18fe910957b2edb7e89eefc6f5c984b791d85341 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 12 Feb 2019 18:01:40 -0300 Subject: renderer_vulkan: Add declarations file This file is intended to be included instead of vulkan/vulkan.hpp. It includes declarations of unique handlers using a dynamic dispatcher instead of a static one (which would require linking to a Vulkan library). --- src/video_core/CMakeLists.txt | 7 +++++ src/video_core/renderer_vulkan/declarations.h | 45 +++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/video_core/renderer_vulkan/declarations.h diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 33e507e69..a12680d35 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -101,6 +101,13 @@ add_library(video_core STATIC video_core.h ) +if (ENABLE_VULKAN) + target_sources(video_core PRIVATE renderer_vulkan/declarations.h) + + target_include_directories(video_core PRIVATE ../../externals/Vulkan-Headers/include) + target_compile_definitions(video_core PRIVATE HAS_VULKAN) +endif() + create_target_directory_groups(video_core) target_link_libraries(video_core PUBLIC common core) diff --git a/src/video_core/renderer_vulkan/declarations.h b/src/video_core/renderer_vulkan/declarations.h new file mode 100644 index 000000000..ba25b5bc7 --- /dev/null +++ b/src/video_core/renderer_vulkan/declarations.h @@ -0,0 +1,45 @@ +// Copyright 2019 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include + +namespace Vulkan { + +// vulkan.hpp unique handlers use DispatchLoaderStatic +template +using UniqueHandle = vk::UniqueHandle; + +using UniqueAccelerationStructureNV = UniqueHandle; +using UniqueBuffer = UniqueHandle; +using UniqueBufferView = UniqueHandle; +using UniqueCommandBuffer = UniqueHandle; +using UniqueCommandPool = UniqueHandle; +using UniqueDescriptorPool = UniqueHandle; +using UniqueDescriptorSet = UniqueHandle; +using UniqueDescriptorSetLayout = UniqueHandle; +using UniqueDescriptorUpdateTemplate = UniqueHandle; +using UniqueDevice = UniqueHandle; +using UniqueDeviceMemory = UniqueHandle; +using UniqueEvent = UniqueHandle; +using UniqueFence = UniqueHandle; +using UniqueFramebuffer = UniqueHandle; +using UniqueImage = UniqueHandle; +using UniqueImageView = UniqueHandle; +using UniqueIndirectCommandsLayoutNVX = UniqueHandle; +using UniqueObjectTableNVX = UniqueHandle; +using UniquePipeline = UniqueHandle; +using UniquePipelineCache = UniqueHandle; +using UniquePipelineLayout = UniqueHandle; +using UniqueQueryPool = UniqueHandle; +using UniqueRenderPass = UniqueHandle; +using UniqueSampler = UniqueHandle; +using UniqueSamplerYcbcrConversion = UniqueHandle; +using UniqueSemaphore = UniqueHandle; +using UniqueShaderModule = UniqueHandle; +using UniqueSwapchainKHR = UniqueHandle; +using UniqueValidationCacheEXT = UniqueHandle; + +} // namespace Vulkan -- cgit v1.2.3