[clang] [Doc][HLSL] Add documentation for root signature. (PR #83933)

David Peixotto via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 29 13:31:37 PDT 2024


dmpots wrote:

I did not see any discussion of local root signatures here. It is probably good to consider those as well when thinking about this design. There is alternate syntax for specifying both local root signatues and global root signatures starting in SM 6.3

https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-state-object

https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-state-object#globalrootsignature
```
GlobalRootSignature MyGlobalRootSignature =
{
    "DescriptorTable(UAV(u0)),"                     // Output texture
    "SRV(t0),"                                      // Acceleration structure
    "CBV(b0),"                                      // Scene constants
    "DescriptorTable(SRV(t1, numDescriptors = 2))"  // Static index and vertex buffers.
};
```

https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-state-object#localrootsignature
```
LocalRootSignature MyLocalRootSignature = 
{
    "RootConstants(num32BitConstants = 4, b1)"  // Cube constants 
};
```

https://github.com/llvm/llvm-project/pull/83933


More information about the cfe-commits mailing list