Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Apr 18, 2023

Related issue: #25867

Description

In order to solve the issue outlined in #25867 (comment), WebGPURenderer request all supported features of a device now.

@Mugen87 Mugen87 marked this pull request as ready for review April 18, 2023 08:06
@Mugen87 Mugen87 added this to the r152 milestone Apr 18, 2023
@Mugen87 Mugen87 merged commit ee2a5f2 into mrdoob:dev Apr 18, 2023
emmanueljl pushed a commit to emmanueljl/three.js that referenced this pull request Apr 28, 2023
@Methuselah96 Methuselah96 mentioned this pull request Apr 28, 2023
38 tasks
@takahirox
Copy link
Collaborator

Nit: If we want to request all supported features, we may make an array from GPUAdapter.features directly.

const supportedFeatures = [];
for (const feature of adapter.features.values()) {
  supportedFeatures.push(feature);
}

Note that GPUAdapter.features is setlike in WebGPU and WebIDL.

https://webidl.spec.whatwg.org/#es-setlike
https://gpuweb.github.io/gpuweb/#gpusupportedfeatures

Pros: We don't need to manage features list for this purpose. Even if new features added in the WebGPU spec, we don't need to update the code.
Cons: If we will want to not support certain features, maybe the current implementation would be simpler?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Apr 30, 2023

If we will want to not support certain features

That is a good point. I suppose not supporting certain features could become useful so I guess the current approach is more flexible.

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