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

Proposal: "auto" layout algorithm should be able to generate any layout #4956

Open
kainino0x opened this issue Nov 7, 2024 · 2 comments
Open
Labels
api WebGPU API proposal wgsl WebGPU Shading Language Issues
Milestone

Comments

@kainino0x
Copy link
Contributor

kainino0x commented Nov 7, 2024

Currently the "auto" layout algorithm makes a few assumptions about what layout to generate, which means if those assumptions are wrong for your application, you're forced to use a explicit layout. At least the following aren't achievable - not sure if I'm missing any:

  1. "non-filtering" samplers (would be partially but not entirely fixed by Change layout: 'auto' algorithm so it doesn't generate invalid bindGroupLayouts #4952)
  • and "unfilterable-float" bindings to go with them

Also the following, but I believe they don't matter because of auto layout exclusivity (EDIT: however they become important with #4957!):

  1. "float" when there are no usages with a sampler (it picks "unfilterable-float")
  2. "depth" when the shader type is non-depth (texture_2d<f32> etc.)
@kainino0x kainino0x added the api WebGPU API label Nov 7, 2024
@kainino0x kainino0x added this to the Milestone 1 milestone Nov 7, 2024
@kainino0x kainino0x added the wgsl WebGPU Shading Language Issues label Nov 7, 2024
@kainino0x
Copy link
Contributor Author

A simple proposal for 1 and 2 is to allow @filter(true) and @filter(false) on both sampler and texture bindings which choose between "filtering"/"float" and "non-filtering"/"unfilterable-float".

For 3, something like texture_2d<depth> or @depth texture2d<f32>?

@kainino0x kainino0x changed the title "auto" layout algorithm should be able to generate any layout Proposal: "auto" layout algorithm should be able to generate any layout Nov 7, 2024
@kdashg
Copy link
Contributor

kdashg commented Nov 19, 2024

WGSL 2024-11-19 Minutes
  • KG: We didn’t have much time to go over this, so we need more time to give it more thought.
  • ds: Some things we need, like unfilterable-floats, so if we give a way to say so, we wouldn’t have to guess in our implementation.
  • (no resolution today)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api WebGPU API proposal wgsl WebGPU Shading Language Issues
Projects
None yet
Development

No branches or pull requests

2 participants