Skip to content

Commit 3f03d48

Browse files
Tighten unified-stride doc/help wording: conflict is with a non-zero stride (#11723)
diagnoseConflictingDescriptorHeapStrideOptions() raises E57006 only when SPIRVResourceHeapStride != 0; an explicit `-spirv-resource-heap-stride 0` selects the same default OpConstantSizeOfEXT path that the unified option modifies and is accepted. Correct the option help text, the slang.h enumerator doc comment, and all three user-facing doc surfaces to say the unified option is mutually exclusive with a non-zero -spirv-resource-heap-stride (combining the two is the error), rather than overstating that supplying the resource-heap-stride option at all conflicts.
1 parent 14f5d62 commit 3f03d48

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

docs/command-line-slangc-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ Specify the byte stride for the sampler descriptor heap when generating SPIRV wi
646646

647647
<a id="spirv-unified-descriptor-heap-stride"></a>
648648
### -spirv-unified-descriptor-heap-stride
649-
When generating SPIRV with spvDescriptorHeapEXT, emit each resource descriptor-heap runtime array's ArrayStride as the maximum of image and buffer descriptor sizes, so a single heap shared by buffers and images is indexed at the device's unified stride. Only affects the OpConstantSizeOfEXT default path (when no explicit [-spirv-resource-heap-stride](#spirv-resource-heap-stride) is given); mutually exclusive with [-spirv-resource-heap-stride](#spirv-resource-heap-stride) (supplying both is an error). Does not affect the sampler heap or acceleration-structure entries.
649+
When generating SPIRV with spvDescriptorHeapEXT, emit each resource descriptor-heap runtime array's ArrayStride as the maximum of image and buffer descriptor sizes, so a single heap shared by buffers and images is indexed at the device's unified stride. Only affects the default OpConstantSizeOfEXT path (used when [-spirv-resource-heap-stride](#spirv-resource-heap-stride) is 0); mutually exclusive with a non-zero [-spirv-resource-heap-stride](#spirv-resource-heap-stride) (combining the two is an error). Does not affect the sampler heap or acceleration-structure entries.
650650

651651

652652
<a id="separate-debug-info"></a>

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,9 +709,10 @@ acceleration-structure entries, an explicit resource heap stride must be at leas
709709
Alternatively, the `-spirv-unified-descriptor-heap-stride` option makes every resource descriptor-heap
710710
runtime array use a single shared stride equal to the maximum of the image and buffer descriptor sizes,
711711
so a heap that holds both buffers and images is indexed at the device's unified stride regardless of which
712-
descriptor type a particular shader accesses. This affects only the default `OpConstantSizeOfEXT` path, so
713-
it is mutually exclusive with `-spirv-resource-heap-stride` (supplying both is an error). The sampler heap
714-
and acceleration-structure entries are unaffected.
712+
descriptor type a particular shader accesses. This affects only the default `OpConstantSizeOfEXT` path
713+
(used when `-spirv-resource-heap-stride` is 0), so it is mutually exclusive with a non-zero
714+
`-spirv-resource-heap-stride` (combining the two is an error). The sampler heap and acceleration-structure
715+
entries are unaffected.
715716

716717
> **Note on `RaytracingAccelerationStructure`:** When the `spvDescriptorHeapEXT` capability is active and
717718
> a `DescriptorHandle<RaytracingAccelerationStructure>` is dereferenced, Slang loads a 64-bit device address

docs/user-guide/08-compiling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ meanings of their `CompilerOptionValue` encodings.
10911091
| ValidateUniformity | When set will perform [uniformity analysis](a1-05-uniformity.md).|
10921092
| SPIRVResourceHeapStride | Specifies the byte stride for the resource descriptor heap when generating SPIR-V with `spvDescriptorHeapEXT`. `intValue0` encodes the stride in bytes; use 0 to emit `OpConstantSizeOfEXT(ResourceType)` as the default stride. For `RaytracingAccelerationStructure` entries, the 0 default emits a literal 8-byte `ArrayStride` for the `uint64` device address elements; explicit stride values still override these defaults, but must be at least 8 bytes for acceleration-structure entries. |
10931093
| SPIRVSamplerHeapStride | Specifies the byte stride for the sampler descriptor heap when generating SPIR-V with `spvDescriptorHeapEXT`. `intValue0` encodes the stride in bytes; use 0 to let the driver compute the stride via `OpConstantSizeOfEXT`. |
1094-
| SPIRVUnifiedDescriptorHeapStride | When generating SPIR-V with `spvDescriptorHeapEXT`, emits each resource descriptor-heap runtime array's `ArrayStride` as the maximum of the image and buffer descriptor sizes, so a single heap shared by buffers and images is indexed at the device's unified stride. Only affects the default `OpConstantSizeOfEXT` path; mutually exclusive with `SPIRVResourceHeapStride` (supplying both is an error). Does not affect the sampler heap or acceleration-structure entries. `intValue0` specifies a bool value for the setting. |
1094+
| SPIRVUnifiedDescriptorHeapStride | When generating SPIR-V with `spvDescriptorHeapEXT`, emits each resource descriptor-heap runtime array's `ArrayStride` as the maximum of the image and buffer descriptor sizes, so a single heap shared by buffers and images is indexed at the device's unified stride. Only affects the default `OpConstantSizeOfEXT` path (used when `SPIRVResourceHeapStride` is 0); mutually exclusive with a non-zero `SPIRVResourceHeapStride` (combining the two is an error). Does not affect the sampler heap or acceleration-structure entries. `intValue0` specifies a bool value for the setting. |
10951095
| ForceDXLayout | When set forces the compiler to use DirectX-compatible (HLSL register packing) rules when laying out buffer struct fields during code generation. `intValue0` specifies a bool value for the setting. |
10961096
| ForceCLayout | When set forces the compiler to use C struct layout rules (natural alignment, no HLSL/GLSL padding) when laying out buffer struct fields during code generation. `intValue0` specifies a bool value for the setting. |
10971097
| DenormalModeFp16 | Specifies how 16-bit floating-point denormal values are handled. `intValue0` encodes a value from the `SlangFpDenormalMode` enum. |

include/slang.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,8 @@ typedef uint32_t SlangSizeT;
12071207
153, // bool: when set, emit each SPIRV resource descriptor-heap runtime array's
12081208
// ArrayStride as the maximum of image and buffer descriptor sizes, so a
12091209
// single heap shared by buffers and images is indexed at the device's unified
1210-
// stride. Opt-in; mutually exclusive with an explicit
1211-
// `-spirv-resource-heap-stride <N>` (supplying both is an error).
1210+
// stride. Opt-in; mutually exclusive with a non-zero
1211+
// `-spirv-resource-heap-stride` (combining the two is an error).
12121212

12131213
CountOf,
12141214
};

source/slang/slang-options.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,10 +931,9 @@ void initCommandOptions(CommandOptions& options)
931931
"When generating SPIRV with spvDescriptorHeapEXT, emit each resource descriptor-heap "
932932
"runtime array's ArrayStride as the maximum of image and buffer descriptor sizes, so "
933933
"a single heap shared by buffers and images is indexed at the device's unified stride. "
934-
"Only affects the OpConstantSizeOfEXT default path (when no explicit "
935-
"-spirv-resource-heap-stride is given); mutually exclusive with "
936-
"-spirv-resource-heap-stride (supplying both is an error). Does not "
937-
"affect the sampler heap or acceleration-structure entries."},
934+
"Only affects the default OpConstantSizeOfEXT path (used when -spirv-resource-heap-stride "
935+
"is 0); mutually exclusive with a non-zero -spirv-resource-heap-stride (combining the two "
936+
"is an error). Does not affect the sampler heap or acceleration-structure entries."},
938937
{OptionKind::EmitSeparateDebug,
939938
"-separate-debug-info",
940939
nullptr,

0 commit comments

Comments
 (0)