mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
b47fdcdfab
commit
d3e527f2a4
|
@ -252,10 +252,12 @@ void GSDeviceMTL::DrawCommandBufferFinished(u64 draw, id<MTLCommandBuffer> buffe
|
|||
|
||||
void GSDeviceMTL::FlushEncoders()
|
||||
{
|
||||
if (!m_current_render_cmdbuf)
|
||||
return;
|
||||
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];
|
||||
|
|
Loading…
Reference in New Issue