Skip to content

feat(core): comprehensive render/compute pass validation (v0.21.2)#105

Merged
kolkov merged 4 commits intomainfrom
feat/v0.21.2-validation
Mar 16, 2026
Merged

feat(core): comprehensive render/compute pass validation (v0.21.2)#105
kolkov merged 4 commits intomainfrom
feat/v0.21.2-validation

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Mar 16, 2026

14/17 Rust wgpu-core validation checks. Binder struct, SetBindGroup bounds, draw-time compatibility, dynamic offsets, vertex/index buffer. Fixes AMD/NVIDIA crash (ui#52).

kolkov added 4 commits March 16, 2026 09:48
Track pipeline bind group count at SetPipeline, validate index < count
at SetBindGroup. Prevents vkCmdBindDescriptorSets crash on AMD/NVIDIA
when bind group index exceeds pipeline layout set count.
Matching Rust wgpu-core validation pattern:
- Binder: tracks assigned vs expected bind group layouts per slot
- SetBindGroup: MAX_BIND_GROUPS hard cap, index bounds, layout tracking
- SetPipeline: updates expected layouts, tracks pipeline state
- Draw/DrawIndexed: validates pipeline set + bind group compatibility
- Dispatch: validates pipeline set + bind group compatibility
- 13 binder tests + 9 integration tests
- Prevents AMD/NVIDIA crash (ui#52) at wgpu API level
- Dynamic offset alignment check (256 bytes) in SetBindGroup
- Vertex buffer count validation in Draw/DrawIndexed
- Index buffer set check in DrawIndexed/DrawIndexedIndirect
- Extracted validateSetBindGroup helper (DRY render/compute)
- 15 new tests, 0 regressions
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 76.51515% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
device.go 56.25% 13 Missing and 1 partial ⚠️
binder.go 84.09% 4 Missing and 3 partials ⚠️
computepass.go 61.11% 7 Missing ⚠️
renderpass.go 92.10% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit 1be43a5 into main Mar 16, 2026
11 checks passed
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.

1 participant