gpu: add DepthStencilState
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
bf3cf08e1e
commit
3ec84f516a
3 changed files with 18 additions and 15 deletions
14
gpu/src/TODO
14
gpu/src/TODO
|
|
@ -204,20 +204,6 @@ typedef struct WGPUCopyTextureForBrowserOptions {
|
|||
WGPUAlphaMode dstAlphaMode;
|
||||
} WGPUCopyTextureForBrowserOptions;
|
||||
|
||||
typedef struct WGPUDepthStencilState {
|
||||
WGPUChainedStruct const * nextInChain;
|
||||
WGPUTextureFormat format;
|
||||
bool depthWriteEnabled;
|
||||
WGPUCompareFunction depthCompare;
|
||||
WGPUStencilFaceState stencilFront;
|
||||
WGPUStencilFaceState stencilBack;
|
||||
uint32_t stencilReadMask;
|
||||
uint32_t stencilWriteMask;
|
||||
int32_t depthBias;
|
||||
float depthBiasSlopeScale;
|
||||
float depthBiasClamp;
|
||||
} WGPUDepthStencilState;
|
||||
|
||||
typedef struct WGPUImageCopyBuffer {
|
||||
WGPUChainedStruct const * nextInChain;
|
||||
WGPUTextureDataLayout layout;
|
||||
|
|
|
|||
|
|
@ -89,10 +89,11 @@ pub const VertexBufferLayout = @import("data.zig").VertexBufferLayout;
|
|||
|
||||
// Data structures not ABI-compatible with webgpu.h
|
||||
pub const CompilationMessage = @import("structs.zig").CompilationMessage;
|
||||
pub const CompilationInfo = @Import("structs.zig").CompilationInfo;
|
||||
pub const CompilationInfo = @import("structs.zig").CompilationInfo;
|
||||
pub const MultisampleState = @import("structs.zig").MultisampleState;
|
||||
pub const PrimitiveState = @import("structs.zig").PrimitiveState;
|
||||
pub const StorageTextureBindingLayout = @import("structs.zig").StorageTextureBindingLayout;
|
||||
pub const DepthStencilState = @import("structs.zig").DepthStencilState;
|
||||
|
||||
// Enumerations
|
||||
pub const Feature = @import("enums.zig").Feature;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@ const Buffer = @import("Buffer.zig");
|
|||
const Sampler = @import("Sampler.zig");
|
||||
const Texture = @import("Texture.zig");
|
||||
const TextureView = @import("TextureView.zig");
|
||||
const StencilFaceState = @import("data.zig").StencilFaceState;
|
||||
const CompilationMessageType = @import("enums.zig").CompilationMessageType;
|
||||
const PrimitiveTopology = @import("enums.zig").PrimitiveTopology;
|
||||
const IndexFormat = @import("enums.zig").IndexFormat;
|
||||
const FrontFace = @import("enums.zig").FrontFace;
|
||||
const CullMode = @import("enums.zig").CullMode;
|
||||
const StorageTextureAccess = @import("enums.zig").StorageTextureAccess;
|
||||
const CompareFunction = @import("enums.zig").CompareFunction;
|
||||
|
||||
pub const CompilationMessage = struct {
|
||||
message: [:0]const u8,
|
||||
|
|
@ -42,10 +44,24 @@ pub const StorageTextureBindingLayout = struct {
|
|||
view_dimension: Texture.ViewDimension,
|
||||
};
|
||||
|
||||
pub const DepthStencilState = struct {
|
||||
format: Texture.Format,
|
||||
depth_write_enabled: bool,
|
||||
depth_compare: CompareFunction,
|
||||
stencil_front: StencilFaceState,
|
||||
stencil_back: StencilFaceState,
|
||||
stencil_read_mask: u32,
|
||||
stencil_write_mask: u32,
|
||||
depth_bias: i32,
|
||||
depth_bias_slope_scale: f32,
|
||||
depth_bias_clamp: f32,
|
||||
};
|
||||
|
||||
test "syntax" {
|
||||
_ = CompilationMessage;
|
||||
_ = CompilationInfo;
|
||||
_ = MultisampleState;
|
||||
_ = PrimitiveState;
|
||||
_ = StorageTextureBindingLayout;
|
||||
_ = DepthStencilState;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue