mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-06 12:15:43 +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>
65 lines
974 B
GLSL
65 lines
974 B
GLSL
#version 310 es
|
|
precision mediump float;
|
|
|
|
struct S {
|
|
float a;
|
|
};
|
|
|
|
layout (binding = 0) buffer S_1 {
|
|
float a;
|
|
} b0;
|
|
layout (binding = 0) buffer S_2 {
|
|
float a;
|
|
} b1;
|
|
layout (binding = 0) buffer S_3 {
|
|
float a;
|
|
} b2;
|
|
layout (binding = 0) buffer S_4 {
|
|
float a;
|
|
} b3;
|
|
layout (binding = 0) buffer S_5 {
|
|
float a;
|
|
} b4;
|
|
layout (binding = 0) buffer S_6 {
|
|
float a;
|
|
} b5;
|
|
layout (binding = 0) buffer S_7 {
|
|
float a;
|
|
} b6;
|
|
layout (binding = 0) buffer S_8 {
|
|
float a;
|
|
} b7;
|
|
layout (binding = 1) uniform S_9 {
|
|
float a;
|
|
} b8;
|
|
layout (binding = 1) uniform S_10 {
|
|
float a;
|
|
} b9;
|
|
layout (binding = 1) uniform S_11 {
|
|
float a;
|
|
} b10;
|
|
layout (binding = 1) uniform S_12 {
|
|
float a;
|
|
} b11;
|
|
layout (binding = 1) uniform S_13 {
|
|
float a;
|
|
} b12;
|
|
layout (binding = 1) uniform S_14 {
|
|
float a;
|
|
} b13;
|
|
layout (binding = 1) uniform S_15 {
|
|
float a;
|
|
} b14;
|
|
layout (binding = 1) uniform S_16 {
|
|
float a;
|
|
} b15;
|
|
|
|
void tint_symbol() {
|
|
return;
|
|
}
|
|
void main() {
|
|
tint_symbol();
|
|
}
|
|
|
|
|