Skip to content

add variable rasterization rate proposal - #6271

Closed
cabanier wants to merge 1 commit into
gpuweb:mainfrom
cabanier:VariableRasterizationRate
Closed

cabanier wants to merge 1 commit into
gpuweb:mainfrom
cabanier:VariableRasterizationRate

Conversation

@cabanier

Copy link
Copy Markdown
Contributor

Proposal for #450

@github-actions

github-actions Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (90c2694):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

should treat it as an optional performance feature. User agents may clamp requested rates upward or
disable the feature in contexts where exposing it is not appropriate.

## Open Questions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll add the proposal for discussion in the group. That said, right now it looks like VRS is fairly non-portable and potentially difficult to secure. We'll likely need a lot more work before it can make it in the spec.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you have a suggestion on how we could add this? I'd like to avoid adding another WebXR-only API like we did for WebGL...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mwyrzykowski doesn't Apple jump through some hoops to get this feature to work? If we can't have a WebGPU extension, would you be ok with a WebXR only solution?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you have a suggestion on how we could add this? I'd like to avoid adding another WebXR-only API like we did for WebGL...

Which one are you referring to?

TBH I don't know how we could make anything portable right now. Maybe using Vulkan subpasses to generate the density map from separable maps like in Metal? At least it would work the same on two implementations, but on the other hand IDK that it would be efficient in Vulkan in practice :/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which one are you referring to?

https://immersive-web.github.io/webxr/#dom-xrwebgllayer-fixedfoveation and https://immersive-web.github.io/layers/#dom-xrwebglbinding-foveateboundtexture

TBH I don't know how we could make anything portable right now. Maybe using Vulkan subpasses to generate the density map from separable maps like in Metal? At least it would work the same on two implementations, but on the other hand IDK that it would be efficient in Vulkan in practice :/

We get the density maps from OpenXR and I was going to expose those textures in WebXR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mmmh it wouldn't be ideal to add something so bespoke for WebXR. Wouldn't the density map from OpenXR be a privacy concern though?

@cabanier cabanier Jun 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. AFAIK the density maps are currently fixed in time but they left the door open to change it according to system pressure.
There is a feature to make it so the density reflects your eye gaze but there's currently no plan to expose that.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Density maps are a privacy concern if they track the user's gaze / head position, but there are also static density maps.

Currently Apple uses the:

attribute float? fixedFoveation;

to enable / disable foveation, but the map itself can not be configured.

I don't think we can override the compositor's foveation map on visionPro. I mean we can, but it is specific to the device.

It is unclear why the map is beneficial as opposed to the floating point or boolean even VRR on/off?

@cabanier cabanier closed this Jun 18, 2026
@mwyrzykowski

mwyrzykowski commented Jun 24, 2026 •

Copy link
Copy Markdown

Regarding the post-processing as discussed in the meeting - we could propose tile shaders as a WebGPU optional feature to avoid the additional pass which is not TBDR friendly :) I think all VRR headsets on the market are TBDR

@Kangz Kangz added this to the Milestone 3 milestone Jun 24, 2026
@Kangz

Kangz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
GPU Web WG 2026-06-24 Atlantic-time
  • CW: This was already closed…
  • RC: It sounds like this will be difficult to do portably. [...] We can do density maps under the hood, hack it into Dawn and use that instead.
  • CW: If the results are only observable to the user, then there’s no portability problems with it being variable-rasterization or whatever.
  • RC: There’s no privacy issue: foviation is fixed. Same for Apple.
  • CW: IF we wanted to make it completely unobservable what the foviation is, and then that would allow variable rasterization/shading rate/etc, we could do that by saying that the texture can only be a render attachment, and prevent usage of storage writes
  • JB: And copies as well?
  • CW: Yes. The texture from WebXR would be render-attachment only, and no other writable textures.
  • RC: Well, we’d like to be able to render to a multi-sampled texture.
  • CW: That’s all handled in the renderpass descriptor, so we can validate this.
  • RC: Can you still do multiple render passes, then?
  • CW: You would not be able to sample from the last render target.
  • RC: That was the problem we had with WebXR as well. People want to do post-processing on the texture they’d rendered to. Until recently that was not possible, although the API was changed recently to make it possible. I was not fond of the workarounds we had to do.
  • CW: It sounds like doing foviation magically in the implementation might not be any more complex than adding all this to the API
  • MW: For the WebXR case, we default to everything behind the scenes because there’s a specific foviation map we want to use, and if the user provides their own, it won’t match the device, and it’ll look lousy. We need to confirm that the density map as specified is actually supportable on all backends.
  • RC: I was going to propose enhancing WebXR/WebGPU, such that when you get the color texture, you also get the density map texture. Sites would not need to invent it themselves, they would get it form the browser. This can depend on the system load, sites don’t know how to do this themselves. WebXR would be providing these textures.
  • CW: The problem is, if you get the textures, then you can see the differences, which is a portability problem, and getting access to foviation might be bad on Apple.
  • RC: It’s fixed foviation, it’s not supposed to be eye-tracked.
  • MW: That’s right, it’s static foviation.
  • CW: It sounds like it’s going ot be a lot of work to define the foviation, and it’s not going to be portable, and it’s only going to be WebXR. Having the browser just do it for you behind the scenes seems better.
  • RC: Well, we’ve run into issues in the past. I don’t see how post-processing could work.
  • CW: Let’s chat offline about how that could potentially work in Chromium.
  • CW: Let’s revisit this topic when we have more details about whether it’s implementable.
  • AB: It would be a shame to miss out on the feature just because we see irreconcilable differences between variable rasterization rate and variable rate shading (VRR and VRS). Only Vulkan has both.
  • CW: I agree it’s an important feature, but I can’t justify Milestone 2.
  • JB: The vendors have a lot on their plates these days, so realistically we’re not going to be getting to this soon. Just calling it milestone 3 is more honest.
  • RC: Okay. We can find a way to do this behind the scenes for now, and add it to the API later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants