....
Created attachment 375593 [details] WIP It's good to go, I just need to make it into landing shape. It's 20-30ms faster on compute_boids
Created attachment 375602 [details] patch
Comment on attachment 375602 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=375602&action=review > Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:128 > + return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(location, AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator&[]", String::ConstructFromLiteral), WTFMove(parameters), nullptr, isOperator, ParsingMode::StandardLibrary)); Wouldn't all native functions be marked as StandardLibrary? > Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp:62 > +auto Parser::parse(Program& program, StringView stringView, ParsingMode mode) -> Expected<void, Error> is "ParsingMode" really the best name for this? It doesn't have much to do with parsing.
Comment on attachment 375602 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=375602&action=review >> Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp:62 >> +auto Parser::parse(Program& program, StringView stringView, ParsingMode mode) -> Expected<void, Error> > > is "ParsingMode" really the best name for this? It doesn't have much to do with parsing. Oh, I misunderstood this. Disregard.
Comment on attachment 375602 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=375602&action=review >> Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:128 >> + return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(location, AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator&[]", String::ConstructFromLiteral), WTFMove(parameters), nullptr, isOperator, ParsingMode::StandardLibrary)); > > Wouldn't all native functions be marked as StandardLibrary? Yeah they are. But right now, our constructor for NativeFunctionDeclaration takes a FunctionDeclaration as an rvalue. It's kinda weird. We should do a refactoring where we just give it the real constructor parameters directly. When we do that, we can omit ParsingMode and it can directly pass StandardLibrary to the parent constructor.
Comment on attachment 375602 [details] patch Clearing flags on attachment: 375602 Committed r248303: <https://trac.webkit.org/changeset/248303>
All reviewed patches have been landed. Closing bug.
<rdar://problem/53992512>