Commit db3da9b
committed
Fix builtin direction validation to check per-entry-point usage
The BuiltinStorageClassDirectionRule was validating builtin directions
against ALL entry points in the module, but a builtin variable may only
be used by specific entry points.
For example, ClipDistance as Input is valid in Fragment shaders but not
in Vertex shaders. If a module has both entry points but ClipDistance is
only in the Fragment interface, validation should pass.
This fix builds a map of which entry points actually use each variable
(from the OpEntryPoint interface lists) and only validates builtin
direction against those specific entry points.
Added positive and negative tests for the fix.1 parent 64684ea commit db3da9b
2 files changed
Lines changed: 96 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
1097 | | - | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1098 | 1115 | | |
1099 | 1116 | | |
1100 | 1117 | | |
| |||
1141 | 1158 | | |
1142 | 1159 | | |
1143 | 1160 | | |
1144 | | - | |
1145 | | - | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
1146 | 1166 | | |
1147 | 1167 | | |
1148 | 1168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30413 | 30413 | | |
30414 | 30414 | | |
30415 | 30415 | | |
| 30416 | + | |
| 30417 | + | |
| 30418 | + | |
| 30419 | + | |
| 30420 | + | |
| 30421 | + | |
| 30422 | + | |
| 30423 | + | |
| 30424 | + | |
| 30425 | + | |
| 30426 | + | |
| 30427 | + | |
| 30428 | + | |
| 30429 | + | |
| 30430 | + | |
| 30431 | + | |
| 30432 | + | |
| 30433 | + | |
| 30434 | + | |
| 30435 | + | |
| 30436 | + | |
| 30437 | + | |
| 30438 | + | |
| 30439 | + | |
| 30440 | + | |
| 30441 | + | |
| 30442 | + | |
| 30443 | + | |
| 30444 | + | |
| 30445 | + | |
| 30446 | + | |
| 30447 | + | |
| 30448 | + | |
| 30449 | + | |
| 30450 | + | |
| 30451 | + | |
| 30452 | + | |
| 30453 | + | |
| 30454 | + | |
| 30455 | + | |
| 30456 | + | |
| 30457 | + | |
| 30458 | + | |
| 30459 | + | |
| 30460 | + | |
| 30461 | + | |
| 30462 | + | |
| 30463 | + | |
| 30464 | + | |
| 30465 | + | |
| 30466 | + | |
| 30467 | + | |
| 30468 | + | |
| 30469 | + | |
| 30470 | + | |
| 30471 | + | |
| 30472 | + | |
| 30473 | + | |
| 30474 | + | |
| 30475 | + | |
| 30476 | + | |
| 30477 | + | |
| 30478 | + | |
| 30479 | + | |
| 30480 | + | |
| 30481 | + | |
| 30482 | + | |
| 30483 | + | |
| 30484 | + | |
| 30485 | + | |
| 30486 | + | |
| 30487 | + | |
| 30488 | + | |
0 commit comments