1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Fixes sizing of buffers to the current output.

This commit is contained in:
Thomas Harte 2020-09-01 21:33:54 -04:00
parent 9e2bf2af7e
commit bf252b8061

View File

@ -296,15 +296,15 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget;
[self setAspectRatio];
@synchronized(self) {
[self updateSizeBuffers];
[self updateSizeBuffersToSize:size];
}
}
- (void)updateSizeBuffers {
- (void)updateSizeBuffersToSize:(CGSize)size {
// TODO: consider multisampling here? But it seems like you'd need another level of indirection
// in order to maintain an ongoing buffer that supersamples only at the end.
const NSUInteger frameBufferWidth = NSUInteger(_view.drawableSize.width * _view.layer.contentsScale);
const NSUInteger frameBufferHeight = NSUInteger(_view.drawableSize.height * _view.layer.contentsScale);
const NSUInteger frameBufferWidth = NSUInteger(size.width * _view.layer.contentsScale);
const NSUInteger frameBufferHeight = NSUInteger(size.height * _view.layer.contentsScale);
// Generate a framebuffer and a stencil.
MTLTextureDescriptor *const textureDescriptor = [MTLTextureDescriptor