gpu: add BindGroup.Entry
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
3c8dfa06a1
commit
a6eab5ef18
5 changed files with 15 additions and 13 deletions
|
|
@ -1,13 +1,3 @@
|
||||||
typedef struct WGPUBindGroupEntry {
|
|
||||||
WGPUChainedStruct const * nextInChain;
|
|
||||||
uint32_t binding;
|
|
||||||
WGPUBuffer buffer; // nullable
|
|
||||||
uint64_t offset;
|
|
||||||
uint64_t size;
|
|
||||||
WGPUSampler sampler; // nullable
|
|
||||||
WGPUTextureView textureView; // nullable
|
|
||||||
} WGPUBindGroupEntry;
|
|
||||||
|
|
||||||
typedef struct WGPUBlendComponent {
|
typedef struct WGPUBlendComponent {
|
||||||
WGPUBlendOperation operation;
|
WGPUBlendOperation operation;
|
||||||
WGPUBlendFactor srcFactor;
|
WGPUBlendFactor srcFactor;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ const std = @import("std");
|
||||||
pub const Buffer = enum(usize) {
|
pub const Buffer = enum(usize) {
|
||||||
_,
|
_,
|
||||||
|
|
||||||
// TODO: verify there is a use case for nullable value of this type.
|
|
||||||
pub const none: Buffer = @intToEnum(Buffer, 0);
|
pub const none: Buffer = @intToEnum(Buffer, 0);
|
||||||
|
|
||||||
pub const BindingType = enum(u32) {
|
pub const BindingType = enum(u32) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
pub const Sampler = enum(usize) {
|
pub const Sampler = enum(usize) {
|
||||||
_,
|
_,
|
||||||
|
|
||||||
// TODO: verify there is a use case for nullable value of this type.
|
|
||||||
pub const none: Sampler = @intToEnum(Sampler, 0);
|
pub const none: Sampler = @intToEnum(Sampler, 0);
|
||||||
|
|
||||||
pub const AddressMode = enum(u32) {
|
pub const AddressMode = enum(u32) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
|
const Buffer = @import("buffer.zig").Buffer;
|
||||||
|
const Sampler = @import("sampler.zig").Sampler;
|
||||||
|
const TextureView = @import("texture_view.zig").TextureView;
|
||||||
|
const ChainedStruct = @import("types.zig").ChainedStruct;
|
||||||
|
|
||||||
pub const BindGroup = enum(usize) {
|
pub const BindGroup = enum(usize) {
|
||||||
_,
|
_,
|
||||||
|
|
||||||
// TODO: verify there is a use case for nullable value of this type.
|
// TODO: verify there is a use case for nullable value of this type.
|
||||||
pub const none: BindGroup = @intToEnum(BindGroup, 0);
|
pub const none: BindGroup = @intToEnum(BindGroup, 0);
|
||||||
|
|
||||||
|
pub const Entry = extern struct {
|
||||||
|
next_in_chain: *const ChainedStruct,
|
||||||
|
binding: u32,
|
||||||
|
buffer: Buffer = Buffer.none, // nullable
|
||||||
|
offset: u64,
|
||||||
|
size: u64,
|
||||||
|
sampler: Sampler = Sampler.none, // nullable
|
||||||
|
texture_view: TextureView = TextureView.none, // nullable
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
pub const TextureView = enum(usize) {
|
pub const TextureView = enum(usize) {
|
||||||
_,
|
_,
|
||||||
|
|
||||||
// TODO: verify there is a use case for nullable value of this type.
|
|
||||||
pub const none: TextureView = @intToEnum(TextureView, 0);
|
pub const none: TextureView = @intToEnum(TextureView, 0);
|
||||||
|
|
||||||
pub const Dimension = enum(u32) {
|
pub const Dimension = enum(u32) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue