mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-20 00:52:01 +00:00
Start Texture region-based CopyTo
This commit is contained in:
parent
0f3358b931
commit
5dd444f605
1 changed files with 8 additions and 3 deletions
|
@ -11,6 +11,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
{
|
||||
private readonly TextureCreateInfo _info;
|
||||
private readonly Pipeline _pipeline;
|
||||
private readonly MTLDevice _device;
|
||||
|
||||
public MTLTexture MTLTexture;
|
||||
public TextureCreateInfo Info => Info;
|
||||
|
@ -19,6 +20,8 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public Texture(MTLDevice device, Pipeline pipeline, TextureCreateInfo info, int firstLayer, int firstLevel)
|
||||
{
|
||||
_device = device;
|
||||
_pipeline = pipeline;
|
||||
_info = info;
|
||||
|
||||
var descriptor = new MTLTextureDescriptor();
|
||||
|
@ -38,8 +41,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
alpha = Info.SwizzleA.Convert()
|
||||
};
|
||||
|
||||
MTLTexture = device.NewTexture(descriptor);
|
||||
_pipeline = pipeline;
|
||||
MTLTexture = _device.NewTexture(descriptor);
|
||||
}
|
||||
|
||||
public void CopyTo(ITexture destination, int firstLayer, int firstLevel)
|
||||
|
@ -76,7 +78,10 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var samplerDescriptor = new MTLSamplerDescriptor();
|
||||
samplerDescriptor.MinFilter = linearFilter ? MTLSamplerMinMagFilter.Linear : MTLSamplerMinMagFilter.Nearest;
|
||||
samplerDescriptor.MagFilter = linearFilter ? MTLSamplerMinMagFilter.Linear : MTLSamplerMinMagFilter.Nearest;
|
||||
var samplerState = _device.NewSamplerState(samplerDescriptor);
|
||||
}
|
||||
|
||||
public void CopyTo(BufferRange range, int layer, int level, int stride)
|
||||
|
|
Loading…
Reference in a new issue