gpu: Added helper functions to BindGroupLayout.Entry #213
No reviewers
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach!213
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Also added default values to
*.BindingLayoutstructures like this is done inwebgpu_cpp.h.Without those methods and default values the code to init
BindGroupLayoutis very verbose.With this PR initialization is much cleaner:
@ -103,9 +103,9 @@ pub const BindingType = enum(u32) {I think we should have this default to
.uniformsince that's what it's defined as in the spec:https://www.w3.org/TR/webgpu/#dictdef-gpubufferbindinglayout
@ -36,7 +36,7 @@ pub const BindingType = enum(u32) {Similarly, should default to
.filteringhttps://www.w3.org/TR/webgpu/#dictdef-gpusamplerbindinglayout
@ -217,3 +216,4 @@multisampled: bool = false,};pub const DataLayout = extern struct {.floatand.dimension_2d@ -39,9 +39,9 @@ pub const PrimitiveState = struct {.dimension_2d@ -39,9 +39,9 @@ pub const PrimitiveState = struct {.write_only@ -39,9 +39,9 @@ pub const PrimitiveState = struct {The spec has this to say - I think we should make this required for now, no default
.none:@ -38,10 +40,76 @@ pub const Entry = extern struct {reserved: ?*anyopaque = null,I actually think these should be optional values, according to the spec, not default to zero values.
@ -45,0 +60,4 @@.type = binding_type,.has_dynamic_offset = has_dynamic_offset,.min_binding_size = min_binding_size,},Could add comments to these to make it clear they're helpers:
LGTM otherwise!
@ -38,10 +40,76 @@ pub const Entry = extern struct {reserved: ?*anyopaque = null,BindingLayoutGroup.Entryis anextern struct- we can't have optional field for ABI compatibility.Note that
BindGroupLayout.Entryrepresents an union of various binding types. The idea is that all bindings are undefined by default and then the user sets only the one that is needed.https://www.w3.org/TR/webgpu/#dictdef-gpubindgrouplayoutentry
@ -38,10 +40,76 @@ pub const Entry = extern struct {reserved: ?*anyopaque = null,Ahh, you're right!
Perfect, thanks again!