Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

SenorBlanco
Copy link
Contributor

@SenorBlanco SenorBlanco commented Dec 12, 2024

Naming these now will allow Core-only browsers to safely support all Compatibility mode extensions.

A non-exhaustive effort was made to explore OpenGL extension support for these features.

EDIT: cc #4987

Copy link
Contributor

github-actions bot commented Dec 12, 2024

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

Copy link
Contributor

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

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

Mostly bikeshedding.

Fewer restrictions than I realized that relate to specific texture formats. Though it is possible that some of these capabilities could be format dependent (depth formats in particular)


**Justification**: GLSL ES 3.1 (section 4.4.7, "Format Layout Qualifiers") does not permit any two-component (RG) texture formats in a format layout qualifier.

Feature: `storage-texture-rg`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible that we would need to be able to expose these separately, some hardware might have rg32float but not rg32uint/rg32sint or vice versa. Not sure how likely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted.

If we did that, though, it'd be tempting to split up depth-texture-load and depth-texture-sample into the explicit depth formats. But that's a lot of features.

@teoxoy
Copy link
Member

teoxoy commented Dec 12, 2024

Do we need to add features for things that we know won't change (for example the proposed: texture-views, provoking-vertex-first, texture-depth-load, texture-depth-sample, texture-format-reinterpretation)? Or even for things that are not wildly available? I'm worried that the feature matrix is getting more and more complex (in theory, not in practice).

I guess it's probably ok in the end and it might work better from the spec's point of view as we won't need special handling for compat, only talk about if feature X exists then Y.

I wish we had a non-normative doc that can give devs a rough idea of how available features are (and maybe even common ranges for limits).

@SenorBlanco
Copy link
Contributor Author

SenorBlanco commented Dec 12, 2024

Do we need to add features for things that we know won't change (for example the proposed: texture-views, provoking-vertex-first, texture-depth-load, texture-depth-sample, texture-format-reinterpretation)? Or even for things that are not wildly available?

I haven't checked, but D3D11 might be able to support these features, even if OpenGL ES can't.

I'm worried that the feature matrix is getting more and more complex (in theory, not in practice).

It's a good point. The concern in the meeting was that folks might start using the Features we'd agreed upon (e.g., float32-renderable) in Compat code, and if Core-only browsers didn't add support to recognize them now, such content would break until a new version of the Core-only browser shipped. By naming them all now, we give ourselves the chance to ship the features in Compat in future without breaking Core-only browsers.

I guess it's probably ok in the end and it might work better from the spec's point of view as we won't need special handling for compat, only talk about if feature X exists then Y.

I wish we had a non-normative doc that can give devs a rough idea of how available features are (and maybe even common ranges for limits).

Copy link

@mwyrzykowski mwyrzykowski left a comment

Choose a reason for hiding this comment

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

Looks good overall, waiting for next update to ✅

@kainino0x
Copy link
Contributor

kainino0x commented Dec 12, 2024

In addition to D3D11, there could also be Vulkan 1.0 devices that support Compat without supporting Core.

I'm worried that the feature matrix is getting more and more complex (in theory, not in practice).

I also don't love that, and am still a bit concerned that we need to commit to the granularity on a relatively short deadline. I'll put in a plug again for being able to defer these decisions if we use hasCompatibilityFeature()/requiredCompatibilityFeatures. 🙂

@mwyrzykowski
Copy link

I also don't love that, and am still a bit concerned that we need to commit to the granularity on a relatively short deadline. I'll put in a plug again for being able to defer these decisions if we use hasCompatibilityFeature()/requiredCompatibilityFeatures. 🙂

We could prefer to be overly granular for now and remove features later before the compat specification reaches CR. There is little harm for example in saying we reserve K * 10 names for features but then only K make it into the specification.

Naming these now will allow Core-only browsers to safely support all
Compatibility mode extensions.

A non-exhaustive effort was made to explore OpenGL extension support
for these features.
@SenorBlanco
Copy link
Contributor Author

I also don't love that, and am still a bit concerned that we need to commit to the granularity on a relatively short deadline. I'll put in a plug again for being able to defer these decisions if we use hasCompatibilityFeature()/requiredCompatibilityFeatures. 🙂

I worry that this is yet another wart that is going to be difficult to unship.

Also, I'm wondering how this scales to future featureLevels. E.g., for featureLevel Whizbang, Would we need to add hasWhizbangFeature() / requiredWhizbangFeatures()? Or is there something Compat-specific about this issue?

@mwyrzykowski
Copy link

mwyrzykowski commented Dec 17, 2024

@SenorBlanco @kainino0x I suppose it is really necessary we know all the feature and limit names right now?

We do have readonly attribute DOMstring featureLevel; being added to the GPUAdapter in #5012 so a site could check the featureLevel prior to requesting certain compat features as a way to work around this issue? Then we can take our time with names for compat mode and any site which does run into this issue could be directed to featureLevel detection to workaround the browser not stating they support a compat feature which they should on core.

