sysgpu: provide clear default values instead of WebGPU 'undefined' default values #1159
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#1159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
eg. the default value for the
typefield ofBuffer.BindingLayoutshould beuniform, according to the WebGPU spec.The
undefinedbuffer type should only be used in the default value of thebufferonBindGroupLayout.Entry, in order to show that those fields are empty.The default values of the structs themselves should match WebGPU spec, so that if someone tries to use the defaults they get the expected behaviour instead of a confusing validation error :)
For Dawn / mach-gpu, we follow Dawn's API definitions (webgpu.h and dawn.json) which have
Buffer.BindingLayout.type's default value asundefined. https://github.com/hexops/dawn/blob/generated-2023-08-10.1691685418/dawn.json#L276For sysgpu we will document the defaults better, but for Dawn / mach-gpu this is as intended
Are Dawn's defaults not simply the zero-values? Zero-values are ofc the "default" in a C API, but a Zig API shouldn't necessarily mirror that.
I'd argue it's much better to use the WebGPU spec's defaults, as those are more carefully considered and thus make more sense.
I guess that'd turn this into a feature request rather than a bug :)
yeah, that's
undefined(which is an enum name assigned zero value in basically every case)I agree, I'll update the title