diff --git a/gfx/common/metal/Context.m b/gfx/common/metal/Context.m index 22b1c13ead..094bf50caf 100644 --- a/gfx/common/metal/Context.m +++ b/gfx/common/metal/Context.m @@ -493,8 +493,10 @@ - (id)blitCommandBuffer { - if (!_blitCommandBuffer) + if (!_blitCommandBuffer) { _blitCommandBuffer = [_commandQueue commandBuffer]; + _blitCommandBuffer.label = @"Blit command buffer"; + } return _blitCommandBuffer; } @@ -562,6 +564,7 @@ assert(_commandBuffer == nil); dispatch_semaphore_wait(_inflightSemaphore, DISPATCH_TIME_FOREVER); _commandBuffer = [_commandQueue commandBuffer]; + _commandBuffer.label = @"Frame command buffer"; _backBuffer = nil; } @@ -579,6 +582,7 @@ _backBuffer = self.nextDrawable.texture; } _rce = [_commandBuffer renderCommandEncoderWithDescriptor:rpd]; + _rce.label = @"Frame command encoder"; } return _rce; } diff --git a/gfx/common/metal/Filter.m b/gfx/common/metal/Filter.m index c9909815e3..aca78b2eea 100644 --- a/gfx/common/metal/Filter.m +++ b/gfx/common/metal/Filter.m @@ -52,7 +52,6 @@ { id ce = [cb computeCommandEncoder]; ce.label = @"filter kernel"; - [ce pushDebugGroup:@"filter kernel"]; [ce setComputePipelineState:_kernel]; @@ -67,7 +66,6 @@ [ce dispatchThreadgroups:count threadsPerThreadgroup:size]; - [ce popDebugGroup]; [ce endEncoding]; } @@ -75,8 +73,7 @@ { id ce = [cb computeCommandEncoder]; ce.label = @"filter kernel"; - [ce pushDebugGroup:@"filter kernel"]; - + [ce setComputePipelineState:_kernel]; [ce setBuffer:tin offset:0 atIndex:0]; @@ -89,7 +86,6 @@ [ce dispatchThreadgroups:count threadsPerThreadgroup:size]; - [ce popDebugGroup]; [ce endEncoding]; } diff --git a/gfx/common/metal_common.m b/gfx/common/metal_common.m index 19a9e163f2..4daa096397 100644 --- a/gfx/common/metal_common.m +++ b/gfx/common/metal_common.m @@ -299,10 +299,11 @@ [self _drawCore:video_info]; [self _drawMenu:video_info]; + id rce = _context.rce; + #ifdef HAVE_OVERLAY if (_overlay.enabled) { - id rce = _context.rce; [rce pushDebugGroup:@"overlay"]; [_context resetRenderViewport:_overlay.fullscreen ? kFullscreenViewport : kVideoViewport]; [rce setRenderPipelineState:[_context getStockShader:VIDEO_SHADER_STOCK_BLEND blend:YES]]; @@ -319,19 +320,29 @@ if (osd_params) { + [rce pushDebugGroup:@"video stats"]; font_driver_render_msg(video_info, NULL, video_info->stat_text, osd_params); + [rce popDebugGroup]; } } #ifdef HAVE_MENU #ifdef HAVE_MENU_WIDGETS if (video_info->widgets_inited) + { + [rce pushDebugGroup:@"menu widgets"]; menu_widgets_frame(video_info); + [rce popDebugGroup]; + } #endif #endif if (msg && *msg) + { + [rce pushDebugGroup:@"message"]; [self _renderMessage:msg info:video_info]; + [rce popDebugGroup]; + } [self _endFrame]; }