summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2025-07-15 09:32:14 -0500
committerAndrew Davis <afd@ti.com>2025-07-25 11:33:33 -0500
commit19cf50cbacf665e06e949aebe42798e3edd1ac6c (patch)
tree8617dbd820990cc3e503e65ebae604f2ef1ef8ed
parent84ada447ee65798115da95679b13053f295ce601 (diff)
cube-shadertoy: Do not setup VertexAttribPointer in init
Vertex attribute information is setup each loop before drawing, no need to set this up in init as it will be overwritten each draw call anyway. Signed-off-by: Andrew Davis <afd@ti.com>
-rw-r--r--cube-shadertoy.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/cube-shadertoy.c b/cube-shadertoy.c
index dfa8919..52c4f81 100644
--- a/cube-shadertoy.c
+++ b/cube-shadertoy.c
@@ -291,7 +291,6 @@ static int init_shadertoy(const char *file)
glBindBuffer(GL_ARRAY_BUFFER, gl.stoy_vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), 0, GL_STATIC_DRAW);
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), &vertices[0]);
- glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid *)(intptr_t)0);
return 0;
}
@@ -400,8 +399,6 @@ const struct cube * init_cube_shadertoy(const struct egl *egl, const struct gbm
if (ret)
return NULL;
- glUseProgram(gl.program);
-
gl.modelviewmatrix = glGetUniformLocation(gl.program, "modelviewMatrix");
gl.modelviewprojectionmatrix = glGetUniformLocation(gl.program, "modelviewprojectionMatrix");
gl.texture = glGetUniformLocation(gl.program, "uTex");
@@ -419,9 +416,6 @@ const struct cube * init_cube_shadertoy(const struct egl *egl, const struct gbm
glBufferSubData(GL_ARRAY_BUFFER, gl.positionsoffset, sizeof(vVertices), &vVertices[0]);
glBufferSubData(GL_ARRAY_BUFFER, gl.texcoordsoffset, sizeof(vTexCoords), &vTexCoords[0]);
glBufferSubData(GL_ARRAY_BUFFER, gl.normalsoffset, sizeof(vNormals), &vNormals[0]);
- glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid *)(intptr_t)gl.positionsoffset);
- glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid *)(intptr_t)gl.normalsoffset);
- glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *)(intptr_t)gl.texcoordsoffset);
ret = init_shadertoy(file);
if (ret) {