forked from gfx-rs/wgpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Broke the hello-triangle demo on intel graphics
- Loading branch information
1 parent
630c12f
commit dfcc1ed
Showing
2 changed files
with
60 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
@group(0) | ||
@binding(0) | ||
var<uniform> color: vec4<f32>; | ||
|
||
struct VertexOutput { | ||
@location(0) color: vec4<f32>, | ||
@builtin(position) position: vec4<f32>, | ||
}; | ||
|
||
@vertex | ||
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4<f32> { | ||
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> VertexOutput { | ||
let x = f32(i32(in_vertex_index) - 1); | ||
let y = f32(i32(in_vertex_index & 1u) * 2 - 1); | ||
return vec4<f32>(x, y, 0.0, 1.0); | ||
return VertexOutput(color, vec4<f32>(x, y, 0.0, 1.0)); | ||
} | ||
|
||
@fragment | ||
fn fs_main() -> @location(0) vec4<f32> { | ||
return vec4<f32>(1.0, 0.0, 0.0, 1.0); | ||
fn fs_main(vertex: VertexOutput) -> @location(0) vec4<f32> { | ||
return vertex.color; | ||
} |