From ac09b5a2e945f587a8b3b712f54b76d46edb0c2f Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 15 Apr 2018 19:54:38 -0500 Subject: GLCache: Added a function to convert cached PixelFormats back to texture formats. TODO: The way we handle cached formats must change, framebuffer and texture formats are too different to keep them in the same place. --- src/video_core/renderer_opengl/gl_rasterizer_cache.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/video_core/renderer_opengl/gl_rasterizer_cache.h') diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 3293905d6..0b2e3ffef 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -115,6 +115,18 @@ struct SurfaceParams { } } + static Tegra::Texture::TextureFormat TextureFormatFromPixelFormat(PixelFormat format) { + // TODO(Subv): Properly implement this + switch (format) { + case PixelFormat::RGBA8: + return Tegra::Texture::TextureFormat::A8R8G8B8; + case PixelFormat::DXT1: + return Tegra::Texture::TextureFormat::DXT1; + default: + UNREACHABLE(); + } + } + static bool CheckFormatsBlittable(PixelFormat pixel_format_a, PixelFormat pixel_format_b) { SurfaceType a_type = GetFormatType(pixel_format_a); SurfaceType b_type = GetFormatType(pixel_format_b); -- cgit v1.2.3 From a3e82e8e1f5cb39246f30cac045db8e243f0daee Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 15 Apr 2018 19:55:39 -0500 Subject: GLCache: Take into account the texture's block height when caching and unswizzling. --- src/video_core/renderer_opengl/gl_rasterizer_cache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/video_core/renderer_opengl/gl_rasterizer_cache.h') diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 0b2e3ffef..26d6c3061 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -225,6 +225,7 @@ struct SurfaceParams { u32 width = 0; u32 height = 0; u32 stride = 0; + u32 block_height = 0; u16 res_scale = 1; bool is_tiled = false; -- cgit v1.2.3