diff options
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 |