From 729f347f60b6d0aec95a3b7fcbeebae4d0024fa8 Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Fri, 1 Dec 2017 14:17:54 -0700 Subject: [PATCH] Fix OpenGL function prototype calling conventions OpenGL doesn't use the default function calling convention on all platforms, which is why gl.h defines the macros GL_APICALL and GL_APIENTRY for applications to use when defining their own OpenGL function prototypes. Not using these may cause a crash if an OpenGL function is called with the wrong calling convention. Affects: KHR-GL46.transform_feedback.* Components: OpenGL VK-GL-CTS issue: 882 Change-Id: I8766262b32a04b8eff8e110e1f116c2f915274e9 --- .../modules/gl/gl3cTransformFeedbackTests.hpp | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/external/openglcts/modules/gl/gl3cTransformFeedbackTests.hpp b/external/openglcts/modules/gl/gl3cTransformFeedbackTests.hpp index 0f5776a..31ba85c 100644 --- a/external/openglcts/modules/gl/gl3cTransformFeedbackTests.hpp +++ b/external/openglcts/modules/gl/gl3cTransformFeedbackTests.hpp @@ -223,10 +223,10 @@ private: */ bool testInstanced(void); - typedef void (*BindBufferOffsetEXT_ProcAddress)(glw::GLenum target, glw::GLuint index, glw::GLuint buffer, - glw::GLintptr offset); - typedef void (*GetIntegerIndexedvEXT_ProcAddress)(glw::GLenum param, glw::GLuint index, glw::GLint* values); - typedef void (*GetBooleanIndexedvEXT_ProcAddress)(glw::GLenum param, glw::GLuint index, glw::GLboolean* values); + typedef GLW_APICALL void (GLW_APIENTRY *BindBufferOffsetEXT_ProcAddress)(glw::GLenum target, glw::GLuint index, glw::GLuint buffer, + glw::GLintptr offset); + typedef GLW_APICALL void (GLW_APIENTRY *GetIntegerIndexedvEXT_ProcAddress)(glw::GLenum param, glw::GLuint index, glw::GLint* values); + typedef GLW_APICALL void (GLW_APIENTRY *GetBooleanIndexedvEXT_ProcAddress)(glw::GLenum param, glw::GLuint index, glw::GLboolean* values); BindBufferOffsetEXT_ProcAddress m_glBindBufferOffsetEXT; GetIntegerIndexedvEXT_ProcAddress m_glGetIntegerIndexedvEXT; @@ -388,8 +388,8 @@ protected: glw::GLenum m_attrib_type; glw::GLuint m_max_vertices_drawn; - typedef void (*BindBufferOffsetEXT_ProcAddress)(glw::GLenum target, glw::GLuint index, glw::GLuint buffer, - glw::GLintptr offset); + typedef GLW_APICALL void (GLW_APIENTRY *BindBufferOffsetEXT_ProcAddress)(glw::GLenum target, glw::GLuint index, glw::GLuint buffer, + glw::GLintptr offset); BindBufferOffsetEXT_ProcAddress m_glBindBufferOffsetEXT; @@ -1196,10 +1196,10 @@ private: bool check(); void clean(); - typedef glw::GLuint (*GetUniformBlockIndex_ProcAddress)(glw::GLuint program, const glw::GLchar* uniformBlockName); - typedef void (*UniformBlockBinding_ProcAddress)(glw::GLuint program, - glw::GLuint uniformIndex, - glw::GLuint uniformBlockBinding); + typedef GLW_APICALL glw::GLuint (GLW_APIENTRY *GetUniformBlockIndex_ProcAddress)(glw::GLuint program, const glw::GLchar* uniformBlockName); + typedef GLW_APICALL void (GLW_APIENTRY *UniformBlockBinding_ProcAddress)(glw::GLuint program, + glw::GLuint uniformIndex, + glw::GLuint uniformBlockBinding); GetUniformBlockIndex_ProcAddress m_glGetUniformBlockIndex; UniformBlockBinding_ProcAddress m_glUniformBlockBinding; @@ -1280,10 +1280,10 @@ private: bool check(); void clean(); - typedef glw::GLuint (*GetUniformBlockIndex_ProcAddress)(glw::GLuint program, const glw::GLchar* uniformBlockName); - typedef void (*UniformBlockBinding_ProcAddress)(glw::GLuint program, - glw::GLuint uniformIndex, - glw::GLuint uniformBlockBinding); + typedef GLW_APICALL glw::GLuint (GLW_APIENTRY *GetUniformBlockIndex_ProcAddress)(glw::GLuint program, const glw::GLchar* uniformBlockName); + typedef GLW_APICALL void (GLW_APIENTRY *UniformBlockBinding_ProcAddress)(glw::GLuint program, + glw::GLuint uniformIndex, + glw::GLuint uniformBlockBinding); GetUniformBlockIndex_ProcAddress m_glGetUniformBlockIndex; UniformBlockBinding_ProcAddress m_glUniformBlockBinding; -- 2.7.4