-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
1 parent
797f5ce
commit 518faba
Showing
2 changed files
with
166 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters