[webkit-changes] [WebKit/WebKit] 26fe72: [WGSL] Implement template disambiguation

Tadeu Zagallo noreply at github.com
Mon Sep 11 00:46:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 26fe72210ffe0d1b5c92ec513730b60e4db5591c
      https://github.com/WebKit/WebKit/commit/26fe72210ffe0d1b5c92ec513730b60e4db5591c
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M Source/WebGPU/WGSL/Lexer.cpp
    M Source/WebGPU/WGSL/Lexer.h
    M Source/WebGPU/WGSL/Parser.cpp
    M Source/WebGPU/WGSL/ParserPrivate.h
    M Source/WebGPU/WGSL/Token.cpp
    M Source/WebGPU/WGSL/Token.h
    M Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp
    M Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp

  Log Message:
  -----------
  [WGSL] Implement template disambiguation
https://bugs.webkit.org/show_bug.cgi?id=261338
rdar://115176925

Reviewed by Mike Wyrzykowski.

Implement the template disambiguation as described in https://www.w3.org/TR/WGSL/#template-lists-sec
and the algorithm described in https://github.com/gpuweb/gpuweb/issues/3770

* Source/WebGPU/WGSL/Lexer.cpp:
(WGSL::Lexer<T>::lex):
(WGSL::Lexer<T>::nextToken):
* Source/WebGPU/WGSL/Lexer.h:
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::consumeType):
(WGSL::Parser<Lexer>::consumeTypes):
(WGSL::Parser<Lexer>::consume):
(WGSL::Parser<Lexer>::parseShader):
(WGSL::Parser<Lexer>::maybeSplitToken):
(WGSL::Parser<Lexer>::disambiguateTemplates):
(WGSL::Parser<Lexer>::parseTypeNameAfterIdentifier):
(WGSL::Parser<Lexer>::parseArrayType):
(WGSL::Parser<Lexer>::parseVariableWithAttributes):
(WGSL::Parser<Lexer>::parseVariableQualifier):
(WGSL::Parser<Lexer>::parsePrimaryExpression):
* Source/WebGPU/WGSL/ParserPrivate.h:
(WGSL::Parser::Parser):
* Source/WebGPU/WGSL/Token.cpp:
(WGSL::toString):
* Source/WebGPU/WGSL/Token.h:
(WGSL::Token::operator=):
* Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp:
(TestWGSLAPI::TestLexer::TestLexer):
(TestWGSLAPI::TestLexer::lex):
(TestWGSLAPI::checkSingleToken):
(TestWGSLAPI::checkNextTokenIs):
(TestWGSLAPI::checkNextTokenIsIdentifier):
(TestWGSLAPI::checkNextTokenIsLiteral):
(TestWGSLAPI::checkNextTokensAreBuiltinAttr):
(TestWGSLAPI::TEST):
* Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp:
(TestWGSLAPI::TEST):

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




More information about the webkit-changes mailing list