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

Skip to content

Compat: Limits added for compat need to behave in a forward compatible way #5013

@greggman

Description

@greggman

One of the goals for compat, from the proposal is:

Since WebGPU Compatibility mode is a subset of WebGPU, all valid Compatibility mode applications are also valid WebGPU applications.

The current proposal with regards to limits, does not seem to meet this goal.

maxStorage(Buffers/Textures)InVertexStage and maxStorage(Buffers/Textures)InFragmentStage

Both say

In Compatibility mode, these new limits will have a default of zero. In Core mode, they will default to the maximum value of a GPUSize32.

That means if I write code like this

maxStorageTexturesInFragmentStage = adapter.limits.maxStorageTexturesInFragmentStage
device = await adapter.requestDevice({requiredLimits: {maxStorageTexturesInFragmentStage}});

...

// use all the textures
for (let t = 0; t < maxStorageTexturesInFragmentStage; ++t) {
}

It will run in compat but fail in core.

Should this design be revisited?

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIcompatWebGPU Compatibility Mode

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions