Address some feedback
This commit is contained in:
parent
0e62e7d888
commit
0278fadbea
8 changed files with 20 additions and 20 deletions
|
@ -50,7 +50,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
PixelFormat PixelFormat;
|
PixelFormat PixelFormat;
|
||||||
PixelType PixelType;
|
PixelType PixelType;
|
||||||
|
|
||||||
if (ImageTable.IsCompressed(NewImage.Format))
|
if (ImageUtils.IsCompressed(NewImage.Format))
|
||||||
{
|
{
|
||||||
InternalFmt = (PixelInternalFormat)OGLEnumConverter.GetCompressedImageFormat(NewImage.Format);
|
InternalFmt = (PixelInternalFormat)OGLEnumConverter.GetCompressedImageFormat(NewImage.Format);
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
CopyBuffer = GL.GenBuffer();
|
CopyBuffer = GL.GenBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CurrentSize = Math.Max(ImageTable.GetSize(NewImage),
|
int CurrentSize = Math.Max(ImageUtils.GetSize(NewImage),
|
||||||
ImageTable.GetSize(Image));
|
ImageUtils.GetSize(Image));
|
||||||
|
|
||||||
GL.BindBuffer(BufferTarget.PixelPackBuffer, CopyBuffer);
|
GL.BindBuffer(BufferTarget.PixelPackBuffer, CopyBuffer);
|
||||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, CopyBuffer);
|
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, CopyBuffer);
|
||||||
|
@ -84,7 +84,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
GL.BufferData(BufferTarget.PixelPackBuffer, CurrentSize, IntPtr.Zero, BufferUsageHint.StreamCopy);
|
GL.BufferData(BufferTarget.PixelPackBuffer, CurrentSize, IntPtr.Zero, BufferUsageHint.StreamCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImageTable.IsCompressed(Image.Format))
|
if (ImageUtils.IsCompressed(Image.Format))
|
||||||
{
|
{
|
||||||
GL.GetCompressedTexImage(TextureTarget.Texture2D, 0, IntPtr.Zero);
|
GL.GetCompressedTexImage(TextureTarget.Texture2D, 0, IntPtr.Zero);
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
const int Level = 0;
|
const int Level = 0;
|
||||||
const int Border = 0;
|
const int Border = 0;
|
||||||
|
|
||||||
if (ImageTable.IsCompressed(NewImage.Format))
|
if (ImageUtils.IsCompressed(NewImage.Format))
|
||||||
{
|
{
|
||||||
Console.WriteLine("Hit");
|
Console.WriteLine("Hit");
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
NewImage.Width,
|
NewImage.Width,
|
||||||
NewImage.Height,
|
NewImage.Height,
|
||||||
Border,
|
Border,
|
||||||
ImageTable.GetSize(NewImage),
|
ImageUtils.GetSize(NewImage),
|
||||||
IntPtr.Zero);
|
IntPtr.Zero);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -152,8 +152,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
Initialized = true;
|
Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasColor => ImageTable.HasColor(Image.Format);
|
public bool HasColor => ImageUtils.HasColor(Image.Format);
|
||||||
public bool HasDepth => ImageTable.HasDepth(Image.Format);
|
public bool HasDepth => ImageUtils.HasDepth(Image.Format);
|
||||||
public bool HasStencil => ImageTable.HasStencil(Image.Format);
|
public bool HasStencil => ImageUtils.HasStencil(Image.Format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -380,7 +380,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
{
|
{
|
||||||
if (Texture.TryGetImage(Key, out ImageHandler Tex))
|
if (Texture.TryGetImage(Key, out ImageHandler Tex))
|
||||||
{
|
{
|
||||||
byte[] Data = new byte[ImageTable.GetSize(Tex.Image)];
|
byte[] Data = new byte[ImageUtils.GetSize(Tex.Image)];
|
||||||
|
|
||||||
GL.BindTexture(TextureTarget.Texture2D, Tex.Handle);
|
GL.BindTexture(TextureTarget.Texture2D, Tex.Handle);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
|
|
||||||
bool IsASTC = TypeLess >= GalImageFormat.ASTC_BEGIN && TypeLess <= GalImageFormat.ASTC_END;
|
bool IsASTC = TypeLess >= GalImageFormat.ASTC_BEGIN && TypeLess <= GalImageFormat.ASTC_END;
|
||||||
|
|
||||||
if (ImageTable.IsCompressed(Image.Format) && !IsASTC)
|
if (ImageUtils.IsCompressed(Image.Format) && !IsASTC)
|
||||||
{
|
{
|
||||||
InternalFormat InternalFmt = OGLEnumConverter.GetCompressedImageFormat(Image.Format);
|
InternalFormat InternalFmt = OGLEnumConverter.GetCompressedImageFormat(Image.Format);
|
||||||
|
|
||||||
|
|
|
@ -201,11 +201,11 @@ namespace Ryujinx.Graphics
|
||||||
int VpW = (int)(TX + MathF.Abs(SX)) - VpX;
|
int VpW = (int)(TX + MathF.Abs(SX)) - VpX;
|
||||||
int VpH = (int)(TY + MathF.Abs(SY)) - VpY;
|
int VpH = (int)(TY + MathF.Abs(SY)) - VpY;
|
||||||
|
|
||||||
GalImageFormat ImageFormat = ImageTable.ConvertSurface((GalSurfaceFormat)Format);
|
GalImageFormat ImageFormat = ImageUtils.ConvertSurface((GalSurfaceFormat)Format);
|
||||||
|
|
||||||
GalImage Image = new GalImage(Width, Height, ImageFormat);
|
GalImage Image = new GalImage(Width, Height, ImageFormat);
|
||||||
|
|
||||||
long Size = ImageTable.GetSize(Image);
|
long Size = ImageUtils.GetSize(Image);
|
||||||
|
|
||||||
Gpu.Renderer.Texture.CreateFb(Key, Size, Image);
|
Gpu.Renderer.Texture.CreateFb(Key, Size, Image);
|
||||||
|
|
||||||
|
@ -234,11 +234,11 @@ namespace Ryujinx.Graphics
|
||||||
int Width = ReadRegister(NvGpuEngine3dReg.ZetaHoriz);
|
int Width = ReadRegister(NvGpuEngine3dReg.ZetaHoriz);
|
||||||
int Height = ReadRegister(NvGpuEngine3dReg.ZetaVert);
|
int Height = ReadRegister(NvGpuEngine3dReg.ZetaVert);
|
||||||
|
|
||||||
GalImageFormat ImageFormat = ImageTable.ConvertZeta((GalZetaFormat)Format);
|
GalImageFormat ImageFormat = ImageUtils.ConvertZeta((GalZetaFormat)Format);
|
||||||
|
|
||||||
GalImage Image = new GalImage(Width, Height, ImageFormat);
|
GalImage Image = new GalImage(Width, Height, ImageFormat);
|
||||||
|
|
||||||
long Size = ImageTable.GetSize(Image);
|
long Size = ImageUtils.GetSize(Image);
|
||||||
|
|
||||||
Gpu.Renderer.Texture.CreateFb(Key, Size, Image);
|
Gpu.Renderer.Texture.CreateFb(Key, Size, Image);
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ namespace Ryujinx.Graphics
|
||||||
{
|
{
|
||||||
GalImage NewImage = TextureFactory.MakeTexture(Vmm, TicPosition);
|
GalImage NewImage = TextureFactory.MakeTexture(Vmm, TicPosition);
|
||||||
|
|
||||||
long Size = (uint)ImageTable.GetSize(NewImage);
|
long Size = (uint)ImageUtils.GetSize(NewImage);
|
||||||
|
|
||||||
bool HasCachedTexture = false;
|
bool HasCachedTexture = false;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Texture
|
namespace Ryujinx.Graphics.Texture
|
||||||
{
|
{
|
||||||
static class ImageTable
|
static class ImageUtils
|
||||||
{
|
{
|
||||||
struct ImageDescriptor
|
struct ImageDescriptor
|
||||||
{
|
{
|
|
@ -114,7 +114,7 @@ namespace Ryujinx.Graphics.Texture
|
||||||
|
|
||||||
GalTextureFormat Format = (GalTextureFormat)(Tic[0] & 0x7f);
|
GalTextureFormat Format = (GalTextureFormat)(Tic[0] & 0x7f);
|
||||||
|
|
||||||
return ImageTable.ConvertTexture(Format, RType, GType, BType, AType);
|
return ImageUtils.ConvertTexture(Format, RType, GType, BType, AType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int[] ReadWords(NvGpuVmm Vmm, long Position, int Count)
|
private static int[] ReadWords(NvGpuVmm Vmm, long Position, int Count)
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Texture
|
||||||
{
|
{
|
||||||
public static byte[] Read(IAMemory Memory, TextureInfo Texture)
|
public static byte[] Read(IAMemory Memory, TextureInfo Texture)
|
||||||
{
|
{
|
||||||
TextureReaderDelegate Reader = ImageTable.GetReader(Texture.Format);
|
TextureReaderDelegate Reader = ImageUtils.GetReader(Texture.Format);
|
||||||
|
|
||||||
return Reader(Memory, Texture);
|
return Reader(Memory, Texture);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using Ryujinx.Audio;
|
using Ryujinx.Audio;
|
||||||
using Ryujinx.Graphics.Gal;
|
|
||||||
using Ryujinx.Graphics;
|
using Ryujinx.Graphics;
|
||||||
|
using Ryujinx.Graphics.Gal;
|
||||||
using Ryujinx.HLE.HOS;
|
using Ryujinx.HLE.HOS;
|
||||||
using Ryujinx.HLE.Input;
|
using Ryujinx.HLE.Input;
|
||||||
using Ryujinx.HLE.Logging;
|
using Ryujinx.HLE.Logging;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue