Explorar el Código

Validation test update

Popov72 hace 4 años
padre
commit
f6c756fd46

BIN
tests/validation/ReferenceImages/webgpu/create environment texture.png


BIN
tests/validation/ReferenceImages/webgpu/show all procedural textures.png


+ 18 - 9
tests/validation/config.json

@@ -448,20 +448,23 @@
             "renderCount": 2,
             "playgroundId": "#DS8AA7#18",
             "replace": "__folder__, Animation_Skin, __page__, 0",
-            "referenceImage": "gltfAnimationSkin0.png"
+            "referenceImage": "gltfAnimationSkin0.png",
+            "excludedEngines": ["webgpu"]
         },
         {
             "title": "GLTF Animation Skin (1)",
             "renderCount": 2,
             "playgroundId": "#DS8AA7#18",
             "replace": "__folder__, Animation_Skin, __page__, 1",
-            "referenceImage": "gltfAnimationSkin1.png"
+            "referenceImage": "gltfAnimationSkin1.png",
+            "excludedEngines": ["webgpu"]
         },
         {
             "title": "GLTF Animation Skin Type",
             "playgroundId": "#DS8AA7#18",
             "replace": "__folder__, Animation_SkinType, __page__, 0",
-            "referenceImage": "gltfAnimationSkinType.png"
+            "referenceImage": "gltfAnimationSkinType.png",
+            "excludedEngines": ["webgpu"]
         },
         {
             "title": "GLTF Buffer Interleaved",
@@ -539,13 +542,15 @@
             "title": "GLTF Mesh Primitive Mode (0)",
             "playgroundId": "#DS8AA7#18",
             "replace": "__folder__, Mesh_PrimitiveMode, __page__, 0",
-            "referenceImage": "gltfMeshPrimitiveMode0.png"
+            "referenceImage": "gltfMeshPrimitiveMode0.png",
+            "excludedEngines": ["webgpu"]
         },
         {
             "title": "GLTF Mesh Primitive Mode (1)",
             "playgroundId": "#DS8AA7#18",
             "replace": "__folder__, Mesh_PrimitiveMode, __page__, 1",
-            "referenceImage": "gltfMeshPrimitiveMode1.png"
+            "referenceImage": "gltfMeshPrimitiveMode1.png",
+            "excludedEngines": ["webgpu"]
         },
         {
             "title": "GLTF Mesh Primitive Vertex Color",
@@ -876,7 +881,8 @@
             "playgroundId": "#XT1HAS#1",
             "referenceImage": "ssao2.png",
             "renderCount": 200,
-            "excludeFromAutomaticTesting": true
+            "excludeFromAutomaticTesting": true,
+            "excludedEngines": ["webgpu"]
         },
         {
             "title": "DepthRenderer",
@@ -932,21 +938,24 @@
             "playgroundId": "#E5YGEL#2",
             "referenceImage": "motionBlur.png",
             "renderCount": 10,
-            "excludeFromAutomaticTesting": true
+            "excludeFromAutomaticTesting": true,
+            "excludedEngines": ["webgpu"]
         },
         {
             "title": "Screen space reflections",
             "playgroundId": "#PIZ1GK#172",
             "referenceImage": "ssr.png",
             "renderCount": 10,
-            "excludeFromAutomaticTesting": true
+            "excludeFromAutomaticTesting": true,
+            "excludedEngines": ["webgpu"]
         },
         {
             "title": "Geometry buffer renderer",
             "playgroundId": "#PIZ1GK#173",
             "referenceImage": "geometrybufferrenderer.png",
             "renderCount": 10,
-            "excludeFromAutomaticTesting": true
+            "excludeFromAutomaticTesting": true,
+            "excludedEngines": ["webgpu"]
         }
     ]
 }

+ 18 - 3
tests/validation/validation.js

@@ -5,6 +5,7 @@ var canvas;
 var currentScene;
 var config;
 var justOnce;
+var engineName;
 
 // Random replacement
 var seed = 1;
@@ -178,6 +179,12 @@ function runTest(index, done, listname) {
         done(false);
     }
 
+    const excludedEngines = config.tests[index].excludedEngines;
+    if (Array.isArray(excludedEngines) && excludedEngines.indexOf(engineName) >= 0) {
+        done(true);
+        return;
+    }
+    
     // Clear the plugin activated observables in case it is registered in the test.
     BABYLON.SceneLoader.OnPluginActivatedObservable.clear();
 
@@ -376,8 +383,16 @@ function runTest(index, done, listname) {
 
 }
 
-function init(engineName) {
-    engineName = engineName.toLowerCase();
+function init(_engineName) {
+    _engineName = _engineName ? _engineName.toLowerCase() : "webgl2";
+    if (window.disableWebGL2Support) {
+        _engineName = "webgl1";
+    }
+    if (_engineName === "webgl") {
+        _engineName = "webgl1";
+    }
+
+    engineName = _engineName;
 
     BABYLON.SceneLoader.ShowLoadingScreen = false;
     BABYLON.SceneLoader.ForceFullSceneLoadingForIncremental = true;
@@ -419,7 +434,7 @@ function init(engineName) {
             engine.initAsync(glslangOptions).then(() => resolve());
         });
     } else {
-        engine = new BABYLON.Engine(canvas, false, { useHighPrecisionFloats: true, disableWebGL2Support: window.disableWebGL2Support || engineName === "webgl" || engineName === "webgl1" ? true : false });
+        engine = new BABYLON.Engine(canvas, false, { useHighPrecisionFloats: true, disableWebGL2Support: engineName === "webgl1" ? true : false });
         engine.enableOfflineSupport = false;
         engine.setDitheringState(false);
         return Promise.resolve();

+ 10 - 5
tests/validation/webgpu.json

@@ -12,7 +12,7 @@
         },
         {
             "title": "water material",
-            "playgroundId": "#EUH2VL#0"
+            "playgroundId": "#EUH2VL#1"
         },
         {
             "title": "show bounding box",
@@ -44,11 +44,14 @@
         },
         {
             "title": "pillars sphere and torus with PCSS shadows",
-            "playgroundId": "#WL4Q8J#0"
+            "playgroundId": "#WL4Q8J#0",
+            "excludedEngines": ["webgl1"]
         },
         {
             "title": "soft transparent shadows",
-            "playgroundId": "#G3DJGA#0"
+            "playgroundId": "#G3DJGA#0",
+            "excludedEngines": ["webgl1"]
+
         },
         {
             "title": "default render pipeline",
@@ -90,7 +93,7 @@
         {
             "title": "show all procedural textures",
             "renderCount": 5,
-            "playgroundId": "#4N0QRP#0"
+            "playgroundId": "#4N0QRP#1"
         },
         {
             "title": "custom handling of materials for render target pass",
@@ -104,7 +107,9 @@
         {
             "title": "cascaded shadow maps and flying saucers",
             "renderCount": 10,
-            "playgroundId": "#IIZ9UU#63"
+            "playgroundId": "#IIZ9UU#63",
+            "excludedEngines": ["webgl1"]
+
         },
         {
             "title": "sprite maps",