mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Don't use duplicate function name in boids shader (#2183)
From the spec: "A declaration must not introduce a name when that identifier is already in scope with the same end scope as another instance of that name." naga doesn't yet check this (gfx-rs/naga#1480) but Chrome/Tint rightly complains with: error: redefinition of 'main'
This commit is contained in:
committed by
GitHub
parent
3545a4fdd5
commit
47fd77619f
@@ -1,5 +1,5 @@
|
||||
[[stage(vertex)]]
|
||||
fn main(
|
||||
fn main_vs(
|
||||
[[location(0)]] particle_pos: vec2<f32>,
|
||||
[[location(1)]] particle_vel: vec2<f32>,
|
||||
[[location(2)]] position: vec2<f32>,
|
||||
@@ -13,6 +13,6 @@ fn main(
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main() -> [[location(0)]] vec4<f32> {
|
||||
fn main_fs() -> [[location(0)]] vec4<f32> {
|
||||
return vec4<f32>(1.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ impl framework::Example for Example {
|
||||
layout: Some(&render_pipeline_layout),
|
||||
vertex: wgpu::VertexState {
|
||||
module: &draw_shader,
|
||||
entry_point: "main",
|
||||
entry_point: "main_vs",
|
||||
buffers: &[
|
||||
wgpu::VertexBufferLayout {
|
||||
array_stride: 4 * 4,
|
||||
@@ -153,7 +153,7 @@ impl framework::Example for Example {
|
||||
},
|
||||
fragment: Some(wgpu::FragmentState {
|
||||
module: &draw_shader,
|
||||
entry_point: "main",
|
||||
entry_point: "main_fs",
|
||||
targets: &[config.format.into()],
|
||||
}),
|
||||
primitive: wgpu::PrimitiveState::default(),
|
||||
|
||||
Reference in New Issue
Block a user