@@ -127,6 +127,14 @@ typedef GLenum(DP_APIENTRY * TglCheckFramebufferStatusFn)(GLenum target);
127127
128128typedef GLubyte const *(DP_APIENTRY * TglGetStringiFn)(GLenum name, GLuint index);
129129
130+ typedef void (DP_APIENTRY * TglTexImage3DFn)(GLenum target, GLint level, GLint internalformat, GLsizei width,
131+ GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type,
132+ void const * pixels);
133+ typedef void (DP_APIENTRY * TglTexSubImage3DFn)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
134+ GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
135+ void const * pixels);
136+ typedef void (DP_APIENTRY * TglDrawArraysInstancedFn)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
137+
130138TglClearColorFn glClearColorFn = nullptr ;
131139TglClearFn glClearFn = nullptr ;
132140TglViewportFn glViewportFn = nullptr ;
@@ -205,6 +213,10 @@ TglCheckFramebufferStatusFn glCheckFramebufferStatusFn = nullptr;
205213
206214TglGetStringiFn glGetStringiFn = nullptr ;
207215
216+ TglTexImage3DFn glTexImage3DFn = nullptr ;
217+ TglTexSubImage3DFn glTexSubImage3DFn = nullptr ;
218+ TglDrawArraysInstancedFn glDrawArraysInstancedFn = nullptr ;
219+
208220#if !defined(GL_NUM_EXTENSIONS)
209221#define GL_NUM_EXTENSIONS 0x821D
210222#endif
@@ -282,6 +294,9 @@ void GLFunctions::Init(dp::ApiVersion apiVersion)
282294 glMapBufferRangeFn = ::glMapBufferRange;
283295 glFlushMappedBufferRangeFn = ::glFlushMappedBufferRange;
284296 glGetStringiFn = ::glGetStringi;
297+ glTexImage3DFn = ::glTexImage3D;
298+ glTexSubImage3DFn = ::glTexSubImage3D;
299+ glDrawArraysInstancedFn = ::glDrawArraysInstanced;
285300
286301 glClearColorFn = LOAD_GL_FUNC (TglClearColorFn, glClearColor);
287302 glClearFn = LOAD_GL_FUNC (TglClearFn, glClear);
@@ -296,6 +311,9 @@ void GLFunctions::Init(dp::ApiVersion apiVersion)
296311 glMapBufferRangeFn = LOAD_GL_FUNC (TglMapBufferRangeFn, glMapBufferRange);
297312 glFlushMappedBufferRangeFn = LOAD_GL_FUNC (TglFlushMappedBufferRangeFn, glFlushMappedBufferRange);
298313 glGetStringiFn = LOAD_GL_FUNC (TglGetStringiFn, glGetStringi);
314+ glTexImage3DFn = LOAD_GL_FUNC (TglTexImage3DFn, glTexImage3D);
315+ glTexSubImage3DFn = LOAD_GL_FUNC (TglTexSubImage3DFn, glTexSubImage3D);
316+ glDrawArraysInstancedFn = LOAD_GL_FUNC (TglDrawArraysInstancedFn, glDrawArraysInstanced);
299317
300318 glClearColorFn = ::glClearColor;
301319 glClearFn = ::glClear;
@@ -1000,8 +1018,9 @@ void GLFunctions::glTexImage2DArray(int width, int height, int layers, glConst l
10001018 void const * data)
10011019{
10021020 ASSERT_EQUAL (CurrentApiVersion, dp::ApiVersion::OpenGLES3, ());
1021+ ASSERT (glTexImage3DFn != nullptr , ());
10031022 int const internalFormat = TextureInternalFormatByLayout (layout, pixelType);
1004- GLCHECK (:: glTexImage3D (GL_TEXTURE_2D_ARRAY, 0 , internalFormat, width, height, layers, 0 , layout, pixelType, data));
1023+ GLCHECK (glTexImage3DFn (GL_TEXTURE_2D_ARRAY, 0 , internalFormat, width, height, layers, 0 , layout, pixelType, data));
10051024}
10061025
10071026void GLFunctions::glTexSubImage2D (int x, int y, int width, int height, glConst layout, glConst pixelType,
@@ -1015,7 +1034,8 @@ void GLFunctions::glTexSubImage2DArray(int x, int y, int layer, int width, int h
10151034 glConst pixelType, void const * data)
10161035{
10171036 ASSERT_EQUAL (CurrentApiVersion, dp::ApiVersion::OpenGLES3, ());
1018- GLCHECK (::glTexSubImage3D (GL_TEXTURE_2D_ARRAY, 0 , x, y, layer, width, height, 1 , layout, pixelType, data));
1037+ ASSERT (glTexSubImage3DFn != nullptr , ());
1038+ GLCHECK (glTexSubImage3DFn (GL_TEXTURE_2D_ARRAY, 0 , x, y, layer, width, height, 1 , layout, pixelType, data));
10191039}
10201040
10211041void GLFunctions::glTexParameter (glConst param, glConst value, glConst target)
@@ -1036,10 +1056,12 @@ void GLFunctions::glDrawArrays(glConst mode, int32_t first, uint32_t count)
10361056 ASSERT_EQUAL (CurrentApiVersion, dp::ApiVersion::OpenGLES3, ());
10371057 GLCHECK (::glDrawArrays (mode, first, count));
10381058}
1059+
10391060void GLFunctions::glDrawArraysInstanced (glConst mode, int32_t first, uint32_t count, uint32_t instanceCount)
10401061{
10411062 ASSERT_EQUAL (CurrentApiVersion, dp::ApiVersion::OpenGLES3, ());
1042- GLCHECK (::glDrawArraysInstanced (mode, first, count, instanceCount));
1063+ ASSERT (glDrawArraysInstancedFn != nullptr , ());
1064+ GLCHECK (glDrawArraysInstancedFn (mode, first, count, instanceCount));
10431065}
10441066
10451067void GLFunctions::glGenFramebuffer (uint32_t * fbo)
0 commit comments