1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-26 15:32:04 +00:00

Merge branch 'master' into AppleIISCSI

This commit is contained in:
Thomas Harte 2022-08-29 11:47:48 -04:00
commit cd7671e8fa
3 changed files with 16 additions and 3 deletions

View File

@ -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];
@ -69,7 +70,10 @@ struct Scan {
uint16_t cyclesSinceRetrace;
} endPoints[2];
uint8_t compositeAmplitude;
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;
};

View File

@ -84,6 +84,11 @@ void ScanTarget::enable_vertex_attributes(ShaderType type, Shader &target) {
Scan test_scan;
Line test_line;
// Some GPUs require alignment and will need to copy vertex data to a
// shadow buffer otherwise
static_assert(sizeof(Scan) % 4 == 0);
static_assert(sizeof(Line) % 4 == 0);
switch(type) {
case ShaderType::Composition:
for(int c = 0; c < 2; ++c) {

View File

@ -304,7 +304,11 @@ struct ScanTarget {
/// For composite video, dictates the amplitude of the colour subcarrier as a proportion of
/// the whole, as determined from the colour burst. Will be 0 if there was no colour burst.
uint8_t composite_amplitude;
union {
uint8_t composite_amplitude;
uint32_t padding;
};
};
/// Requests a new scan to populate.