aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Graphics3d/Texture/TextureHelper.cs
diff options
context:
space:
mode:
authorgdk <gab.dark.100@gmail.com>2019-10-13 03:02:07 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit1876b346fea647e8284a66bb6d62c38801035cff (patch)
tree6eeff094298cda84d1613dc5ec0691e51d7b35f1 /Ryujinx.Graphics/Graphics3d/Texture/TextureHelper.cs
parentf617fb542a0e3d36012d77a4b5acbde7b08902f2 (diff)
Initial work
Diffstat (limited to 'Ryujinx.Graphics/Graphics3d/Texture/TextureHelper.cs')
-rw-r--r--Ryujinx.Graphics/Graphics3d/Texture/TextureHelper.cs53
1 files changed, 0 insertions, 53 deletions
diff --git a/Ryujinx.Graphics/Graphics3d/Texture/TextureHelper.cs b/Ryujinx.Graphics/Graphics3d/Texture/TextureHelper.cs
deleted file mode 100644
index e07eb037..00000000
--- a/Ryujinx.Graphics/Graphics3d/Texture/TextureHelper.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using ARMeilleure.Memory;
-using Ryujinx.Common;
-using Ryujinx.Graphics.Gal;
-using Ryujinx.Graphics.Memory;
-
-namespace Ryujinx.Graphics.Texture
-{
- static class TextureHelper
- {
- public static ISwizzle GetSwizzle(GalImage image)
- {
- int blockWidth = ImageUtils.GetBlockWidth (image.Format);
- int blockHeight = ImageUtils.GetBlockHeight (image.Format);
- int blockDepth = ImageUtils.GetBlockDepth (image.Format);
- int bytesPerPixel = ImageUtils.GetBytesPerPixel(image.Format);
-
- int width = BitUtils.DivRoundUp(image.Width, blockWidth);
- int height = BitUtils.DivRoundUp(image.Height, blockHeight);
- int depth = BitUtils.DivRoundUp(image.Depth, blockDepth);
-
- if (image.Layout == GalMemoryLayout.BlockLinear)
- {
- int alignMask = image.TileWidth * (64 / bytesPerPixel) - 1;
-
- width = (width + alignMask) & ~alignMask;
-
- return new BlockLinearSwizzle(
- width,
- height,
- depth,
- image.GobBlockHeight,
- image.GobBlockDepth,
- bytesPerPixel);
- }
- else
- {
- return new LinearSwizzle(image.Pitch, bytesPerPixel, width, height);
- }
- }
-
- public static (MemoryManager Memory, long Position) GetMemoryAndPosition(
- IMemory memory,
- long position)
- {
- if (memory is NvGpuVmm vmm)
- {
- return (vmm.Memory, vmm.GetPhysicalAddress(position));
- }
-
- return ((MemoryManager)memory, position);
- }
- }
-}