1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-10 12:29:01 +00:00

Avoids a redundant clear.

This commit is contained in:
Thomas Harte 2020-08-17 22:09:15 -04:00
parent 59c4c8233f
commit 11dec6fc0f

View File

@ -448,6 +448,9 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget;
- (void)drawInMTKView:(nonnull MTKView *)view {
// Schedule a copy from the current framebuffer to the view; blitting is unavailable as the target is a framebuffer texture.
id<MTLCommandBuffer> commandBuffer = [_commandQueue commandBuffer];
// Every pixel will be drawn, so don't clear or reload.
view.currentRenderPassDescriptor.colorAttachments[0].loadAction = MTLLoadActionDontCare;
id<MTLRenderCommandEncoder> encoder = [commandBuffer renderCommandEncoderWithDescriptor:view.currentRenderPassDescriptor];
[encoder setRenderPipelineState:_copyPipeline];