diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2025-05-22 13:40:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-22 20:40:40 +0000 |
| commit | 1ad34781514a0b22ff48374b6de7ac1d3976f313 (patch) | |
| tree | 08a04e7851ad39e2d1ff5821dc43fa91408654f2 /docs/user-guide | |
| parent | ce238dd878038bf857968931773cc9b10f3b225d (diff) | |
adjust docs as per review (#7168)
Diffstat (limited to 'docs/user-guide')
| -rw-r--r-- | docs/user-guide/03-convenience-features.md | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/docs/user-guide/03-convenience-features.md b/docs/user-guide/03-convenience-features.md index 2c2eb6f42..5646292aa 100644 --- a/docs/user-guide/03-convenience-features.md +++ b/docs/user-guide/03-convenience-features.md @@ -604,23 +604,20 @@ When targeting SPIRV, Slang will introduce a global array of descriptors and fet The descriptor set ID of the global descriptor array can be configured with the `-bindless-space-index` (or `CompilerOptionName::BindlessSpaceIndex` when using the API) option. -Default behavior assigns the following binding-indicies to each descriptor type: -```slang -enum DefaultVkBindlessBindings : uint -{ - Sampler = 0, /// SAMPLER - CombinedTextureSampler = 1, /// COMBINED_IMAGE_SAMPLER - Texture_Read = 2, /// SAMPLED_IMAGE - Texture_ReadWrite = 3, /// STORAGE_IMAGE - TexelBuffer_Read = 4, /// UNIFORM_TEXEL_BUFFER - TexelBuffer_ReadWrite = 5, /// STORAGE_TEXEL_BUFFER - Buffer_Read = 6, /// UNIFORM_BUFFER - Buffer_ReadWrite = 7, /// STORAGE_BUFFER - Unknown = 8, /// Other -} -``` - -`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. +Default behavior assigns binding-indicies based on descriptor types: +| Enum Value | Vulkan Descriptor Type | Binding Index | +|------------------------|-------------------------------------------|---------------| +| Sampler | VK_DESCRIPTOR_TYPE_SAMPLER | 0 | +| CombinedTextureSampler | VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER | 1 | +| Texture_Read | VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE | 2 | +| Texture_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_IMAGE | 3 | +| TexelBuffer_Read | VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER | 4 | +| TexelBuffer_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER | 5 | +| Buffer_Read | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER | 6 | +| Buffer_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER | 7 | +| Unknown | Other | 8 | + +> `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`. > #### Note > The default implementation for SPIRV may change in the future if SPIRV is extended to provide what is @@ -671,7 +668,7 @@ interface IOpaqueDescriptor The user can call `defaultGetDescriptorFromHandle` function from their implementation of `getDescriptorFromHandle` to dispatch to the default behavior. -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): +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: ```slang public enum BindlessDescriptorOptions { @@ -681,20 +678,17 @@ public enum BindlessDescriptorOptions ``` `VkMutable` provides the following bindings for descriptor types: -```slang -enum VkMutableBindlessBindings : uint -{ - Sampler = 0, /// SAMPLER - CombinedTextureSampler = 1, /// COMBINED_IMAGE_SAMPLER - Texture_Read = 2, /// SAMPLED_IMAGE - Texture_ReadWrite = 2, /// STORAGE_IMAGE - TexelBuffer_Read = 2, /// UNIFORM_TEXEL_BUFFER - TexelBuffer_ReadWrite = 2, /// STORAGE_TEXEL_BUFFER - Buffer_Read = 2, /// UNIFORM_BUFFER - Buffer_ReadWrite = 2, /// STORAGE_BUFFER, - Unknown = 3, /// Other -} -``` +| Enum Value | Vulkan Descriptor Type | Binding Index | +|------------------------|-------------------------------------------|---------------| +| Sampler | VK_DESCRIPTOR_TYPE_SAMPLER | 0 | +| CombinedTextureSampler | VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER | 1 | +| Texture_Read | VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE | 2 | +| Texture_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_IMAGE | 2 | +| TexelBuffer_Read | VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER | 2 | +| TexelBuffer_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER | 2 | +| Buffer_Read | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER | 2 | +| Buffer_ReadWrite | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER | 2 | +| Unknown | Other | 3 | 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 `DescriptorAccess` enums are defined as: |
