summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-11-26 20:10:49 +0100
committerLioncash <mathew1800@gmail.com>2019-11-27 03:55:37 +0100
commit536fc7f0ea77e08d68c760f387c307d258804e3b (patch)
treee979df531bf1222788cc26144531c6e6f5cca1d1 /src/video_core/renderer_vulkan
parentcore/memory: Move memory read/write implementation functions into an anonymous namespace (diff)
downloadyuzu-536fc7f0ea77e08d68c760f387c307d258804e3b.tar
yuzu-536fc7f0ea77e08d68c760f387c307d258804e3b.tar.gz
yuzu-536fc7f0ea77e08d68c760f387c307d258804e3b.tar.bz2
yuzu-536fc7f0ea77e08d68c760f387c307d258804e3b.tar.lz
yuzu-536fc7f0ea77e08d68c760f387c307d258804e3b.tar.xz
yuzu-536fc7f0ea77e08d68c760f387c307d258804e3b.tar.zst
yuzu-536fc7f0ea77e08d68c760f387c307d258804e3b.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.cpp4
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.h7
2 files changed, 9 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
index d2e9f4031..959638747 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
@@ -24,9 +24,11 @@ CachedBufferEntry::CachedBufferEntry(VAddr cpu_addr, std::size_t size, u64 offse
alignment{alignment} {}
VKBufferCache::VKBufferCache(Tegra::MemoryManager& tegra_memory_manager,
+ Memory::Memory& cpu_memory_,
VideoCore::RasterizerInterface& rasterizer, const VKDevice& device,
VKMemoryManager& memory_manager, VKScheduler& scheduler, u64 size)
- : RasterizerCache{rasterizer}, tegra_memory_manager{tegra_memory_manager} {
+ : RasterizerCache{rasterizer}, tegra_memory_manager{tegra_memory_manager}, cpu_memory{
+ cpu_memory_} {
const auto usage = vk::BufferUsageFlagBits::eVertexBuffer |
vk::BufferUsageFlagBits::eIndexBuffer |
vk::BufferUsageFlagBits::eUniformBuffer;
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h
index 49f13bcdc..daa8ccf66 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.h
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h
@@ -13,6 +13,10 @@
#include "video_core/renderer_vulkan/declarations.h"
#include "video_core/renderer_vulkan/vk_scheduler.h"
+namespace Memory {
+class Memory;
+}
+
namespace Tegra {
class MemoryManager;
}
@@ -58,7 +62,7 @@ private:
class VKBufferCache final : public RasterizerCache<std::shared_ptr<CachedBufferEntry>> {
public:
- explicit VKBufferCache(Tegra::MemoryManager& tegra_memory_manager,
+ explicit VKBufferCache(Tegra::MemoryManager& tegra_memory_manager, Memory::Memory& cpu_memory_,
VideoCore::RasterizerInterface& rasterizer, const VKDevice& device,
VKMemoryManager& memory_manager, VKScheduler& scheduler, u64 size);
~VKBufferCache();
@@ -92,6 +96,7 @@ private:
void AlignBuffer(std::size_t alignment);
Tegra::MemoryManager& tegra_memory_manager;
+ Memory::Memory& cpu_memory;
std::unique_ptr<VKStreamBuffer> stream_buffer;
vk::Buffer buffer_handle;