-
Notifications
You must be signed in to change notification settings - Fork 3
feat(vulkan): Intel compatibility fixes and wgpu-style synchronization #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intel Iris Xe Vulkan drivers return VK_SUCCESS but write VK_NULL_HANDLE to pipeline output, violating Vulkan spec. Intel closed IGCIT #1309 as "legacy support" — no fix coming. Changes: - Add ErrDriverBug error type for driver spec violations - Add null checks after vkCreateGraphicsPipelines/vkCreateComputePipelines - Return hal.ErrDriverBug instead of crashing on affected hardware Fixes #24
- Fix goffi pointer-to-pointer calling convention in loader.go
goffi expects args[] to contain pointers to WHERE values are stored
For pointer args (const char*), must use &ptr not &data[0] directly
- Add WSI function loading in commands.go LoadInstance()
Surface: vkDestroySurfaceKHR, vkGetPhysicalDeviceSurfaceSupportKHR
Capabilities: vkGetPhysicalDeviceSurfaceCapabilities/Formats/PresentModesKHR
Platform: vkCreateWin32SurfaceKHR
Swapchain: vkCreate/DestroySwapchainKHR, vkGetSwapchainImagesKHR,
vkAcquireNextImageKHR, vkQueuePresentKHR
- Add SetDeviceProcAddr() for Intel driver compatibility
Intel Iris Xe doesn't support vkGetInstanceProcAddr(NULL, vkGetDeviceProcAddr)
Must load with valid instance handle after vkCreateInstance
- Add enterprise-level documentation
Package godoc with goffi calling convention examples
Function loading hierarchy documentation
Intel driver compatibility notes
Tested on Intel Iris Xe (12th Gen i7-1265U), Vulkan 1.4.323
Confirmed: Intel null pipeline bug detected by ErrDriverBug check
Refs: #24
Replace VK_KHR_dynamic_rendering with classic VkRenderPass approach for Intel Iris Xe compatibility. Dynamic rendering doesn't work properly on Intel Windows drivers. Changes: - Add RenderPassCache for VkRenderPass and VkFramebuffer caching - Modify BeginRenderPass to use vkCmdBeginRenderPass - Update pipeline creation to use compatible VkRenderPass - Add vkFormat field to TextureView for swapchain format tracking - Add acquire fence to swapchain synchronization (from Rust wgpu) Clear color now works (blue background visible), triangle drawing still needs investigation.
- Removed DEBUG printf statements from device.go and pipeline.go - Removed temporary SPIR-V file saving - Updated to use VkRenderPass instead of dynamic rendering - Triangle now renders correctly on Intel Iris Xe Graphics
- Add rotating acquire semaphore pool (one per swapchain image) - Add per-image present semaphores (indexed by image) - Track currentAcquireSem for proper Submit/Present semaphore pairing - Fix 'Not Responding' freeze on Windows with Intel Iris Xe This matches the synchronization pattern used by Rust wgpu: - Acquire semaphores rotate to avoid reuse conflicts - Present semaphores are per-image (known after acquire) - Post-acquire fence wait ensures image is ready (Windows/DXGI fix)
- Add acquireFences[] array (one fence per acquire semaphore) - Wait on specific fence before reusing an acquire semaphore - Signal fence when submission completes - Fences start signaled so first frame doesn't block This completes the wgpu-style synchronization model: 1. Pre-acquire fence wait (ensures semaphore is safe to reuse) 2. Post-acquire fence wait (Windows/Intel DXGI fix) 3. Rotating acquire semaphores (avoid reuse conflicts) 4. Per-image present semaphores (known after acquire)
- Add vkGetFenceStatus check before waiting on fences (wgpu-style) - Skip fence wait if already signaled, reducing unnecessary stalls - Add Device.WaitIdle() and Device.ResetCommandPool() methods - Update vulkan-triangle test to periodically reset command pool - Prevents command buffer memory exhaustion in long-running apps Note: FIFO present mode on Intel/Windows/DXGI has known ~35-50 FPS limitation (see wgpu issue #8310). Immediate mode achieves 1600+ FPS, confirming rendering pipeline works correctly.
- VkRenderPass support (replaces VK_KHR_dynamic_rendering for Intel) - wgpu-style swapchain synchronization with rotating semaphores/fences - Fence status optimization (skip wait if already signaled) - Device.WaitIdle() and Device.ResetCommandPool() methods - Updated naga v0.8.3 → v0.8.4 (SPIR-V instruction ordering) - Code quality: linter fixes, type switches, nolint directives
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Critical fixes for Intel Vulkan driver compatibility and proper swapchain synchronization.
Added
Fixed
Dependencies
Testing
Related