Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebGPU] Implement GPUAdapter.requestAdapterInfo #12923

Conversation

mwyrzykowski
Copy link
Contributor

@mwyrzykowski mwyrzykowski commented Apr 19, 2023

1e0ff03

[WebGPU] Implement GPUAdapter.requestAdapterInfo
https://bugs.webkit.org/show_bug.cgi?id=251377
<radar://104829439>

Reviewed by Myles C. Maxfield.

Minimally implement requestAdapterInfo, so https://mlc.ai/web-llm/
does not report an error about output.adapterInfo.description being
undefined.

* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Modules/WebGPU/GPUAdapter.cpp:
(WebCore::GPUAdapter::requestAdapterInfo):
* Source/WebCore/Modules/WebGPU/GPUAdapter.h:
* Source/WebCore/Modules/WebGPU/GPUAdapter.idl:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h:

* Source/WebCore/Modules/WebGPU/GPUAdapterInfo.h: Added.
(WebCore::GPUAdapterInfo::create):
(WebCore::GPUAdapterInfo::vendor const):
(WebCore::GPUAdapterInfo::architecture const):
(WebCore::GPUAdapterInfo::device const):
(WebCore::GPUAdapterInfo::description const):
(WebCore::GPUAdapterInfo::GPUAdapterInfo):
* Source/WebCore/Modules/WebGPU/GPUAdapterInfo.idl: Added.
Add new files.

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

a2b6895

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@mwyrzykowski mwyrzykowski self-assigned this Apr 19, 2023
@mwyrzykowski mwyrzykowski added the WebGPU For bugs in WebGPU label Apr 19, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 19, 2023
@mwyrzykowski mwyrzykowski removed the merging-blocked Applied to prevent a change from being merged label Apr 19, 2023
@mwyrzykowski mwyrzykowski force-pushed the eng/WebGPU-Implement-GPUAdapter-requestAdapterInfo branch from fa46428 to 2dca057 Compare April 19, 2023 19:40
@@ -72,8 +73,7 @@ void GPUAdapter::requestDevice(ScriptExecutionContext&, const std::optional<GPUD

void GPUAdapter::requestAdapterInfo(const std::optional<Vector<String>>&, RequestAdapterInfoPromise&& promise)
{
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=251377 - [WebGPU] Implement GPUAdapter.requestAdapterInfo
promise.resolve(nullptr);
promise.resolve(GPUAdapterInfo::create());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is sufficient - we will probably want this to be more complicated in the future.

I think we should have device creation automatically report this info from the GPU Process to the web process - like how limits and features are already handled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebGPUAdapter already has an adapter name, we could likely use this directly to populate at least one of the GPUAdapterInfo fields, I will do that for now. We can expand upon it as needed in the future

@mwyrzykowski mwyrzykowski force-pushed the eng/WebGPU-Implement-GPUAdapter-requestAdapterInfo branch from 2dca057 to 4b42a81 Compare April 20, 2023 05:37
@mwyrzykowski mwyrzykowski force-pushed the eng/WebGPU-Implement-GPUAdapter-requestAdapterInfo branch from 4b42a81 to a2b6895 Compare April 20, 2023 05:42
@mwyrzykowski mwyrzykowski added the merge-queue Applied to send a pull request to merge-queue label Apr 20, 2023
https://bugs.webkit.org/show_bug.cgi?id=251377
<radar://104829439>

Reviewed by Myles C. Maxfield.

Minimally implement requestAdapterInfo, so https://mlc.ai/web-llm/
does not report an error about output.adapterInfo.description being
undefined.

* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Modules/WebGPU/GPUAdapter.cpp:
(WebCore::GPUAdapter::requestAdapterInfo):
* Source/WebCore/Modules/WebGPU/GPUAdapter.h:
* Source/WebCore/Modules/WebGPU/GPUAdapter.idl:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h:

* Source/WebCore/Modules/WebGPU/GPUAdapterInfo.h: Added.
(WebCore::GPUAdapterInfo::create):
(WebCore::GPUAdapterInfo::vendor const):
(WebCore::GPUAdapterInfo::architecture const):
(WebCore::GPUAdapterInfo::device const):
(WebCore::GPUAdapterInfo::description const):
(WebCore::GPUAdapterInfo::GPUAdapterInfo):
* Source/WebCore/Modules/WebGPU/GPUAdapterInfo.idl: Added.
Add new files.

Canonical link: https://commits.webkit.org/263164@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WebGPU-Implement-GPUAdapter-requestAdapterInfo branch from a2b6895 to 1e0ff03 Compare April 20, 2023 06:52
@webkit-commit-queue
Copy link
Collaborator

Committed 263164@main (1e0ff03): https://commits.webkit.org/263164@main

Reviewed commits have been landed. Closing PR #12923 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 1e0ff03 into WebKit:main Apr 20, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebGPU For bugs in WebGPU
Projects
None yet
5 participants