gpuweb / gpuweb

Where the GPU for the Web work happens!

Home Page:http://webgpu.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

const/override binary expression clarification.

Kangz opened this issue · comments

For example for division of signed integer there is the following:
image

It is unclear what should happen if "e1" is a const expression and e2 a pipeline overridable expression because const expressions are overridable expressions. I suggest rewording with trailing otherwises.

  • If e1 is most negative value in T, and e2 is -1:
    • It is a shader-creation error if e1 and e2 are const-expressions, otherwise
    • It is a pipeline-creation error if e1 and e2 are both override-expressions, otherwise
    • e1

It is unclear what should happen if "e1" is a const expression and e2 a pipeline overridable expression because const expressions are overridable expressions.

My reading was that it should be a pipeline-creation error (since const-expressions are also override-expressions).

Ah yes that case works, but const + const falls in both first conditions.

I believe that then gets covered by Each requirement [will](https://www.w3.org/TR/WGSL/#behavioral-requirements) be checked at the earliest opportunity. From https://www.w3.org/TR/WGSL/#errors

Thanks that solves it.