Commit 6cb6465
spirv-val: Allow ArrayStrideIdEXT on structs with descriptors (KhronosGroup#6705)
Per `SPV_EXT_descriptor_heap`, `ArrayStrideIdEXT` must be allowed on
arrays containing descriptor types. This includes composites that
contain descriptors, not only arrays whose element type is directly a
descriptor.
**Root Cause**:
The validator only checked whether the array element type itself was a
descriptor type.
For
[RuntimeArray<Material>](https://github.com/KhronosGroup/glslang/pull/4272/changes#diff-3142250076641bab8379f6637d480636190a14c9f31e0f7915cb4e76fc1d840e),
the direct element type is `OpTypeStruct`, so validation rejected it
even though `Material` contains `OpTypeBufferEXT`.
**Solution**:
Recursively inspect the array element type when validating
`ArrayStrideIdEXT`, so structs and other composites containing
descriptor types are accepted.
**Test**:
Added a validator regression test covering a runtime array of a struct
containing `OpTypeBufferEXT`.
Co-authored-by: guangxu2 <guangxu2@amd.com>1 parent 236bf64 commit 6cb6465
2 files changed
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
407 | 412 | | |
408 | 413 | | |
409 | | - | |
| 414 | + | |
410 | 415 | | |
411 | 416 | | |
412 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1563 | 1590 | | |
1564 | 1591 | | |
1565 | 1592 | | |
| |||
0 commit comments