Skip to content

fix(vulkan): validate WSI query functions in LoadInstance (v0.20.2)#102

Merged
kolkov merged 1 commit intomainfrom
fix/wsi-validation-loadinstance
Mar 12, 2026
Merged

fix(vulkan): validate WSI query functions in LoadInstance (v0.20.2)#102
kolkov merged 1 commit intomainfrom
fix/wsi-validation-loadinstance

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Mar 12, 2026

Summary

  • Validate WSI query functions (vkGetPhysicalDeviceSurfaceCapabilitiesKHR, SurfaceFormatsKHR, SurfacePresentModesKHR) during LoadInstance()
  • Previously, if any WSI function failed to load (nil), the error was silent until a later SIGSEGV via goffi nil function pointer call
  • Now fails fast with a clear error message: "failed to load WSI query functions (VK_KHR_surface)"

Defense-in-depth for gogpu/ui#45 (SIGSEGV on Wayland/Sway).

Test plan

  • go build ./... passes (Windows, cross-compile)
  • GOWORK=off golangci-lint run --timeout=5m — 0 issues
  • CI: build on Linux, macOS, Windows
  • CI: tests and lint pass

vkGetPhysicalDeviceSurfaceCapabilitiesKHR, SurfaceFormatsKHR, and
SurfacePresentModesKHR are now verified during instance initialization.
Previously, if any WSI function failed to load (nil), the error was
silent until a later SIGSEGV via goffi nil function pointer call.
Now fails fast with a clear error message.

Defense-in-depth for gogpu/ui#45
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit c80d13c into main Mar 12, 2026
11 checks passed
@kolkov kolkov deleted the fix/wsi-validation-loadinstance branch March 12, 2026 17:09
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