Skip to content

Conversation

@dneto0
Copy link
Contributor

@dneto0 dneto0 commented Feb 3, 2021

Fixes #1409

@dneto0 dneto0 requested review from dj2 and kvark February 3, 2021 21:54
@dneto0 dneto0 added the wgsl WebGPU Shading Language Issues label Feb 3, 2021
@dneto0 dneto0 added this to the MVP milestone Feb 3, 2021
wgsl/index.bs Outdated

An array element type must not be:

* The [=void=] type.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a laundry list.

I could have defined a new concept such as a "concrete" type.

However, I expect WGSL will soon have to support arrays of textures and arrays of samplers, so the category isn't going to be particularly stable.

These may only appear in specific contexts.<br>
</table>

An array element type must be one of:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this set of types is going to show up a lot. I.e. the same should apply to structure members, function arguments, etc. Can we have a common definition for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have two cases in this PR.

The closest analog in SPIR-V is "concrete" type. (That also covers a physical pointer, which is not in WSGL). I think we should keep an eye on this and if we get a lot more cases then we'll add a definition.

Define array and structure types in a positive sense.
(Use an allow-list of subtypes instead of a deny-list.)

Fixes gpuweb#1409
@dneto0
Copy link
Contributor Author

dneto0 commented Feb 16, 2021

Rebased to avoid merge conflicts.

@dneto0
Copy link
Contributor Author

dneto0 commented Feb 16, 2021

The change was approved in the WGSL meeting of 2021-02-16

@github-actions
Copy link
Contributor

Previews, as seen at the time of posting this comment:
WebGPU | IDL
WGSL
5056b0c

@dj2 dj2 merged commit 792e9f2 into gpuweb:main Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wgsl WebGPU Shading Language Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WGSL: limit types that can go into arrays and structs

3 participants