aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics
diff options
context:
space:
mode:
authorThomas Guillemard <thog@protonmail.com>2019-01-05 22:26:16 +0100
committerAc_K <Acoustik666@gmail.com>2019-01-05 22:26:16 +0100
commitb4d91402c676035cf574983148c2d8682b3cf6f3 (patch)
tree9d7acea69d148031c9afa6f92c5d091836348ddd /Ryujinx.Graphics
parent290f5e812e68e47d95aba0cc3789a4bc6d04c7ce (diff)
Some improvements for nvnflinger (#555)
* Initial fixes for last release of libnx For now, the framebuffer aren't okay but it will not crash/ * Improve code reaadability in NvFlinger parsing * Make surfaces access more userfriendly * Add ColorFormat * Fix code style in ColorFormat.cs * Add multiple framebuffer support in nvnflinger This fix libnx console rendering * Move ReadStruct/WriteStruct to Ryujinx.Common * fix the last nit * Fix inverted color for R5G6B5 Also add some other format that libnx might uses. * Remove hardcoded BlockHeight in nvflinger
Diffstat (limited to 'Ryujinx.Graphics')
-rw-r--r--Ryujinx.Graphics/Gal/GalImageFormat.cs1
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs1
-rw-r--r--Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs1
3 files changed, 3 insertions, 0 deletions
diff --git a/Ryujinx.Graphics/Gal/GalImageFormat.cs b/Ryujinx.Graphics/Gal/GalImageFormat.cs
index 83c7f569..70998d11 100644
--- a/Ryujinx.Graphics/Gal/GalImageFormat.cs
+++ b/Ryujinx.Graphics/Gal/GalImageFormat.cs
@@ -24,6 +24,7 @@ namespace Ryujinx.Graphics.Gal
RGBA4,
RGB565,
+ BGR565,
BGR5A1,
RGB5A1,
R8,
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
index 38b00d49..f2afe7b5 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
@@ -157,6 +157,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
case GalImageFormat.BGR5A1 | GalImageFormat.Unorm: return (PixelInternalFormat.Rgb5A1, PixelFormat.Rgba, PixelType.UnsignedShort5551);
case GalImageFormat.RGB5A1 | GalImageFormat.Unorm: return (PixelInternalFormat.Rgb5A1, PixelFormat.Rgba, PixelType.UnsignedShort1555Reversed);
case GalImageFormat.RGB565 | GalImageFormat.Unorm: return (PixelInternalFormat.Rgba, PixelFormat.Rgb, PixelType.UnsignedShort565Reversed);
+ case GalImageFormat.BGR565 | GalImageFormat.Unorm: return (PixelInternalFormat.Rgba, PixelFormat.Rgb, PixelType.UnsignedShort565);
case GalImageFormat.RG16 | GalImageFormat.Float: return (PixelInternalFormat.Rg16f, PixelFormat.Rg, PixelType.HalfFloat);
case GalImageFormat.RG16 | GalImageFormat.Sint: return (PixelInternalFormat.Rg16i, PixelFormat.RgInteger, PixelType.Short);
case GalImageFormat.RG16 | GalImageFormat.Snorm: return (PixelInternalFormat.Rg16Snorm, PixelFormat.Rg, PixelType.Short);
diff --git a/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs b/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs
index 6fff7f70..f958e1de 100644
--- a/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs
+++ b/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs
@@ -106,6 +106,7 @@ namespace Ryujinx.Graphics.Texture
{ GalImageFormat.BGR5A1, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) },
{ GalImageFormat.RGB5A1, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) },
{ GalImageFormat.RGB565, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) },
+ { GalImageFormat.BGR565, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) },
{ GalImageFormat.BptcUnorm, new ImageDescriptor(16, 4, 4, TargetBuffer.Color) },
{ GalImageFormat.RG16, new ImageDescriptor(4, 1, 1, TargetBuffer.Color) },
{ GalImageFormat.RG8, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) },