diff options
author | bunnei <bunneidev@gmail.com> | 2018-06-24 23:42:29 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-06-27 06:08:03 +0200 |
commit | 3f9f047375dd9aae7eadcb957747fa8db01544bf (patch) | |
tree | 4a5ce82d2726e5f723a3a7a0e72d973f6d6d0573 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | gl_rasterizer_cache: Cache size_in_bytes as a const per surface. (diff) | |
download | yuzu-3f9f047375dd9aae7eadcb957747fa8db01544bf.tar yuzu-3f9f047375dd9aae7eadcb957747fa8db01544bf.tar.gz yuzu-3f9f047375dd9aae7eadcb957747fa8db01544bf.tar.bz2 yuzu-3f9f047375dd9aae7eadcb957747fa8db01544bf.tar.lz yuzu-3f9f047375dd9aae7eadcb957747fa8db01544bf.tar.xz yuzu-3f9f047375dd9aae7eadcb957747fa8db01544bf.tar.zst yuzu-3f9f047375dd9aae7eadcb957747fa8db01544bf.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index bc463fc30..f9b0ce434 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -468,11 +468,30 @@ bool RasterizerOpenGL::AccelerateFill(const void* config) { return true; } -bool RasterizerOpenGL::AccelerateDisplay(const Tegra::FramebufferConfig& framebuffer, +bool RasterizerOpenGL::AccelerateDisplay(const Tegra::FramebufferConfig& config, VAddr framebuffer_addr, u32 pixel_stride, ScreenInfo& screen_info) { - // TODO(bunnei): ImplementMe - return false; + if (!framebuffer_addr) { + return {}; + } + + MICROPROFILE_SCOPE(OpenGL_CacheManagement); + + const auto& surface{res_cache.TryFindFramebufferSurface(framebuffer_addr)}; + if (!surface) { + return {}; + } + + // Verify that the cached surface is the same size and format as the requested framebuffer + const auto& params{surface->GetSurfaceParams()}; + const auto& pixel_format{SurfaceParams::PixelFormatFromGPUPixelFormat(config.pixel_format)}; + ASSERT_MSG(params.width == config.width, "Framebuffer width is different"); + ASSERT_MSG(params.height == config.height, "Framebuffer height is different"); + ASSERT_MSG(params.pixel_format == pixel_format, "Framebuffer pixel_format is different"); + + screen_info.display_texture = surface->Texture().handle; + + return true; } void RasterizerOpenGL::SamplerInfo::Create() { |