From e6227f98983822f03bd6b943613cbd2bc0901038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 2 Sep 2019 13:00:22 +0200 Subject: [PATCH] Use correct uniforms when blitting menu frame with Metal Fixes broken rgui with the Metal video driver. --- gfx/common/metal_common.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gfx/common/metal_common.m b/gfx/common/metal_common.m index cdc51d5451..65d238b907 100644 --- a/gfx/common/metal_common.m +++ b/gfx/common/metal_common.m @@ -83,7 +83,6 @@ id _samplerStateNearest; // other state - Uniforms _uniforms; Uniforms _viewportMVP; } @@ -384,8 +383,9 @@ if (_menu.enabled && _menu.hasFrame) { + [rce pushDebugGroup:@"menu frame"]; [_menu.view drawWithContext:_context]; - [rce setVertexBytes:&_uniforms length:sizeof(_uniforms) atIndex:BufferIndexUniforms]; + [rce setVertexBytes:_context.uniforms length:sizeof(*_context.uniforms) atIndex:BufferIndexUniforms]; [rce setRenderPipelineState:_t_pipelineState]; if (_menu.view.filter == RTextureFilterNearest) { @@ -396,6 +396,7 @@ [rce setFragmentSamplerState:_samplerStateLinear atIndex:SamplerIndexDraw]; } [_menu.view drawWithEncoder:rce]; + [rce popDebugGroup]; } #if defined(HAVE_MENU)