mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-12-02 14:32:07 +01:00
Fix Cubemap & Array Texture Creation
This commit is contained in:
parent
04ca284e14
commit
54c8dabadc
1 changed files with 16 additions and 10 deletions
|
@ -27,18 +27,24 @@ namespace Ryujinx.Graphics.Metal
|
||||||
_pipeline = pipeline;
|
_pipeline = pipeline;
|
||||||
_info = info;
|
_info = info;
|
||||||
|
|
||||||
var descriptor = new MTLTextureDescriptor
|
var descriptor = new MTLTextureDescriptor();
|
||||||
{
|
|
||||||
PixelFormat = FormatTable.GetFormat(Info.Format),
|
descriptor.PixelFormat = FormatTable.GetFormat(Info.Format);
|
||||||
Usage = MTLTextureUsage.ShaderRead,
|
descriptor.Usage = MTLTextureUsage.ShaderRead;
|
||||||
Width = (ulong)Width,
|
|
||||||
Height = (ulong)Height,
|
|
||||||
Depth = (ulong)Depth
|
|
||||||
};
|
|
||||||
descriptor.Depth = (ulong)Info.Depth;
|
|
||||||
descriptor.SampleCount = (ulong)Info.Samples;
|
descriptor.SampleCount = (ulong)Info.Samples;
|
||||||
descriptor.MipmapLevelCount = (ulong)Info.Levels;
|
|
||||||
descriptor.TextureType = Info.Target.Convert();
|
descriptor.TextureType = Info.Target.Convert();
|
||||||
|
descriptor.Width = (ulong)Info.Width;
|
||||||
|
descriptor.Height = (ulong)Info.Height;
|
||||||
|
descriptor.MipmapLevelCount = (ulong)Info.Levels;
|
||||||
|
|
||||||
|
if (info.Target == Target.Texture3D)
|
||||||
|
{
|
||||||
|
descriptor.Depth = (ulong)Info.Depth;
|
||||||
|
}
|
||||||
|
else if (info.Target != Target.Cubemap)
|
||||||
|
{
|
||||||
|
descriptor.ArrayLength = (ulong)Info.Depth;
|
||||||
|
}
|
||||||
|
|
||||||
var swizzleR = Info.SwizzleR.Convert();
|
var swizzleR = Info.SwizzleR.Convert();
|
||||||
var swizzleG = Info.SwizzleG.Convert();
|
var swizzleG = Info.SwizzleG.Convert();
|
||||||
|
|
Loading…
Reference in a new issue