Ver código fonte

Merge pull request #6685 from sebavan/master

no webgpu handling pg
sebavan 6 anos atrás
pai
commit
f049393437
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      Playground/js/indexWebGPU.js

+ 5 - 0
Playground/js/indexWebGPU.js

@@ -525,6 +525,11 @@ function showError(errorMessage, errorEvent) {
                 var createEngineFunction = "createDefaultEngine";
                 var createSceneFunction;
 
+                if (!navigator.gpu) {
+                    showError("WebGPU is not supported on your platform.", {});
+                    return;
+                }
+
                 getRunCode(jsEditor, async function(code) {
                     var createDefaultEngine = function() {
                         return new BABYLON.WebGPUEngine(canvas);