Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a097f4c45e4e4334501f614fd9db3b3e7badb047
      
https://github.com/WebKit/WebKit/commit/a097f4c45e4e4334501f614fd9db3b3e7badb047
  Author: Ruthvik Konda <[email protected]>
  Date:   2026-09-02 (Wed, 02 Sep 2026)

  Changed paths:
    M 
LayoutTests/http/tests/webgpu/webgpu/shader/validation/statement/discard-expected.txt
    M Source/WebGPU/WGSL/VisibilityValidator.cpp
    M Tools/TestWebKitAPI/Tests/WGSL/TypeCheckingTests.mm

  Log Message:
  -----------
  [WGSL] shader,validation,statement,discard:* is failing
https://bugs.webkit.org/show_bug.cgi?id=323140
rdar://186400145

Reviewed by Dan Glastonbury and Mike Wyrzykowski.

The WGSL spec[1] states that the discard statement must only be used in a
fragment shader stage, but we accepted it in vertex and compute entry points,
and in any function reachable from one. Metal codegen then emitted
discard_fragment() inside a [[kernel]] or [[vertex]] function, which the Metal
compiler rejects.

VisibilityValidator already walks the call graph once per entry point to check
that built-ins are only called from the stages that allow them, so validating
the discard statement there also covers helper functions reached from a
non-fragment entry point.

[1]: https://www.w3.org/TR/WGSL/#discard-statement

* 
LayoutTests/http/tests/webgpu/webgpu/shader/validation/statement/discard-expected.txt:
* Source/WebGPU/WGSL/VisibilityValidator.cpp:
(WGSL::VisibilityValidator::visit):
* Tools/TestWebKitAPI/Tests/WGSL/TypeCheckingTests.mm:
(TestWGSLAPI::TEST(WGSLTypeCheckingTests, Visibility)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to