Bools are IO-shareable, but only for builtins#1246
Conversation
| * Values written as output for downstream processing in the pipeline, or to an output attachment. | ||
|
|
||
| Note: Only built-in pipeline inputs may have a boolean type. | ||
| A user data attribute input or output must not be of [=bool=] type or contain a [=bool=] type. |
There was a problem hiding this comment.
This reads strangely. Maybe A user input or output data attribure ..?
| Note: An [=IO-shareable=] type would also be host-shareable if it and its subtypes have | ||
| the approporate [=stride=] and [=offset=] attributes. | ||
| Note: An [=IO-shareable=] type *T* would also be host-shareable if *T* and its subtypes have | ||
| appropriate [=stride=] and [=offset=] attributes, and if *T* is not [=bool=] and did |
kvark
left a comment
There was a problem hiding this comment.
Why can't the user I/O data have bools? Do we have the relevant investigation somewhere?
|
|
And you probably wouldn't want to have WGSL give them a bit pattern (i.e. define bools as translating to OpTypeInt) unless you had 1-byte storage (not possible in core), otherwise they would waste bandwidth (at 4 bytes per bool). |
|
@kainino0x what you posted actually agrees with my question and contradicts @dneto0 's PR: it says Input and Output are valid storage classes for bools. Where does it say that Input and Output bools are only allowed for builtins? |
|
Discussed at the 2020-12-01 meeting. Resolution: Accept with the update. @kvark will file a post-MVP issue on relaxing the rule. |
d0c47c5 to
d157e69
Compare
|
I think I've addressed your feedback. PTAL @dj2 |
|
@kvark asked
OpTypeBool can't be on the pipeline input or output boundary because OpTypeBool does not have a concrete bit representation. There's this note in the SPIR-V spec:
(I'm looking for a more definitive statement in Vulkan...) |
|
Ah, here it is. From 15.1.2 User-defined Variable Interface
That excludes bool. |
|
Discussed in 2021-01-19 meeting
|
WGSL meeting minutes 2021-01-26
|
|
Ok, so there is agreement on the content. Now this PR just needs editorial review. |
This CL adds unimplemented stub tests for the `transpose` builtin. Issue: gpuweb#1246
Fixes #1244