Skip to content

Commit 1c96319

Browse files
authored
Viewer: Switch back to webgpu by default (#17184)
@Popov72 fixed the timing issues around webgpu snapshot mode + shadows in this PR: #17166 Given this, re-enabling the code that chooses webgpu by default when it is supported in a chromium browser.
1 parent f48ef24 commit 1c96319

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

packages/tools/viewer/src/viewerFactory.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,14 @@ const DefaultCanvasViewerOptions = {
2525
* @returns The default engine to use.
2626
*/
2727
export function GetDefaultEngine(): NonNullable<CanvasViewerOptions["engine"]> {
28-
// TODO: There are some difficult to repro timing issues with WebGPU + snapshot rendering.
29-
// We need to do deeper diagnosis to understand the issues and make this more reliable.
30-
// For now, we will default to WebGL.
31-
32-
// // First check for WebGPU support.
33-
// if ("gpu" in navigator) {
34-
// // For now, only use WebGPU with chromium-based browsers.
35-
// // WebGPU can be enabled in other browsers once they are fully functional and the performance is at least as good as WebGL.
36-
// if ("chrome" in window) {
37-
// return "WebGPU";
38-
// }
39-
// }
28+
// First check for WebGPU support.
29+
if ("gpu" in navigator) {
30+
// For now, only use WebGPU with chromium-based browsers.
31+
// WebGPU can be enabled in other browsers once they are fully functional and the performance is at least as good as WebGL.
32+
if ("chrome" in window) {
33+
return "WebGPU";
34+
}
35+
}
4036

4137
return "WebGL";
4238
}

0 commit comments

Comments
 (0)