I am trying to use 2 "D3D12_DESCRIPTOR_RANGE" in a root descriptor table,defined as follows:

//1st range 
D3D12_DESCRIPTOR_RANGE materialtablerange = {};
materialtablerange.OffsetInDescriptorsFromTableStart = 0;
materialtablerange.NumDescriptors = 1;
materialtablerange.RegisterSpace = 0;
materialtablerange.BaseShaderRegister = 1;
D3D12_DESCRIPTOR_RANGE* tableranges = new D3D12_DESCRIPTOR_RANGE[2];
//2nd range
D3D12_DESCRIPTOR_RANGE texturesrvrange = {};
texturesrvrange.BaseShaderRegister = 0;
texturesrvrange.RegisterSpace = 0;
texturesrvrange.NumDescriptors = -1;
texturesrvrange.OffsetInDescriptorsFromTableStart = 2;

So we have 1st range which specifies 1 srv and 2nd range which defines an unbound srv array. Unfortunately this does not seems to work as when I try to serialize the rootsignature via "D3D12SerializeRootSignature".I get "E_INVALIDARG" return code and error msg(from blob as following: "Shader register range of type SRV (root parameter [1], visibility PIXEL, descriptor table slot [1]) overlaps with another shader register range (root parameter[1], visibility PIXEL, descriptor table slot [0])." This issue seems to go away if I set NumDescriptors in 2nd range as 1.So I wanted to understand why these 2 ranges are raising an overlap error message in rootsignature Serialize and how to set it up properly,if possible?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.