Root Signature Descriptor Ranges & Registers

Started by
1 comment, last by Riko Ophorst 7 years, 5 months ago

In D3D12 you can set a root parameter in a root signature to be a descriptor table, which is just a collection of descriptor ranges.

A descriptor range is just a typed list of descriptors. You set which shader register the descriptor range sits in with D3D12_DESCRIPTOR_RANGE::BaseShaderRegister, however I am wondering what happens to all the other descriptors in the range? What register are they put into? Just the BaseShaderRegister + the current descriptor in the range?

So say I have a descriptor range like this:


D3D12_DESCRIPTOR_RANGE range;
range.RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV;
range.NumDescriptors = 7;
range.BaseShaderRegister = 2;
range.RegisterSpace = 0;
range.OffsetInDescriptorsFromTableStart = 0;

Can I then assume that the descriptors will be placed in registers 2 to 8?

So I would be able to access them like this in HLSL?


Texture2D texture01 : register(t2);
Texture2D texture02 : register(t3);
Texture2D texture03 : register(t4);
Texture2D texture04 : register(t5);
Texture2D texture05 : register(t6);
Texture2D texture06 : register(t7);
Texture2D texture07 : register(t8);

Are my assumptions correct?

Advertisement

Yes, that's correct.

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

Yes, that's correct.

I don't know what I was expecting.. Thanks I guess :)

This topic is closed to new replies.

Advertisement