examples: fixed uniform buffer release and unused var #269
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!269
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?
@ -125,4 +125,3 @@defer uniform_buffer.release();const bind_group = engine.gpu_driver.device.createBindGroup(&gpu.BindGroup.Descriptor{.layout = bgl,I think the reason this worked and was not an error, is because
createBindGrouptakes thisuniform_bufferas a parameter. So it probably.reference()'s theuniform_bufferparameter and holds on to it. I think we maybe maintaining a duplicatereferenceneedlessly now.But I need to confirm this / dig into the Dawn source code & make sure this is true, review all examples for correctness, etc.
@ -125,4 +125,3 @@defer uniform_buffer.release();const bind_group = engine.gpu_driver.device.createBindGroup(&gpu.BindGroup.Descriptor{.layout = bgl,I think that
release()just puts the memory that was allocated before in free memory, but doesn't change neither the contents neither uniform_buffer that points to what is now freed memory. Hence we would have probably seen something strange if we later allocated and wrote something to new allocated memory.