Skip to content

Commit

Permalink
fix #301 (#302)
Browse files Browse the repository at this point in the history
Now we convert uint32 into C.GLsizeiptr first, then convert GLsizeiptr into *void inside C function, so the race detector will not failed anymore.
  • Loading branch information
zyxkad authored Dec 22, 2023
1 parent 4e30d5c commit 721b746
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gls/glapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3055,9 +3055,9 @@ void glVertexAttrib4usv(GLuint index, const GLushort *v) {
}
}

void glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer) {
void glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLsizeiptr pointer) {

pglVertexAttribPointer(index, size, type, normalized, stride, pointer);
pglVertexAttribPointer(index, size, type, normalized, stride, (void*)(pointer));
if (checkError) {
GLenum err = pglGetError();
if (err != GL_NO_ERROR) {
Expand Down
2 changes: 1 addition & 1 deletion gls/glcorearb.h
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLsizeiptr pointer);
#endif
#endif /* GL_VERSION_2_0 */

Expand Down
2 changes: 1 addition & 1 deletion gls/gls-desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ func (gs *GLS) Uniform4fv(location int32, count int32, v *float32) {
// VertexAttribPointer defines an array of generic vertex attribute data.
func (gs *GLS) VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset uint32) {

C.glVertexAttribPointer(C.GLuint(index), C.GLint(size), C.GLenum(xtype), bool2c(normalized), C.GLsizei(stride), unsafe.Pointer(uintptr(offset)))
C.glVertexAttribPointer(C.GLuint(index), C.GLint(size), C.GLenum(xtype), bool2c(normalized), C.GLsizei(stride), C.GLsizeiptr(offset))
}

// Viewport sets the viewport.
Expand Down

0 comments on commit 721b746

Please sign in to comment.