WGSL 2023 01 10 Minutes
Kelsey Gilbert edited this page Jan 11, 2023
·
1 revision
πͺ Chair: KG
β¨οΈπ Scribes: JB
πΊ Location: meet.google.com
β Time: (APAC) Tuesday **4-5pm **Americas/Los_Angeles
Specification: https://webgpu.dev/wgsl
Meeting Issues: Marked Issues
Open Issues: WGSL Issues, Outstanding V1 Issues+PRs, Untriaged WGSL issues
**Todos doc: **WGSL TODOs
Previous: 2022-12-13 WGSL - Agenda / Minutes
Note: These are the minutes taken in real-time. The official minutes can be found on the WebGPU wiki.
If you didn't receive a meet.google.com invitation and plan on participating, please send dneto a Google Apps enabled address and he'll add you.
WIP, the list of all the people invited to the meeting. In bold, the people that have been seen in the meeting:
- Apple
- Dan Glastonbury
- **Mike Wyrzykowski **
- Myles C. Maxfield
- Cocos
- Huabin Ling
- Zeqiang Li
- Zhenglong Zhou
- Connecting Matrix
- Muhammad Abeer
- Google
- Alan Baker
- Antonio Maiorano
- Ben Clayton
- Brandon Jones
- Corentin Wallez
- Dan Sinclair
- David Neto
- Ekaterina Ignasheva
- Kai Ninomiya
- James Price
- Rahul Garg
- Ryan Harrison
- Intel
- Hao Li
- Jia A Chen
- Jiajia Qin
- Jiawei Shao
- Narifumi Iwamoto
- Shaobo Yan
- Yang Gu
- Yunchao He
- Zhaoming Jiang
- Kings Distributed Systems
- Daniel Desjardins
- Hamada Gasmallah
- Wes Garland
- Microsoft
- Damyan Pepper
- Greg Roth
- Michael Dougherty
- Rafael Cintron
- Tex Riddell
- Mozilla
- Erich Gubler
- Jim Blandy
- Kelsey Gilbert
- Teodor Tanasoaia
- UC Santa Cruz
- Reese Levine
- Tyler Sorensen
- Unity
- Brendan Duncan
- Dominic Cerisano
- Dzmitry Malyshau
- Eduardo H.P. Souza
- Jeremy Sachs
- Joshua Groves
- Lukasz Pasek
- Matijs Toonen
- Mehmet Oguz Derin
- Michael Shannon
- Pelle Johnsen
- Robin Morisset
- Timo de Kort
- Tyler Larson
- Jason Erb
- Wednesday 10am-10:50am
- https://meet.google.com/xrp-hpck-vmy
- Everyone welcome
- Mass calendar invite will have been sent out
- If you still need an invite, add your email here:
- kelsey.gilbert@mozilla.com (example)
- If you still need an invite, add your email here:
- FYI: text/wgsl media type registration
- DN: No feedback from media-types@ietf.org. So I submitted the registration via form at https://www.iana.org/form/media-types
- DN: Have one feedback item: to reference WebGPU 2.2 privacy considerations. Will do.
- (Merged, but Myles had a follow-up question)
- MM: If you have a BGRA texture bound as a storage texture, in Vulkan this is impossible - it has to be polyfilled by attaching an RGBA texture, and then emitting additional instructions to do the swizzle
- AB: In D3D you have to have a packing instruction instead of a swizzle, and would load+unpack from an r32uint
- MM: I believe there is no shading language today where the swizzling is contained within the shading language itself, where the language itself makes a distinction between bgra and rgba textures. Is this true?
- AB: Not sure. In SPIR-V, I donβt think you write BGRA anywhere
- MM: The problem is that if someone has a shader in another language and they want to compile it to WGSL, then they have to divide up this information about whether itβs BGRA or RGBA. Can we avoid this? We could force the person to add this information in order to produce WGSL, but what would it take to make it unnecessary for them to add this information? And for the texture types that do require additional instructions, could we unconditionally have the instructions around the store, but predicated on some other contextual information, so that the side channel information could be provided at compile time, and used to either swizzle or not swizzle (hopefully without a branch). Was this considered in Nov/Dec?
- DN: When compiling from a different language, if the other shading language doesnβt distinguish between BGRA8 or RGBA8, then why not always unconditionally map it to the RGBA8unorm? Isnβt that viable?
- MM: Suppose you have a two-pass algorithm: first pass renders into a BGRA texture, using a rendertarget. That writes data 1,2,3,4. Then you have a second pass algorithm that attaches that output as a storage texture, and you read from it. Ideally, youβd want that read to also be 1,2,3,4. That seems to fall down.
- AB: Right now we donβt do storage reads. We do texel loads. We swizzle on write, so when you sample later, itβll get the right components. I think all this was predicated on the idea that it was a performance benefit on Metal to expose the BGRA. IS that actually the case?
- MM: Itβs important that the results of this discussion arenβt, letβs remove BGRA, because our compositor canβt handle RGBA, so we want it to at least be possible for a WebGPU impl to produce an BGRA texture, so we donβt always have to do a blit. Thatβs why thereβs a performance concern. The perf of loads and stores in a shader isnβt the issue.
- KG: Can we say storage is always rgba8unrom?
- MM: Alternate: shader lang doesnβt say itβs rgba or bgra, and be able to bind either kind to your shader. Then have your shader be flexible with that runtime side channel flag.
- AB: We require a format in the shader for storage texture. So youβre saying always require that to say rgba8 but then exploit side channel to conditionalize the swizzle in the shader code.
- MM: Benefit is for the shader porter. Move the burden to the API implementor.
- AB: Donβt have enough context. Not sure itβs (...missed this).
- BC: Are there other formats that require swizzling in the shader? So this new magic thing would apply to this format.
- MM: Yes.
- BC: Feels a bit funky. What we have is very explicit. The API to the shader is 1-1 mapping.
- AB: We discussed about loosening the validation on the API side, and allow binding either. But API folks decided intentionally to not allow that.
- MM:Ok, Glad it was explicitly discussed. Wanted to make sure it was on the table.
- DN: JP has coded it up, but we need to go write it down for the spec still. Weβre happy with the semantics though.
Language evolution https://github.com/gpuweb/gpuweb/issues/3149
- AB: I recall, a while back Myles had queued up discussion points around this issue. Would like to hear them if available. Google has expressed an opinion (e.g. high water mark of used features).
- MM: Donβt have queued up issues. Did post to the issue last night.
- AB: When weβve discussed the JavaScript model internally. On the API side, querying when things exist or not makes sense. On the shader side it doesnβt seem great to do a bunch of compile-fail. We agree with overall major point: donβt want version hell.
- MM: True the βversion hellβ is our primary concern. The larger model is concern #2.
- AB: Definitely agree with the major concern.
- KG: Hard to tell lessons learned from WebGL, WebGL 2. While we do have version declarations in the GLSL that are not strictly compatible; but perhaps itβs not too onerous?
- MM: Can speak more why about the primary concern. First, itβs way easier to maintain compiler if you donβt have to maintain all the version layers. (So benefit to us, to reduce complexity). For developer learning, searching for tutorial for WebGL, many of them are very old.
- KG: Does that not run counter to the desire that whatever is on tip is the βreal oneβ. Isnβt it a benefit to see βah, this example is oldβ.
- MM: E.g. look for GLSL tutorial that may say βvaryingβ. Would like the JS model where wouldnβt break backward compatibility.
- DN: Isnβt that concern about breaking backward compatibility?
- AB: Really the concern is when introducing new things that are close to old functionality. Donβt want 50 ways to do very similar things.
- MM: Can see βdo we have version numbersβ is distinct from βchanging keywordβ. But I will just make the observation that GLSL started with version numbers, and then felt free to rename keywords.
- KG: Can agree we should agree itβs bad to rename keywords. Iβm not particularly concerned about slipping up: when we might do it, restate the argument, and itβs compelling.
- Can think more, but nothing concrete to conclude in this meeting today.
- DN: From someone at Google who tried a bunch of things that work in Rust that donβt work in Tint. For formal argos to user funcs, they are instantiated when they are declared, so e.g. i32: i32) -> i32 validates βweirdβ because the return type/ident comes after the formal param named
i32
. - JB: Isnβt e.g. i32 an ident keyword? Wouldnβt that not be able to be an ident?
- DN: Weβre agreed to allow that, just not in the spec yet.
- BC: FWIW I did have to replace i32 with a type alias, but the main point still stands
- JB: We like this.
- MM: Neutral on this.
- KG: Only thing that comes to mind is e.g. c++ template pattern like <typename T, T U>.
- JB: It seems unlikely that you want to write this, but if you did, it does feel weird that itβs forbidden.
- Resolved accept
- Also:
- JB: Are there really two PRs? Would be nice to reduce to one, if so.
- DN: [yes?]
- DN: Briefly, uniformity issues are an error in compute shaders, but only a diagnostic (soft) error for fragment shaders. [...]
- Uniformity failure triggers a diagnostic
- Diagnostic is can be filtered
- But if not filtered by default then it produces a shader creation error.
- MM: So the opt-out is for disabling the diagnostic, not modifying the dataflow through the graph?
- DN: Yes
- JB: Do I understand that the reason for collecting these sets, when we have a user-def function, we have the detail to attribute the error to specific builtin calls in the user-def funcs?
- DN: Yes, we donβt want to have to go back and re-calculate this
- JB: I would like another week to better understand the language used here.
- DN: In real life, youβd construct this differently anyway.
- JB: Doesnβt that not work, because the analysis needs to match?
- DN: If you turn off the error, then it canβt cause an error, so you might as well not emit that edge.
- JB: But in terms of how we assign tags to funcs, diag tags have no applicability to [...]
- DN: [...]
- DN: The obvious thing to do in an implementation,
- KG: Would prefer to have pseudocode that implementors implement rather than spec language that is different from how it should be implemented.
- AB: The modifications david was referring to is good for turning something βoffβ. But not great for different levels of βwarnβ, βinfoβ, βerrorβ. So it depends on the maximum severity that may be in effect.
- MM: Nitpick: It would be nice if we referred to these by the [class of] builtin that they are, rather than the type of shader. [imagine if we added workgroup to frag shaders]
- MM: We are discussing with our HW team about how bad it is to get derivative stuff wrong.
- JB: If itβs βbad derivatives are a disasterβ, then we have trouble
- MM: Just trying to reflect our harsh realities.
- AB: Regardless of where that lands, this is two things, one is opting out, other is introducing a way to talk about severity of diagnostics.
- MM: Sounds legit. We donβt have opinions about details about opting out of UnAn. Mechanism for quieting the error seems fine, weβre mostly concerned about security here.
- DN: Sounds like weβre on the same page.
- MM: What happens if you try to opt out of UnAn in a compute shader.
- DN: Only opt-out is actually for
derivative-uniformity
as an attribute, so it wouldnβt apply. - MM: sounds like we should warn if itβs used where it doesnβt make sense.
- KG: UAs are allowed to emit warnings!
- Resolved: Write more and better spec text.
- Next week: (non-APAC!) Tuesday, January 17, 11a-noon (America/Los_Angeles)
- F2F is in San Francisco Bay Area. Specific host to be determined.
- See email: Feb 16, 17. Intended to be in person, but definitely have remote options.
- Roughly each day is: 2 blocks 4 hours morning and afternoon. Lunch together.