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] Add parsing for directives #20623

Conversation

tadeuzagallo
Copy link
Member

@tadeuzagallo tadeuzagallo commented Nov 16, 2023

5aa9fe8

[WGSL] Add parsing for directives
https://bugs.webkit.org/show_bug.cgi?id=264973
rdar://118522832

Reviewed by Mike Wyrzykowski.

Add support for parsing enable, requires and diagnostic directives.

* Source/WebGPU/WGSL/AST/AST.h:
* Source/WebGPU/WGSL/AST/ASTDiagnostic.h: Copied from Source/WebGPU/WGSL/AST/ASTDirective.h.
* Source/WebGPU/WGSL/AST/ASTDiagnosticAttribute.h:
* Source/WebGPU/WGSL/AST/ASTDiagnosticDirective.h: Copied from Source/WebGPU/WGSL/AST/ASTDirective.h.
* Source/WebGPU/WGSL/AST/ASTDirective.h:
(WGSL::AST::Directive::Directive):
(WGSL::AST::Directive::name const): Deleted.
* Source/WebGPU/WGSL/AST/ASTForward.h:
* Source/WebGPU/WGSL/AST/ASTNode.h:
* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/AST/ASTStringDumper.h:
* Source/WebGPU/WGSL/AST/ASTVisitor.cpp:
(WGSL::AST::Visitor::visit):
* Source/WebGPU/WGSL/AST/ASTVisitor.h:
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseShader):
(WGSL::Parser<Lexer>::parseEnableDirective):
(WGSL::Parser<Lexer>::parseRequireDirective):
(WGSL::Parser<Lexer>::parseAttribute):
(WGSL::Parser<Lexer>::parseDiagnostic):
* Source/WebGPU/WGSL/ParserPrivate.h:
* Source/WebGPU/WGSL/WGSLEnums.cpp:
* Source/WebGPU/WGSL/WGSLEnums.h:
* Source/WebGPU/WGSL/WGSLShaderModule.h:
(WGSL::ShaderModule::enabledExtensions):
(WGSL::ShaderModule::requiredFeatures):
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:

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

95d790b

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

@tadeuzagallo tadeuzagallo self-assigned this Nov 16, 2023
@tadeuzagallo tadeuzagallo added the WebGPU For bugs in WebGPU label Nov 16, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 16, 2023
@tadeuzagallo tadeuzagallo force-pushed the eng/WGSL-Add-parsing-for-directives branch from feb7e35 to 95d790b Compare November 16, 2023 20:10
@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 Nov 17, 2023
https://bugs.webkit.org/show_bug.cgi?id=264973
rdar://118522832

Reviewed by Mike Wyrzykowski.

Add support for parsing enable, requires and diagnostic directives.

* Source/WebGPU/WGSL/AST/AST.h:
* Source/WebGPU/WGSL/AST/ASTDiagnostic.h: Copied from Source/WebGPU/WGSL/AST/ASTDirective.h.
* Source/WebGPU/WGSL/AST/ASTDiagnosticAttribute.h:
* Source/WebGPU/WGSL/AST/ASTDiagnosticDirective.h: Copied from Source/WebGPU/WGSL/AST/ASTDirective.h.
* Source/WebGPU/WGSL/AST/ASTDirective.h:
(WGSL::AST::Directive::Directive):
(WGSL::AST::Directive::name const): Deleted.
* Source/WebGPU/WGSL/AST/ASTForward.h:
* Source/WebGPU/WGSL/AST/ASTNode.h:
* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/AST/ASTStringDumper.h:
* Source/WebGPU/WGSL/AST/ASTVisitor.cpp:
(WGSL::AST::Visitor::visit):
* Source/WebGPU/WGSL/AST/ASTVisitor.h:
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseShader):
(WGSL::Parser<Lexer>::parseEnableDirective):
(WGSL::Parser<Lexer>::parseRequireDirective):
(WGSL::Parser<Lexer>::parseAttribute):
(WGSL::Parser<Lexer>::parseDiagnostic):
* Source/WebGPU/WGSL/ParserPrivate.h:
* Source/WebGPU/WGSL/WGSLEnums.cpp:
* Source/WebGPU/WGSL/WGSLEnums.h:
* Source/WebGPU/WGSL/WGSLShaderModule.h:
(WGSL::ShaderModule::enabledExtensions):
(WGSL::ShaderModule::requiredFeatures):
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/270879@main
@webkit-commit-queue
Copy link
Collaborator

Committed 270879@main (5aa9fe8): https://commits.webkit.org/270879@main

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

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