[webkit-changes] [WebKit/WebKit] 518fab: [WGSL] Add code generation for textureNumLevels
Tadeu Zagallo
noreply at github.com
Tue Sep 26 02:09:24 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 518faba7204dd1a114f54a8734a382741b78e1a0
https://github.com/WebKit/WebKit/commit/518faba7204dd1a114f54a8734a382741b78e1a0
Author: Tadeu Zagallo <tzagallo at apple.com>
Date: 2023-09-26 (Tue, 26 Sep 2023)
Changed paths:
M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
M Source/WebGPU/WGSL/tests/valid/overload.wgsl
Log Message:
-----------
[WGSL] Add code generation for textureNumLevels
https://bugs.webkit.org/show_bug.cgi?id=262047
rdar://115996263
Reviewed by Dan Glastonbury.
Generate Metal code for `textureNumLevels(t)` calls by transforming it into
`t.get_num_mip_levels()` calls. I also moved all the helpers that emit code for
built-ins into their own static functions, as it was becoming quite messy to
have so many lambdas in the same method.
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::emitTextureDimensions):
(WGSL::Metal::emitTextureLoad):
(WGSL::Metal::emitTextureSample):
(WGSL::Metal::emitTextureSampleClampToEdge):
(WGSL::Metal::emitTextureNumLevels):
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/tests/valid/overload.wgsl:
Canonical link: https://commits.webkit.org/268442@main
More information about the webkit-changes
mailing list