mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-11-30 05:22:08 +01:00
Properly check for 3D
This commit is contained in:
parent
d58f79ae0f
commit
04ca284e14
1 changed files with 7 additions and 2 deletions
|
@ -175,6 +175,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
int height = Info.Height;
|
int height = Info.Height;
|
||||||
int depth = Info.Depth;
|
int depth = Info.Depth;
|
||||||
int levels = Info.GetLevelsClamped();
|
int levels = Info.GetLevelsClamped();
|
||||||
|
bool is3D = Info.Target == Target.Texture3D;
|
||||||
|
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
|
@ -194,7 +195,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
(ulong)offset,
|
(ulong)offset,
|
||||||
(ulong)Info.GetMipStride(level),
|
(ulong)Info.GetMipStride(level),
|
||||||
(ulong)mipSize,
|
(ulong)mipSize,
|
||||||
new MTLSize { width = (ulong)width, height = (ulong)height, depth = (ulong)depth },
|
new MTLSize { width = (ulong)width, height = (ulong)height, depth = is3D ? (ulong)depth : 1 },
|
||||||
MTLTexture,
|
MTLTexture,
|
||||||
0,
|
0,
|
||||||
(ulong)level,
|
(ulong)level,
|
||||||
|
@ -205,7 +206,11 @@ namespace Ryujinx.Graphics.Metal
|
||||||
|
|
||||||
width = Math.Max(1, width >> 1);
|
width = Math.Max(1, width >> 1);
|
||||||
height = Math.Max(1, height >> 1);
|
height = Math.Max(1, height >> 1);
|
||||||
depth = Math.Max(1, depth >> 1);
|
|
||||||
|
if (is3D)
|
||||||
|
{
|
||||||
|
depth = Math.Max(1, depth >> 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue