mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 10:51:35 +00:00
This transform converts all separate texture/sampler references in a program into combined texture/samplers. This is required for GLSL, which does not support separate texture/samplers. As input, the transform requires a map from the unique sampler/texture pairs previously gathered by the Resolver to strings, which will be used as the names of the newly-generated combined samplers. Note that binding points are unused by GLSL, and so are set to (0, 0) with collision detection disabled. All function signatures containing textures or samplers are rewritten, as well as function calls and texture intrinsic calls. For texture intrinsic calls, a placeholder sampler is used to satisfy the subsequent Resolver pass (GLSL texture intrinsics do not require a separate sampler, but WGSL intrinsics do). The placeholder is also used if the shader contains only texture references (e.g., textureLoad). Bug: tint:1366 Change-Id: Iff8407d28fdc2a8adac5cb655707a08c8553c389 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/77080 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>