Build a fragment shader based on output value and types e.g. write to color target 0 a vec4<f32>(1.0, 0.0, 1.0, 1.0) and color target 2 a vec2<u32>(1, 2)
vec4<f32>(1.0, 0.0, 1.0, 1.0)
vec2<u32>(1, 2)
outputs: [ { values: [1, 0, 1, 1],, plainType: 'f32', componentCount: 4, }, null, { values: [1, 2], plainType: 'u32', componentCount: 2, },] Copy
outputs: [ { values: [1, 0, 1, 1],, plainType: 'f32', componentCount: 4, }, null, { values: [1, 2], plainType: 'u32', componentCount: 2, },]
return:
struct Outputs { @location(0) o1 : vec4<f32>, @location(2) o3 : vec2<u32>,}@fragment fn main() -> Outputs { return Outputs(vec4<f32>(1.0, 0.0, 1.0, 1.0), vec4<u32>(1, 2));} Copy
struct Outputs { @location(0) o1 : vec4<f32>, @location(2) o3 : vec2<u32>,}@fragment fn main() -> Outputs { return Outputs(vec4<f32>(1.0, 0.0, 1.0, 1.0), vec4<u32>(1, 2));}
If fragDepth is given there will be an extra @builtin(frag_depth) output with the specified value assigned.
the shader outputs for each location attribute
the shader outputs frag_depth value (optional)
the fragment shader string
Generated using TypeDoc
Build a fragment shader based on output value and types e.g. write to color target 0 a
vec4<f32>(1.0, 0.0, 1.0, 1.0)
and color target 2 avec2<u32>(1, 2)
return:
If fragDepth is given there will be an extra @builtin(frag_depth) output with the specified value assigned.