Maintain identity swizzle view of textures for rendering

This commit is contained in:
riperiperi 2024-07-03 13:43:45 +01:00 committed by Isaac Marovitz
parent 7b9b23e500
commit 468ab8242f
2 changed files with 64 additions and 6 deletions

View file

@ -101,10 +101,10 @@ namespace Ryujinx.Graphics.Metal
for (int i = 0; i < Constants.MaxColorAttachments; i++)
{
if (_currentState.RenderTargets[i] != null)
if (_currentState.RenderTargets[i] is Texture tex)
{
var passAttachment = renderPassDescriptor.ColorAttachments.Object((ulong)i);
passAttachment.Texture = _currentState.RenderTargets[i].GetHandle();
tex.PopulateRenderPassAttachment(passAttachment);
passAttachment.LoadAction = _currentState.ClearLoadAction ? MTLLoadAction.Clear : MTLLoadAction.Load;
passAttachment.StoreAction = MTLStoreAction.Store;
}