gpu: add Sampler.Descriptor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
7509404a91
commit
ad907bf637
2 changed files with 19 additions and 15 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
const AddressMode = @import("enums.zig").AddressMode;
|
||||||
|
const FilterMode = @import("enums.zig").FilterMode;
|
||||||
|
const CompareFunction = @Import("data.zig").CompareFunction;
|
||||||
|
|
||||||
const Sampler = @This();
|
const Sampler = @This();
|
||||||
|
|
||||||
/// The type erased pointer to the Sampler implementation
|
/// The type erased pointer to the Sampler implementation
|
||||||
|
|
@ -34,10 +38,25 @@ pub const BindingLayout = struct {
|
||||||
type: BindingType,
|
type: BindingType,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const Descriptor = struct {
|
||||||
|
label: ?[*:0]const u8 = null,
|
||||||
|
address_mode_u: AddressMode,
|
||||||
|
address_mode_v: AddressMode,
|
||||||
|
address_mode_w: AddressMode,
|
||||||
|
mag_filter: FilterMode,
|
||||||
|
min_filter: FilterMode,
|
||||||
|
mipmap_filter: FilterMode,
|
||||||
|
lod_min_clamp: f32,
|
||||||
|
load_max_clamp: f32,
|
||||||
|
compare: CompareFunction,
|
||||||
|
max_anisotropy: u16,
|
||||||
|
};
|
||||||
|
|
||||||
test "syntax" {
|
test "syntax" {
|
||||||
_ = VTable;
|
_ = VTable;
|
||||||
_ = reference;
|
_ = reference;
|
||||||
_ = release;
|
_ = release;
|
||||||
_ = BindingType;
|
_ = BindingType;
|
||||||
_ = BindingLayout;
|
_ = BindingLayout;
|
||||||
|
_ = Descriptor;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
15
gpu/src/TODO
15
gpu/src/TODO
|
|
@ -57,21 +57,6 @@ typedef struct WGPUDawnTogglesDeviceDescriptor {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct WGPUSamplerDescriptor {
|
|
||||||
WGPUChainedStruct const * nextInChain;
|
|
||||||
char const * label;
|
|
||||||
WGPUAddressMode addressModeU;
|
|
||||||
WGPUAddressMode addressModeV;
|
|
||||||
WGPUAddressMode addressModeW;
|
|
||||||
WGPUFilterMode magFilter;
|
|
||||||
WGPUFilterMode minFilter;
|
|
||||||
WGPUFilterMode mipmapFilter;
|
|
||||||
float lodMinClamp;
|
|
||||||
float lodMaxClamp;
|
|
||||||
WGPUCompareFunction compare;
|
|
||||||
uint16_t maxAnisotropy;
|
|
||||||
} WGPUSamplerDescriptor;
|
|
||||||
|
|
||||||
typedef struct WGPUTextureViewDescriptor {
|
typedef struct WGPUTextureViewDescriptor {
|
||||||
WGPUChainedStruct const * nextInChain;
|
WGPUChainedStruct const * nextInChain;
|
||||||
char const * label;
|
char const * label;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue