diff --git a/Ryujinx.Graphics/Gal/GalImageFormat.cs b/Ryujinx.Graphics/Gal/GalImageFormat.cs index 4de248b16b..7a4faf245f 100644 --- a/Ryujinx.Graphics/Gal/GalImageFormat.cs +++ b/Ryujinx.Graphics/Gal/GalImageFormat.cs @@ -12,6 +12,7 @@ A1B5G5R5, B5G6R5, BC7U, + G16R16, G8R8, R16, R8, diff --git a/Ryujinx.Graphics/Gal/ImageFormatConverter.cs b/Ryujinx.Graphics/Gal/ImageFormatConverter.cs index af0f2caecf..1ed638b10e 100644 --- a/Ryujinx.Graphics/Gal/ImageFormatConverter.cs +++ b/Ryujinx.Graphics/Gal/ImageFormatConverter.cs @@ -52,11 +52,19 @@ namespace Ryujinx.Graphics.Gal { switch (Format) { - case GalFrameBufferFormat.R32Float: return GalImageFormat.R32; + case GalFrameBufferFormat.R32Float: return GalImageFormat.R32; + case GalFrameBufferFormat.RGB10A2Unorm: return GalImageFormat.A2B10G10R10; + case GalFrameBufferFormat.RGBA8Srgb: return GalImageFormat.A8B8G8R8; //Stubbed + case GalFrameBufferFormat.RGBA16Float: return GalImageFormat.R16G16B16A16; + case GalFrameBufferFormat.R16Float: return GalImageFormat.R16; + case GalFrameBufferFormat.R8Unorm: return GalImageFormat.R8; + case GalFrameBufferFormat.RGBA8Unorm: return GalImageFormat.A8B8G8R8; + case GalFrameBufferFormat.R11G11B10Float: return GalImageFormat.BF10GF11RF11; + case GalFrameBufferFormat.RGBA32Float: return GalImageFormat.R32G32B32A32; + case GalFrameBufferFormat.RG16Snorm: return GalImageFormat.G16R16; } - //Stubbed. - return GalImageFormat.A8B8G8R8; + throw new NotImplementedException(Format.ToString()); } public static GalImageFormat ConvertZeta(GalZetaFormat Format) @@ -66,8 +74,7 @@ namespace Ryujinx.Graphics.Gal case GalZetaFormat.Z32Float: return GalImageFormat.ZF32; } - //Stubbed. - return GalImageFormat.Z24S8; + throw new NotImplementedException(Format.ToString()); } public static bool HasColor(GalImageFormat Format) @@ -84,6 +91,7 @@ namespace Ryujinx.Graphics.Gal case GalImageFormat.A1B5G5R5: case GalImageFormat.B5G6R5: case GalImageFormat.BC7U: + case GalImageFormat.G16R16: case GalImageFormat.G8R8: case GalImageFormat.R16: case GalImageFormat.R8: diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs index dccebb1c48..840373684e 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs @@ -129,18 +129,19 @@ namespace Ryujinx.Graphics.Gal.OpenGL { switch (Format) { - case GalImageFormat.R32G32B32A32: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.Float); - case GalImageFormat.R16G16B16A16: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.HalfFloat); + case GalImageFormat.R32G32B32A32: return (PixelInternalFormat.Rgba32f, PixelFormat.Rgba, PixelType.Float); + case GalImageFormat.R16G16B16A16: return (PixelInternalFormat.Rgba16f, PixelFormat.Rgba, PixelType.HalfFloat); case GalImageFormat.A8B8G8R8: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedByte); - case GalImageFormat.A2B10G10R10: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedInt2101010Reversed); - case GalImageFormat.R32: return (PixelInternalFormat.Rgba8, PixelFormat.Red, PixelType.Float); - case GalImageFormat.A1B5G5R5: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedShort5551); - case GalImageFormat.B5G6R5: return (PixelInternalFormat.Rgba8, PixelFormat.Rgb, PixelType.UnsignedShort565); - case GalImageFormat.G8R8: return (PixelInternalFormat.Rgba8, PixelFormat.Rg, PixelType.UnsignedByte); - case GalImageFormat.R16: return (PixelInternalFormat.Rgba8, PixelFormat.Red, PixelType.HalfFloat); - case GalImageFormat.R8: return (PixelInternalFormat.Rgba8, PixelFormat.Red, PixelType.UnsignedByte); + case GalImageFormat.A2B10G10R10: return (PixelInternalFormat.Rgb10A2, PixelFormat.Rgba, PixelType.UnsignedInt2101010Reversed); + case GalImageFormat.R32: return (PixelInternalFormat.R32f, PixelFormat.Red, PixelType.Float); + case GalImageFormat.A1B5G5R5: return (PixelInternalFormat.Rgb5A1, PixelFormat.Rgba, PixelType.UnsignedShort5551); + case GalImageFormat.B5G6R5: return (PixelInternalFormat.Rgba, PixelFormat.Rgb, PixelType.UnsignedShort565); //Stubbed. + case GalImageFormat.G16R16: return (PixelInternalFormat.Rg16f, PixelFormat.Rg, PixelType.HalfFloat); + case GalImageFormat.G8R8: return (PixelInternalFormat.Rg8, PixelFormat.Rg, PixelType.UnsignedByte); + case GalImageFormat.R16: return (PixelInternalFormat.R16, PixelFormat.Red, PixelType.HalfFloat); + case GalImageFormat.R8: return (PixelInternalFormat.R8, PixelFormat.Red, PixelType.UnsignedByte); case GalImageFormat.ZF32: return (PixelInternalFormat.DepthComponent32f, PixelFormat.DepthComponent, PixelType.Float); - case GalImageFormat.BF10GF11RF11: return (PixelInternalFormat.Rgba8, PixelFormat.Rgb, PixelType.UnsignedInt10F11F11FRev); + case GalImageFormat.BF10GF11RF11: return (PixelInternalFormat.R11fG11fB10f, PixelFormat.Rgb, PixelType.UnsignedInt10F11F11FRev); case GalImageFormat.Z24S8: return (PixelInternalFormat.Depth24Stencil8, PixelFormat.DepthStencil, PixelType.UnsignedInt248); } diff --git a/Ryujinx.Graphics/Gal/OpenGL/TCE.cs b/Ryujinx.Graphics/Gal/OpenGL/TCE.cs index 2b60f01155..5f7cff8fc9 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/TCE.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/TCE.cs @@ -68,7 +68,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL { CopyBufferSize = CurrentSize; - GL.BufferData(BufferTarget.PixelPackBuffer, CurrentSize, IntPtr.Zero, BufferUsageHint.DynamicCopy); + GL.BufferData(BufferTarget.PixelPackBuffer, CurrentSize, IntPtr.Zero, BufferUsageHint.StreamCopy); } GL.GetTexImage(TextureTarget.Texture2D, 0, this.PixelFormat, this.PixelType, IntPtr.Zero); diff --git a/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs b/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs index 1b1b4be841..c35cdcb092 100644 --- a/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs +++ b/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs @@ -42,6 +42,7 @@ namespace Ryujinx.HLE.Gpu.Texture case GalImageFormat.A8B8G8R8: case GalImageFormat.A2B10G10R10: + case GalImageFormat.G16R16: case GalImageFormat.R32: case GalImageFormat.ZF32: case GalImageFormat.BF10GF11RF11: