diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-06-09 00:46:06 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-06-09 00:46:06 -0300 |
| commit | 91420a402c9e786ddef2811bb671003dd0a40565 (patch) | |
| tree | b8081fb4efcf0fa2369931f72e96175ca221afff /Ryujinx.Core/Gpu/TextureWriter.cs | |
| parent | 78223484394db924d02383310d8bace8a01fa152 (diff) | |
Use source texture size when doing reads for texure copy
Diffstat (limited to 'Ryujinx.Core/Gpu/TextureWriter.cs')
| -rw-r--r-- | Ryujinx.Core/Gpu/TextureWriter.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Ryujinx.Core/Gpu/TextureWriter.cs b/Ryujinx.Core/Gpu/TextureWriter.cs index 686d0dce..5633614f 100644 --- a/Ryujinx.Core/Gpu/TextureWriter.cs +++ b/Ryujinx.Core/Gpu/TextureWriter.cs @@ -6,21 +6,28 @@ namespace Ryujinx.Core.Gpu { static class TextureWriter { - public static void Write(IAMemory Memory, Texture Texture, byte[] Data) + public static void Write( + IAMemory Memory, + Texture Texture, + byte[] Data, + int Width, + int Height) { switch (Texture.Format) { - case GalTextureFormat.A8B8G8R8: Write4Bpp(Memory, Texture, Data); break; + case GalTextureFormat.A8B8G8R8: Write4Bpp(Memory, Texture, Data, Width, Height); break; default: throw new NotImplementedException(Texture.Format.ToString()); } } - private unsafe static void Write4Bpp(IAMemory Memory, Texture Texture, byte[] Data) + private unsafe static void Write4Bpp( + IAMemory Memory, + Texture Texture, + byte[] Data, + int Width, + int Height) { - int Width = Texture.Width; - int Height = Texture.Height; - ISwizzle Swizzle = TextureHelper.GetSwizzle(Texture, Width, 4); (AMemory CpuMem, long Position) = TextureHelper.GetMemoryAndPosition( |
