Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f6b375129695f4b25759d9780f4521f482f93335
      
https://github.com/WebKit/WebKit/commit/f6b375129695f4b25759d9780f4521f482f93335
  Author: Tadeu Zagallo <[email protected]>
  Date:   2024-07-04 (Thu, 04 Jul 2024)

  Changed paths:
    M Source/WebGPU/WGSL/AST/ASTCallExpression.h
    M Source/WebGPU/WGSL/TypeCheck.cpp
    A Source/WebGPU/WGSL/VisibilityValidator.cpp
    A Source/WebGPU/WGSL/VisibilityValidator.h
    M Source/WebGPU/WGSL/WGSL.cpp
    A Source/WebGPU/WGSL/tests/invalid/visibility.wgsl
    M Source/WebGPU/WGSL/tests/valid/overload.wgsl
    M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [WGSL] built-in functions should only be allowed in appropriate shader stages
https://bugs.webkit.org/show_bug.cgi?id=276140
rdar://130225282

Reviewed by Mike Wyrzykowski.

We already had the information about which shader stages the built-ins could be
called from, but we were missing the check. Add a new pass that traverses the
call graph and checks if all the built-ins are called from the appropriate 
stages.

* Source/WebGPU/WGSL/AST/ASTCallExpression.h:
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::chooseOverload):
* Source/WebGPU/WGSL/VisibilityValidator.cpp: Added.
(WGSL::VisibilityValidator::VisibilityValidator):
(WGSL::VisibilityValidator::validate):
(WGSL::VisibilityValidator::visit):
(WGSL::VisibilityValidator::error):
(WGSL::validateVisibility):
* Source/WebGPU/WGSL/VisibilityValidator.h: Added.
* Source/WebGPU/WGSL/WGSL.cpp:
(WGSL::staticCheck):
* Source/WebGPU/WGSL/tests/invalid/visibility.wgsl: Added.
* Source/WebGPU/WGSL/tests/valid/overload.wgsl:
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to