diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2021-07-27 01:35:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-27 01:35:01 +0200 |
commit | 7511f65e312ab9916967a1234e471ef11b818787 (patch) | |
tree | 15b618a83f4fe178f4cac76a46523ad3397fd327 /src/video_core/renderer_vulkan/vk_stream_buffer.h | |
parent | Merge pull request #6740 from K0bin/hvv-fallback (diff) | |
parent | vk_stream_buffer: Remove unused stream buffer (diff) | |
download | yuzu-7511f65e312ab9916967a1234e471ef11b818787.tar yuzu-7511f65e312ab9916967a1234e471ef11b818787.tar.gz yuzu-7511f65e312ab9916967a1234e471ef11b818787.tar.bz2 yuzu-7511f65e312ab9916967a1234e471ef11b818787.tar.lz yuzu-7511f65e312ab9916967a1234e471ef11b818787.tar.xz yuzu-7511f65e312ab9916967a1234e471ef11b818787.tar.zst yuzu-7511f65e312ab9916967a1234e471ef11b818787.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_stream_buffer.h | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/video_core/renderer_vulkan/vk_stream_buffer.h b/src/video_core/renderer_vulkan/vk_stream_buffer.h deleted file mode 100644 index 2e9c8cb46..000000000 --- a/src/video_core/renderer_vulkan/vk_stream_buffer.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2019 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <optional> -#include <utility> -#include <vector> - -#include "common/common_types.h" -#include "video_core/vulkan_common/vulkan_wrapper.h" - -namespace Vulkan { - -class Device; -class VKFenceWatch; -class VKScheduler; - -class VKStreamBuffer final { -public: - explicit VKStreamBuffer(const Device& device, VKScheduler& scheduler); - ~VKStreamBuffer(); - - /** - * Reserves a region of memory from the stream buffer. - * @param size Size to reserve. - * @returns A pair of a raw memory pointer (with offset added), and the buffer offset - */ - std::pair<u8*, u64> Map(u64 size, u64 alignment); - - /// Ensures that "size" bytes of memory are available to the GPU, potentially recording a copy. - void Unmap(u64 size); - - VkBuffer Handle() const noexcept { - return *buffer; - } - - u64 Address() const noexcept { - return 0; - } - -private: - struct Watch { - u64 tick{}; - u64 upper_bound{}; - }; - - /// Creates Vulkan buffer handles committing the required the required memory. - void CreateBuffers(); - - /// Increases the amount of watches available. - void ReserveWatches(std::vector<Watch>& watches, std::size_t grow_size); - - void WaitPendingOperations(u64 requested_upper_bound); - - const Device& device; ///< Vulkan device manager. - VKScheduler& scheduler; ///< Command scheduler. - - vk::Buffer buffer; ///< Mapped buffer. - vk::DeviceMemory memory; ///< Memory allocation. - u64 stream_buffer_size{}; ///< Stream buffer size. - - u64 offset{}; ///< Buffer iterator. - u64 mapped_size{}; ///< Size reserved for the current copy. - - std::vector<Watch> current_watches; ///< Watches recorded in the current iteration. - std::size_t current_watch_cursor{}; ///< Count of watches, reset on invalidation. - std::optional<std::size_t> invalidation_mark; ///< Number of watches used in the previous cycle. - - std::vector<Watch> previous_watches; ///< Watches used in the previous iteration. - std::size_t wait_cursor{}; ///< Last watch being waited for completion. - u64 wait_bound{}; ///< Highest offset being watched for completion. -}; - -} // namespace Vulkan |