diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-11-29 02:59:09 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-11-29 03:02:20 +0100 |
commit | fb6cf12a17daf1f452d9c542e22c9252bbfb5c76 (patch) | |
tree | 44b01462f402e7e8bf2c8a7e37edf1fb16ea1526 /src/video_core/renderer_opengl/gl_framebuffer_cache.h | |
parent | gl_rasterizer: Re-enable framebuffer cache for clear buffers (diff) | |
download | yuzu-fb6cf12a17daf1f452d9c542e22c9252bbfb5c76.tar yuzu-fb6cf12a17daf1f452d9c542e22c9252bbfb5c76.tar.gz yuzu-fb6cf12a17daf1f452d9c542e22c9252bbfb5c76.tar.bz2 yuzu-fb6cf12a17daf1f452d9c542e22c9252bbfb5c76.tar.lz yuzu-fb6cf12a17daf1f452d9c542e22c9252bbfb5c76.tar.xz yuzu-fb6cf12a17daf1f452d9c542e22c9252bbfb5c76.tar.zst yuzu-fb6cf12a17daf1f452d9c542e22c9252bbfb5c76.zip |
Diffstat (limited to '')
-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 3b5ff2149..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; - u16 colors_count; +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 |