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

[WGSL] Serialize global overrides #12860

Conversation

tadeuzagallo
Copy link
Member

@tadeuzagallo tadeuzagallo commented Apr 18, 2023

e8be4ea

[WGSL] Serialize global overrides
https://bugs.webkit.org/show_bug.cgi?id=255600
rdar://108197601

Reviewed by Myles C. Maxfield.

Add serialization support for override declarations. Notice that we temporarily
disable the mangling of globals, which ironically wasn't being used yet, but
requires notifying the API about the mangling. I will be implementing that next
and will re-enable the mangling.

* Source/WebGPU/WGSL/MangleNames.cpp:
(WGSL::NameManglerVisitor::visit):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::write):
(WGSL::Metal::FunctionDefinitionWriter::visit):
(WGSL::Metal::FunctionDefinitionWriter::visitGlobal):
(WGSL::Metal::FunctionDefinitionWriter::serializeVariable):

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

1c015db

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  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

@tadeuzagallo tadeuzagallo self-assigned this Apr 18, 2023
@tadeuzagallo tadeuzagallo added the WebGPU For bugs in WebGPU label Apr 18, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 18, 2023
return;

m_stringBuilder.append("constant ");
serializeVariable(variable);
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is the validation that only certain types are allowed to be function constants?

Where is this tested?

Copy link
Member Author

Choose a reason for hiding this comment

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

We have basically no validation of that sort yet. We could test by matching the metal output, but behavior tests won't work yet since we still need one more patch to get overrides to actually work.

@tadeuzagallo tadeuzagallo force-pushed the eng/WGSL-Serialize-global-overrides branch from 8a47a9e to 1c015db Compare April 20, 2023 07:00
@tadeuzagallo tadeuzagallo added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Apr 20, 2023
https://bugs.webkit.org/show_bug.cgi?id=255600
rdar://108197601

Reviewed by Myles C. Maxfield.

Add serialization support for override declarations. Notice that we temporarily
disable the mangling of globals, which ironically wasn't being used yet, but
requires notifying the API about the mangling. I will be implementing that next
and will re-enable the mangling.

* Source/WebGPU/WGSL/MangleNames.cpp:
(WGSL::NameManglerVisitor::visit):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::write):
(WGSL::Metal::FunctionDefinitionWriter::visit):
(WGSL::Metal::FunctionDefinitionWriter::visitGlobal):
(WGSL::Metal::FunctionDefinitionWriter::serializeVariable):

Canonical link: https://commits.webkit.org/263167@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WGSL-Serialize-global-overrides branch from 1c015db to e8be4ea Compare April 20, 2023 08:05
@webkit-commit-queue
Copy link
Collaborator

Committed 263167@main (e8be4ea): https://commits.webkit.org/263167@main

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

@webkit-commit-queue webkit-commit-queue merged commit e8be4ea 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
@tadeuzagallo tadeuzagallo deleted the eng/WGSL-Serialize-global-overrides branch May 17, 2023 12:40
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