[webkit-changes] [WebKit/WebKit] 255232: [WebGPU] fragmentWriteGBuffers.wgsl does not compile

Tadeu Zagallo noreply at github.com
Tue Sep 26 00:23:26 PDT 2023


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

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

  Log Message:
  -----------
  [WebGPU] fragmentWriteGBuffers.wgsl does not compile
https://bugs.webkit.org/show_bug.cgi?id=261890
rdar://115849432

Reviewed by Mike Wyrzykowski.

When a fragment entrypoint returns a struct, the generated code requires different
annotations for the struct fields, similar to how we generate VertexOutput structs.
We replicate the same process of cloning the struct with a different role, FragmentOutput,
and use it to generate the correct code without breaking other uses of the user-defined
struct.

* 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: Added.

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




More information about the webkit-changes mailing list