diff options
| author | 2019-02-12 18:01:40 -0300 | |
|---|---|---|
| committer | 2019-02-12 18:33:02 -0300 | |
| commit | 18fe910957b2edb7e89eefc6f5c984b791d85341 (patch) | |
| tree | 20672b4738aa3d9013c0a51996ba2b95696e9c1f /src | |
| parent | logging: Add Vulkan backend logging class type (diff) | |
| download | yuzu-18fe910957b2edb7e89eefc6f5c984b791d85341.tar.gz yuzu-18fe910957b2edb7e89eefc6f5c984b791d85341.tar.xz yuzu-18fe910957b2edb7e89eefc6f5c984b791d85341.zip | |
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).
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/declarations.h | 45 |
2 files changed, 52 insertions, 0 deletions
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 | |||
| 101 | video_core.h | 101 | video_core.h |
| 102 | ) | 102 | ) |
| 103 | 103 | ||
| 104 | if (ENABLE_VULKAN) | ||
| 105 | target_sources(video_core PRIVATE renderer_vulkan/declarations.h) | ||
| 106 | |||
| 107 | target_include_directories(video_core PRIVATE ../../externals/Vulkan-Headers/include) | ||
| 108 | target_compile_definitions(video_core PRIVATE HAS_VULKAN) | ||
| 109 | endif() | ||
| 110 | |||
| 104 | create_target_directory_groups(video_core) | 111 | create_target_directory_groups(video_core) |
| 105 | 112 | ||
| 106 | target_link_libraries(video_core PUBLIC common core) | 113 | 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 @@ | |||
| 1 | // Copyright 2019 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <vulkan/vulkan.hpp> | ||
| 8 | |||
| 9 | namespace Vulkan { | ||
| 10 | |||
| 11 | // vulkan.hpp unique handlers use DispatchLoaderStatic | ||
| 12 | template <typename T> | ||
| 13 | using UniqueHandle = vk::UniqueHandle<T, vk::DispatchLoaderDynamic>; | ||
| 14 | |||
| 15 | using UniqueAccelerationStructureNV = UniqueHandle<vk::AccelerationStructureNV>; | ||
| 16 | using UniqueBuffer = UniqueHandle<vk::Buffer>; | ||
| 17 | using UniqueBufferView = UniqueHandle<vk::BufferView>; | ||
| 18 | using UniqueCommandBuffer = UniqueHandle<vk::CommandBuffer>; | ||
| 19 | using UniqueCommandPool = UniqueHandle<vk::CommandPool>; | ||
| 20 | using UniqueDescriptorPool = UniqueHandle<vk::DescriptorPool>; | ||
| 21 | using UniqueDescriptorSet = UniqueHandle<vk::DescriptorSet>; | ||
| 22 | using UniqueDescriptorSetLayout = UniqueHandle<vk::DescriptorSetLayout>; | ||
| 23 | using UniqueDescriptorUpdateTemplate = UniqueHandle<vk::DescriptorUpdateTemplate>; | ||
| 24 | using UniqueDevice = UniqueHandle<vk::Device>; | ||
| 25 | using UniqueDeviceMemory = UniqueHandle<vk::DeviceMemory>; | ||
| 26 | using UniqueEvent = UniqueHandle<vk::Event>; | ||
| 27 | using UniqueFence = UniqueHandle<vk::Fence>; | ||
| 28 | using UniqueFramebuffer = UniqueHandle<vk::Framebuffer>; | ||
| 29 | using UniqueImage = UniqueHandle<vk::Image>; | ||
| 30 | using UniqueImageView = UniqueHandle<vk::ImageView>; | ||
| 31 | using UniqueIndirectCommandsLayoutNVX = UniqueHandle<vk::IndirectCommandsLayoutNVX>; | ||
| 32 | using UniqueObjectTableNVX = UniqueHandle<vk::ObjectTableNVX>; | ||
| 33 | using UniquePipeline = UniqueHandle<vk::Pipeline>; | ||
| 34 | using UniquePipelineCache = UniqueHandle<vk::PipelineCache>; | ||
| 35 | using UniquePipelineLayout = UniqueHandle<vk::PipelineLayout>; | ||
| 36 | using UniqueQueryPool = UniqueHandle<vk::QueryPool>; | ||
| 37 | using UniqueRenderPass = UniqueHandle<vk::RenderPass>; | ||
| 38 | using UniqueSampler = UniqueHandle<vk::Sampler>; | ||
| 39 | using UniqueSamplerYcbcrConversion = UniqueHandle<vk::SamplerYcbcrConversion>; | ||
| 40 | using UniqueSemaphore = UniqueHandle<vk::Semaphore>; | ||
| 41 | using UniqueShaderModule = UniqueHandle<vk::ShaderModule>; | ||
| 42 | using UniqueSwapchainKHR = UniqueHandle<vk::SwapchainKHR>; | ||
| 43 | using UniqueValidationCacheEXT = UniqueHandle<vk::ValidationCacheEXT>; | ||
| 44 | |||
| 45 | } // namespace Vulkan | ||