Browse Source

Merge pull request #6685 from sebavan/master

no webgpu handling pg
sebavan 6 năm trước cách đây
mục cha
commit
f049393437
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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);