summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-04-05 23:23:49 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-04-06 15:23:06 +0200
commit7fcd0fee6d580a381fdc4a4ec5b77687e4857b5b (patch)
treefc9c659ffa601aee77eeea2a11f16be98cefc902 /src/video_core/renderer_opengl
parentTexture Cache: Use vAddr instead of physical memory for caching. (diff)
downloadyuzu-7fcd0fee6d580a381fdc4a4ec5b77687e4857b5b.tar
yuzu-7fcd0fee6d580a381fdc4a4ec5b77687e4857b5b.tar.gz
yuzu-7fcd0fee6d580a381fdc4a4ec5b77687e4857b5b.tar.bz2
yuzu-7fcd0fee6d580a381fdc4a4ec5b77687e4857b5b.tar.lz
yuzu-7fcd0fee6d580a381fdc4a4ec5b77687e4857b5b.tar.xz
yuzu-7fcd0fee6d580a381fdc4a4ec5b77687e4857b5b.tar.zst
yuzu-7fcd0fee6d580a381fdc4a4ec5b77687e4857b5b.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_buffer_cache.cpp8
-rw-r--r--src/video_core/renderer_opengl/gl_buffer_cache.h4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp
index 0375fca17..4eb37a96c 100644
--- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp
@@ -21,8 +21,8 @@ using Maxwell = Tegra::Engines::Maxwell3D::Regs;
MICROPROFILE_DEFINE(OpenGL_Buffer_Download, "OpenGL", "Buffer Download", MP_RGB(192, 192, 128));
-CachedBufferBlock::CachedBufferBlock(CacheAddr cache_addr, const std::size_t size)
- : VideoCommon::BufferBlock{cache_addr, size} {
+CachedBufferBlock::CachedBufferBlock(VAddr cpu_addr, const std::size_t size)
+ : VideoCommon::BufferBlock{cpu_addr, size} {
gl_buffer.Create();
glNamedBufferData(gl_buffer.handle, static_cast<GLsizeiptr>(size), nullptr, GL_DYNAMIC_DRAW);
}
@@ -47,8 +47,8 @@ OGLBufferCache::~OGLBufferCache() {
glDeleteBuffers(static_cast<GLsizei>(std::size(cbufs)), std::data(cbufs));
}
-Buffer OGLBufferCache::CreateBlock(CacheAddr cache_addr, std::size_t size) {
- return std::make_shared<CachedBufferBlock>(cache_addr, size);
+Buffer OGLBufferCache::CreateBlock(VAddr cpu_addr, std::size_t size) {
+ return std::make_shared<CachedBufferBlock>(cpu_addr, size);
}
void OGLBufferCache::WriteBarrier() {
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.h b/src/video_core/renderer_opengl/gl_buffer_cache.h
index 8c7145443..d94a11252 100644
--- a/src/video_core/renderer_opengl/gl_buffer_cache.h
+++ b/src/video_core/renderer_opengl/gl_buffer_cache.h
@@ -31,7 +31,7 @@ using GenericBufferCache = VideoCommon::BufferCache<Buffer, GLuint, OGLStreamBuf
class CachedBufferBlock : public VideoCommon::BufferBlock {
public:
- explicit CachedBufferBlock(CacheAddr cache_addr, const std::size_t size);
+ explicit CachedBufferBlock(VAddr cpu_addr, const std::size_t size);
~CachedBufferBlock();
const GLuint* GetHandle() const {
@@ -55,7 +55,7 @@ public:
}
protected:
- Buffer CreateBlock(CacheAddr cache_addr, std::size_t size) override;
+ Buffer CreateBlock(VAddr cpu_addr, std::size_t size) override;
void WriteBarrier() override;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index a25e7486d..cb4928bbe 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -663,7 +663,7 @@ void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) {
}
CacheAddr cache_addr = ToCacheAddr(system.Memory().GetPointer(addr));
texture_cache.FlushRegion(addr, size);
- buffer_cache.FlushRegion(cache_addr, size);
+ buffer_cache.FlushRegion(addr, size);
query_cache.FlushRegion(cache_addr, size);
}
@@ -675,7 +675,7 @@ void RasterizerOpenGL::InvalidateRegion(VAddr addr, u64 size) {
CacheAddr cache_addr = ToCacheAddr(system.Memory().GetPointer(addr));
texture_cache.InvalidateRegion(addr, size);
shader_cache.InvalidateRegion(cache_addr, size);
- buffer_cache.InvalidateRegion(cache_addr, size);
+ buffer_cache.InvalidateRegion(addr, size);
query_cache.InvalidateRegion(cache_addr, size);
}