Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are entryPoints namespaces per module or per stage per module? #1023

Closed
Kangz opened this issue Aug 24, 2020 · 5 comments
Closed

Are entryPoints namespaces per module or per stage per module? #1023

Kangz opened this issue Aug 24, 2020 · 5 comments
Labels
wgsl WebGPU Shading Language Issues
Projects
Milestone

Comments

@Kangz
Copy link
Contributor

Kangz commented Aug 24, 2020

When writing WGSL it is possible to define multiple entrypoints in a single module. However what's the constraint on entry point names? Obviously two entry points for the same stage can't have the same name, but are entry points allowed to have the same name when they are for different stages.

I think it would make sense to have a namespace per stage, WDYT?

@Kangz Kangz added the wgsl WebGPU Shading Language Issues label Aug 24, 2020
@dj2
Copy link
Member

dj2 commented Aug 24, 2020

I think we should restrict the API and WGSL to require different names per stage. So, essentially, names in a module must be unique. This is because for HLSL we just output the functions, and having multiple functions with the same name is going to be troublesome.

@kvark
Copy link
Contributor

kvark commented Aug 24, 2020

In SPIR-V they are namespaced per stage.

I think we should restrict the API and WGSL to require different names per stage. So, essentially, names in a module must be unique. This is because for HLSL we just output the functions, and having multiple functions with the same name is going to be troublesome.

If the HLSL backend needs to rename a few functions internally, this is no big deal, and totally transparent from the user.

However, if we force the names to be unique, converting from SPIR-V will not work for some of the modules.

@dj2
Copy link
Member

dj2 commented Aug 24, 2020

Good point, filed a bug in Tint to do the renaming in the HLSL backend.

@grorg grorg added this to For Next Meeting in WGSL Aug 25, 2020
@dneto0
Copy link
Contributor

dneto0 commented Sep 22, 2020

Discussed 2020-09-22

  • Decided to use the most restrictive rule: entry point names are in the same namespace as everything else.
  • We can revisit and relax this later if we like.

@dneto0 dneto0 added this to the post-MVP milestone Sep 22, 2020
@dneto0 dneto0 moved this from For Next Meeting to Under Discussion in WGSL Sep 22, 2020
@dneto0 dneto0 moved this from Under Discussion to Reconsider Post MVP in WGSL Sep 22, 2020
@dj2
Copy link
Member

dj2 commented Sep 22, 2020

Going to close this as I believe it just falls under the general function names must be unique rule so there is nothing to change here.

@dj2 dj2 closed this as completed Sep 22, 2020
WGSL automation moved this from Reconsider Post MVP to Done Sep 22, 2020
ben-clayton pushed a commit to ben-clayton/gpuweb that referenced this issue Sep 6, 2022
Additionally, extends `linearRange` and `biasedRange` to support arbitrary
inputs instead of requiring them to be in order, and adds some `kValue`
entries for f32 limits.
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
WGSL
Done
Development

No branches or pull requests

4 participants