From b8e21b8b21da85fea52cf5d37cda5454d9ca0334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 3 Mar 2021 14:43:54 +0100 Subject: [PATCH] GL: make the new setUniform() code paths work on 32bit Windows. The GL API uses the __stdcall calling convention but the default is __cdecl. This distinction is not on 64bit anymore and there it's the same. --- src/Magnum/GL/AbstractShaderProgram.h | 68 +++++++++---------- .../GL/Implementation/ShaderProgramState.h | 68 +++++++++---------- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/Magnum/GL/AbstractShaderProgram.h b/src/Magnum/GL/AbstractShaderProgram.h index 9f17ffdf7..fe54fae93 100644 --- a/src/Magnum/GL/AbstractShaderProgram.h +++ b/src/Magnum/GL/AbstractShaderProgram.h @@ -1369,48 +1369,48 @@ class MAGNUM_GL_EXPORT AbstractShaderProgram: public AbstractObject { signature matching the DSA APIs. On DSA-enabled platforms the glProgramUniform*() functions are used directly, otherwise these all use() the shader first and then call the old-style API. */ - MAGNUM_GL_LOCAL static void uniform1fvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniform2fvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniform3fvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniform4fvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniform1ivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLint* values); - MAGNUM_GL_LOCAL static void uniform2ivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLint* values); - MAGNUM_GL_LOCAL static void uniform3ivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLint* values); - MAGNUM_GL_LOCAL static void uniform4ivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLint* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform1fvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform2fvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform3fvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform4fvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform1ivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLint* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform2ivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLint* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform3ivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLint* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform4ivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLint* values); #ifndef MAGNUM_TARGET_GLES2 - MAGNUM_GL_LOCAL static void uniform1uivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLuint* values); - MAGNUM_GL_LOCAL static void uniform2uivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLuint* values); - MAGNUM_GL_LOCAL static void uniform3uivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLuint* values); - MAGNUM_GL_LOCAL static void uniform4uivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLuint* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform1uivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLuint* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform2uivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLuint* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform3uivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLuint* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform4uivImplementationDefault(GLuint id, GLint location, GLsizei count, const GLuint* values); #endif #ifndef MAGNUM_TARGET_GLES - MAGNUM_GL_LOCAL static void uniform1dvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniform2dvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniform3dvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniform4dvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform1dvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform2dvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform3dvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniform4dvImplementationDefault(GLuint id, GLint location, GLsizei count, const GLdouble* values); #endif - MAGNUM_GL_LOCAL static void uniformMatrix2fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniformMatrix3fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniformMatrix4fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix2fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix3fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix4fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); #ifndef MAGNUM_TARGET_GLES2 - MAGNUM_GL_LOCAL static void uniformMatrix2x3fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniformMatrix3x2fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniformMatrix2x4fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniformMatrix4x2fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniformMatrix3x4fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); - MAGNUM_GL_LOCAL static void uniformMatrix4x3fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix2x3fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix3x2fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix2x4fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix4x2fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix3x4fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix4x3fvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLfloat* values); #endif #ifndef MAGNUM_TARGET_GLES - MAGNUM_GL_LOCAL static void uniformMatrix2dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniformMatrix3dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniformMatrix4dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniformMatrix2x3dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniformMatrix3x2dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniformMatrix2x4dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniformMatrix4x2dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniformMatrix3x4dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); - MAGNUM_GL_LOCAL static void uniformMatrix4x3dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix2dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix3dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix4dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix2x3dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix3x2dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix2x4dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix4x2dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix3x4dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); + MAGNUM_GL_LOCAL static void APIENTRY uniformMatrix4x3dvImplementationDefault(GLuint id, GLint location, GLsizei count, GLboolean transpose, const GLdouble* values); #endif GLuint _id; diff --git a/src/Magnum/GL/Implementation/ShaderProgramState.h b/src/Magnum/GL/Implementation/ShaderProgramState.h index 4793433bd..dc686e174 100644 --- a/src/Magnum/GL/Implementation/ShaderProgramState.h +++ b/src/Magnum/GL/Implementation/ShaderProgramState.h @@ -49,48 +49,48 @@ struct ShaderProgramState { void(*cleanLogImplementation)(std::string&); #ifndef MAGNUM_TARGET_WEBGL - void(*uniform1fvImplementation)(GLuint, GLint, GLsizei, const GLfloat*); - void(*uniform2fvImplementation)(GLuint, GLint, GLsizei, const GLfloat*); - void(*uniform3fvImplementation)(GLuint, GLint, GLsizei, const GLfloat*); - void(*uniform4fvImplementation)(GLuint, GLint, GLsizei, const GLfloat*); - void(*uniform1ivImplementation)(GLuint, GLint, GLsizei, const GLint*); - void(*uniform2ivImplementation)(GLuint, GLint, GLsizei, const GLint*); - void(*uniform3ivImplementation)(GLuint, GLint, GLsizei, const GLint*); - void(*uniform4ivImplementation)(GLuint, GLint, GLsizei, const GLint*); + void(APIENTRY *uniform1fvImplementation)(GLuint, GLint, GLsizei, const GLfloat*); + void(APIENTRY *uniform2fvImplementation)(GLuint, GLint, GLsizei, const GLfloat*); + void(APIENTRY *uniform3fvImplementation)(GLuint, GLint, GLsizei, const GLfloat*); + void(APIENTRY *uniform4fvImplementation)(GLuint, GLint, GLsizei, const GLfloat*); + void(APIENTRY *uniform1ivImplementation)(GLuint, GLint, GLsizei, const GLint*); + void(APIENTRY *uniform2ivImplementation)(GLuint, GLint, GLsizei, const GLint*); + void(APIENTRY *uniform3ivImplementation)(GLuint, GLint, GLsizei, const GLint*); + void(APIENTRY *uniform4ivImplementation)(GLuint, GLint, GLsizei, const GLint*); #ifndef MAGNUM_TARGET_GLES2 - void(*uniform1uivImplementation)(GLuint, GLint, GLsizei, const GLuint*); - void(*uniform2uivImplementation)(GLuint, GLint, GLsizei, const GLuint*); - void(*uniform3uivImplementation)(GLuint, GLint, GLsizei, const GLuint*); - void(*uniform4uivImplementation)(GLuint, GLint, GLsizei, const GLuint*); + void(APIENTRY *uniform1uivImplementation)(GLuint, GLint, GLsizei, const GLuint*); + void(APIENTRY *uniform2uivImplementation)(GLuint, GLint, GLsizei, const GLuint*); + void(APIENTRY *uniform3uivImplementation)(GLuint, GLint, GLsizei, const GLuint*); + void(APIENTRY *uniform4uivImplementation)(GLuint, GLint, GLsizei, const GLuint*); #endif #ifndef MAGNUM_TARGET_GLES - void(*uniform1dvImplementation)(GLuint, GLint, GLsizei, const GLdouble*); - void(*uniform2dvImplementation)(GLuint, GLint, GLsizei, const GLdouble*); - void(*uniform3dvImplementation)(GLuint, GLint, GLsizei, const GLdouble*); - void(*uniform4dvImplementation)(GLuint, GLint, GLsizei, const GLdouble*); + void(APIENTRY *uniform1dvImplementation)(GLuint, GLint, GLsizei, const GLdouble*); + void(APIENTRY *uniform2dvImplementation)(GLuint, GLint, GLsizei, const GLdouble*); + void(APIENTRY *uniform3dvImplementation)(GLuint, GLint, GLsizei, const GLdouble*); + void(APIENTRY *uniform4dvImplementation)(GLuint, GLint, GLsizei, const GLdouble*); #endif - void(*uniformMatrix2fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); - void(*uniformMatrix3fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); - void(*uniformMatrix4fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix2fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix3fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix4fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); #ifndef MAGNUM_TARGET_GLES2 - void(*uniformMatrix2x3fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); - void(*uniformMatrix3x2fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); - void(*uniformMatrix2x4fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); - void(*uniformMatrix4x2fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); - void(*uniformMatrix3x4fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); - void(*uniformMatrix4x3fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix2x3fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix3x2fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix2x4fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix4x2fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix3x4fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); + void(APIENTRY *uniformMatrix4x3fvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLfloat*); #endif #ifndef MAGNUM_TARGET_GLES - void(*uniformMatrix2dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); - void(*uniformMatrix3dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); - void(*uniformMatrix4dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); - void(*uniformMatrix2x3dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); - void(*uniformMatrix3x2dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); - void(*uniformMatrix2x4dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); - void(*uniformMatrix4x2dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); - void(*uniformMatrix3x4dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); - void(*uniformMatrix4x3dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix2dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix3dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix4dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix2x3dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix3x2dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix2x4dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix4x2dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix3x4dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); + void(APIENTRY *uniformMatrix4x3dvImplementation)(GLuint, GLint, GLsizei, GLboolean, const GLdouble*); #endif #endif