Skip to content
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

ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart has incorrect signature which results in segfault #16

Open
dcov opened this issue Jan 3, 2023 · 1 comment

Comments

@dcov
Copy link

dcov commented Jan 3, 2023

After a quick search I found this article explaining the issue: https://joshstaiger.org/notes/C-Language-Problems-in-Direct3D-12-GetCPUDescriptorHandleForHeapStart.html

The gist of it being that instead of returning a D3D12_CPU_DESCRIPTOR_HANDLE, it takes an 'out' pointer parameter.

And indeed applying the fix works:

const GetCPUDescriptorHandleForHeapStart = @ptrCast(
    *const fn (
        self: *const ID3D12DescriptorHeap,
        out: ?*D3D12_CPU_DESCRIPTOR_HANDLE,
    ) callconv(WINAPI) void,
    heap.vtable.GetCPUDescriptorHandleForHeapStart
);

I'm guessing this is an issue with the win32metadata, but I'm fine with the workaround so there's no rush on my end to fix it.

@marler8997
Copy link
Contributor

I think this is a manifestation of #6

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

No branches or pull requests

2 participants