mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-27 06:35:04 +00:00
Guarantees alignof(4) on all GPU-bound structures.
Taken as given: Metal's requirement here is reasonable enough that it'll either be the same as other frameworks, or at least possibly help them down a fast path.
This commit is contained in:
parent
219923bd63
commit
4c9418f59a
@ -210,9 +210,11 @@ struct ScanTarget {
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
Defines a scan in terms of its two endpoints.
|
Defines a scan in terms of its two endpoints.
|
||||||
|
|
||||||
|
Is guaranteed to be a multiple of four bytes in size.
|
||||||
*/
|
*/
|
||||||
struct Scan {
|
struct alignas(4) Scan {
|
||||||
struct EndPoint {
|
struct alignas(4) EndPoint {
|
||||||
/// Provide the coordinate of this endpoint. These are fixed point, purely fractional
|
/// Provide the coordinate of this endpoint. These are fixed point, purely fractional
|
||||||
/// numbers, relative to the scale provided in the Modals.
|
/// numbers, relative to the scale provided in the Modals.
|
||||||
uint16_t x, y;
|
uint16_t x, y;
|
||||||
|
@ -51,7 +51,7 @@ class BufferingScanTarget: public Outputs::Display::ScanTarget {
|
|||||||
|
|
||||||
// Extends the definition of a Scan to include two extra fields,
|
// Extends the definition of a Scan to include two extra fields,
|
||||||
// completing this scan's source data and destination locations.
|
// completing this scan's source data and destination locations.
|
||||||
struct Scan {
|
struct alignas(4) Scan {
|
||||||
Outputs::Display::ScanTarget::Scan scan;
|
Outputs::Display::ScanTarget::Scan scan;
|
||||||
|
|
||||||
/// Stores the y coordinate for this scan's data within the write area texture.
|
/// Stores the y coordinate for this scan's data within the write area texture.
|
||||||
@ -66,12 +66,13 @@ class BufferingScanTarget: public Outputs::Display::ScanTarget {
|
|||||||
/// Defines the boundaries of a complete line of video — a 2d start and end location,
|
/// Defines the boundaries of a complete line of video — a 2d start and end location,
|
||||||
/// composite phase and amplitude (if relevant), the source line in the intermediate buffer
|
/// composite phase and amplitude (if relevant), the source line in the intermediate buffer
|
||||||
/// plus the start and end offsets of the area that is visible from the intermediate buffer.
|
/// plus the start and end offsets of the area that is visible from the intermediate buffer.
|
||||||
struct Line {
|
struct alignas(4) Line {
|
||||||
struct EndPoint {
|
struct alignas(4) EndPoint {
|
||||||
uint16_t x, y;
|
uint16_t x, y;
|
||||||
uint16_t cycles_since_end_of_horizontal_retrace;
|
uint16_t cycles_since_end_of_horizontal_retrace;
|
||||||
int16_t composite_angle;
|
int16_t composite_angle;
|
||||||
} end_points[2];
|
} end_points[2];
|
||||||
|
|
||||||
uint16_t line;
|
uint16_t line;
|
||||||
uint8_t composite_amplitude;
|
uint8_t composite_amplitude;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user