Check for null resources before declaring them resident

This commit is contained in:
Isaac Marovitz 2024-09-08 01:29:36 +02:00
parent b0628d3d50
commit 97bc91af52
No known key found for this signature in database
GPG Key ID: 97250B2B09A132E1
1 changed files with 4 additions and 1 deletions

View File

@ -293,7 +293,10 @@ namespace Ryujinx.Graphics.Metal
foreach (var resource in _currentState.RenderEncoderResources.Resources)
{
renderCommandEncoder.UseResource(resource.MtlResource, resource.ResourceUsage, resource.Stages);
if (resource.MtlResource.NativePtr != IntPtr.Zero)
{
renderCommandEncoder.UseResource(resource.MtlResource, resource.ResourceUsage, resource.Stages);
}
}
foreach (var buffer in _currentState.RenderEncoderResources.VertexBuffers)