Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Examples Browser] Support device type switching #5147

Merged
merged 17 commits into from
Mar 15, 2023
Merged

Conversation

ellthompson
Copy link
Contributor

@ellthompson ellthompson commented Mar 13, 2023

Adds support for graphics device type switching in the examples browser. Users can choose to run each example using WebGL 1, WebGL 2 or WebGPU.
image

The browser will attempt to run the current example using the selected device, however if that device is not usable for a given example a fallback device will be used instead. This will be displayed to the user as follows:
image

If the user selects an unsupported device type, then switches to an example which can use that device type, their selection will be restored. This allows a user to click through both WebGL and WebGPU examples while keeping track of their preferred device type.

Only examples with the following property set will support the WebGPU device type. This will allow us to progressively enable WebGPU in different examples as its support matures.

static WEBGPU_ENABLED = true;

Fixes #5027

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@ellthompson ellthompson marked this pull request as ready for review March 14, 2023 10:33
Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

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

Looks great, cannot wait to test this.
Left few suggestions before merging.

@mvaligursky mvaligursky self-requested a review March 15, 2023 14:50
@ellthompson ellthompson merged commit f0a9ac8 into main Mar 15, 2023
@ellthompson ellthompson deleted the examples-device-type branch March 15, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish WebGPU-enabled build of Examples Browser
3 participants