summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_framebuffer_cache.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-12-01 00:46:40 +0100
committerGitHub <noreply@github.com>2019-12-01 00:46:40 +0100
commit930b7c18a6d73d2365c8c2b868279fe5d44630d3 (patch)
treefa68e3c531ec46b3aa5e1a525dc3bbbc5d784255 /src/video_core/renderer_opengl/gl_framebuffer_cache.h
parentMerge pull request #3185 from ReinUsesLisp/oob-texture (diff)
parentgl_framebuffer_cache: Optimize framebuffer key (diff)
downloadyuzu-930b7c18a6d73d2365c8c2b868279fe5d44630d3.tar
yuzu-930b7c18a6d73d2365c8c2b868279fe5d44630d3.tar.gz
yuzu-930b7c18a6d73d2365c8c2b868279fe5d44630d3.tar.bz2
yuzu-930b7c18a6d73d2365c8c2b868279fe5d44630d3.tar.lz
yuzu-930b7c18a6d73d2365c8c2b868279fe5d44630d3.tar.xz
yuzu-930b7c18a6d73d2365c8c2b868279fe5d44630d3.tar.zst
yuzu-930b7c18a6d73d2365c8c2b868279fe5d44630d3.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_framebuffer_cache.h')
-rw-r--r--src/video_core/renderer_opengl/gl_framebuffer_cache.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_framebuffer_cache.h b/src/video_core/renderer_opengl/gl_framebuffer_cache.h
index 424344c48..02ec80ae9 100644
--- a/src/video_core/renderer_opengl/gl_framebuffer_cache.h
+++ b/src/video_core/renderer_opengl/gl_framebuffer_cache.h
@@ -18,21 +18,24 @@
namespace OpenGL {
-struct alignas(sizeof(u64)) FramebufferCacheKey {
- bool stencil_enable = false;
- u16 colors_count = 0;
+constexpr std::size_t BitsPerAttachment = 4;
- std::array<GLenum, Tegra::Engines::Maxwell3D::Regs::NumRenderTargets> color_attachments{};
- std::array<View, Tegra::Engines::Maxwell3D::Regs::NumRenderTargets> colors;
+struct FramebufferCacheKey {
View zeta;
+ std::array<View, Tegra::Engines::Maxwell3D::Regs::NumRenderTargets> colors;
+ u32 color_attachments = 0;
- std::size_t Hash() const;
+ std::size_t Hash() const noexcept;
- bool operator==(const FramebufferCacheKey& rhs) const;
+ bool operator==(const FramebufferCacheKey& rhs) const noexcept;
- bool operator!=(const FramebufferCacheKey& rhs) const {
+ bool operator!=(const FramebufferCacheKey& rhs) const noexcept {
return !operator==(rhs);
}
+
+ void SetAttachment(std::size_t index, u32 attachment) {
+ color_attachments |= attachment << (BitsPerAttachment * index);
+ }
};
} // namespace OpenGL