[webkit-changes] [WebKit/WebKit] 9c5b69: [WGSL] Packed struct should not assume every neste...
Tadeu Zagallo
noreply at github.com
Thu Nov 9 02:27:18 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9c5b6978185e8766d399367daf2c784ec7053ac7
https://github.com/WebKit/WebKit/commit/9c5b6978185e8766d399367daf2c784ec7053ac7
Author: Tadeu Zagallo <tzagallo at apple.com>
Date: 2023-11-09 (Thu, 09 Nov 2023)
Changed paths:
M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
M Source/WebGPU/WGSL/tests/valid/packing.wgsl
Log Message:
-----------
[WGSL] Packed struct should not assume every nested struct is also packed
https://bugs.webkit.org/show_bug.cgi?id=264429
rdar://118129804
Reviewed by Mike Wyrzykowski.
A struct `S` might contain a field `x` whose type is another struct `T`. Currently,
if we pack `S`, during code generation we'll emit the type of `x` as `T::Packed`,
i.e. we just assume that all the structs referenced by `S` will also be packed.
Instead, we need to check before emitting code whether `T` was packed or not.
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/tests/valid/packing.wgsl:
Canonical link: https://commits.webkit.org/270438@main
More information about the webkit-changes
mailing list