Using multiple Descriptor Heaps of the same type (SRV_CBV_UAV) with SetDescriptorHeaps possible?

Started by
3 comments, last by Anthom 8 years, 8 months ago

Its really noticable, that the d3d12 examples only use one descriptor heap for all srv's and cbv's (+ maybe another sampler heap). So i thought i try to split that into 2 heaps, one for srv and one for cbv.

Ive made a stackoverflow question documenting my failed try: http://stackoverflow.com/questions/32114174/directx-12-how-to-use-commandlist-with-multiple-descriptor-heaps

Maybe i missed something in the documentation like "only one descriptor heap per type per commandlist allowed"?

Advertisement

And I've asked whether you've enabled the debug layer yet.

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

Thanks for the hint ajmiles.

Seems like my suspicion was right. After enabling the debug layer, i got the following output:

D3D12 ERROR: ID3D12CommandList::SetDescriptorHeaps: pDescriptorHeaps[1] sets a descriptor heap type that appears earlier in the pDescriptorHeaps array. Only one of any given descriptor heap type can be set at a time. [ EXECUTION ERROR #554: SET_DESCRIPTOR_HEAP_INVALID] D3D12 ERROR:

So only one Descriptor Heap for each Heap Type (SRV_CBV_UAV or SAMPLER) can be set at the same time!

So the way to go is to have one big descriptor heap that can store all the needed descriptors. (at least for each commandlist)

As per my last comment, you can use multiple descriptor heaps throughout the command list, just not on a single draw.

SetDescriptorHeaps can set either:

a) 1 CBV/SRV/UAV heap

b) 1 Sampler heap

c) 1 CBV/SRV/UAV heap and 1 sampler heap.

Thus the only valid values for "NumDescriptorHeaps" are 1 and 2. By all means change them regularly though within the command list.

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

thanks, that clarified it for me.

This topic is closed to new replies.

Advertisement