Skip to content

Commit

Permalink
Fixed fallthrough of devices (#7095)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpal81xd authored Nov 5, 2024
1 parent 3ed3d55 commit a949d2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/iframe/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function updateDeviceType(config) {
deviceType = 'webgl1';
return;
}
if (config.WEBGL1_DISABLED && deviceType !== 'webgl2') {
if ((config.WEBGL1_DISABLED && deviceType !== 'webgl2') || deviceType === 'webgpu') {
console.warn('WebGPU is disabled. Using WebGL 2.0 device instead.');
deviceType = 'webgl2';
return;
Expand All @@ -131,14 +131,14 @@ export function updateDeviceType(config) {
deviceType = 'webgl1';
return;
}
if (config.WEBGL1_DISABLED && deviceType !== 'webgpu') {
if ((config.WEBGL1_DISABLED && deviceType !== 'webgpu') || deviceType === 'webgl2') {
console.warn('WebGL 2.0 is disabled. Using WebGPU device instead.');
deviceType = 'webgpu';
return;
}
}
if (config.WEBGL1_DISABLED) {
if (config.WEBGPU_DISABLED && deviceType !== 'webgl2') {
if ((config.WEBGPU_DISABLED && deviceType !== 'webgl2') || deviceType === 'webgl1') {
console.warn('WebGL 1.0 is disabled. Using WebGL 2.0 device instead.');
deviceType = 'webgl2';
return;
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/misc/editor.example.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @config DESCRIPTION <div style='text-align:center'><div>Translate (1), Rotate (2), Scale (3)</div><div>World/Local (X)</div><div>Perspective (P), Orthographic (O)</div></div>
// @config WEBGPU_DISABLED
import * as pc from 'playcanvas';
import { data } from 'examples/observer';
import { deviceType, rootPath, localImport } from 'examples/utils';
Expand Down

0 comments on commit a949d2c

Please sign in to comment.