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

ID3D12GraphicsCommandList.SetDescriptorHeaps with null #462

Open
MarcioAB opened this issue Oct 28, 2024 · 0 comments
Open

ID3D12GraphicsCommandList.SetDescriptorHeaps with null #462

MarcioAB opened this issue Oct 28, 2024 · 0 comments

Comments

@MarcioAB
Copy link

DebugLayer is showing the following error in ID3D12GraphicsCommandList.SetDescriptorHeaps:

Error
pDescriptorHeaps[0] is NULL but NumDescriptorHeaps is > 0.
To unset all descriptor heaps, pass 0 for NumDescriptorHeaps.

Below a simple code to reproduce the issue:

ID3D12DescriptorHeap d1 = default;  // <---- d1 = null
CL12.SetDescriptorHeaps(d1);  // <--- error

or

ID3D12DescriptorHeap d1 = new ID3D12DescriptorHeap(IntPtr.Zero);  // <--- d1 = null
CL12.SetDescriptorHeaps(d1);  // <--- error

I understand the related SetDescriptorHeaps code is this one, so it should work:

public unsafe void SetDescriptorHeaps(ID3D12DescriptorHeap? heap) {
    nint num = ((heap == null) ? IntPtr.Zero : heap.NativePointer);
    SetDescriptorHeaps(1u, &num);
}
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

1 participant