Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b810632939925d5e80263b3991700849b1873cea
      
https://github.com/WebKit/WebKit/commit/b810632939925d5e80263b3991700849b1873cea
  Author: Tadeu Zagallo <tzaga...@apple.com>
  Date:   2023-05-19 (Fri, 19 May 2023)

  Changed paths:
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/Types.cpp
    M Source/WebGPU/WGSL/Types.h

  Log Message:
  -----------
  [WGSL] Respect @size and @alignment when serializing structs
https://bugs.webkit.org/show_bug.cgi?id=256971
rdar://109516591

Reviewed by Dan Glastonbury.

Implement the size and alignment calculation for types according to the spec[1] 
and
respect both the implicit and explit size and alignments (provided through 
attributes)
when serializing structs.

[1]: https://gpuweb.github.io/gpuweb/wgsl/#alignment-and-size

* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::insertStructs):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/Types.cpp:
(WGSL::Type::size const):
(WGSL::Type::alignment const):
* Source/WebGPU/WGSL/Types.h:

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to