From f2929230a20b2dde4fad5d0ef203d13f267257f4 Mon Sep 17 00:00:00 2001 From: Thomas Harte <thomas.harte@gmail.com> Date: Tue, 1 Sep 2020 21:37:36 -0400 Subject: [PATCH] [Experimentally] introduces blending between computed S-Video fragments. --- OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm | 2 +- OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm index da55ca7fa..d5b609efe 100644 --- a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm +++ b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm @@ -593,7 +593,7 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget; pipelineDescriptor.vertexFunction = [library newFunctionWithName:_pipeline == Pipeline::DirectToDisplay ? @"scanToDisplay" : @"lineToDisplay"]; if(_pipeline != Pipeline::DirectToDisplay) { - pipelineDescriptor.fragmentFunction = [library newFunctionWithName:@"copyFragment"]; + pipelineDescriptor.fragmentFunction = [library newFunctionWithName:@"interpolateFragment"]; } else { const bool isRGBOutput = modals.display_type == Outputs::Display::DisplayType::RGB; pipelineDescriptor.fragmentFunction = diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal b/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal index f5eb88940..e0d04f9c2 100644 --- a/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal +++ b/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal @@ -97,17 +97,15 @@ struct SourceInterpolator { float2 textureLocation(constant Line *line, float offset, constant Uniforms &uniforms) { return float2( uniforms.cycleMultiplier * mix(line->endPoints[0].cyclesSinceRetrace, line->endPoints[1].cyclesSinceRetrace, offset), - line->line); + line->line + 0.5f); } float2 textureLocation(constant Scan *scan, float offset, constant Uniforms &) { return float2( mix(scan->endPoints[0].dataOffset, scan->endPoints[1].dataOffset, offset), - scan->dataY); + scan->dataY + 0.5f); } -// TODO: add 0.5f to the y coordinates above to ensure the middle of each line is hit? - template <typename Input> SourceInterpolator toDisplay( constant Uniforms &uniforms [[buffer(1)]], constant Input *inputs [[buffer(0)]],