diff options
author | bunnei <bunneidev@gmail.com> | 2019-12-01 00:46:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-01 00:46:40 +0100 |
commit | 930b7c18a6d73d2365c8c2b868279fe5d44630d3 (patch) | |
tree | fa68e3c531ec46b3aa5e1a525dc3bbbc5d784255 /src/video_core/renderer_opengl/gl_framebuffer_cache.h | |
parent | Merge pull request #3185 from ReinUsesLisp/oob-texture (diff) | |
parent | gl_framebuffer_cache: Optimize framebuffer key (diff) | |
download | yuzu-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.h | 19 |
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 |