Skip to content

Commit 1ad3478

Browse files
authored
adjust docs as per review (#7168)
1 parent ce238dd commit 1ad3478

File tree

1 file changed

+26
-32
lines changed

1 file changed

+26
-32
lines changed

docs/user-guide/03-convenience-features.md

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -604,23 +604,20 @@ When targeting SPIRV, Slang will introduce a global array of descriptors and fet
604604
The descriptor set ID of the global descriptor array can be configured with the `-bindless-space-index`
605605
(or `CompilerOptionName::BindlessSpaceIndex` when using the API) option.
606606

607-
Default behavior assigns the following binding-indicies to each descriptor type:
608-
```slang
609-
enum DefaultVkBindlessBindings : uint
610-
{
611-
Sampler = 0, /// SAMPLER
612-
CombinedTextureSampler = 1, /// COMBINED_IMAGE_SAMPLER
613-
Texture_Read = 2, /// SAMPLED_IMAGE
614-
Texture_ReadWrite = 3, /// STORAGE_IMAGE
615-
TexelBuffer_Read = 4, /// UNIFORM_TEXEL_BUFFER
616-
TexelBuffer_ReadWrite = 5, /// STORAGE_TEXEL_BUFFER
617-
Buffer_Read = 6, /// UNIFORM_BUFFER
618-
Buffer_ReadWrite = 7, /// STORAGE_BUFFER
619-
Unknown = 8, /// Other
620-
}
621-
```
622-
623-
`ACCELERATION_STRUCTURE` is excluded from the list of types since slang by default uses the provided handle to a `RaytracingAccelerationStructure` as a GPU address into the respective `RaytracingAccelerationStructure`, casting the 64bit handle into the type.
607+
Default behavior assigns binding-indicies based on descriptor types:
608+
| Enum Value | Vulkan Descriptor Type | Binding Index |
609+
|------------------------|-------------------------------------------|---------------|
610+
| Sampler | VK_DESCRIPTOR_TYPE_SAMPLER | 0 |
611+
| CombinedTextureSampler | VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER | 1 |
612+
| Texture_Read | VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE | 2 |
613+
| Texture_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_IMAGE | 3 |
614+
| TexelBuffer_Read | VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER | 4 |
615+
| TexelBuffer_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER | 5 |
616+
| Buffer_Read | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER | 6 |
617+
| Buffer_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER | 7 |
618+
| Unknown | Other | 8 |
619+
620+
> `ACCELERATION_STRUCTURE` is excluded from the list of types since Slang by default uses the handle to a `RaytracingAccelerationStructure` as a GPU address, casting the handle to a `RaytracingAccelerationStructure`. This removes the need for a binding-slot of `RaytracingAccelerationStructure`.
624621
625622
> #### Note
626623
> The default implementation for SPIRV may change in the future if SPIRV is extended to provide what is
@@ -671,7 +668,7 @@ interface IOpaqueDescriptor
671668
The user can call `defaultGetDescriptorFromHandle` function from their implementation of
672669
`getDescriptorFromHandle` to dispatch to the default behavior.
673670

674-
Additionally, `defaultGetDescriptorFromHandle` has the parameter `constexpr BindlessDescriptorOptions bindlessOptions`. This parameter provides some alternative presets for how bindless indexes are assigned (currently only relevant to SPIRV):
671+
Additionally, `defaultGetDescriptorFromHandle()` takes an optional argument whose type is `constexpr BindlessDescriptorOptions`. This parameter allows to specify alternative standard presets for how bindless-indexes are assigned. Note that this is currently only relevant to SPIRV:
675672
```slang
676673
public enum BindlessDescriptorOptions
677674
{
@@ -681,20 +678,17 @@ public enum BindlessDescriptorOptions
681678
```
682679

683680
`VkMutable` provides the following bindings for descriptor types:
684-
```slang
685-
enum VkMutableBindlessBindings : uint
686-
{
687-
Sampler = 0, /// SAMPLER
688-
CombinedTextureSampler = 1, /// COMBINED_IMAGE_SAMPLER
689-
Texture_Read = 2, /// SAMPLED_IMAGE
690-
Texture_ReadWrite = 2, /// STORAGE_IMAGE
691-
TexelBuffer_Read = 2, /// UNIFORM_TEXEL_BUFFER
692-
TexelBuffer_ReadWrite = 2, /// STORAGE_TEXEL_BUFFER
693-
Buffer_Read = 2, /// UNIFORM_BUFFER
694-
Buffer_ReadWrite = 2, /// STORAGE_BUFFER,
695-
Unknown = 3, /// Other
696-
}
697-
```
681+
| Enum Value | Vulkan Descriptor Type | Binding Index |
682+
|------------------------|-------------------------------------------|---------------|
683+
| Sampler | VK_DESCRIPTOR_TYPE_SAMPLER | 0 |
684+
| CombinedTextureSampler | VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER | 1 |
685+
| Texture_Read | VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE | 2 |
686+
| Texture_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_IMAGE | 2 |
687+
| TexelBuffer_Read | VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER | 2 |
688+
| TexelBuffer_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER | 2 |
689+
| Buffer_Read | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER | 2 |
690+
| Buffer_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER | 2 |
691+
| Unknown | Other | 3 |
698692

699693
The `kind` and `descriptorAccess` constants allows user code to fetch resources from different locations depending on the type and access of the resource being requested. The `DescriptorKind` and
700694
`DescriptorAccess` enums are defined as:

0 commit comments

Comments
 (0)