diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-05-29 23:15:28 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-07-06 05:37:55 +0200 |
commit | 345f852bdb64d1a779ac617965f46f5b8227eca5 (patch) | |
tree | 68e3d6c6c07bf3a47956c0a4015dfb777eeaf589 /src/video_core/renderer_opengl/gl_global_cache.h | |
parent | gl_buffer_cache: Rework to support internalized buffers (diff) | |
download | yuzu-345f852bdb64d1a779ac617965f46f5b8227eca5.tar yuzu-345f852bdb64d1a779ac617965f46f5b8227eca5.tar.gz yuzu-345f852bdb64d1a779ac617965f46f5b8227eca5.tar.bz2 yuzu-345f852bdb64d1a779ac617965f46f5b8227eca5.tar.lz yuzu-345f852bdb64d1a779ac617965f46f5b8227eca5.tar.xz yuzu-345f852bdb64d1a779ac617965f46f5b8227eca5.tar.zst yuzu-345f852bdb64d1a779ac617965f46f5b8227eca5.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_global_cache.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_global_cache.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/video_core/renderer_opengl/gl_global_cache.h b/src/video_core/renderer_opengl/gl_global_cache.h deleted file mode 100644 index 2d467a240..000000000 --- a/src/video_core/renderer_opengl/gl_global_cache.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2018 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <memory> -#include <unordered_map> - -#include <glad/glad.h> - -#include "common/assert.h" -#include "common/common_types.h" -#include "video_core/engines/maxwell_3d.h" -#include "video_core/rasterizer_cache.h" -#include "video_core/renderer_opengl/gl_resource_manager.h" - -namespace OpenGL { - -namespace GLShader { -class GlobalMemoryEntry; -} - -class RasterizerOpenGL; -class CachedGlobalRegion; -using GlobalRegion = std::shared_ptr<CachedGlobalRegion>; - -class CachedGlobalRegion final : public RasterizerCacheObject { -public: - explicit CachedGlobalRegion(VAddr cpu_addr, u8* host_ptr, u32 size, u32 max_size); - ~CachedGlobalRegion(); - - VAddr GetCpuAddr() const override { - return cpu_addr; - } - - std::size_t GetSizeInBytes() const override { - return size; - } - - /// Gets the GL program handle for the buffer - GLuint GetBufferHandle() const { - return buffer.handle; - } - - /// Reloads the global region from guest memory - void Reload(u32 size_); - - void Flush(); - -private: - VAddr cpu_addr{}; - u8* host_ptr{}; - u32 size{}; - u32 max_size{}; - - OGLBuffer buffer; -}; - -class GlobalRegionCacheOpenGL final : public RasterizerCache<GlobalRegion> { -public: - explicit GlobalRegionCacheOpenGL(RasterizerOpenGL& rasterizer); - - /// Gets the current specified shader stage program - GlobalRegion GetGlobalRegion(const GLShader::GlobalMemoryEntry& descriptor, - Tegra::Engines::Maxwell3D::Regs::ShaderStage stage); - -protected: - void FlushObjectInner(const GlobalRegion& object) override { - object->Flush(); - } - -private: - GlobalRegion TryGetReservedGlobalRegion(CacheAddr addr, u32 size) const; - GlobalRegion GetUncachedGlobalRegion(GPUVAddr addr, u8* host_ptr, u32 size); - void ReserveGlobalRegion(GlobalRegion region); - - std::unordered_map<CacheAddr, GlobalRegion> reserve; - u32 max_ssbo_size{}; -}; - -} // namespace OpenGL |