GS:MTL: Always end all encoders on FlushEncoders

Previously, texture upload encoders weren't submitted if no rendering had been done, which would result in an assertion failure if the device was destroyed in that state, as the encoders would be released without calling `endEncoding` on them.
This commit is contained in:
TellowKrinkle authored and refractionpcsx2 committed 2023-04-29 17:37:24 +01:00
1 parent b47fdcdfab
commit d3e527f2a4
1 file changed
+8 -4
+8 -4
View File
@@ -252,10 +252,12 @@ void GSDeviceMTL::DrawCommandBufferFinished(u64 draw, id<MTLCommandBuffer> buffe
void GSDeviceMTL::FlushEncoders()
{
if (!m_current_render_cmdbuf)
return;
EndRenderPass();
Sync(m_vertex_upload_buf);
bool needs_submit = m_current_render_cmdbuf;
if (needs_submit)
{
EndRenderPass();
Sync(m_vertex_upload_buf);
}
if (m_dev.features.unified_memory)
{
ASSERT(!m_vertex_upload_cmdbuf && "Should never be used!");
@@ -274,6 +276,8 @@ void GSDeviceMTL::FlushEncoders()
m_texture_upload_encoder = nil;
m_texture_upload_cmdbuf = nil;
}
if (!needs_submit)
return;
if (m_late_texture_upload_encoder)
{
[m_late_texture_upload_encoder endEncoding];