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] @group, @binding and @location should accept expressions #14469

Conversation

tadeuzagallo
Copy link
Member

@tadeuzagallo tadeuzagallo commented May 30, 2023

ecb0065

[WGSL] @group, @binding and @location should accept expressions
https://bugs.webkit.org/show_bug.cgi?id=257471
rdar://109995472

Reviewed by Myles C. Maxfield.

Currently we are only parsing integer literals as arguments to these attributes,
but according to the grammar they should accept any const expressions.

* Source/WebGPU/WGSL/AST/ASTBindingAttribute.h:
* Source/WebGPU/WGSL/AST/ASTGroupAttribute.h:
* Source/WebGPU/WGSL/AST/ASTLocationAttribute.h:
* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::collectGlobals):
(WGSL::RewriteGlobalVariables::insertStructs):
(WGSL::RewriteGlobalVariables::insertParameters):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseAttribute):

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

86183ef

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
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@tadeuzagallo tadeuzagallo self-assigned this May 30, 2023
@tadeuzagallo tadeuzagallo added the WebGPU For bugs in WebGPU label May 30, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 30, 2023
@tadeuzagallo tadeuzagallo force-pushed the eng/WGSL-group-binding-and-location-should-accept-expressions branch from b2ed50a to 86183ef Compare May 30, 2023 09:30
@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 May 31, 2023
https://bugs.webkit.org/show_bug.cgi?id=257471
rdar://109995472

Reviewed by Myles C. Maxfield.

Currently we are only parsing integer literals as arguments to these attributes,
but according to the grammar they should accept any const expressions.

* Source/WebGPU/WGSL/AST/ASTBindingAttribute.h:
* Source/WebGPU/WGSL/AST/ASTGroupAttribute.h:
* Source/WebGPU/WGSL/AST/ASTLocationAttribute.h:
* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::collectGlobals):
(WGSL::RewriteGlobalVariables::insertStructs):
(WGSL::RewriteGlobalVariables::insertParameters):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseAttribute):

Canonical link: https://commits.webkit.org/264717@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WGSL-group-binding-and-location-should-accept-expressions branch from 86183ef to ecb0065 Compare May 31, 2023 07:38
@webkit-commit-queue
Copy link
Collaborator

Committed 264717@main (ecb0065): https://commits.webkit.org/264717@main

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

@webkit-commit-queue webkit-commit-queue merged commit ecb0065 into WebKit:main May 31, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 31, 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