Skip to content

Commit

Permalink
GS:MTL: Fix barriers
Browse files Browse the repository at this point in the history
  • Loading branch information
TellowKrinkle committed Dec 26, 2021
1 parent 1b3e0c2 commit 668ec0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion pcsx2/GS/Renderers/Metal/GSDeviceMTL.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ class API_AVAILABLE(macos(10.13)) GSDeviceMTL final : public GSDevice
id<MTLDevice> m_dev;
id<MTLCommandQueue> m_queue;
id<MTLFence> m_draw_sync_fence;
bool m_wait_on_draw_sync_fence;
NSView* m_view;
CAMetalLayer* m_layer;
id<MTLLibrary> m_shaders;
Expand Down
12 changes: 2 additions & 10 deletions pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ static void GSDeviceMTLCleanup(NSView* view, CAMetalLayer* layer)
destinationOffset:buffer.last_upload
size:buffer.usage.Pos() - buffer.last_upload];
[enc updateFence:m_draw_sync_fence];
m_wait_on_draw_sync_fence = true;
buffer.last_upload = buffer.usage.Pos();
}

Expand All @@ -249,11 +248,8 @@ static void GSDeviceMTLCleanup(NSView* view, CAMetalLayer* layer)
m_late_texture_upload_encoder = [GetRenderCmdBuf() blitCommandEncoder];
pxAssertRel(m_late_texture_upload_encoder, "Failed to create late texture upload encoder!");
[m_late_texture_upload_encoder setLabel:@"Late Texture Upload"];
if (m_wait_on_draw_sync_fence)
{
m_wait_on_draw_sync_fence = false;
if (!m_unified_memory)
[m_late_texture_upload_encoder waitForFence:m_draw_sync_fence];
}
}
return m_late_texture_upload_encoder;
}
Expand Down Expand Up @@ -401,12 +397,9 @@ static void GSDeviceMTLCleanup(NSView* view, CAMetalLayer* layer)

EndRenderPass();
m_current_render.encoder = [GetRenderCmdBuf() renderCommandEncoderWithDescriptor:desc];
if (m_wait_on_draw_sync_fence)
{
m_wait_on_draw_sync_fence = false;
if (!m_unified_memory)
[m_current_render.encoder waitForFence:m_draw_sync_fence
beforeStages:MTLRenderStageVertex];
}
m_current_render.color_target = color;
m_current_render.depth_target = depth;
m_current_render.stencil_target = stencil;
Expand Down Expand Up @@ -719,7 +712,6 @@ static void setFnConstantI(MTLFunctionConstantValues* fc, unsigned int value, GS
// Init metal stuff
m_queue = [m_dev newCommandQueue];
m_draw_sync_fence = [m_dev newFence];
m_wait_on_draw_sync_fence = !m_unified_memory;
m_shaders = [m_dev newDefaultLibrary];

m_fn_constants = [MTLFunctionConstantValues new];
Expand Down

0 comments on commit 668ec0a

Please sign in to comment.