diff options
author | bunnei <bunneidev@gmail.com> | 2022-03-25 04:16:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 04:16:11 +0100 |
commit | ab6a5784fa991016b5d8c097471fbda88853ba5d (patch) | |
tree | 407ed36099630b4e52bcd727e799d8f22bb43c24 /src/video_core/renderer_opengl/gl_buffer_cache.cpp | |
parent | Merge pull request #8050 from bunnei/nvflinger-rewrite (diff) | |
parent | GC: Address Feedback. (diff) | |
download | yuzu-ab6a5784fa991016b5d8c097471fbda88853ba5d.tar yuzu-ab6a5784fa991016b5d8c097471fbda88853ba5d.tar.gz yuzu-ab6a5784fa991016b5d8c097471fbda88853ba5d.tar.bz2 yuzu-ab6a5784fa991016b5d8c097471fbda88853ba5d.tar.lz yuzu-ab6a5784fa991016b5d8c097471fbda88853ba5d.tar.xz yuzu-ab6a5784fa991016b5d8c097471fbda88853ba5d.tar.zst yuzu-ab6a5784fa991016b5d8c097471fbda88853ba5d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_buffer_cache.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp index d4dd10bb6..f1f7b384b 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp @@ -135,6 +135,20 @@ BufferCacheRuntime::BufferCacheRuntime(const Device& device_) buffer.Create(); glNamedBufferData(buffer.handle, 0x10'000, nullptr, GL_STREAM_COPY); } + + device_access_memory = [this]() -> u64 { + if (device.CanReportMemoryUsage()) { + return device.GetCurrentDedicatedVideoMemory() + 512_MiB; + } + return 2_GiB; // Return minimum requirements + }(); +} + +u64 BufferCacheRuntime::GetDeviceMemoryUsage() const { + if (device.CanReportMemoryUsage()) { + return device_access_memory - device.GetCurrentDedicatedVideoMemory(); + } + return 2_GiB; } void BufferCacheRuntime::CopyBuffer(Buffer& dst_buffer, Buffer& src_buffer, |