2020-04-17 11:14:09 +10:00
|
|
|
use piet_gpu_derive::piet_gpu;
|
|
|
|
|
|
|
|
piet_gpu! {
|
|
|
|
#[gpu_write]
|
|
|
|
mod ptcl {
|
|
|
|
struct CmdStroke {
|
2020-06-04 02:28:43 +10:00
|
|
|
// This is really a Ref<Tile>, but we don't have cross-module
|
|
|
|
// references.
|
|
|
|
tile_ref: u32,
|
2020-04-29 04:02:19 +10:00
|
|
|
half_width: f32,
|
2020-04-17 11:14:09 +10:00
|
|
|
rgba_color: u32,
|
|
|
|
}
|
|
|
|
struct CmdFill {
|
2020-06-06 08:07:02 +10:00
|
|
|
// As above, really Ref<Tile>
|
|
|
|
tile_ref: u32,
|
2020-05-01 10:06:01 +10:00
|
|
|
backdrop: i32,
|
|
|
|
rgba_color: u32,
|
2020-04-17 11:14:09 +10:00
|
|
|
}
|
2020-11-20 06:53:59 +11:00
|
|
|
struct CmdBeginClip {
|
|
|
|
tile_ref: u32,
|
|
|
|
backdrop: i32,
|
|
|
|
}
|
2020-11-21 04:26:02 +11:00
|
|
|
// This is mostly here for expedience and can always be optimized
|
|
|
|
// out for pure clips, but will be useful for blend groups.
|
|
|
|
struct CmdBeginSolidClip {
|
|
|
|
alpha: f32,
|
|
|
|
}
|
2020-11-20 06:53:59 +11:00
|
|
|
struct CmdEndClip {
|
|
|
|
// This will be 1.0 for clips, but we can imagine blend groups.
|
|
|
|
alpha: f32,
|
|
|
|
}
|
2020-04-17 11:14:09 +10:00
|
|
|
struct CmdSolid {
|
|
|
|
rgba_color: u32,
|
|
|
|
}
|
2020-04-26 03:15:22 +10:00
|
|
|
struct CmdJump {
|
|
|
|
new_ref: u32,
|
|
|
|
}
|
2020-04-17 11:14:09 +10:00
|
|
|
enum Cmd {
|
|
|
|
End,
|
|
|
|
Fill(CmdFill),
|
2020-11-20 06:53:59 +11:00
|
|
|
BeginClip(CmdBeginClip),
|
2020-11-21 04:26:02 +11:00
|
|
|
BeginSolidClip(CmdBeginSolidClip),
|
2020-11-20 06:53:59 +11:00
|
|
|
EndClip(CmdEndClip),
|
2020-04-17 11:14:09 +10:00
|
|
|
Stroke(CmdStroke),
|
|
|
|
Solid(CmdSolid),
|
2020-04-26 03:15:22 +10:00
|
|
|
Jump(CmdJump),
|
2020-04-17 11:14:09 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|