[rs] Avoid array indexing in hello-triangle

This commit is contained in:
Joshua Groves authored and Dzmitry Malyshau committed 2020-03-30 07:58:06 -04:00
1 parent ef1e47216e
commit 652c7242fb
2 files changed
+2 -7

No files matched your search

+2 -7
View File
@@ -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.