mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Co-authored-by: Jim Blandy <jimb@red-bean.com> Co-authored-by: Erich Gubler <erichdongubler@gmail.com> Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com> Co-authored-by: SupaMaggie70Incorporated <85136135+SupaMaggie70Incorporated@users.noreply.github.com>
38 lines
868 B
WebGPU Shading Language
38 lines
868 B
WebGPU Shading Language
// An empty WGSL shader to check that task payload/mesh output
|
|
// are still properly written without being used in the shader
|
|
|
|
enable wgpu_mesh_shader;
|
|
|
|
struct TaskPayload {
|
|
dummy: u32,
|
|
}
|
|
struct VertexOutput {
|
|
@builtin(position) position: vec4<f32>,
|
|
}
|
|
struct PrimitiveOutput {
|
|
@builtin(line_indices) indices: vec2<u32>,
|
|
}
|
|
|
|
var<task_payload> taskPayload: TaskPayload;
|
|
|
|
@task
|
|
@payload(taskPayload)
|
|
@workgroup_size(1)
|
|
fn ts_main() -> @builtin(mesh_task_size) vec3<u32> {
|
|
return vec3(1, 1, 1);
|
|
}
|
|
|
|
struct MeshOutput {
|
|
@builtin(vertices) vertices: array<VertexOutput, 2>,
|
|
@builtin(primitives) primitives: array<PrimitiveOutput, 1>,
|
|
@builtin(vertex_count) vertex_count: u32,
|
|
@builtin(primitive_count) primitive_count: u32,
|
|
}
|
|
|
|
var<workgroup> mesh_output: MeshOutput;
|
|
|
|
@mesh(mesh_output)
|
|
@payload(taskPayload)
|
|
@workgroup_size(1)
|
|
fn ms_main() {}
|