Title: [250277] trunk/Source/WebInspectorUI
Revision
250277
Author
drou...@apple.com
Date
2019-09-23 17:51:35 -0700 (Mon, 23 Sep 2019)

Log Message

Web Inspector: Canvas: WebGPU compute shaders aren't syntax highlighted
https://bugs.webkit.org/show_bug.cgi?id=202030

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CodeMirrorAdditions.js:
`CodeMirror.defineMIME` expects a "spec" object, which can't just be another MIME type.
Instead, get the "spec" of the defined "x-shader/x-vertex" and "x-shader/x-fragment" modes
and use that when defining MIMEs for the WebGPU shader pipeline modes.

* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
Get the `contextType` off of the shader's canvas, which is where it actually lives.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (250276 => 250277)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-09-24 00:46:14 UTC (rev 250276)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-09-24 00:51:35 UTC (rev 250277)
@@ -1,5 +1,21 @@
 2019-09-23  Devin Rousso  <drou...@apple.com>
 
+        Web Inspector: Canvas: WebGPU compute shaders aren't syntax highlighted
+        https://bugs.webkit.org/show_bug.cgi?id=202030
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/CodeMirrorAdditions.js:
+        `CodeMirror.defineMIME` expects a "spec" object, which can't just be another MIME type.
+        Instead, get the "spec" of the defined "x-shader/x-vertex" and "x-shader/x-fragment" modes
+        and use that when defining MIMEs for the WebGPU shader pipeline modes.
+
+        * UserInterface/Views/ShaderProgramContentView.js:
+        (WI.ShaderProgramContentView):
+        Get the `contextType` off of the shader's canvas, which is where it actually lives.
+
+2019-09-23  Devin Rousso  <drou...@apple.com>
+
         Web Inspector: Canvas: show WebGPU shader pipelines
         https://bugs.webkit.org/show_bug.cgi?id=201675
         <rdar://problem/55543450>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js (250276 => 250277)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js	2019-09-24 00:46:14 UTC (rev 250276)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js	2019-09-24 00:51:35 UTC (rev 250277)
@@ -684,9 +684,9 @@
     });
 
     // FIXME: Add WHLSL specific modes.
-    CodeMirror.defineMIME("x-pipeline/x-compute", "x-shader/x-vertex");
-    CodeMirror.defineMIME("x-pipeline/x-fragment", "x-shader/x-fragment");
-    CodeMirror.defineMIME("x-pipeline/x-vertex", "x-shader/x-vertex");
+    CodeMirror.defineMIME("x-pipeline/x-compute", CodeMirror.resolveMode("x-shader/x-vertex"));
+    CodeMirror.defineMIME("x-pipeline/x-fragment", CodeMirror.resolveMode("x-shader/x-fragment"));
+    CodeMirror.defineMIME("x-pipeline/x-vertex", CodeMirror.resolveMode("x-shader/x-vertex"));
 })();
 
 WI.compareCodeMirrorPositions = function(a, b)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ShaderProgramContentView.js (250276 => 250277)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ShaderProgramContentView.js	2019-09-24 00:46:14 UTC (rev 250276)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ShaderProgramContentView.js	2019-09-24 00:51:35 UTC (rev 250277)
@@ -31,7 +31,7 @@
 
         super(shaderProgram);
 
-        let isWebGPU = this.representedObject.contextType === WI.Canvas.ContextType.WebGPU;
+        let isWebGPU = this.representedObject.canvas.contextType === WI.Canvas.ContextType.WebGPU;
 
         this._refreshButtonNavigationItem = new WI.ButtonNavigationItem("refresh", WI.UIString("Refresh"), "Images/ReloadFull.svg", 13, 13);
         this._refreshButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to