summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer_cache.h
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.h
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 'src/video_core/renderer_opengl/gl_rasterizer_cache.h')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index 0ff0ce90f..23e4d02d8 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -53,10 +53,15 @@ enum class ScaleMatch {
struct SurfaceParams {
enum class PixelFormat {
ABGR8 = 0,
- DXT1 = 1,
+ B5G6R5 = 1,
+ DXT1 = 2,
+
+ Max,
Invalid = 255,
};
+ static constexpr size_t MaxPixelFormat = static_cast<size_t>(PixelFormat::Max);
+
enum class ComponentType {
Invalid = 0,
SNorm = 1,
@@ -78,8 +83,9 @@ struct SurfaceParams {
if (format == PixelFormat::Invalid)
return 0;
- constexpr std::array<unsigned int, 2> bpp_table = {
+ constexpr std::array<unsigned int, MaxPixelFormat> bpp_table = {
32, // ABGR8
+ 16, // B5G6R5
64, // DXT1
};
@@ -115,6 +121,8 @@ struct SurfaceParams {
switch (format) {
case Tegra::Texture::TextureFormat::A8R8G8B8:
return PixelFormat::ABGR8;
+ case Tegra::Texture::TextureFormat::B5G6R5:
+ return PixelFormat::B5G6R5;
case Tegra::Texture::TextureFormat::DXT1:
return PixelFormat::DXT1;
default:
@@ -128,6 +136,8 @@ struct SurfaceParams {
switch (format) {
case PixelFormat::ABGR8:
return Tegra::Texture::TextureFormat::A8R8G8B8;
+ case PixelFormat::B5G6R5:
+ return Tegra::Texture::TextureFormat::B5G6R5;
case PixelFormat::DXT1:
return Tegra::Texture::TextureFormat::DXT1;
default:
@@ -189,7 +199,7 @@ struct SurfaceParams {
}
static SurfaceType GetFormatType(PixelFormat pixel_format) {
- if ((unsigned int)pixel_format <= static_cast<unsigned int>(PixelFormat::DXT1)) {
+ if (static_cast<size_t>(pixel_format) < MaxPixelFormat) {
return SurfaceType::ColorTexture;
}