mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-01-23 21:44:56 +03:00
Set Depth Attachment Texture
This commit is contained in:
parent
824321c88a
commit
7f65ec0b8c
@ -30,6 +30,7 @@ namespace Ryujinx.Graphics.Metal
|
||||
private MTLCommandEncoder? _currentEncoder;
|
||||
private EncoderType _currentEncoderType = EncoderType.None;
|
||||
private MTLTexture[] _renderTargets = [];
|
||||
private MTLTexture _depthTarget;
|
||||
|
||||
private RenderEncoderState _renderEncoderState;
|
||||
private readonly MTLVertexDescriptor _vertexDescriptor = new();
|
||||
@ -136,6 +137,10 @@ namespace Ryujinx.Graphics.Metal
|
||||
}
|
||||
}
|
||||
|
||||
var depthAttachment = descriptor.DepthAttachment;
|
||||
depthAttachment.Texture = _depthTarget;
|
||||
depthAttachment.LoadAction = MTLLoadAction.Load;
|
||||
|
||||
var renderCommandEncoder = _commandBuffer.RenderCommandEncoder(descriptor);
|
||||
_renderEncoderState.SetEncoderState(renderCommandEncoder, descriptor, _vertexDescriptor);
|
||||
|
||||
@ -523,6 +528,11 @@ namespace Ryujinx.Graphics.Metal
|
||||
}
|
||||
}
|
||||
|
||||
if (depthStencil is Texture depthTexture)
|
||||
{
|
||||
_depthTarget = depthTexture.MTLTexture;
|
||||
}
|
||||
|
||||
// Recreate Render Command Encoder
|
||||
BeginRenderPass();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user