gpu: add ColorTargetState
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
5b66e3fbe0
commit
44d378e102
2 changed files with 10 additions and 10 deletions
|
|
@ -1,10 +1,3 @@
|
|||
pub const ColorTargetState = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
format: TextureFormat,
|
||||
blend: ?*const BlendState = null,
|
||||
write_mask: ColorWriteMaskFlags,
|
||||
};
|
||||
|
||||
pub const WGPUComputePipelineDescriptor = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
label: ?[*:0]const u8 = null,
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ pub const VertexStepMode = enum(u32) {
|
|||
vertex_buffer_not_used = 0x00000002,
|
||||
};
|
||||
|
||||
pub const ColorWriteMask = packed struct {
|
||||
pub const ColorWriteMaskFlags = packed struct {
|
||||
red: bool = false,
|
||||
green: bool = false,
|
||||
blue: bool = false,
|
||||
|
|
@ -315,14 +315,14 @@ pub const ColorWriteMask = packed struct {
|
|||
);
|
||||
}
|
||||
|
||||
pub const all = ColorWriteMask{
|
||||
pub const all = ColorWriteMaskFlags{
|
||||
.red = true,
|
||||
.green = true,
|
||||
.blue = true,
|
||||
.alpha = true,
|
||||
};
|
||||
|
||||
pub fn equal(a: ColorWriteMask, b: ColorWriteMask) bool {
|
||||
pub fn equal(a: ColorWriteMaskFlags, b: ColorWriteMaskFlags) bool {
|
||||
return @truncate(u4, @bitCast(u32, a)) == @truncate(u4, @bitCast(u32, b));
|
||||
}
|
||||
};
|
||||
|
|
@ -584,6 +584,13 @@ pub const VertexBufferLayout = extern struct {
|
|||
attributes: [*]const VertexAttribute,
|
||||
};
|
||||
|
||||
pub const ColorTargetState = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
format: Texture.Format,
|
||||
blend: ?*const BlendState = null,
|
||||
write_mask: ColorWriteMaskFlags,
|
||||
};
|
||||
|
||||
test "BackendType name" {
|
||||
try testing.expectEqualStrings("Vulkan", BackendType.vulkan.name());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue