Skip to content

fix(hooks): initialize command buffer dispatch pointers#48

Merged
ralgar merged 2 commits into
mainfrom
fix/validation-layers
Apr 6, 2026
Merged

fix(hooks): initialize command buffer dispatch pointers#48
ralgar merged 2 commits into
mainfrom
fix/validation-layers

Conversation

@ralgar

@ralgar ralgar commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Command buffers are dispatchable objects. When allocated through the dispatch table directly, the loader trampoline is bypassed and the dispatch pointer is never fixed up, causing the validation layer to crash when looking up the device.

Hook vkAllocateCommandBuffers to fix up the dispatch pointer on all allocations, and route internal allocations through the hook rather than the dispatch table.

Fixes crash when using validation layers.

Also fixes a deadlock triggered by this PR, caused by unnecessary exclusive locking when reading from the instance dispatch map.

@ralgar ralgar marked this pull request as draft April 6, 2026 07:25
Fixes a deadlock on startup triggered by the previous commit.
@ralgar ralgar force-pushed the fix/validation-layers branch from 336f419 to 281785e Compare April 6, 2026 19:33
@ralgar ralgar marked this pull request as ready for review April 6, 2026 19:36
@ralgar ralgar merged commit 13374b2 into main Apr 6, 2026
3 checks passed
@ralgar ralgar deleted the fix/validation-layers branch April 6, 2026 19:36
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