mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[rs] Avoid array indexing in hello-triangle
This commit is contained in:
committed by
Dzmitry Malyshau
parent
ef1e47216e
commit
652c7242fb
@@ -4,12 +4,7 @@ out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
const vec2 positions[3] = vec2[3](
|
||||
vec2(0.0, -0.5),
|
||||
vec2(0.5, 0.5),
|
||||
vec2(-0.5, 0.5)
|
||||
);
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
|
||||
vec2 position = vec2(gl_VertexIndex, (gl_VertexIndex & 1) * 2) - 1;
|
||||
gl_Position = vec4(position, 0.0, 1.0);
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user