From 33a4cebc225454dfd8dc9a7263fe1f4bfb8a9748 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 14 Feb 2019 12:52:46 -0300 Subject: vk_resource_manager: Add VKResource interface VKResource is an interface that gets signaled by a fence when it is free to be reused. --- src/video_core/CMakeLists.txt | 4 +++- .../renderer_vulkan/vk_resource_manager.cpp | 14 ++++++++++++ .../renderer_vulkan/vk_resource_manager.h | 26 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/video_core/renderer_vulkan/vk_resource_manager.cpp create mode 100644 src/video_core/renderer_vulkan/vk_resource_manager.h (limited to 'src/video_core') diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index d35a738d5..59319f206 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -105,7 +105,9 @@ if (ENABLE_VULKAN) target_sources(video_core PRIVATE renderer_vulkan/declarations.h renderer_vulkan/vk_device.cpp - renderer_vulkan/vk_device.h) + renderer_vulkan/vk_device.h + renderer_vulkan/vk_resource_manager.cpp + renderer_vulkan/vk_resource_manager.h) target_include_directories(video_core PRIVATE ../../externals/Vulkan-Headers/include) target_compile_definitions(video_core PRIVATE HAS_VULKAN) diff --git a/src/video_core/renderer_vulkan/vk_resource_manager.cpp b/src/video_core/renderer_vulkan/vk_resource_manager.cpp new file mode 100644 index 000000000..46563748e --- /dev/null +++ b/src/video_core/renderer_vulkan/vk_resource_manager.cpp @@ -0,0 +1,14 @@ +// Copyright 2018 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "video_core/renderer_vulkan/declarations.h" +#include "video_core/renderer_vulkan/vk_resource_manager.h" + +namespace Vulkan { + +VKResource::VKResource() = default; + +VKResource::~VKResource() = default; + +} // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_resource_manager.h b/src/video_core/renderer_vulkan/vk_resource_manager.h new file mode 100644 index 000000000..21a53abcd --- /dev/null +++ b/src/video_core/renderer_vulkan/vk_resource_manager.h @@ -0,0 +1,26 @@ +// Copyright 2018 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "video_core/renderer_vulkan/declarations.h" + +namespace Vulkan { + +class VKFence; + +/// Interface for a Vulkan resource +class VKResource { +public: + explicit VKResource(); + virtual ~VKResource(); + + /** + * Signals the object that an owning fence has been signaled. + * @param signaling_fence Fence that signals its usage end. + */ + virtual void OnFenceRemoval(VKFence* signaling_fence) = 0; +}; + +} // namespace Vulkan -- cgit v1.2.3