[webkit-changes] [WebKit/WebKit] fbd53e: [WGSL] frag_depth on return value does not generat...

Tadeu Zagallo noreply at github.com
Mon Oct 30 09:42:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fbd53e5fa81a503d731ab9fcfb3827de132c52d7
      https://github.com/WebKit/WebKit/commit/fbd53e5fa81a503d731ab9fcfb3827de132c52d7
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-10-30 (Mon, 30 Oct 2023)

  Changed paths:
    M Source/WebGPU/WGSL/AST/ASTStructure.h
    M Source/WebGPU/WGSL/EntryPointRewriter.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/tests/valid/fragment-output.wgsl

  Log Message:
  -----------
  [WGSL] frag_depth on return value does not generate depth(any) attribution
https://bugs.webkit.org/show_bug.cgi?id=263393
rdar://117221582

Reviewed by Mike Wyrzykowski.

Add support for returning builtins from fragment shaders. In order to generate
valid metal code, we need to wrap the return type in a struct, since it's not
valid to add the attributes directly to the return type.

* Source/WebGPU/WGSL/AST/ASTStructure.h:
* Source/WebGPU/WGSL/EntryPointRewriter.cpp:
(WGSL::EntryPointRewriter::checkReturnType):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/tests/valid/fragment-output.wgsl:

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




More information about the webkit-changes mailing list