@kainino0x
Copy link
Contributor

I worry that this is yet another wart that is going to be difficult to unship.

We would not unship hasCompatibilityFeature(). requiredCompatibilityFeature can be trivially unshipped since it is ignored on core adapters anyway.
IMO hasCompatibilityFeature() is a much smaller wart than 10ish feature names that will always show up in both adapter.features and device.features.

Also, I'm wondering how this scales to future featureLevels. E.g., for featureLevel Whizbang, Would we need to add hasWhizbangFeature() / requiredWhizbangFeatures()? Or is there something Compat-specific about this issue?

I think the analogous situation is we've already shipped whizbang and some browser is removing core by upgrading it to whizbang. However (1) all of the core-based features will already be using features/requiredFeatures so we can't consider moving them to hasCoreFeature()/requiredCoreFeatures and (2) all major browsers will have shipped core already so won't be shipping whizbang without having ever implemented core.

We do have readonly attribute DOMstring featureLevel; being added to the GPUAdapter in #5012 so a site could check the featureLevel prior to requesting certain compat features as a way to work around this issue? Then we can take our time with names for compat mode and any site which does run into this issue could be directed to featureLevel detection to workaround the browser not stating they support a compat feature which they should on core.

I don't think this adds anything. Technically that pattern works for the situation where safari ships core before chrome ships compat, but (as someone other than me pointed out) there's also the situation where chrome has already shipped compat and wants to add some new more-fine-grained compat feature. This won't work during the transition period where both old and new instances of chrome are running in the wild.

Anyway, I don't think there's any need for this. If we're relying on sites to get it right anyway, they should just check adapter.features.has('late-breaking-compat-feature') before setting requiredFeatures: ['late-breaking-compat-feature']. This works in both situations, and we tell people to do this already, and we enforce it by rejecting requestDevice() to indicate a programming error.

hasCompatibilityFeature()/requiredCompatibilityFeatures retains the portability risk for old vs new chrome, but eliminates the portability risk of chrome vs safari (for this specific problem). I think.

@SenorBlanco
Copy link
Contributor Author

@SenorBlanco @kainino0x I suppose it is really necessary we know all the feature and limit names right now?

We do have readonly attribute DOMstring featureLevel; being added to the GPUAdapter in #5012 so a site could check the featureLevel prior to requesting certain compat features as a way to work around this issue? Then we can take our time with names for compat mode and any site which does run into this issue could be directed to featureLevel detection to workaround the browser not stating they support a compat feature which they should on core.

Sure. If we're ok with relying on Compat applications to do feature detection via adapter.featureLevel == 'core' || features.has('feature') in the interim, there's no rush to name the features. We can discuss it in upcoming meetings.

@Kangz
Copy link
Contributor

Kangz commented Jan 27, 2025

GPU Web WG 2025-01-22 Atlantic-time
  • SW:
  • JB: Mozilla worries that some of the changes we’re looking at right now in this area are in the area of diminishing returns. We worry that the impact will be diminished because people use it incorrectly.
    • We’ve already done a massive expansion of the reach of webgpu api via compat, and that’s valuable. But adding too many corners of the API here for compat users to be yet more perfect is becoming not worth it.
  • SW: So you’re in favor though of Add and name Features for all Compat Mode limitations. #5018 and Compatibility Mode: update to use featureLevel. #5012, but not going further?
  • JB: Yes. Rather, I’m happy with no further change. If people want that, Mozilla is ok with that.
  • [Discussing other topics first]

@kainino0x kainino0x added the compat WebGPU Compatibility Mode label Jan 30, 2025
@Kangz
Copy link
Contributor

Kangz commented Feb 18, 2025

GPU Web WG 2025-01-29 Atlantic-time
* JB: Now no need to list all of these features, and have Safari expose them?
* KG: I do want these to have names. Not requestable "Features", but ability to discuss 'flexible texture views'.
* KN: Want names for the restrictions or names for the features?
* KG: Names for features OK.
* KN: And then we can use them for hasCompatibilityFeature if we do add it.
* SW: Want names for each one, or keep them clustered?
* KG: Clustered OK.
* SW: Will these names come into the spec?
* KG: Might show up as heading/section names.
* JB: Gives us and people reading the spec a foothold for discussing the differences between Core and Compat.
* KN: In spec can have a section of "here's what core has that compat doesn't". E.g. subsection titled "Flexible Texture Views".
* JB: These are editorial concerns.

@kainino0x kainino0x added the api WebGPU API label Apr 25, 2025
@greggman
Copy link
Contributor

greggman commented Jul 7, 2025

this can be closed yes?

@kainino0x kainino0x closed this Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api WebGPU API compat WebGPU Compatibility Mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants