mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-09 06:55:37 +00:00
metal: Clear bogus pointer if we fail to get a new drawable.
Reference Issue #16232.
This commit is contained in:
@@ -483,6 +483,8 @@ static bool METAL_ActivateRenderCommandEncoder(SDL_Renderer *renderer, MTLLoadAc
|
||||
}
|
||||
}
|
||||
|
||||
data.mtlpassdesc.colorAttachments[0].texture = mtltexture;
|
||||
|
||||
/* mtltexture can be nil here if macOS refused to give us a drawable,
|
||||
which apparently can happen for minimized windows, etc. */
|
||||
if (mtltexture == nil) {
|
||||
@@ -495,7 +497,6 @@ static bool METAL_ActivateRenderCommandEncoder(SDL_Renderer *renderer, MTLLoadAc
|
||||
}
|
||||
|
||||
data.mtlpassdesc.colorAttachments[0].loadAction = load;
|
||||
data.mtlpassdesc.colorAttachments[0].texture = mtltexture;
|
||||
|
||||
data.mtlcmdbuffer = [data.mtlcmdqueue commandBuffer];
|
||||
data.mtlcmdencoder = [data.mtlcmdbuffer renderCommandEncoderWithDescriptor:data.mtlpassdesc];
|
||||
|
||||
Reference in New Issue
Block a user