mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
WGSL: * Remove vertex_idx and instance_idx. These are now vertex_index and instance_index. It seems this was removed once before, then reverted due to CTS failures, but the original change never landed again. * Remove the [[set(n)]] decoration. This has been [[group(n)]] for months now. API: * Remove deprecated enums from transform::VertexFormat. * Remove transform::Renamer constructor that takes a Config. This should be passed by DataMap. * Remove ast::AccessControl alias to ast::Access. Change-Id: I988c96c4269b02a5d77163409f261fd5923188e0 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56541 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
26 lines
837 B
WebGPU Shading Language
26 lines
837 B
WebGPU Shading Language
|
|
[[block]]
|
|
struct vertexUniformBuffer1 {
|
|
transform1 : mat2x2<f32>;
|
|
};
|
|
[[block]]
|
|
struct vertexUniformBuffer2 {
|
|
transform2 : mat2x2<f32>;
|
|
};
|
|
|
|
[[group(0), binding(0)]] var<uniform> x_20 : vertexUniformBuffer1;
|
|
[[group(1), binding(0)]] var<uniform> x_26 : vertexUniformBuffer2;
|
|
|
|
|
|
[[stage(vertex)]]
|
|
fn main([[builtin(vertex_index)]] gl_VertexIndex : u32) -> [[builtin(position)]] vec4<f32> {
|
|
var indexable : array<vec2<f32>, 3>;
|
|
let x_23 : mat2x2<f32> = x_20.transform1;
|
|
let x_28 : mat2x2<f32> = x_26.transform2;
|
|
let x_46 : u32 = gl_VertexIndex;
|
|
indexable = array<vec2<f32>, 3>(vec2<f32>(-1.0, 1.0), vec2<f32>(1.0, 1.0), vec2<f32>(-1.0, -1.0));
|
|
let x_51 : vec2<f32> = indexable[x_46];
|
|
let x_52 : vec2<f32> = (mat2x2<f32>((x_23[0u] + x_28[0u]), (x_23[1u] + x_28[1u])) * x_51);
|
|
return vec4<f32>(x_52.x, x_52.y, 0.0, 1.0);
|
|
}
|