Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions src/sysgpu/shader/Air.zig
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@ pub const Inst = union(enum) {
binary_intrinsic: BinaryIntrinsic,
triple_intrinsic: TripleIntrinsic,

atomic_load: AtomicLoad,
atomic_store: AtomicStore,
atomic_binary_intrinsic: AtomicBinaryIntrinsic,

block: RefIndex,
loop: InstIndex,
continuing: InstIndex,
Expand Down Expand Up @@ -756,9 +760,9 @@ pub const Inst = union(enum) {
};

pub const Unary = struct {
op: Op,
result_type: InstIndex,
expr: InstIndex,
op: Op,

pub const Op = enum {
not,
Expand All @@ -770,13 +774,14 @@ pub const Inst = union(enum) {

pub const NilIntrinsic = enum {
storage_barrier,
texture_barrier,
workgroup_barrier,
};

pub const UnaryIntrinsic = struct {
op: Op,
result_type: InstIndex,
expr: InstIndex,
op: Op,

pub const Op = enum {
all,
Expand Down Expand Up @@ -897,6 +902,53 @@ pub const Inst = union(enum) {
};
};

pub const AtomicLoad = struct {
result_type: InstIndex,
scope: Scope,
expr: InstIndex,

pub const Scope = enum {
device,
workgroup,
};
};

pub const AtomicStore = struct {
result_type: InstIndex,
scope: Scope,
lhs: InstIndex,
rhs: InstIndex,

pub const Scope = enum {
device,
workgroup,
};
};

pub const AtomicBinaryIntrinsic = struct {
op: Op,
result_type: InstIndex,
scope: Scope,
lhs: InstIndex,
rhs: InstIndex,

pub const Op = enum {
add,
sub,
max,
min,
@"and",
@"or",
xor,
exchange,
};

pub const Scope = enum {
device,
workgroup,
};
};

pub const Assign = struct {
mod: Modifier,
type: InstIndex,
Expand Down
Loading
Loading