Title: [235525] trunk/Tools
Revision
235525
Author
[email protected]
Date
2018-08-30 14:53:43 -0700 (Thu, 30 Aug 2018)

Log Message

[WHLSL] Implement tests to verify array indexing order matches our desires
https://bugs.webkit.org/show_bug.cgi?id=189099

Patch by Thomas Denney <[email protected]> on 2018-08-30
Reviewed by Myles C. Maxfield.

* WebGPUShadingLanguageRI/Test.js: Add new test for array indexing order
and the option to explicitly disable tests (this test is disabled by
default).
* WebGPUShadingLanguageRI/TypeRef.js:
(TypeRef.wrap): Fixes  typo.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (235524 => 235525)


--- trunk/Tools/ChangeLog	2018-08-30 21:33:38 UTC (rev 235524)
+++ trunk/Tools/ChangeLog	2018-08-30 21:53:43 UTC (rev 235525)
@@ -1,3 +1,16 @@
+2018-08-30  Thomas Denney  <[email protected]>
+
+        [WHLSL] Implement tests to verify array indexing order matches our desires
+        https://bugs.webkit.org/show_bug.cgi?id=189099
+
+        Reviewed by Myles C. Maxfield.
+
+        * WebGPUShadingLanguageRI/Test.js: Add new test for array indexing order
+        and the option to explicitly disable tests (this test is disabled by
+        default).
+        * WebGPUShadingLanguageRI/TypeRef.js:
+        (TypeRef.wrap): Fixes  typo.
+
 2018-08-30  Sihui Liu  <[email protected]>
 
         WKNavigation.ProcessCrashDuringCallback is failing on iOS

Modified: trunk/Tools/WebGPUShadingLanguageRI/Test.js (235524 => 235525)


--- trunk/Tools/WebGPUShadingLanguageRI/Test.js	2018-08-30 21:33:38 UTC (rev 235524)
+++ trunk/Tools/WebGPUShadingLanguageRI/Test.js	2018-08-30 21:53:43 UTC (rev 235525)
@@ -5551,9 +5551,44 @@
     checkFloat(program, callFunction(program, "foo13", []), 29 * 7 + 43 * 11 + 61 * 13);
 }
 
+tests.DISABLED_arrayIndex = function() {
+    let program = doPrep(`
+        uint innerArrayLength() {
+            int[2][3] array;
+            return array[0].length;
+        }
+        
+        uint outerArrayLength() {
+            int[2][3] array;
+            return array.length;
+        }
+        
+        int arrayIndexing(uint i, uint j) {
+            int[2][3] array;
+            array[0][0] = 1;
+            array[0][1] = 2;
+            array[0][2] = 3;
+            array[1][0] = 4;
+            array[1][1] = 5;
+            array[1][2] = 6;
+            return array[i][j];
+        }
+    `);
+    
+    checkUint(program, callFunction(program, "innerArrayLength", []), 3);
+    checkUint(program, callFunction(program, "outerArrayLength", []), 2);
+    checkInt(program, callFunction(program, "arrayIndexing", [ makeUint(program, 0), makeUint(program, 0) ]), 1);
+    checkInt(program, callFunction(program, "arrayIndexing", [ makeUint(program, 0), makeUint(program, 1) ]), 2);
+    checkInt(program, callFunction(program, "arrayIndexing", [ makeUint(program, 0), makeUint(program, 2) ]), 3);
+    checkInt(program, callFunction(program, "arrayIndexing", [ makeUint(program, 1), makeUint(program, 0) ]), 4);
+    checkInt(program, callFunction(program, "arrayIndexing", [ makeUint(program, 1), makeUint(program, 1) ]), 5);
+    checkInt(program, callFunction(program, "arrayIndexing", [ makeUint(program, 1), makeUint(program, 2) ]), 6);    
+}
+
 okToTest = true;
 
 let testFilter = /.*/; // run everything by default
+let testExclusionFilter = /^DISABLED_/;
 if (this["arguments"]) {
     for (let i = 0; i < arguments.length; i++) {
         switch (arguments[0]) {
@@ -5583,12 +5618,16 @@
     names.sort();
     for (let s of names) {
         if (s.match(testFilter)) {
-            print("TEST: " + s + "...");
-            yield;
-            const testBefore = preciseTime();
-            tests[s]();
-            const testAfter = preciseTime();
-            print(`    OK, took ${Math.round((testAfter - testBefore) * 1000)} ms`);
+            if (s.match(testExclusionFilter)) {
+                print(`Skipping ${s} because it is disabled.`);
+            } else {
+                print("TEST: " + s + "...");
+                yield;
+                const testBefore = preciseTime();
+                tests[s]();
+                const testAfter = preciseTime();
+                print(`    OK, took ${Math.round((testAfter - testBefore) * 1000)} ms`);
+            }
         }
     }
 

Modified: trunk/Tools/WebGPUShadingLanguageRI/TypeRef.js (235524 => 235525)


--- trunk/Tools/WebGPUShadingLanguageRI/TypeRef.js	2018-08-30 21:33:38 UTC (rev 235524)
+++ trunk/Tools/WebGPUShadingLanguageRI/TypeRef.js	2018-08-30 21:53:43 UTC (rev 235525)
@@ -42,7 +42,7 @@
         if (type instanceof NativeType)
             result = new TypeRef(type.origin, type.name, type.typeArguments);
         else
-            result = new TypeRef(type.orgin, type.name);
+            result = new TypeRef(type.origin, type.name);
         result.type = type;
         return result;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to