Use correct uniforms when blitting menu frame with Metal

Fixes broken rgui with the Metal video driver.
This commit is contained in:
Tor Arne Vestbø 2019-09-02 13:00:22 +02:00
parent a52130e368
commit e6227f9898

View File

@ -83,7 +83,6 @@
id<MTLSamplerState> _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)