From 303ea496f1ae2a03789210468f3171667ae7a389 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 29 Aug 2022 11:45:11 -0400 Subject: [PATCH 1/2] Incorporate new additional padding. --- OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal b/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal index 7bc5f57ef..1a6b75a70 100644 --- a/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal +++ b/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal @@ -60,7 +60,8 @@ constexpr sampler linearSampler( coord::pixel, // MARK: - Structs used for receiving data from the emulation. -// This is intended to match the net effect of `Scan` as defined by the BufferingScanTarget. +// This is intended to match the net effect of `Scan` as defined by the BufferingScanTarget, +// with a couple of added fields. struct Scan { struct EndPoint { uint16_t position[2]; @@ -70,6 +71,7 @@ struct Scan { } endPoints[2]; uint8_t compositeAmplitude; + uint8_t __alignment[3]; // TODO: reuse some padding as the next two fields, to save two bytes. uint16_t dataY; uint16_t line; }; From 330d8526866cc846a9e670518168e7f4981d205e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 29 Aug 2022 11:46:53 -0400 Subject: [PATCH 2/2] Adopt same format as the master. --- OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal b/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal index 1a6b75a70..cab2225de 100644 --- a/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal +++ b/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal @@ -70,8 +70,10 @@ struct Scan { uint16_t cyclesSinceRetrace; } endPoints[2]; - uint8_t compositeAmplitude; - uint8_t __alignment[3]; // TODO: reuse some padding as the next two fields, to save two bytes. + union { + uint8_t compositeAmplitude; + uint32_t padding; // TODO: reuse some padding as the next two fields, to save two bytes. + }; uint16_t dataY; uint16_t line; };