src/core: move mach-core@9a4d09707d9f1cb6ea5602bdf58caeefc46146be package to here
Helps hexops/mach#1165 Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
fa3f6161ad
commit
38f296ecce
157 changed files with 28383 additions and 0 deletions
25
src/core/examples/instanced-cube/shader.wgsl
Normal file
25
src/core/examples/instanced-cube/shader.wgsl
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
@binding(0) @group(0) var<uniform> ubos : array<mat4x4<f32>, 16>;
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) position_clip : vec4<f32>,
|
||||
@location(0) fragUV : vec2<f32>,
|
||||
@location(1) fragPosition: vec4<f32>,
|
||||
};
|
||||
|
||||
@vertex
|
||||
fn vertex_main(@builtin(instance_index) instanceIdx : u32,
|
||||
@location(0) position : vec4<f32>,
|
||||
@location(1) uv : vec2<f32>) -> VertexOutput {
|
||||
var output : VertexOutput;
|
||||
output.position_clip = ubos[instanceIdx] * position;
|
||||
output.fragUV = uv;
|
||||
output.fragPosition = 0.5 * (position + vec4<f32>(1.0, 1.0, 1.0, 1.0));
|
||||
return output;
|
||||
}
|
||||
|
||||
@fragment fn frag_main(
|
||||
@location(0) fragUV: vec2<f32>,
|
||||
@location(1) fragPosition: vec4<f32>
|
||||
) -> @location(0) vec4<f32> {
|
||||
return fragPosition;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue