mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
[rs] Avoid array indexing in hello-triangle
This commit is contained in:
1 parent
ef1e47216e
commit
652c7242fb
2 files changed
+2
-7
No files matched your search
@@ -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