diff options
author | bunnei <bunneidev@gmail.com> | 2019-02-19 02:58:32 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2019-03-15 03:34:42 +0100 |
commit | 2eaf6c41a4686028c0abc84d1be6fd48a67cf49f (patch) | |
tree | 6ad0848c848aea68e637386cad5068e13c831b92 /src/video_core/renderer_vulkan/vk_buffer_cache.h | |
parent | Merge pull request #2233 from ReinUsesLisp/morton-cleanup (diff) | |
download | yuzu-2eaf6c41a4686028c0abc84d1be6fd48a67cf49f.tar yuzu-2eaf6c41a4686028c0abc84d1be6fd48a67cf49f.tar.gz yuzu-2eaf6c41a4686028c0abc84d1be6fd48a67cf49f.tar.bz2 yuzu-2eaf6c41a4686028c0abc84d1be6fd48a67cf49f.tar.lz yuzu-2eaf6c41a4686028c0abc84d1be6fd48a67cf49f.tar.xz yuzu-2eaf6c41a4686028c0abc84d1be6fd48a67cf49f.tar.zst yuzu-2eaf6c41a4686028c0abc84d1be6fd48a67cf49f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_buffer_cache.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index d8e916f31..8b415744b 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h @@ -24,22 +24,39 @@ class VKFence; class VKMemoryManager; class VKStreamBuffer; -struct CachedBufferEntry final : public RasterizerCacheObject { - VAddr GetAddr() const override { - return addr; +class CachedBufferEntry final : public RasterizerCacheObject { +public: + explicit CachedBufferEntry(VAddr cpu_addr, std::size_t size, u64 offset, std::size_t alignment, + u8* host_ptr); + + VAddr GetCpuAddr() const override { + return cpu_addr; } std::size_t GetSizeInBytes() const override { return size; } + std::size_t GetSize() const { + return size; + } + + u64 GetOffset() const { + return offset; + } + + std::size_t GetAlignment() const { + return alignment; + } + // We do not have to flush this cache as things in it are never modified by us. void Flush() override {} - VAddr addr; - std::size_t size; - u64 offset; - std::size_t alignment; +private: + VAddr cpu_addr{}; + std::size_t size{}; + u64 offset{}; + std::size_t alignment{}; }; class VKBufferCache final : public RasterizerCache<std::shared_ptr<CachedBufferEntry>> { |