Skip to content

Commit

Permalink
[gldemo] switch to gl_VertexIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorbin committed Oct 9, 2023
1 parent fbd5bb6 commit 2711895
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gltiles.vert
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ uniform LayerParams {
float tileSize;

// Implicit positioning mode is enabled if stride > 0, where tiles are laid
// out as a dense grid indexed by gl_VertexID in row-major order starting at
// out as a dense grid indexed by gl_VertexIndex in row-major order starting at
// layer origin (defined by transform) and progressing in stride-sized rows.
// Any offset attribute value is added to this value.
//
Expand Down Expand Up @@ -60,8 +60,8 @@ void main(void) {
vec2 loc;
if (stride > 0) {
loc = vec2(
float(gl_VertexID % stride),
float(gl_VertexID / stride)
float(gl_VertexIndex % stride),
float(gl_VertexIndex / stride)
);
}
loc += 0.5;
Expand Down

0 comments on commit 2711895

Please sign in to comment.