mirror of https://github.com/encounter/SDL.git
metal: Make sure we have a command buffer available before trying to present.
This fixes a case where you render to the backbuffer, then render to a render target, set the current target back to the backbuffer, and then present without drawing anything else; in this circumstance, the Present command would never happen. Fixes Bugzilla #5011.
This commit is contained in:
parent
b5affd12e6
commit
b7a4fdd318
|
@ -1518,6 +1518,8 @@ METAL_RenderPresent(SDL_Renderer * renderer)
|
||||||
{ @autoreleasepool {
|
{ @autoreleasepool {
|
||||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||||
|
|
||||||
|
METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionLoad, NULL, nil);
|
||||||
|
|
||||||
if (data.mtlcmdencoder != nil) {
|
if (data.mtlcmdencoder != nil) {
|
||||||
[data.mtlcmdencoder endEncoding];
|
[data.mtlcmdencoder endEncoding];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue