Skip to content

v0.27.5: defensive NULL handle guard in TransitionTextures/Buffers#179

Merged
kolkov merged 1 commit into
mainfrom
release/v0.27.5
May 13, 2026
Merged

v0.27.5: defensive NULL handle guard in TransitionTextures/Buffers#179
kolkov merged 1 commit into
mainfrom
release/v0.27.5

Conversation

@kolkov
Copy link
Copy Markdown
Contributor

@kolkov kolkov commented May 13, 2026

Summary

  • Fix Vulkan crash on destroyed texture barriervkCmdPipelineBarrier access violation (0xc0000005) when a destroyed texture (VkImage=0) reached the driver. Three-level defense-in-depth:
    1. Public API (encoder_native.go) — filters nil/destroyed textures before HAL
    2. Vulkan HAL — skips barriers with handle=0, logs warning
    3. DX12 HAL — skips barriers with nil raw resource, logs warning
  • Both TransitionTextures and TransitionBuffers fixed (same pattern)
  • Rust wgpu prevents this via Snatchable<TextureInner> + SnatchGuard at core layer

Test plan

  • 4 new tests: destroyed handle + nil texture/buffer (Vulkan HAL)
  • go test ./... — all pass
  • golangci-lint run --timeout=5m — 0 issues
  • Cross-platform build: Windows, Linux, macOS

…n, DX12)

Prevents vkCmdPipelineBarrier access violation (0xc0000005) when a
destroyed texture (handle=0) reaches the barrier array. Three-level
defense-in-depth: public API filters nil/destroyed textures, Vulkan
HAL skips zero handles, DX12 HAL skips nil raw resources.

Rust wgpu prevents this at core via Snatchable+SnatchGuard. Our Go
port lacks Snatchable, so defensive guards at HAL boundary are the
correct enterprise pattern until a full DeviceTextureTracker lands.
@kolkov kolkov merged commit bbcb70b into main May 13, 2026
10 checks passed
@kolkov kolkov deleted the release/v0.27.5 branch May 13, 2026 21:41
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
encoder_native.go 71.42% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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