diff --git a/OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib b/OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib
index b1eeadf5a..93bf418b9 100644
--- a/OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib
+++ b/OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib
@@ -27,7 +27,7 @@
-
+
diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm
index b85da72f1..a5059fa4d 100644
--- a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm
+++ b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm
@@ -112,7 +112,7 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget;
//
uniforms()->scale[0] = modals.output_scale.x;
uniforms()->scale[1] = modals.output_scale.y;
- uniforms()->lineWidth = 1.0f / modals.expected_vertical_lines;
+ uniforms()->lineWidth = 0.75f / modals.expected_vertical_lines; // TODO: return to 1.0 (or slightly more), once happy.
const auto toRGB = to_rgb_matrix(modals.composite_colour_space);
uniforms()->toRGB = simd::float3x3(
@@ -205,6 +205,11 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget;
break;
}
+ // Enable blending.
+ pipelineDescriptor.colorAttachments[0].blendingEnabled = YES;
+ pipelineDescriptor.colorAttachments[0].sourceRGBBlendFactor = MTLBlendFactorSourceAlpha;
+ pipelineDescriptor.colorAttachments[0].destinationRGBBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
+
_scanPipeline = [view.device newRenderPipelineStateWithDescriptor:pipelineDescriptor error:nil];
}
@@ -219,9 +224,15 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget;
[self setModals:*newModals view:view];
}
+ // Buy into framebuffer preservation.
+ // TODO: do I really need to do this on every draw?
+ MTLRenderPassDescriptor *const descriptor = view.currentRenderPassDescriptor;
+ descriptor.colorAttachments[0].loadAction = MTLLoadActionLoad;
+ descriptor.colorAttachments[0].storeAction = MTLStoreActionStore;
+ descriptor.colorAttachments[0].clearColor = MTLClearColorMake(1.0, 1.0, 0.0, 1.0);
+
// Generate a command encoder for the view.
id commandBuffer = [_commandQueue commandBuffer];
- MTLRenderPassDescriptor *const descriptor = view.currentRenderPassDescriptor;
id encoder = [commandBuffer renderCommandEncoderWithDescriptor:descriptor];
// Drawing. Just scans.
diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal b/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal
index d5bfa4877..944222e87 100644
--- a/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal
+++ b/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal
@@ -171,9 +171,10 @@ float3 convertRed1Green1Blue1(SourceInterpolator vert, texture2d texture
return float3(sample&4, sample&2, sample&1);
}
+// TODO: don't hard code the 0.64 in sample##name.
#define DeclareShaders(name, pixelType) \
fragment float4 sample##name(SourceInterpolator vert [[stage_in]], texture2d texture [[texture(0)]]) { \
- return float4(convert##name(vert, texture), 1.0); \
+ return float4(convert##name(vert, texture), 0.64); \
} \
\
fragment float4 svideoSample##name(SourceInterpolator vert [[stage_in]], texture2d texture [[texture(0)]], constant Uniforms &uniforms [[buffer(0)]]) { \