Unstub formats

This commit is contained in:
ReinUsesLisp 2018-08-12 19:08:45 -03:00
commit c8417c3f2f
5 changed files with 27 additions and 16 deletions

View file

@ -12,6 +12,7 @@
A1B5G5R5, A1B5G5R5,
B5G6R5, B5G6R5,
BC7U, BC7U,
G16R16,
G8R8, G8R8,
R16, R16,
R8, R8,

View file

@ -52,11 +52,19 @@ namespace Ryujinx.Graphics.Gal
{ {
switch (Format) 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. throw new NotImplementedException(Format.ToString());
return GalImageFormat.A8B8G8R8;
} }
public static GalImageFormat ConvertZeta(GalZetaFormat Format) public static GalImageFormat ConvertZeta(GalZetaFormat Format)
@ -66,8 +74,7 @@ namespace Ryujinx.Graphics.Gal
case GalZetaFormat.Z32Float: return GalImageFormat.ZF32; case GalZetaFormat.Z32Float: return GalImageFormat.ZF32;
} }
//Stubbed. throw new NotImplementedException(Format.ToString());
return GalImageFormat.Z24S8;
} }
public static bool HasColor(GalImageFormat Format) public static bool HasColor(GalImageFormat Format)
@ -84,6 +91,7 @@ namespace Ryujinx.Graphics.Gal
case GalImageFormat.A1B5G5R5: case GalImageFormat.A1B5G5R5:
case GalImageFormat.B5G6R5: case GalImageFormat.B5G6R5:
case GalImageFormat.BC7U: case GalImageFormat.BC7U:
case GalImageFormat.G16R16:
case GalImageFormat.G8R8: case GalImageFormat.G8R8:
case GalImageFormat.R16: case GalImageFormat.R16:
case GalImageFormat.R8: case GalImageFormat.R8:

View file

@ -129,18 +129,19 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{ {
switch (Format) switch (Format)
{ {
case GalImageFormat.R32G32B32A32: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.Float); case GalImageFormat.R32G32B32A32: return (PixelInternalFormat.Rgba32f, PixelFormat.Rgba, PixelType.Float);
case GalImageFormat.R16G16B16A16: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.HalfFloat); case GalImageFormat.R16G16B16A16: return (PixelInternalFormat.Rgba16f, PixelFormat.Rgba, PixelType.HalfFloat);
case GalImageFormat.A8B8G8R8: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedByte); case GalImageFormat.A8B8G8R8: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedByte);
case GalImageFormat.A2B10G10R10: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedInt2101010Reversed); case GalImageFormat.A2B10G10R10: return (PixelInternalFormat.Rgb10A2, PixelFormat.Rgba, PixelType.UnsignedInt2101010Reversed);
case GalImageFormat.R32: return (PixelInternalFormat.Rgba8, PixelFormat.Red, PixelType.Float); case GalImageFormat.R32: return (PixelInternalFormat.R32f, PixelFormat.Red, PixelType.Float);
case GalImageFormat.A1B5G5R5: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedShort5551); case GalImageFormat.A1B5G5R5: return (PixelInternalFormat.Rgb5A1, PixelFormat.Rgba, PixelType.UnsignedShort5551);
case GalImageFormat.B5G6R5: return (PixelInternalFormat.Rgba8, PixelFormat.Rgb, PixelType.UnsignedShort565); case GalImageFormat.B5G6R5: return (PixelInternalFormat.Rgba, PixelFormat.Rgb, PixelType.UnsignedShort565); //Stubbed.
case GalImageFormat.G8R8: return (PixelInternalFormat.Rgba8, PixelFormat.Rg, PixelType.UnsignedByte); case GalImageFormat.G16R16: return (PixelInternalFormat.Rg16f, PixelFormat.Rg, PixelType.HalfFloat);
case GalImageFormat.R16: return (PixelInternalFormat.Rgba8, PixelFormat.Red, PixelType.HalfFloat); case GalImageFormat.G8R8: return (PixelInternalFormat.Rg8, PixelFormat.Rg, PixelType.UnsignedByte);
case GalImageFormat.R8: return (PixelInternalFormat.Rgba8, PixelFormat.Red, 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.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); case GalImageFormat.Z24S8: return (PixelInternalFormat.Depth24Stencil8, PixelFormat.DepthStencil, PixelType.UnsignedInt248);
} }

View file

@ -68,7 +68,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{ {
CopyBufferSize = CurrentSize; 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); GL.GetTexImage(TextureTarget.Texture2D, 0, this.PixelFormat, this.PixelType, IntPtr.Zero);

View file

@ -42,6 +42,7 @@ namespace Ryujinx.HLE.Gpu.Texture
case GalImageFormat.A8B8G8R8: case GalImageFormat.A8B8G8R8:
case GalImageFormat.A2B10G10R10: case GalImageFormat.A2B10G10R10:
case GalImageFormat.G16R16:
case GalImageFormat.R32: case GalImageFormat.R32:
case GalImageFormat.ZF32: case GalImageFormat.ZF32:
case GalImageFormat.BF10GF11RF11: case GalImageFormat.BF10GF11RF11: