Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e8c97076834e3182b2e3342ccb3fe179c21e7790
      
https://github.com/WebKit/WebKit/commit/e8c97076834e3182b2e3342ccb3fe179c21e7790
  Author: Devin Rousso <[email protected]>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    A LayoutTests/inspector/canvas/requestShaderSource-webgpu-expected.txt
    A LayoutTests/inspector/canvas/requestShaderSource-webgpu.html
    M LayoutTests/inspector/canvas/resources/shaderProgram-utilities-webgpu.js
    M LayoutTests/inspector/canvas/resources/webgpu-worker.js
    A LayoutTests/inspector/canvas/shaderProgram-add-remove-webgpu-expected.txt
    A LayoutTests/inspector/canvas/shaderProgram-add-remove-webgpu.html
    M LayoutTests/inspector/canvas/worker-webgpu-expected.txt
    M LayoutTests/inspector/canvas/worker-webgpu.html
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/win/TestExpectations
    M Source/JavaScriptCore/inspector/protocol/Canvas.json
    M Source/WebCore/Modules/WebGPU/GPUComputePipeline.cpp
    M Source/WebCore/Modules/WebGPU/GPUComputePipeline.h
    M Source/WebCore/Modules/WebGPU/GPUDevice.cpp
    M Source/WebCore/Modules/WebGPU/GPURenderPipeline.cpp
    M Source/WebCore/Modules/WebGPU/GPURenderPipeline.h
    M Source/WebCore/Modules/WebGPU/GPUShaderModule.h
    M Source/WebCore/inspector/InspectorInstrumentation.cpp
    M Source/WebCore/inspector/InspectorInstrumentation.h
    M Source/WebCore/inspector/InspectorShaderProgram.cpp
    M Source/WebCore/inspector/InspectorShaderProgram.h
    M Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp
    M Source/WebCore/inspector/agents/InspectorCanvasAgent.h
    M Source/WebInspectorUI/UserInterface/Models/ShaderProgram.js
    M Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js
    M Source/WebInspectorUI/UserInterface/Views/ShaderProgramContentView.css
    M Source/WebInspectorUI/UserInterface/Views/ShaderProgramContentView.js
    M Source/WebInspectorUI/Versions/Inspector-iOS-14.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-14.5.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-15.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-15.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-16.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-16.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-17.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-17.2.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-17.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-18.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-18.2.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-18.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-26.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-26.2.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-26.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-27.0.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-13.0.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-13.3.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-14.0.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-14.2.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-14.4.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-15.0.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-15.2.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-15.4.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-26.0.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-26.2.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-26.4.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-27.0.json

  Log Message:
  -----------
  Web Inspector: Canvas: instrument WebGPU pipelines
https://bugs.webkit.org/show_bug.cgi?id=320698

Reviewed by Mike Wyrzykowski.

* Source/WebCore/Modules/WebGPU/GPUShaderModule.h:
(WebCore::GPUShaderModule::create):
(WebCore::GPUShaderModule::source const): Added.
(WebCore::GPUShaderModule::GPUShaderModule):
* Source/WebCore/Modules/WebGPU/GPUDevice.cpp:
(WebCore::GPUDevice::~GPUDevice):
(WebCore::GPUDevice::createShaderModule):
(WebCore::GPUDevice::createComputePipeline):
(WebCore::GPUDevice::createRenderPipeline):
(WebCore::GPUDevice::createComputePipelineAsync):
(WebCore::GPUDevice::createRenderPipelineAsync):
Preserve the original WGSL source.
Also save whether `GPURenderPipeline` stages share a `GPUShaderModule`.

* Source/WebCore/Modules/WebGPU/GPUComputePipeline.h:
(WebCore::GPUComputePipeline::shaderSource const): Added.
* Source/WebCore/Modules/WebGPU/GPUComputePipeline.cpp:
(WebCore::GPUComputePipeline::create):
(WebCore::GPUComputePipeline::instances): Added.
(WebCore::GPUComputePipeline::instancesLock): Added.
(WebCore::GPUComputePipeline::willDestroyDevice): Added.
(WebCore::GPUComputePipeline::GPUComputePipeline):
(WebCore::GPUComputePipeline::~GPUComputePipeline): Added.
(WebCore::GPUComputePipeline::device const): Added.
Track live `GPUComputePipeline` and their `GPUDevice`.

* Source/WebCore/Modules/WebGPU/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::vertexShaderSource const): Added.
(WebCore::GPURenderPipeline::fragmentShaderSource const): Added.
(WebCore::GPURenderPipeline::sharesVertexFragmentShader const): Added.
* Source/WebCore/Modules/WebGPU/GPURenderPipeline.cpp:
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::instances): Added.
(WebCore::GPURenderPipeline::instancesLock): Added.
(WebCore::GPURenderPipeline::willDestroyDevice): Added.
(WebCore::GPURenderPipeline::GPURenderPipeline):
(WebCore::GPURenderPipeline::~GPURenderPipeline): Added.
(WebCore::GPURenderPipeline::device const): Added.
Track live `GPURenderPipeline` and their `GPUDevice`.

* Source/WebCore/inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didCreateWebGPUComputePipeline): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUComputePipeline): Added.
(WebCore::InspectorInstrumentation::didCreateWebGPURenderPipeline): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPURenderPipeline): Added.
(WebCore::InspectorInstrumentation::didCreateWebGPUComputePipelineImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUComputePipelineImpl): 
Added.
(WebCore::InspectorInstrumentation::didCreateWebGPURenderPipelineImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPURenderPipelineImpl): Added.
* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCreateWebGPUComputePipelineImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUComputePipelineImpl): 
Added.
(WebCore::InspectorInstrumentation::didCreateWebGPURenderPipelineImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPURenderPipelineImpl): Added.
Notify inspector when `GPUComputePipeline` and `GPURenderPipeline` are created 
and destroyed.

* Source/WebCore/inspector/InspectorShaderProgram.h:
(WebCore::InspectorShaderProgram::create): Added WebGPU overloads.
(WebCore::InspectorShaderProgram::program const): Deleted.
(WebCore::InspectorShaderProgram::InspectorShaderProgram): Added WebGPU 
overloads.
* Source/WebCore/inspector/InspectorShaderProgram.cpp:
(WebCore::InspectorShaderProgram::create): Added WebGPU overloads.
(WebCore::InspectorShaderProgram::InspectorShaderProgram): Added WebGPU 
overloads.
(WebCore::InspectorShaderProgram::requestShaderSource):
(WebCore::InspectorShaderProgram::updateShader):
(WebCore::InspectorShaderProgram::buildObjectForShaderProgram):
Expand to also support `GPUComputePipeline` and GPURenderPipeline`,
Add special handling for when `GPURenderPipeline` do not have a fragment stage.

* Source/JavaScriptCore/inspector/protocol/Canvas.json:
* Source/WebCore/inspector/agents/InspectorCanvasAgent.h:
(WebCore::InspectorCanvasAgent::requestShaderSource):
(WebCore::InspectorCanvasAgent::didCreateWebGPUComputePipeline): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGPUComputePipeline): Added.
(WebCore::InspectorCanvasAgent::didCreateWebGPURenderPipeline): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGPURenderPipeline): Added.
(WebCore::InspectorCanvasAgent::programDestroyedTimerFired):
(WebCore::InspectorCanvasAgent::unbindProgram):
(WebCore::InspectorCanvasAgent::assertInspectorProgram):
(WebCore::InspectorCanvasAgent::findInspectorProgram): Added WebGPU overloads.
* Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::internalEnable):
(WebCore::InspectorCanvasAgent::requestShaderSource):
(WebCore::InspectorCanvasAgent::didCreateWebGPUComputePipeline): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGPUComputePipeline): Added.
(WebCore::InspectorCanvasAgent::didCreateWebGPURenderPipeline): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGPURenderPipeline): Added.
(WebCore::InspectorCanvasAgent::programDestroyedTimerFired):
(WebCore::InspectorCanvasAgent::reset):
(WebCore::InspectorCanvasAgent::unbindCanvas):
(WebCore::InspectorCanvasAgent::unbindProgram):
(WebCore::InspectorCanvasAgent::assertInspectorProgram):
(WebCore::InspectorCanvasAgent::findInspectorProgram):
Discover existing pipelines when `Canvas` instrumentation is enabled.

* Source/WebInspectorUI/UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram.contextTypeSupportsProgramType):
(WI.ShaderProgram.programTypeSupportsShaderType):
(WI.ShaderProgram.prototype.get displayName):
(WI.ShaderProgram.ProgramType.Vertex): Added.
* Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js:
* Source/WebInspectorUI/UserInterface/Views/ShaderProgramContentView.css:
* Source/WebInspectorUI/UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView.prototype.constructor):
(WI.ShaderProgramContentView.prototype.get saveData):
(WI.ShaderProgramContentView.prototype._refreshContent):
Display compute, render, and vertex-only pipelines with read-only WGSL editors.
Reuse one editor when render stages share or only have one shader module.

* LayoutTests/inspector/canvas/resources/shaderProgram-utilities-webgpu.js:
* LayoutTests/inspector/canvas/resources/webgpu-worker.js:
* LayoutTests/inspector/canvas/requestShaderSource-webgpu.html: Added.
* LayoutTests/inspector/canvas/requestShaderSource-webgpu-expected.txt: Added.
* LayoutTests/inspector/canvas/shaderProgram-add-remove-webgpu.html: Added.
* LayoutTests/inspector/canvas/shaderProgram-add-remove-webgpu-expected.txt: 
Added.
* LayoutTests/inspector/canvas/worker-webgpu.html:
* LayoutTests/inspector/canvas/worker-webgpu-expected.txt:
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/win/TestExpectations:

Canonical link: https://commits.webkit.org/318366@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to