summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-04-19 01:11:14 +0200
committerSubv <subv2112@gmail.com>2018-04-19 01:16:45 +0200
commit2985056340b04c81df6afcf841dd541c94204817 (patch)
tree6129616b49d65f4dce32be3f702a9f66cbc51c87 /src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
parentMerge pull request #350 from Subv/tex_components (diff)
downloadyuzu-2985056340b04c81df6afcf841dd541c94204817.tar
yuzu-2985056340b04c81df6afcf841dd541c94204817.tar.gz
yuzu-2985056340b04c81df6afcf841dd541c94204817.tar.bz2
yuzu-2985056340b04c81df6afcf841dd541c94204817.tar.lz
yuzu-2985056340b04c81df6afcf841dd541c94204817.tar.xz
yuzu-2985056340b04c81df6afcf841dd541c94204817.tar.zst
yuzu-2985056340b04c81df6afcf841dd541c94204817.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 9ccc63090..2a0858eac 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -48,8 +48,9 @@ struct FormatTuple {
u32 compression_factor;
};
-static constexpr std::array<FormatTuple, 2> tex_format_tuples = {{
+static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_format_tuples = {{
{GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, false, 1}, // ABGR8
+ {GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV, false, 1}, // B5G6R5
{GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, GL_UNSIGNED_INT_8_8_8_8, true, 16}, // DXT1
}};
@@ -117,15 +118,19 @@ void MortonCopy(u32 stride, u32 block_height, u32 height, u8* gl_buffer, VAddr b
}
}
-static constexpr std::array<void (*)(u32, u32, u32, u8*, VAddr, VAddr, VAddr), 2> morton_to_gl_fns =
- {
+static constexpr std::array<void (*)(u32, u32, u32, u8*, VAddr, VAddr, VAddr),
+ SurfaceParams::MaxPixelFormat>
+ morton_to_gl_fns = {
MortonCopy<true, PixelFormat::ABGR8>,
+ MortonCopy<true, PixelFormat::B5G6R5>,
MortonCopy<true, PixelFormat::DXT1>,
};
-static constexpr std::array<void (*)(u32, u32, u32, u8*, VAddr, VAddr, VAddr), 2> gl_to_morton_fns =
- {
+static constexpr std::array<void (*)(u32, u32, u32, u8*, VAddr, VAddr, VAddr),
+ SurfaceParams::MaxPixelFormat>
+ gl_to_morton_fns = {
MortonCopy<false, PixelFormat::ABGR8>,
+ MortonCopy<false, PixelFormat::B5G6R5>,
// TODO(Subv): Swizzling the DXT1 format is not yet supported
nullptr,
};