mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
[wgsl-in] support const-expressions in attributes allow `Splat` as an evaluated const-expression type
26 lines
337 B
WebGPU Shading Language
26 lines
337 B
WebGPU Shading Language
struct S {
|
|
x: i32,
|
|
}
|
|
|
|
const Value: i32 = 1;
|
|
|
|
@group(0) @binding(0)
|
|
var Texture: texture_2d<f32>;
|
|
@group(0) @binding(1)
|
|
var Sampler: sampler;
|
|
|
|
fn statement() {
|
|
return;
|
|
}
|
|
|
|
fn returns() -> S {
|
|
return S(Value);
|
|
}
|
|
|
|
fn call() {
|
|
statement();
|
|
let _e0 = returns();
|
|
let s = textureSample(Texture, Sampler, vec2(1.0));
|
|
}
|
|
|