summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2018-03-26 21:51:04 -0500
committerGravatar James Rowe2018-04-06 20:44:45 -0600
commitb258403f0d2fb224f32c0ea81ecb6842d783c658 (patch)
tree2eccb1a55c677ef609a61d10ded8b1bcda769dbf /src
parentGLCache: Support uploading compressed textures to the GPU. (diff)
downloadyuzu-b258403f0d2fb224f32c0ea81ecb6842d783c658.tar.gz
yuzu-b258403f0d2fb224f32c0ea81ecb6842d783c658.tar.xz
yuzu-b258403f0d2fb224f32c0ea81ecb6842d783c658.zip
GLCache: Implemented GetTextureSurface.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 942b12d70..5495cea45 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -1018,9 +1018,34 @@ SurfaceRect_Tuple RasterizerCacheOpenGL::GetSurfaceSubRect(const SurfaceParams&
1018 return std::make_tuple(surface, surface->GetScaledSubRect(params)); 1018 return std::make_tuple(surface, surface->GetScaledSubRect(params));
1019} 1019}
1020 1020
1021Surface RasterizerCacheOpenGL::GetTextureSurface(const void* config) { 1021Surface RasterizerCacheOpenGL::GetTextureSurface(const Tegra::Texture::FullTextureInfo& config) {
1022 UNREACHABLE(); 1022 auto& gpu = Core::System::GetInstance().GPU();
1023 return {}; 1023
1024 SurfaceParams params;
1025 params.addr = gpu.memory_manager->PhysicalToVirtualAddress(config.tic.Address());
1026 params.width = config.tic.Width();
1027 params.height = config.tic.Height();
1028 params.is_tiled = config.tic.IsTiled();
1029 params.pixel_format = SurfaceParams::PixelFormatFromTextureFormat(config.tic.format);
1030 params.UpdateParams();
1031
1032 if (config.tic.Width() % 8 != 0 || config.tic.Height() % 8 != 0) {
1033 Surface src_surface;
1034 MathUtil::Rectangle<u32> rect;
1035 std::tie(src_surface, rect) = GetSurfaceSubRect(params, ScaleMatch::Ignore, true);
1036
1037 params.res_scale = src_surface->res_scale;
1038 Surface tmp_surface = CreateSurface(params);
1039 BlitTextures(src_surface->texture.handle, rect, tmp_surface->texture.handle,
1040 tmp_surface->GetScaledRect(),
1041 SurfaceParams::GetFormatType(params.pixel_format), read_framebuffer.handle,
1042 draw_framebuffer.handle);
1043
1044 remove_surfaces.emplace(tmp_surface);
1045 return tmp_surface;
1046 }
1047
1048 return GetSurface(params, ScaleMatch::Ignore, true);
1024} 1049}
1025 1050
1026SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces( 1051SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces(