Skip to content

Fix crashes and SPIRV compatibility on Raytracing. - #55

Open
RowDaBoat wants to merge 2 commits into
manuel5975p:masterfrom
RowDaBoat:master
Open

Fix crashes and SPIRV compatibility on Raytracing.#55
RowDaBoat wants to merge 2 commits into
manuel5975p:masterfrom
RowDaBoat:master

Conversation

@RowDaBoat

Copy link
Copy Markdown
Contributor

Summary

Ray tracing pipeline and bind group creation could crash the Vulkan driver: a
dangling pointer into a caller-owned chain struct could get read after the
caller freed it, and raw-SPIR-V-sourced ray tracing shaders got a
VK_NULL_HANDLE shader module in the SBT.

Fixes

  • Deep-copy the WGPUBindGroupLayoutEntryRayTracing chain in wgpuDeviceCreateBindGroupLayout to avoid a dangling pointer once the caller's chain struct is freed.
  • Free the deep-copied nextInChain entries in wgpuBindGroupLayoutRelease.
  • Use vulkanModuleMultiEP when building the ray tracing SBT's shader stages.

Verification

  • I verified the fixes work using wgvk's raytracing.c example.
  • I tested the SPIR-V path on my own engine, can add an example later if necessary.

…er's chain struct is freed.

fix: free the deep-copied  entries in .
fix: use  when building the ray tracing SBT's shader stages.
@RowDaBoat
RowDaBoat force-pushed the master branch 2 times, most recently from 9cb6fc6 to c7abab1 Compare July 26, 2026 16:31
@manuel5975p

Copy link
Copy Markdown
Owner

lgtm, the failing tests are Zig only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants