diff options
| author | Harsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com> | 2025-09-10 17:31:36 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-10 12:01:36 +0000 |
| commit | 3d0f5ee55788dca324641ae9268ee37dc4d7d9d5 (patch) | |
| tree | 71100ca80c7646853858cd4e244f971d6485ee6c /source/slangc | |
| parent | 2020a102e9e0ea2f39a0f2b2a75085c3607ce734 (diff) | |
CUDA: Fix compiler crash with unsized array field - nonuniformres-as-… (#8380)
…function-parameter.slang #8315
Root Cause:
CUDA compilation crashed with `assert failure:
!seenFinalUnsizedArrayField` because unsized arrays like
`RWStructuredBuffer<uint> globalBuffer[]` were not the final field in
generated parameter structs, violating the layout constraint in
slang-ir-layout.cpp.
Fix:
Extended `collectGlobalUniformParameters` to automatically reorder
struct fields for CUDA targets - regular fields first, unsized arrays
last. Other targets preserve original order.
Impact:
- Enables CUDA support for nonuniform resource indexing as function
parameters
- Zero impact on existing GLSL/HLSL/SPIRV targets
- Automatic handling - no manual parameter reordering required
Files: slang-emit.cpp, slang-ir-collect-global-uniforms.cpp/.h, test
file
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'source/slangc')
0 files changed, 0 insertions, 0 deletions
