e44b849d |
1 | // Copyright (c) 2021 OPEN CASCADE SAS |
2 | // |
3 | // This file is part of Open CASCADE Technology software library. |
4 | // |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
10 | // |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
13 | |
14 | #if defined(_WIN32) |
15 | #include <windows.h> |
16 | #endif |
17 | |
18 | #include <OpenGl_Context.hxx> |
19 | |
20 | #include <OpenGl_ArbTBO.hxx> |
21 | #include <OpenGl_ArbIns.hxx> |
22 | #include <OpenGl_ArbDbg.hxx> |
23 | #include <OpenGl_ArbFBO.hxx> |
24 | #include <OpenGl_ExtGS.hxx> |
25 | #include <OpenGl_ArbSamplerObject.hxx> |
26 | #include <OpenGl_ArbTexBindless.hxx> |
952a0565 |
27 | #include <OpenGl_GlCore46.hxx> |
e44b849d |
28 | |
29 | // ======================================================================= |
30 | // function : init |
31 | // purpose : |
32 | // ======================================================================= |
33 | void OpenGl_GlFunctions::load (OpenGl_Context& theCtx, |
34 | Standard_Boolean theIsCoreProfile) |
35 | { |
92996979 |
36 | #if defined(GL_ES_VERSION_2_0) |
37 | (void )theIsCoreProfile; |
38 | theCtx.core11 = NULL; |
39 | #else |
e44b849d |
40 | const bool isCoreProfile = theIsCoreProfile; |
41 | theCtx.core11 = !isCoreProfile ? (OpenGl_GlCore11* )this : NULL; |
92996979 |
42 | #endif |
e44b849d |
43 | theCtx.core11fwd = (OpenGl_GlCore11Fwd* )this; |
44 | theCtx.core15 = NULL; |
45 | theCtx.core15fwd = NULL; |
46 | theCtx.core20 = NULL; |
47 | theCtx.core20fwd = NULL; |
48 | theCtx.core30 = NULL; |
49 | theCtx.core30fwd = NULL; |
50 | theCtx.core32 = NULL; |
51 | theCtx.core32back = NULL; |
52 | theCtx.core33 = NULL; |
53 | theCtx.core33back = NULL; |
54 | theCtx.core41 = NULL; |
55 | theCtx.core41back = NULL; |
56 | theCtx.core42 = NULL; |
57 | theCtx.core42back = NULL; |
58 | theCtx.core43 = NULL; |
59 | theCtx.core43back = NULL; |
60 | theCtx.core44 = NULL; |
61 | theCtx.core44back = NULL; |
62 | theCtx.core45 = NULL; |
63 | theCtx.core45back = NULL; |
952a0565 |
64 | theCtx.core46 = NULL; |
65 | theCtx.core46back = NULL; |
e44b849d |
66 | theCtx.arbTBO = NULL; |
67 | theCtx.arbTboRGB32 = false; |
68 | theCtx.arbIns = NULL; |
69 | theCtx.arbDbg = NULL; |
70 | theCtx.arbFBO = NULL; |
71 | theCtx.arbFBOBlit = NULL; |
72 | theCtx.extGS = NULL; |
73 | |
74 | //! Make record shorter to retrieve function pointer using variable with same name |
75 | const char* aLastFailedProc = NULL; |
76 | #define FindProcShort(theFunc) theCtx.FindProcVerbose(aLastFailedProc, #theFunc, this->theFunc) |
77 | #define checkExtensionShort theCtx.CheckExtension |
78 | #define isGlGreaterEqualShort(theMaj,theMin) theCtx.IsGlGreaterEqual(theMaj,theMin) |
79 | |
80 | #if defined(GL_ES_VERSION_2_0) |
81 | |
82 | theCtx.hasTexRGBA8 = isGlGreaterEqualShort (3, 0) |
83 | || checkExtensionShort ("GL_OES_rgb8_rgba8"); |
84 | theCtx.hasTexSRGB = isGlGreaterEqualShort (3, 0); |
85 | theCtx.hasFboSRGB = isGlGreaterEqualShort (3, 0); |
86 | theCtx.hasFboRenderMipmap = isGlGreaterEqualShort (3, 0) |
87 | || checkExtensionShort ("GL_OES_fbo_render_mipmap"); |
88 | theCtx.hasSRGBControl = checkExtensionShort ("GL_EXT_sRGB_write_control"); |
89 | theCtx.hasPackRowLength = isGlGreaterEqualShort (3, 0); |
90 | theCtx.hasUnpackRowLength = isGlGreaterEqualShort (3, 0); // || checkExtensionShort ("GL_EXT_unpack_subimage"); |
91 | // NPOT textures has limited support within OpenGL ES 2.0 |
92 | // which are relaxed by OpenGL ES 3.0 or some extensions |
93 | //theCtx.arbNPTW = isGlGreaterEqualShort (3, 0) |
94 | // || checkExtensionShort ("GL_OES_texture_npot") |
95 | // || checkExtensionShort ("GL_NV_texture_npot_2D_mipmap"); |
96 | theCtx.arbNPTW = true; |
97 | theCtx.arbTexRG = isGlGreaterEqualShort (3, 0) |
98 | || checkExtensionShort ("GL_EXT_texture_rg"); |
99 | theCtx.extBgra = checkExtensionShort ("GL_EXT_texture_format_BGRA8888"); |
100 | theCtx.extAnis = checkExtensionShort ("GL_EXT_texture_filter_anisotropic"); |
101 | theCtx.extPDS = isGlGreaterEqualShort (3, 0) |
102 | || checkExtensionShort ("GL_OES_packed_depth_stencil"); |
103 | |
104 | theCtx.core11fwd = (OpenGl_GlCore11Fwd* )this; |
105 | if (isGlGreaterEqualShort (2, 0)) |
106 | { |
107 | // enable compatible functions |
108 | theCtx.core20 = (OpenGl_GlCore20* )this; |
109 | theCtx.core20fwd = (OpenGl_GlCore20Fwd* )this; |
110 | theCtx.core15fwd = (OpenGl_GlCore15Fwd* )this; |
111 | theCtx.arbFBO = (OpenGl_ArbFBO* )this; |
112 | } |
113 | if (isGlGreaterEqualShort (3, 0) |
114 | && FindProcShort (glBlitFramebuffer)) |
115 | { |
116 | theCtx.arbFBOBlit = (OpenGl_ArbFBOBlit* )this; |
117 | } |
118 | if (isGlGreaterEqualShort (3, 0) |
119 | && FindProcShort (glGenSamplers) |
120 | && FindProcShort (glDeleteSamplers) |
121 | && FindProcShort (glIsSampler) |
122 | && FindProcShort (glBindSampler) |
123 | && FindProcShort (glSamplerParameteri) |
124 | && FindProcShort (glSamplerParameteriv) |
125 | && FindProcShort (glSamplerParameterf) |
126 | && FindProcShort (glSamplerParameterfv) |
127 | && FindProcShort (glGetSamplerParameteriv) |
128 | && FindProcShort (glGetSamplerParameterfv)) |
129 | //&& FindProcShort (glSamplerParameterIiv) // only on Desktop or with extensions GL_OES_texture_border_clamp/GL_EXT_texture_border_clamp |
130 | //&& FindProcShort (glSamplerParameterIuiv) |
131 | //&& FindProcShort (glGetSamplerParameterIiv) |
132 | //&& FindProcShort (glGetSamplerParameterIuiv)) |
133 | { |
134 | theCtx.arbSamplerObject = (OpenGl_ArbSamplerObject* )this; |
135 | } |
136 | theCtx.extFragDepth = !isGlGreaterEqualShort(3, 0) |
137 | && checkExtensionShort ("GL_EXT_frag_depth"); |
138 | if (isGlGreaterEqualShort (3, 1) |
139 | && FindProcShort (glTexStorage2DMultisample)) |
140 | { |
141 | // |
142 | } |
143 | |
144 | theCtx.hasUintIndex = isGlGreaterEqualShort (3, 0) |
145 | || checkExtensionShort ("GL_OES_element_index_uint"); |
146 | theCtx.hasHighp = checkExtensionShort ("GL_OES_fragment_precision_high"); |
147 | GLint aRange[2] = {0, 0}; |
148 | GLint aPrec = 0; |
149 | ::glGetShaderPrecisionFormat (GL_FRAGMENT_SHADER, GL_HIGH_FLOAT, aRange, &aPrec); |
150 | if (aPrec != 0) |
151 | { |
152 | theCtx.hasHighp = Standard_True; |
153 | } |
154 | |
155 | theCtx.arbTexFloat = (isGlGreaterEqualShort (3, 0) |
156 | && FindProcShort (glTexImage3D)) |
157 | || checkExtensionShort ("GL_OES_texture_float"); |
158 | theCtx.hasTexFloatLinear = theCtx.arbTexFloat |
159 | && checkExtensionShort ("GL_OES_texture_float_linear"); |
160 | |
161 | const bool hasTexBuffer32 = isGlGreaterEqualShort (3, 2) && FindProcShort (glTexBuffer); |
162 | const bool hasExtTexBuffer = checkExtensionShort ("GL_EXT_texture_buffer") && theCtx.FindProc ("glTexBufferEXT", this->glTexBuffer); |
163 | if (hasTexBuffer32 || hasExtTexBuffer) |
164 | { |
165 | theCtx.arbTBO = reinterpret_cast<OpenGl_ArbTBO*> (this); |
166 | } |
167 | |
168 | bool hasInstanced = isGlGreaterEqualShort (3, 0) |
169 | && FindProcShort (glVertexAttribDivisor) |
170 | && FindProcShort (glDrawArraysInstanced) |
171 | && FindProcShort (glDrawElementsInstanced); |
172 | if (!hasInstanced) |
173 | { |
174 | hasInstanced = checkExtensionShort ("GL_ANGLE_instanced_arrays") |
175 | && theCtx.FindProc ("glVertexAttribDivisorANGLE", this->glVertexAttribDivisor) |
176 | && theCtx.FindProc ("glDrawArraysInstancedANGLE", this->glDrawArraysInstanced) |
177 | && theCtx.FindProc ("glDrawElementsInstancedANGLE", this->glDrawElementsInstanced); |
178 | } |
179 | if (hasInstanced) |
180 | { |
181 | theCtx.arbIns = (OpenGl_ArbIns* )this; |
182 | } |
183 | |
184 | const bool hasVAO = isGlGreaterEqualShort (3, 0) |
185 | && FindProcShort (glBindVertexArray) |
186 | && FindProcShort (glDeleteVertexArrays) |
187 | && FindProcShort (glGenVertexArrays) |
188 | && FindProcShort (glIsVertexArray); |
189 | #ifndef __EMSCRIPTEN__ // latest Emscripten does not pretend having / simulating mapping buffer functions |
190 | const bool hasMapBufferRange = isGlGreaterEqualShort (3, 0) |
191 | && FindProcShort (glMapBufferRange) |
192 | && FindProcShort (glUnmapBuffer) |
193 | && FindProcShort (glGetBufferPointerv) |
194 | && FindProcShort (glFlushMappedBufferRange); |
195 | #endif |
196 | |
197 | // load OpenGL ES 3.0 new functions |
198 | const bool has30es = isGlGreaterEqualShort (3, 0) |
199 | && hasVAO |
200 | #ifndef __EMSCRIPTEN__ |
201 | && hasMapBufferRange |
202 | #endif |
203 | && hasInstanced |
204 | && theCtx.arbSamplerObject != NULL |
205 | && theCtx.arbFBOBlit != NULL |
206 | && FindProcShort (glReadBuffer) |
207 | && FindProcShort (glDrawRangeElements) |
208 | && FindProcShort (glTexImage3D) |
209 | && FindProcShort (glTexSubImage3D) |
210 | && FindProcShort (glCopyTexSubImage3D) |
211 | && FindProcShort (glCompressedTexImage3D) |
212 | && FindProcShort (glCompressedTexSubImage3D) |
213 | && FindProcShort (glGenQueries) |
214 | && FindProcShort (glDeleteQueries) |
215 | && FindProcShort (glIsQuery) |
216 | && FindProcShort (glBeginQuery) |
217 | && FindProcShort (glEndQuery) |
218 | && FindProcShort (glGetQueryiv) |
219 | && FindProcShort (glGetQueryObjectuiv) |
220 | && FindProcShort (glDrawBuffers) |
221 | && FindProcShort (glUniformMatrix2x3fv) |
222 | && FindProcShort (glUniformMatrix3x2fv) |
223 | && FindProcShort (glUniformMatrix2x4fv) |
224 | && FindProcShort (glUniformMatrix4x2fv) |
225 | && FindProcShort (glUniformMatrix3x4fv) |
226 | && FindProcShort (glUniformMatrix4x3fv) |
227 | && FindProcShort (glRenderbufferStorageMultisample) |
228 | && FindProcShort (glFramebufferTextureLayer) |
229 | && FindProcShort (glGetIntegeri_v) |
230 | && FindProcShort (glBeginTransformFeedback) |
231 | && FindProcShort (glEndTransformFeedback) |
232 | && FindProcShort (glBindBufferRange) |
233 | && FindProcShort (glBindBufferBase) |
234 | && FindProcShort (glTransformFeedbackVaryings) |
235 | && FindProcShort (glGetTransformFeedbackVarying) |
236 | && FindProcShort (glVertexAttribIPointer) |
237 | && FindProcShort (glGetVertexAttribIiv) |
238 | && FindProcShort (glGetVertexAttribIuiv) |
239 | && FindProcShort (glVertexAttribI4i) |
240 | && FindProcShort (glVertexAttribI4ui) |
241 | && FindProcShort (glVertexAttribI4iv) |
242 | && FindProcShort (glVertexAttribI4uiv) |
243 | && FindProcShort (glGetUniformuiv) |
244 | && FindProcShort (glGetFragDataLocation) |
245 | && FindProcShort (glUniform1ui) |
246 | && FindProcShort (glUniform2ui) |
247 | && FindProcShort (glUniform3ui) |
248 | && FindProcShort (glUniform4ui) |
249 | && FindProcShort (glUniform1uiv) |
250 | && FindProcShort (glUniform2uiv) |
251 | && FindProcShort (glUniform3uiv) |
252 | && FindProcShort (glUniform4uiv) |
253 | && FindProcShort (glClearBufferiv) |
254 | && FindProcShort (glClearBufferuiv) |
255 | && FindProcShort (glClearBufferfv) |
256 | && FindProcShort (glClearBufferfi) |
257 | && FindProcShort (glGetStringi) |
258 | && FindProcShort (glCopyBufferSubData) |
259 | && FindProcShort (glGetUniformIndices) |
260 | && FindProcShort (glGetActiveUniformsiv) |
261 | && FindProcShort (glGetUniformBlockIndex) |
262 | && FindProcShort (glGetActiveUniformBlockiv) |
263 | && FindProcShort (glGetActiveUniformBlockName) |
264 | && FindProcShort (glUniformBlockBinding) |
265 | && FindProcShort (glFenceSync) |
266 | && FindProcShort (glIsSync) |
267 | && FindProcShort (glDeleteSync) |
268 | && FindProcShort (glClientWaitSync) |
269 | && FindProcShort (glWaitSync) |
270 | && FindProcShort (glGetInteger64v) |
271 | && FindProcShort (glGetSynciv) |
272 | && FindProcShort (glGetInteger64i_v) |
273 | && FindProcShort (glGetBufferParameteri64v) |
274 | && FindProcShort (glBindTransformFeedback) |
275 | && FindProcShort (glDeleteTransformFeedbacks) |
276 | && FindProcShort (glGenTransformFeedbacks) |
277 | && FindProcShort (glIsTransformFeedback) |
278 | && FindProcShort (glPauseTransformFeedback) |
279 | && FindProcShort (glResumeTransformFeedback) |
280 | && FindProcShort (glGetProgramBinary) |
281 | && FindProcShort (glProgramBinary) |
282 | && FindProcShort (glProgramParameteri) |
283 | && FindProcShort (glInvalidateFramebuffer) |
284 | && FindProcShort (glInvalidateSubFramebuffer) |
285 | && FindProcShort (glTexStorage2D) |
286 | && FindProcShort (glTexStorage3D) |
287 | && FindProcShort (glGetInternalformativ); |
288 | if (!has30es) |
289 | { |
290 | theCtx.checkWrongVersion (3, 0, aLastFailedProc); |
291 | } |
292 | else |
293 | { |
294 | theCtx.core30 = (OpenGl_GlCore30* )this; |
295 | theCtx.core30fwd = (OpenGl_GlCore30Fwd* )this; |
296 | theCtx.hasGetBufferData = true; |
297 | } |
298 | |
299 | // load OpenGL ES 3.1 new functions |
300 | const bool has31es = isGlGreaterEqualShort (3, 1) |
301 | && has30es |
302 | && FindProcShort (glDispatchCompute) |
303 | && FindProcShort (glDispatchComputeIndirect) |
304 | && FindProcShort (glDrawArraysIndirect) |
305 | && FindProcShort (glDrawElementsIndirect) |
306 | && FindProcShort (glFramebufferParameteri) |
307 | && FindProcShort (glGetFramebufferParameteriv) |
308 | && FindProcShort (glGetProgramInterfaceiv) |
309 | && FindProcShort (glGetProgramResourceIndex) |
310 | && FindProcShort (glGetProgramResourceName) |
311 | && FindProcShort (glGetProgramResourceiv) |
312 | && FindProcShort (glGetProgramResourceLocation) |
313 | && FindProcShort (glUseProgramStages) |
314 | && FindProcShort (glActiveShaderProgram) |
315 | && FindProcShort (glCreateShaderProgramv) |
316 | && FindProcShort (glBindProgramPipeline) |
317 | && FindProcShort (glDeleteProgramPipelines) |
318 | && FindProcShort (glGenProgramPipelines) |
319 | && FindProcShort (glIsProgramPipeline) |
320 | && FindProcShort (glGetProgramPipelineiv) |
321 | && FindProcShort (glProgramUniform1i) |
322 | && FindProcShort (glProgramUniform2i) |
323 | && FindProcShort (glProgramUniform3i) |
324 | && FindProcShort (glProgramUniform4i) |
325 | && FindProcShort (glProgramUniform1ui) |
326 | && FindProcShort (glProgramUniform2ui) |
327 | && FindProcShort (glProgramUniform3ui) |
328 | && FindProcShort (glProgramUniform4ui) |
329 | && FindProcShort (glProgramUniform1f) |
330 | && FindProcShort (glProgramUniform2f) |
331 | && FindProcShort (glProgramUniform3f) |
332 | && FindProcShort (glProgramUniform4f) |
333 | && FindProcShort (glProgramUniform1iv) |
334 | && FindProcShort (glProgramUniform2iv) |
335 | && FindProcShort (glProgramUniform3iv) |
336 | && FindProcShort (glProgramUniform4iv) |
337 | && FindProcShort (glProgramUniform1uiv) |
338 | && FindProcShort (glProgramUniform2uiv) |
339 | && FindProcShort (glProgramUniform3uiv) |
340 | && FindProcShort (glProgramUniform4uiv) |
341 | && FindProcShort (glProgramUniform1fv) |
342 | && FindProcShort (glProgramUniform2fv) |
343 | && FindProcShort (glProgramUniform3fv) |
344 | && FindProcShort (glProgramUniform4fv) |
345 | && FindProcShort (glProgramUniformMatrix2fv) |
346 | && FindProcShort (glProgramUniformMatrix3fv) |
347 | && FindProcShort (glProgramUniformMatrix4fv) |
348 | && FindProcShort (glProgramUniformMatrix2x3fv) |
349 | && FindProcShort (glProgramUniformMatrix3x2fv) |
350 | && FindProcShort (glProgramUniformMatrix2x4fv) |
351 | && FindProcShort (glProgramUniformMatrix4x2fv) |
352 | && FindProcShort (glProgramUniformMatrix3x4fv) |
353 | && FindProcShort (glProgramUniformMatrix4x3fv) |
354 | && FindProcShort (glValidateProgramPipeline) |
355 | && FindProcShort (glGetProgramPipelineInfoLog) |
356 | && FindProcShort (glBindImageTexture) |
357 | && FindProcShort (glGetBooleani_v) |
358 | && FindProcShort (glMemoryBarrier) |
359 | && FindProcShort (glMemoryBarrierByRegion) |
360 | && FindProcShort (glTexStorage2DMultisample) |
361 | && FindProcShort (glGetMultisamplefv) |
362 | && FindProcShort (glSampleMaski) |
363 | && FindProcShort (glGetTexLevelParameteriv) |
364 | && FindProcShort (glGetTexLevelParameterfv) |
365 | && FindProcShort (glBindVertexBuffer) |
366 | && FindProcShort (glVertexAttribFormat) |
367 | && FindProcShort (glVertexAttribIFormat) |
368 | && FindProcShort (glVertexAttribBinding) |
369 | && FindProcShort (glVertexBindingDivisor); |
370 | if (!has31es) |
371 | { |
372 | theCtx.checkWrongVersion (3, 1, aLastFailedProc); |
373 | } |
374 | |
375 | // initialize debug context extension |
376 | if (isGlGreaterEqualShort (3, 2) |
377 | || checkExtensionShort ("GL_KHR_debug")) |
378 | { |
379 | // this functionality become a part of OpenGL ES 3.2 |
380 | theCtx.arbDbg = NULL; |
381 | if (isGlGreaterEqualShort (3, 2) |
382 | && FindProcShort (glDebugMessageControl) |
383 | && FindProcShort (glDebugMessageInsert) |
384 | && FindProcShort (glDebugMessageCallback) |
385 | && FindProcShort (glGetDebugMessageLog)) |
386 | { |
387 | theCtx.arbDbg = (OpenGl_ArbDbg* )this; |
388 | } |
389 | // According to GL_KHR_debug spec, all functions should have KHR suffix. |
390 | // However, some implementations can export these functions without suffix. |
391 | else if (!isGlGreaterEqualShort (3, 2) |
392 | && theCtx.FindProc ("glDebugMessageControlKHR", this->glDebugMessageControl) |
393 | && theCtx.FindProc ("glDebugMessageInsertKHR", this->glDebugMessageInsert) |
394 | && theCtx.FindProc ("glDebugMessageCallbackKHR", this->glDebugMessageCallback) |
395 | && theCtx.FindProc ("glGetDebugMessageLogKHR", this->glGetDebugMessageLog)) |
396 | { |
397 | theCtx.arbDbg = (OpenGl_ArbDbg* )this; |
398 | } |
399 | } |
400 | |
401 | // load OpenGL ES 3.2 new functions |
402 | const bool has32es = isGlGreaterEqualShort (3, 2) |
403 | && has31es |
404 | && hasTexBuffer32 |
405 | && theCtx.arbDbg != NULL |
406 | && FindProcShort (glBlendBarrier) |
407 | && FindProcShort (glCopyImageSubData) |
408 | && FindProcShort (glPushDebugGroup) |
409 | && FindProcShort (glPopDebugGroup) |
410 | && FindProcShort (glObjectLabel) |
411 | && FindProcShort (glGetObjectLabel) |
412 | && FindProcShort (glObjectPtrLabel) |
413 | && FindProcShort (glGetObjectPtrLabel) |
414 | && FindProcShort (glGetPointerv) |
415 | && FindProcShort (glEnablei) |
416 | && FindProcShort (glDisablei) |
417 | && FindProcShort (glBlendEquationi) |
418 | && FindProcShort (glBlendEquationSeparatei) |
419 | && FindProcShort (glBlendFunci) |
420 | && FindProcShort (glBlendFuncSeparatei) |
421 | && FindProcShort (glColorMaski) |
422 | && FindProcShort (glIsEnabledi) |
423 | && FindProcShort (glDrawElementsBaseVertex) |
424 | && FindProcShort (glDrawRangeElementsBaseVertex) |
425 | && FindProcShort (glDrawElementsInstancedBaseVertex) |
426 | && FindProcShort (glFramebufferTexture) |
427 | && FindProcShort (glPrimitiveBoundingBox) |
428 | && FindProcShort (glGetGraphicsResetStatus) |
429 | && FindProcShort (glReadnPixels) |
430 | && FindProcShort (glGetnUniformfv) |
431 | && FindProcShort (glGetnUniformiv) |
432 | && FindProcShort (glGetnUniformuiv) |
433 | && FindProcShort (glMinSampleShading) |
434 | && FindProcShort (glPatchParameteri) |
435 | && FindProcShort (glTexParameterIiv) |
436 | && FindProcShort (glTexParameterIuiv) |
437 | && FindProcShort (glGetTexParameterIiv) |
438 | && FindProcShort (glGetTexParameterIuiv) |
439 | && FindProcShort (glSamplerParameterIiv) |
440 | && FindProcShort (glSamplerParameterIuiv) |
441 | && FindProcShort (glGetSamplerParameterIiv) |
442 | && FindProcShort (glGetSamplerParameterIuiv) |
443 | && FindProcShort (glTexBufferRange) |
444 | && FindProcShort (glTexStorage3DMultisample); |
445 | if (!has32es) |
446 | { |
447 | theCtx.checkWrongVersion (3, 2, aLastFailedProc); |
448 | } |
449 | |
93cdaa76 |
450 | theCtx.arbTboRGB32 = isGlGreaterEqualShort (3, 2); // OpenGL ES 3.2 introduces TBO already supporting RGB32 format |
e44b849d |
451 | theCtx.extDrawBuffers = checkExtensionShort ("GL_EXT_draw_buffers") && theCtx.FindProc ("glDrawBuffersEXT", this->glDrawBuffers); |
452 | theCtx.arbDrawBuffers = checkExtensionShort ("GL_ARB_draw_buffers") && theCtx.FindProc ("glDrawBuffersARB", this->glDrawBuffers); |
453 | |
454 | if (isGlGreaterEqualShort (3, 0) && FindProcShort (glDrawBuffers)) |
455 | { |
456 | theCtx.hasDrawBuffers = OpenGl_FeatureInCore; |
457 | } |
458 | else if (theCtx.extDrawBuffers || theCtx.arbDrawBuffers) |
459 | { |
460 | theCtx.hasDrawBuffers = OpenGl_FeatureInExtensions; |
461 | } |
462 | |
463 | theCtx.hasFloatBuffer = isGlGreaterEqualShort (3, 2) ? OpenGl_FeatureInCore : |
464 | checkExtensionShort ("GL_EXT_color_buffer_float") ? OpenGl_FeatureInExtensions |
465 | : OpenGl_FeatureNotAvailable; |
466 | theCtx.hasHalfFloatBuffer = isGlGreaterEqualShort (3, 2) ? OpenGl_FeatureInCore : |
467 | checkExtensionShort ("GL_EXT_color_buffer_half_float") ? OpenGl_FeatureInExtensions |
468 | : OpenGl_FeatureNotAvailable; |
469 | |
470 | theCtx.oesSampleVariables = checkExtensionShort ("GL_OES_sample_variables"); |
471 | theCtx.oesStdDerivatives = checkExtensionShort ("GL_OES_standard_derivatives"); |
472 | theCtx.hasSampleVariables = isGlGreaterEqualShort (3, 2) ? OpenGl_FeatureInCore : |
473 | theCtx.oesSampleVariables ? OpenGl_FeatureInExtensions |
474 | : OpenGl_FeatureNotAvailable; |
475 | theCtx.hasGlslBitwiseOps = isGlGreaterEqualShort (3, 0) |
476 | ? OpenGl_FeatureInCore |
477 | : OpenGl_FeatureNotAvailable; |
478 | // without hasHighp, dFdx/dFdy precision is considered too low for flat shading (visual artifacts) |
479 | theCtx.hasFlatShading = isGlGreaterEqualShort (3, 0) |
480 | ? OpenGl_FeatureInCore |
481 | : (theCtx.oesStdDerivatives && theCtx.hasHighp |
482 | ? OpenGl_FeatureInExtensions |
483 | : OpenGl_FeatureNotAvailable); |
484 | if (!isGlGreaterEqualShort (3, 1) |
485 | && theCtx.Vendor().Search("qualcomm") != -1) |
486 | { |
487 | // dFdx/dFdy are completely broken on tested Adreno devices with versions below OpenGl ES 3.1 |
488 | theCtx.hasFlatShading = OpenGl_FeatureNotAvailable; |
489 | } |
490 | |
491 | theCtx.hasGeometryStage = isGlGreaterEqualShort (3, 2) |
492 | ? OpenGl_FeatureInCore |
493 | : (checkExtensionShort ("GL_EXT_geometry_shader") && checkExtensionShort ("GL_EXT_shader_io_blocks") |
494 | ? OpenGl_FeatureInExtensions |
495 | : OpenGl_FeatureNotAvailable); |
496 | #else |
497 | |
498 | theCtx.hasTexRGBA8 = true; |
499 | theCtx.hasTexSRGB = isGlGreaterEqualShort (2, 1); |
500 | theCtx.hasFboSRGB = isGlGreaterEqualShort (2, 1); |
501 | theCtx.hasSRGBControl = theCtx.hasFboSRGB; |
502 | theCtx.hasFboRenderMipmap = true; |
503 | theCtx.arbDrawBuffers = checkExtensionShort ("GL_ARB_draw_buffers"); |
504 | theCtx.arbNPTW = checkExtensionShort ("GL_ARB_texture_non_power_of_two"); |
505 | theCtx.arbTexFloat = isGlGreaterEqualShort (3, 0) |
506 | || checkExtensionShort ("GL_ARB_texture_float"); |
507 | theCtx.hasTexFloatLinear = theCtx.arbTexFloat; |
508 | theCtx.arbSampleShading = checkExtensionShort ("GL_ARB_sample_shading"); |
509 | theCtx.arbDepthClamp = isGlGreaterEqualShort (3, 2) |
510 | || checkExtensionShort ("GL_ARB_depth_clamp") |
511 | || checkExtensionShort ("NV_depth_clamp"); |
512 | theCtx.extBgra = isGlGreaterEqualShort (1, 2) |
513 | || checkExtensionShort ("GL_EXT_bgra"); |
514 | theCtx.extAnis = checkExtensionShort ("GL_EXT_texture_filter_anisotropic"); |
515 | theCtx.extPDS = checkExtensionShort ("GL_EXT_packed_depth_stencil"); |
516 | theCtx.atiMem = checkExtensionShort ("GL_ATI_meminfo"); |
517 | theCtx.nvxMem = checkExtensionShort ("GL_NVX_gpu_memory_info"); |
518 | |
519 | theCtx.hasDrawBuffers = isGlGreaterEqualShort (2, 0) ? OpenGl_FeatureInCore : |
520 | theCtx.arbDrawBuffers ? OpenGl_FeatureInExtensions |
521 | : OpenGl_FeatureNotAvailable; |
522 | |
523 | theCtx.hasGlslBitwiseOps = isGlGreaterEqualShort (3, 0) |
524 | ? OpenGl_FeatureInCore |
525 | : checkExtensionShort ("GL_EXT_gpu_shader4") |
526 | ? OpenGl_FeatureInExtensions |
527 | : OpenGl_FeatureNotAvailable; |
528 | |
529 | theCtx.hasFloatBuffer = theCtx.hasHalfFloatBuffer = |
530 | isGlGreaterEqualShort (3, 0) ? OpenGl_FeatureInCore : |
531 | checkExtensionShort ("GL_ARB_color_buffer_float") ? OpenGl_FeatureInExtensions |
532 | : OpenGl_FeatureNotAvailable; |
533 | |
534 | theCtx.hasGeometryStage = isGlGreaterEqualShort (3, 2) |
535 | ? OpenGl_FeatureInCore |
536 | : OpenGl_FeatureNotAvailable; |
537 | |
538 | theCtx.hasSampleVariables = isGlGreaterEqualShort (4, 0) ? OpenGl_FeatureInCore : |
539 | theCtx.arbSampleShading ? OpenGl_FeatureInExtensions |
540 | : OpenGl_FeatureNotAvailable; |
541 | |
542 | bool has12 = false, has13 = false, has14 = false, has15 = false; |
543 | bool has20 = false, has21 = false; |
544 | bool has30 = false, has31 = false, has32 = false, has33 = false; |
952a0565 |
545 | bool has40 = false, has41 = false, has42 = false, has43 = false, has44 = false, has45 = false, has46 = false; |
e44b849d |
546 | |
547 | // retrieve platform-dependent extensions |
548 | #if defined(HAVE_EGL) |
549 | // |
550 | #elif defined(_WIN32) |
551 | if (FindProcShort (wglGetExtensionsStringARB)) |
552 | { |
553 | const char* aWglExts = this->wglGetExtensionsStringARB (wglGetCurrentDC()); |
554 | if (checkExtensionShort (aWglExts, "WGL_EXT_swap_control")) |
555 | { |
556 | FindProcShort (wglSwapIntervalEXT); |
557 | } |
558 | if (checkExtensionShort (aWglExts, "WGL_ARB_pixel_format")) |
559 | { |
560 | FindProcShort (wglChoosePixelFormatARB); |
561 | } |
562 | if (checkExtensionShort (aWglExts, "WGL_ARB_create_context_profile")) |
563 | { |
564 | FindProcShort (wglCreateContextAttribsARB); |
565 | } |
566 | if (checkExtensionShort (aWglExts, "WGL_NV_DX_interop")) |
567 | { |
568 | FindProcShort (wglDXSetResourceShareHandleNV); |
569 | FindProcShort (wglDXOpenDeviceNV); |
570 | FindProcShort (wglDXCloseDeviceNV); |
571 | FindProcShort (wglDXRegisterObjectNV); |
572 | FindProcShort (wglDXUnregisterObjectNV); |
573 | FindProcShort (wglDXObjectAccessNV); |
574 | FindProcShort (wglDXLockObjectsNV); |
575 | FindProcShort (wglDXUnlockObjectsNV); |
576 | } |
577 | if (checkExtensionShort (aWglExts, "WGL_AMD_gpu_association")) |
578 | { |
579 | FindProcShort (wglGetGPUIDsAMD); |
580 | FindProcShort (wglGetGPUInfoAMD); |
581 | FindProcShort (wglGetContextGPUIDAMD); |
582 | } |
583 | } |
584 | #elif defined(__APPLE__) |
585 | // |
586 | #else |
587 | const char* aGlxExts = ::glXQueryExtensionsString ((Display* )theCtx.myDisplay, DefaultScreen ((Display* )theCtx.myDisplay)); |
588 | if (checkExtensionShort (aGlxExts, "GLX_EXT_swap_control")) |
589 | { |
590 | FindProcShort (glXSwapIntervalEXT); |
591 | } |
592 | if (checkExtensionShort (aGlxExts, "GLX_SGI_swap_control")) |
593 | { |
594 | FindProcShort (glXSwapIntervalSGI); |
595 | } |
596 | if (checkExtensionShort (aGlxExts, "GLX_MESA_query_renderer")) |
597 | { |
598 | FindProcShort (glXQueryRendererIntegerMESA); |
599 | FindProcShort (glXQueryCurrentRendererIntegerMESA); |
600 | FindProcShort (glXQueryRendererStringMESA); |
601 | FindProcShort (glXQueryCurrentRendererStringMESA); |
602 | } |
603 | //extSwapTear = checkExtensionShort (aGlxExts, "GLX_EXT_swap_control_tear"); |
604 | #endif |
605 | |
606 | // load OpenGL 1.2 new functions |
607 | has12 = isGlGreaterEqualShort (1, 2) |
608 | && FindProcShort (glBlendColor) |
609 | && FindProcShort (glBlendEquation) |
610 | && FindProcShort (glDrawRangeElements) |
611 | && FindProcShort (glTexImage3D) |
612 | && FindProcShort (glTexSubImage3D) |
613 | && FindProcShort (glCopyTexSubImage3D); |
614 | if (!has12) |
615 | { |
616 | theCtx.checkWrongVersion (1, 2, aLastFailedProc); |
617 | } |
618 | |
619 | // load OpenGL 1.3 new functions |
620 | has13 = isGlGreaterEqualShort (1, 3) |
621 | && FindProcShort (glActiveTexture) |
622 | && FindProcShort (glSampleCoverage) |
623 | && FindProcShort (glCompressedTexImage3D) |
624 | && FindProcShort (glCompressedTexImage2D) |
625 | && FindProcShort (glCompressedTexImage1D) |
626 | && FindProcShort (glCompressedTexSubImage3D) |
627 | && FindProcShort (glCompressedTexSubImage2D) |
628 | && FindProcShort (glCompressedTexSubImage1D) |
629 | && FindProcShort (glGetCompressedTexImage); |
630 | |
631 | if (!isCoreProfile) |
632 | { |
633 | has13 = has13 |
634 | && FindProcShort (glClientActiveTexture) |
635 | && FindProcShort (glMultiTexCoord1d) |
636 | && FindProcShort (glMultiTexCoord1dv) |
637 | && FindProcShort (glMultiTexCoord1f) |
638 | && FindProcShort (glMultiTexCoord1fv) |
639 | && FindProcShort (glMultiTexCoord1i) |
640 | && FindProcShort (glMultiTexCoord1iv) |
641 | && FindProcShort (glMultiTexCoord1s) |
642 | && FindProcShort (glMultiTexCoord1sv) |
643 | && FindProcShort (glMultiTexCoord2d) |
644 | && FindProcShort (glMultiTexCoord2dv) |
645 | && FindProcShort (glMultiTexCoord2f) |
646 | && FindProcShort (glMultiTexCoord2fv) |
647 | && FindProcShort (glMultiTexCoord2i) |
648 | && FindProcShort (glMultiTexCoord2iv) |
649 | && FindProcShort (glMultiTexCoord2s) |
650 | && FindProcShort (glMultiTexCoord2sv) |
651 | && FindProcShort (glMultiTexCoord3d) |
652 | && FindProcShort (glMultiTexCoord3dv) |
653 | && FindProcShort (glMultiTexCoord3f) |
654 | && FindProcShort (glMultiTexCoord3fv) |
655 | && FindProcShort (glMultiTexCoord3i) |
656 | && FindProcShort (glMultiTexCoord3iv) |
657 | && FindProcShort (glMultiTexCoord3s) |
658 | && FindProcShort (glMultiTexCoord3sv) |
659 | && FindProcShort (glMultiTexCoord4d) |
660 | && FindProcShort (glMultiTexCoord4dv) |
661 | && FindProcShort (glMultiTexCoord4f) |
662 | && FindProcShort (glMultiTexCoord4fv) |
663 | && FindProcShort (glMultiTexCoord4i) |
664 | && FindProcShort (glMultiTexCoord4iv) |
665 | && FindProcShort (glMultiTexCoord4s) |
666 | && FindProcShort (glMultiTexCoord4sv) |
667 | && FindProcShort (glLoadTransposeMatrixf) |
668 | && FindProcShort (glLoadTransposeMatrixd) |
669 | && FindProcShort (glMultTransposeMatrixf) |
670 | && FindProcShort (glMultTransposeMatrixd); |
671 | } |
672 | if (!has13) |
673 | { |
674 | theCtx.checkWrongVersion (1, 3, aLastFailedProc); |
675 | } |
676 | |
677 | // load OpenGL 1.4 new functions |
678 | has14 = isGlGreaterEqualShort (1, 4) |
679 | && FindProcShort (glBlendFuncSeparate) |
680 | && FindProcShort (glMultiDrawArrays) |
681 | && FindProcShort (glMultiDrawElements) |
682 | && FindProcShort (glPointParameterf) |
683 | && FindProcShort (glPointParameterfv) |
684 | && FindProcShort (glPointParameteri) |
685 | && FindProcShort (glPointParameteriv); |
686 | if (!has14) |
687 | { |
688 | theCtx.checkWrongVersion (1, 4, aLastFailedProc); |
689 | } |
690 | |
691 | // load OpenGL 1.5 new functions |
692 | has15 = isGlGreaterEqualShort (1, 5) |
693 | && FindProcShort (glGenQueries) |
694 | && FindProcShort (glDeleteQueries) |
695 | && FindProcShort (glIsQuery) |
696 | && FindProcShort (glBeginQuery) |
697 | && FindProcShort (glEndQuery) |
698 | && FindProcShort (glGetQueryiv) |
699 | && FindProcShort (glGetQueryObjectiv) |
700 | && FindProcShort (glGetQueryObjectuiv) |
701 | && FindProcShort (glBindBuffer) |
702 | && FindProcShort (glDeleteBuffers) |
703 | && FindProcShort (glGenBuffers) |
704 | && FindProcShort (glIsBuffer) |
705 | && FindProcShort (glBufferData) |
706 | && FindProcShort (glBufferSubData) |
707 | && FindProcShort (glGetBufferSubData) |
708 | && FindProcShort (glMapBuffer) |
709 | && FindProcShort (glUnmapBuffer) |
710 | && FindProcShort (glGetBufferParameteriv) |
711 | && FindProcShort (glGetBufferPointerv); |
712 | if (has15) |
713 | { |
714 | if (!isCoreProfile) |
715 | { |
716 | theCtx.core15 = (OpenGl_GlCore15* )this; |
717 | } |
718 | theCtx.core15fwd = (OpenGl_GlCore15Fwd* )this; |
719 | theCtx.hasGetBufferData = true; |
720 | } |
721 | else |
722 | { |
723 | theCtx.checkWrongVersion (1, 5, aLastFailedProc); |
724 | } |
725 | |
726 | // load OpenGL 2.0 new functions |
727 | has20 = isGlGreaterEqualShort (2, 0) |
728 | && FindProcShort (glBlendEquationSeparate) |
729 | && FindProcShort (glDrawBuffers) |
730 | && FindProcShort (glStencilOpSeparate) |
731 | && FindProcShort (glStencilFuncSeparate) |
732 | && FindProcShort (glStencilMaskSeparate) |
733 | && FindProcShort (glAttachShader) |
734 | && FindProcShort (glBindAttribLocation) |
735 | && FindProcShort (glCompileShader) |
736 | && FindProcShort (glCreateProgram) |
737 | && FindProcShort (glCreateShader) |
738 | && FindProcShort (glDeleteProgram) |
739 | && FindProcShort (glDeleteShader) |
740 | && FindProcShort (glDetachShader) |
741 | && FindProcShort (glDisableVertexAttribArray) |
742 | && FindProcShort (glEnableVertexAttribArray) |
743 | && FindProcShort (glGetActiveAttrib) |
744 | && FindProcShort (glGetActiveUniform) |
745 | && FindProcShort (glGetAttachedShaders) |
746 | && FindProcShort (glGetAttribLocation) |
747 | && FindProcShort (glGetProgramiv) |
748 | && FindProcShort (glGetProgramInfoLog) |
749 | && FindProcShort (glGetShaderiv) |
750 | && FindProcShort (glGetShaderInfoLog) |
751 | && FindProcShort (glGetShaderSource) |
752 | && FindProcShort (glGetUniformLocation) |
753 | && FindProcShort (glGetUniformfv) |
754 | && FindProcShort (glGetUniformiv) |
755 | && FindProcShort (glGetVertexAttribdv) |
756 | && FindProcShort (glGetVertexAttribfv) |
757 | && FindProcShort (glGetVertexAttribiv) |
758 | && FindProcShort (glGetVertexAttribPointerv) |
759 | && FindProcShort (glIsProgram) |
760 | && FindProcShort (glIsShader) |
761 | && FindProcShort (glLinkProgram) |
762 | && FindProcShort (glShaderSource) |
763 | && FindProcShort (glUseProgram) |
764 | && FindProcShort (glUniform1f) |
765 | && FindProcShort (glUniform2f) |
766 | && FindProcShort (glUniform3f) |
767 | && FindProcShort (glUniform4f) |
768 | && FindProcShort (glUniform1i) |
769 | && FindProcShort (glUniform2i) |
770 | && FindProcShort (glUniform3i) |
771 | && FindProcShort (glUniform4i) |
772 | && FindProcShort (glUniform1fv) |
773 | && FindProcShort (glUniform2fv) |
774 | && FindProcShort (glUniform3fv) |
775 | && FindProcShort (glUniform4fv) |
776 | && FindProcShort (glUniform1iv) |
777 | && FindProcShort (glUniform2iv) |
778 | && FindProcShort (glUniform3iv) |
779 | && FindProcShort (glUniform4iv) |
780 | && FindProcShort (glUniformMatrix2fv) |
781 | && FindProcShort (glUniformMatrix3fv) |
782 | && FindProcShort (glUniformMatrix4fv) |
783 | && FindProcShort (glValidateProgram) |
784 | && FindProcShort (glVertexAttrib1d) |
785 | && FindProcShort (glVertexAttrib1dv) |
786 | && FindProcShort (glVertexAttrib1f) |
787 | && FindProcShort (glVertexAttrib1fv) |
788 | && FindProcShort (glVertexAttrib1s) |
789 | && FindProcShort (glVertexAttrib1sv) |
790 | && FindProcShort (glVertexAttrib2d) |
791 | && FindProcShort (glVertexAttrib2dv) |
792 | && FindProcShort (glVertexAttrib2f) |
793 | && FindProcShort (glVertexAttrib2fv) |
794 | && FindProcShort (glVertexAttrib2s) |
795 | && FindProcShort (glVertexAttrib2sv) |
796 | && FindProcShort (glVertexAttrib3d) |
797 | && FindProcShort (glVertexAttrib3dv) |
798 | && FindProcShort (glVertexAttrib3f) |
799 | && FindProcShort (glVertexAttrib3fv) |
800 | && FindProcShort (glVertexAttrib3s) |
801 | && FindProcShort (glVertexAttrib3sv) |
802 | && FindProcShort (glVertexAttrib4Nbv) |
803 | && FindProcShort (glVertexAttrib4Niv) |
804 | && FindProcShort (glVertexAttrib4Nsv) |
805 | && FindProcShort (glVertexAttrib4Nub) |
806 | && FindProcShort (glVertexAttrib4Nubv) |
807 | && FindProcShort (glVertexAttrib4Nuiv) |
808 | && FindProcShort (glVertexAttrib4Nusv) |
809 | && FindProcShort (glVertexAttrib4bv) |
810 | && FindProcShort (glVertexAttrib4d) |
811 | && FindProcShort (glVertexAttrib4dv) |
812 | && FindProcShort (glVertexAttrib4f) |
813 | && FindProcShort (glVertexAttrib4fv) |
814 | && FindProcShort (glVertexAttrib4iv) |
815 | && FindProcShort (glVertexAttrib4s) |
816 | && FindProcShort (glVertexAttrib4sv) |
817 | && FindProcShort (glVertexAttrib4ubv) |
818 | && FindProcShort (glVertexAttrib4uiv) |
819 | && FindProcShort (glVertexAttrib4usv) |
820 | && FindProcShort (glVertexAttribPointer); |
821 | if (has20) |
822 | { |
823 | const char* aGlslVer = (const char* )::glGetString (GL_SHADING_LANGUAGE_VERSION); |
824 | if (aGlslVer == NULL |
825 | || *aGlslVer == '\0') |
826 | { |
827 | // broken context has been detected |
828 | theCtx.checkWrongVersion (2, 0, "GLSL 1.1"); |
829 | } |
830 | else |
831 | { |
832 | if (!isCoreProfile) |
833 | { |
834 | theCtx.core20 = (OpenGl_GlCore20* )this; |
835 | } |
836 | theCtx.core20fwd = (OpenGl_GlCore20Fwd* )this; |
837 | } |
838 | } |
839 | else |
840 | { |
841 | theCtx.checkWrongVersion (2, 0, aLastFailedProc); |
842 | } |
843 | |
844 | // load OpenGL 2.1 new functions |
845 | has21 = isGlGreaterEqualShort (2, 1) |
846 | && FindProcShort (glUniformMatrix2x3fv) |
847 | && FindProcShort (glUniformMatrix3x2fv) |
848 | && FindProcShort (glUniformMatrix2x4fv) |
849 | && FindProcShort (glUniformMatrix4x2fv) |
850 | && FindProcShort (glUniformMatrix3x4fv) |
851 | && FindProcShort (glUniformMatrix4x3fv); |
852 | if (!has21) |
853 | { |
854 | theCtx.checkWrongVersion (2, 1, aLastFailedProc); |
855 | } |
856 | |
857 | // load GL_ARB_framebuffer_object (added to OpenGL 3.0 core) |
858 | const bool hasFBO = (isGlGreaterEqualShort (3, 0) || checkExtensionShort ("GL_ARB_framebuffer_object")) |
859 | && FindProcShort (glIsRenderbuffer) |
860 | && FindProcShort (glBindRenderbuffer) |
861 | && FindProcShort (glDeleteRenderbuffers) |
862 | && FindProcShort (glGenRenderbuffers) |
863 | && FindProcShort (glRenderbufferStorage) |
864 | && FindProcShort (glGetRenderbufferParameteriv) |
865 | && FindProcShort (glIsFramebuffer) |
866 | && FindProcShort (glBindFramebuffer) |
867 | && FindProcShort (glDeleteFramebuffers) |
868 | && FindProcShort (glGenFramebuffers) |
869 | && FindProcShort (glCheckFramebufferStatus) |
870 | && FindProcShort (glFramebufferTexture1D) |
871 | && FindProcShort (glFramebufferTexture2D) |
872 | && FindProcShort (glFramebufferTexture3D) |
873 | && FindProcShort (glFramebufferRenderbuffer) |
874 | && FindProcShort (glGetFramebufferAttachmentParameteriv) |
875 | && FindProcShort (glGenerateMipmap) |
876 | && FindProcShort (glBlitFramebuffer) |
877 | && FindProcShort (glRenderbufferStorageMultisample) |
878 | && FindProcShort (glFramebufferTextureLayer); |
879 | |
880 | // load GL_ARB_vertex_array_object (added to OpenGL 3.0 core) |
881 | const bool hasVAO = (isGlGreaterEqualShort (3, 0) || checkExtensionShort ("GL_ARB_vertex_array_object")) |
882 | && FindProcShort (glBindVertexArray) |
883 | && FindProcShort (glDeleteVertexArrays) |
884 | && FindProcShort (glGenVertexArrays) |
885 | && FindProcShort (glIsVertexArray); |
886 | |
887 | // load GL_ARB_map_buffer_range (added to OpenGL 3.0 core) |
888 | const bool hasMapBufferRange = (isGlGreaterEqualShort (3, 0) || checkExtensionShort ("GL_ARB_map_buffer_range")) |
889 | && FindProcShort (glMapBufferRange) |
890 | && FindProcShort (glFlushMappedBufferRange); |
891 | |
892 | // load OpenGL 3.0 new functions |
893 | has30 = isGlGreaterEqualShort (3, 0) |
894 | && hasFBO |
895 | && hasVAO |
896 | && hasMapBufferRange |
897 | && FindProcShort (glColorMaski) |
898 | && FindProcShort (glGetBooleani_v) |
899 | && FindProcShort (glGetIntegeri_v) |
900 | && FindProcShort (glEnablei) |
901 | && FindProcShort (glDisablei) |
902 | && FindProcShort (glIsEnabledi) |
903 | && FindProcShort (glBeginTransformFeedback) |
904 | && FindProcShort (glEndTransformFeedback) |
905 | && FindProcShort (glBindBufferRange) |
906 | && FindProcShort (glBindBufferBase) |
907 | && FindProcShort (glTransformFeedbackVaryings) |
908 | && FindProcShort (glGetTransformFeedbackVarying) |
909 | && FindProcShort (glClampColor) |
910 | && FindProcShort (glBeginConditionalRender) |
911 | && FindProcShort (glEndConditionalRender) |
912 | && FindProcShort (glVertexAttribIPointer) |
913 | && FindProcShort (glGetVertexAttribIiv) |
914 | && FindProcShort (glGetVertexAttribIuiv) |
915 | && FindProcShort (glVertexAttribI1i) |
916 | && FindProcShort (glVertexAttribI2i) |
917 | && FindProcShort (glVertexAttribI3i) |
918 | && FindProcShort (glVertexAttribI4i) |
919 | && FindProcShort (glVertexAttribI1ui) |
920 | && FindProcShort (glVertexAttribI2ui) |
921 | && FindProcShort (glVertexAttribI3ui) |
922 | && FindProcShort (glVertexAttribI4ui) |
923 | && FindProcShort (glVertexAttribI1iv) |
924 | && FindProcShort (glVertexAttribI2iv) |
925 | && FindProcShort (glVertexAttribI3iv) |
926 | && FindProcShort (glVertexAttribI4iv) |
927 | && FindProcShort (glVertexAttribI1uiv) |
928 | && FindProcShort (glVertexAttribI2uiv) |
929 | && FindProcShort (glVertexAttribI3uiv) |
930 | && FindProcShort (glVertexAttribI4uiv) |
931 | && FindProcShort (glVertexAttribI4bv) |
932 | && FindProcShort (glVertexAttribI4sv) |
933 | && FindProcShort (glVertexAttribI4ubv) |
934 | && FindProcShort (glVertexAttribI4usv) |
935 | && FindProcShort (glGetUniformuiv) |
936 | && FindProcShort (glBindFragDataLocation) |
937 | && FindProcShort (glGetFragDataLocation) |
938 | && FindProcShort (glUniform1ui) |
939 | && FindProcShort (glUniform2ui) |
940 | && FindProcShort (glUniform3ui) |
941 | && FindProcShort (glUniform4ui) |
942 | && FindProcShort (glUniform1uiv) |
943 | && FindProcShort (glUniform2uiv) |
944 | && FindProcShort (glUniform3uiv) |
945 | && FindProcShort (glUniform4uiv) |
946 | && FindProcShort (glTexParameterIiv) |
947 | && FindProcShort (glTexParameterIuiv) |
948 | && FindProcShort (glGetTexParameterIiv) |
949 | && FindProcShort (glGetTexParameterIuiv) |
950 | && FindProcShort (glClearBufferiv) |
951 | && FindProcShort (glClearBufferuiv) |
952 | && FindProcShort (glClearBufferfv) |
953 | && FindProcShort (glClearBufferfi) |
954 | && FindProcShort (glGetStringi); |
955 | if (!has30) |
956 | { |
957 | theCtx.checkWrongVersion (3, 0, aLastFailedProc); |
958 | } |
959 | |
960 | // load GL_ARB_uniform_buffer_object (added to OpenGL 3.1 core) |
961 | const bool hasUBO = (isGlGreaterEqualShort (3, 1) || checkExtensionShort ("GL_ARB_uniform_buffer_object")) |
962 | && FindProcShort (glGetUniformIndices) |
963 | && FindProcShort (glGetActiveUniformsiv) |
964 | && FindProcShort (glGetActiveUniformName) |
965 | && FindProcShort (glGetUniformBlockIndex) |
966 | && FindProcShort (glGetActiveUniformBlockiv) |
967 | && FindProcShort (glGetActiveUniformBlockName) |
968 | && FindProcShort (glUniformBlockBinding); |
969 | |
970 | // load GL_ARB_copy_buffer (added to OpenGL 3.1 core) |
971 | const bool hasCopyBufSubData = (isGlGreaterEqualShort (3, 1) || checkExtensionShort ("GL_ARB_copy_buffer")) |
972 | && FindProcShort (glCopyBufferSubData); |
973 | |
974 | if (has30) |
975 | { |
976 | // NPOT textures are required by OpenGL 2.0 specifications |
977 | // but doesn't hardware accelerated by some ancient OpenGL 2.1 hardware (GeForce FX, RadeOn 9700 etc.) |
978 | theCtx.arbNPTW = true; |
979 | theCtx.arbTexRG = true; |
980 | |
981 | if (!isCoreProfile) |
982 | { |
983 | theCtx.core30 = (OpenGl_GlCore30* )this; |
984 | } |
985 | theCtx.core30fwd = (OpenGl_GlCore30Fwd* )this; |
986 | } |
987 | |
988 | // load OpenGL 3.1 new functions |
989 | has31 = isGlGreaterEqualShort (3, 1) |
990 | && hasUBO |
991 | && hasCopyBufSubData |
992 | && FindProcShort (glDrawArraysInstanced) |
993 | && FindProcShort (glDrawElementsInstanced) |
994 | && FindProcShort (glTexBuffer) |
995 | && FindProcShort (glPrimitiveRestartIndex); |
996 | if (has31) |
997 | { |
998 | theCtx.arbTBO = (OpenGl_ArbTBO* )this; |
999 | theCtx.arbIns = (OpenGl_ArbIns* )this; |
1000 | } |
1001 | else |
1002 | { |
1003 | theCtx.checkWrongVersion (3, 1, aLastFailedProc); |
1004 | |
1005 | // initialize TBO extension (ARB) |
1006 | if (checkExtensionShort ("GL_ARB_texture_buffer_object") |
1007 | && theCtx.FindProc ("glTexBufferARB", this->glTexBuffer)) |
1008 | { |
1009 | theCtx.arbTBO = (OpenGl_ArbTBO* )this; |
1010 | } |
1011 | |
1012 | // initialize hardware instancing extension (ARB) |
1013 | if (checkExtensionShort ("GL_ARB_draw_instanced") |
1014 | && theCtx.FindProc ("glDrawArraysInstancedARB", this->glDrawArraysInstanced) |
1015 | && theCtx.FindProc ("glDrawElementsInstancedARB", this->glDrawElementsInstanced)) |
1016 | { |
1017 | theCtx.arbIns = (OpenGl_ArbIns* )this; |
1018 | } |
1019 | } |
1020 | |
1021 | theCtx.arbTboRGB32 = checkExtensionShort ("GL_ARB_texture_buffer_object_rgb32"); |
1022 | |
1023 | // load GL_ARB_draw_elements_base_vertex (added to OpenGL 3.2 core) |
1024 | const bool hasDrawElemsBaseVert = (isGlGreaterEqualShort (3, 2) || checkExtensionShort ("GL_ARB_draw_elements_base_vertex")) |
1025 | && FindProcShort (glDrawElementsBaseVertex) |
1026 | && FindProcShort (glDrawRangeElementsBaseVertex) |
1027 | && FindProcShort (glDrawElementsInstancedBaseVertex) |
1028 | && FindProcShort (glMultiDrawElementsBaseVertex); |
1029 | |
1030 | // load GL_ARB_provoking_vertex (added to OpenGL 3.2 core) |
1031 | const bool hasProvokingVert = (isGlGreaterEqualShort (3, 2) || checkExtensionShort ("GL_ARB_provoking_vertex")) |
1032 | && FindProcShort (glProvokingVertex); |
1033 | |
1034 | // load GL_ARB_sync (added to OpenGL 3.2 core) |
1035 | const bool hasSync = (isGlGreaterEqualShort (3, 2) || checkExtensionShort ("GL_ARB_sync")) |
1036 | && FindProcShort (glFenceSync) |
1037 | && FindProcShort (glIsSync) |
1038 | && FindProcShort (glDeleteSync) |
1039 | && FindProcShort (glClientWaitSync) |
1040 | && FindProcShort (glWaitSync) |
1041 | && FindProcShort (glGetInteger64v) |
1042 | && FindProcShort (glGetSynciv); |
1043 | |
1044 | // load GL_ARB_texture_multisample (added to OpenGL 3.2 core) |
1045 | const bool hasTextureMultisample = (isGlGreaterEqualShort (3, 2) || checkExtensionShort ("GL_ARB_texture_multisample")) |
1046 | && FindProcShort (glTexImage2DMultisample) |
1047 | && FindProcShort (glTexImage3DMultisample) |
1048 | && FindProcShort (glGetMultisamplefv) |
1049 | && FindProcShort (glSampleMaski); |
1050 | |
1051 | // load OpenGL 3.2 new functions |
1052 | has32 = isGlGreaterEqualShort (3, 2) |
1053 | && hasDrawElemsBaseVert |
1054 | && hasProvokingVert |
1055 | && hasSync |
1056 | && hasTextureMultisample |
1057 | && FindProcShort (glGetInteger64i_v) |
1058 | && FindProcShort (glGetBufferParameteri64v) |
1059 | && FindProcShort (glFramebufferTexture); |
1060 | if (has32) |
1061 | { |
1062 | theCtx.core32 = (OpenGl_GlCore32* )this; |
1063 | if (!isCoreProfile) |
1064 | { |
1065 | theCtx.core32back = (OpenGl_GlCore32Back* )this; |
1066 | } |
1067 | } |
1068 | else |
1069 | { |
1070 | theCtx.checkWrongVersion (3, 2, aLastFailedProc); |
1071 | } |
1072 | |
1073 | // load GL_ARB_blend_func_extended (added to OpenGL 3.3 core) |
1074 | const bool hasBlendFuncExtended = (isGlGreaterEqualShort (3, 3) || checkExtensionShort ("GL_ARB_blend_func_extended")) |
1075 | && FindProcShort (glBindFragDataLocationIndexed) |
1076 | && FindProcShort (glGetFragDataIndex); |
1077 | |
1078 | // load GL_ARB_sampler_objects (added to OpenGL 3.3 core) |
1079 | const bool hasSamplerObjects = (isGlGreaterEqualShort (3, 3) || checkExtensionShort ("GL_ARB_sampler_objects")) |
1080 | && FindProcShort (glGenSamplers) |
1081 | && FindProcShort (glDeleteSamplers) |
1082 | && FindProcShort (glIsSampler) |
1083 | && FindProcShort (glBindSampler) |
1084 | && FindProcShort (glSamplerParameteri) |
1085 | && FindProcShort (glSamplerParameteriv) |
1086 | && FindProcShort (glSamplerParameterf) |
1087 | && FindProcShort (glSamplerParameterfv) |
1088 | && FindProcShort (glSamplerParameterIiv) |
1089 | && FindProcShort (glSamplerParameterIuiv) |
1090 | && FindProcShort (glGetSamplerParameteriv) |
1091 | && FindProcShort (glGetSamplerParameterIiv) |
1092 | && FindProcShort (glGetSamplerParameterfv) |
1093 | && FindProcShort (glGetSamplerParameterIuiv); |
1094 | if (hasSamplerObjects) |
1095 | { |
1096 | theCtx.arbSamplerObject = (OpenGl_ArbSamplerObject* )this; |
1097 | } |
1098 | |
1099 | // load GL_ARB_timer_query (added to OpenGL 3.3 core) |
1100 | const bool hasTimerQuery = (isGlGreaterEqualShort (3, 3) || checkExtensionShort ("GL_ARB_timer_query")) |
1101 | && FindProcShort (glQueryCounter) |
1102 | && FindProcShort (glGetQueryObjecti64v) |
1103 | && FindProcShort (glGetQueryObjectui64v); |
1104 | |
1105 | // load GL_ARB_vertex_type_2_10_10_10_rev (added to OpenGL 3.3 core) |
1106 | const bool hasVertType21010101rev = (isGlGreaterEqualShort (3, 3) || checkExtensionShort ("GL_ARB_vertex_type_2_10_10_10_rev")) |
1107 | && FindProcShort (glVertexAttribP1ui) |
1108 | && FindProcShort (glVertexAttribP1uiv) |
1109 | && FindProcShort (glVertexAttribP2ui) |
1110 | && FindProcShort (glVertexAttribP2uiv) |
1111 | && FindProcShort (glVertexAttribP3ui) |
1112 | && FindProcShort (glVertexAttribP3uiv) |
1113 | && FindProcShort (glVertexAttribP4ui) |
1114 | && FindProcShort (glVertexAttribP4uiv); |
1115 | |
1116 | if ( hasVertType21010101rev |
1117 | && !isCoreProfile) |
1118 | { |
1119 | // load deprecated functions |
1120 | const bool hasVertType21010101revExt = |
1121 | FindProcShort (glVertexP2ui) |
1122 | && FindProcShort (glVertexP2uiv) |
1123 | && FindProcShort (glVertexP3ui) |
1124 | && FindProcShort (glVertexP3uiv) |
1125 | && FindProcShort (glVertexP4ui) |
1126 | && FindProcShort (glVertexP4uiv) |
1127 | && FindProcShort (glTexCoordP1ui) |
1128 | && FindProcShort (glTexCoordP1uiv) |
1129 | && FindProcShort (glTexCoordP2ui) |
1130 | && FindProcShort (glTexCoordP2uiv) |
1131 | && FindProcShort (glTexCoordP3ui) |
1132 | && FindProcShort (glTexCoordP3uiv) |
1133 | && FindProcShort (glTexCoordP4ui) |
1134 | && FindProcShort (glTexCoordP4uiv) |
1135 | && FindProcShort (glMultiTexCoordP1ui) |
1136 | && FindProcShort (glMultiTexCoordP1uiv) |
1137 | && FindProcShort (glMultiTexCoordP2ui) |
1138 | && FindProcShort (glMultiTexCoordP2uiv) |
1139 | && FindProcShort (glMultiTexCoordP3ui) |
1140 | && FindProcShort (glMultiTexCoordP3uiv) |
1141 | && FindProcShort (glMultiTexCoordP4ui) |
1142 | && FindProcShort (glMultiTexCoordP4uiv) |
1143 | && FindProcShort (glNormalP3ui) |
1144 | && FindProcShort (glNormalP3uiv) |
1145 | && FindProcShort (glColorP3ui) |
1146 | && FindProcShort (glColorP3uiv) |
1147 | && FindProcShort (glColorP4ui) |
1148 | && FindProcShort (glColorP4uiv) |
1149 | && FindProcShort (glSecondaryColorP3ui) |
1150 | && FindProcShort (glSecondaryColorP3uiv); |
1151 | (void )hasVertType21010101revExt; |
1152 | } |
1153 | |
1154 | // load OpenGL 3.3 extra functions |
1155 | has33 = isGlGreaterEqualShort (3, 3) |
1156 | && hasBlendFuncExtended |
1157 | && hasSamplerObjects |
1158 | && hasTimerQuery |
1159 | && hasVertType21010101rev |
1160 | && FindProcShort (glVertexAttribDivisor); |
1161 | if (has33) |
1162 | { |
1163 | theCtx.core33 = (OpenGl_GlCore33* )this; |
1164 | if (!isCoreProfile) |
1165 | { |
1166 | theCtx.core33back = (OpenGl_GlCore33Back* )this; |
1167 | } |
1168 | } |
1169 | else |
1170 | { |
1171 | theCtx.checkWrongVersion (3, 3, aLastFailedProc); |
1172 | } |
1173 | |
1174 | // load GL_ARB_draw_indirect (added to OpenGL 4.0 core) |
1175 | const bool hasDrawIndirect = (isGlGreaterEqualShort (4, 0) || checkExtensionShort ("GL_ARB_draw_indirect")) |
1176 | && FindProcShort (glDrawArraysIndirect) |
1177 | && FindProcShort (glDrawElementsIndirect); |
1178 | |
1179 | // load GL_ARB_gpu_shader_fp64 (added to OpenGL 4.0 core) |
1180 | const bool hasShaderFP64 = (isGlGreaterEqualShort (4, 0) || checkExtensionShort ("GL_ARB_gpu_shader_fp64")) |
1181 | && FindProcShort (glUniform1d) |
1182 | && FindProcShort (glUniform2d) |
1183 | && FindProcShort (glUniform3d) |
1184 | && FindProcShort (glUniform4d) |
1185 | && FindProcShort (glUniform1dv) |
1186 | && FindProcShort (glUniform2dv) |
1187 | && FindProcShort (glUniform3dv) |
1188 | && FindProcShort (glUniform4dv) |
1189 | && FindProcShort (glUniformMatrix2dv) |
1190 | && FindProcShort (glUniformMatrix3dv) |
1191 | && FindProcShort (glUniformMatrix4dv) |
1192 | && FindProcShort (glUniformMatrix2x3dv) |
1193 | && FindProcShort (glUniformMatrix2x4dv) |
1194 | && FindProcShort (glUniformMatrix3x2dv) |
1195 | && FindProcShort (glUniformMatrix3x4dv) |
1196 | && FindProcShort (glUniformMatrix4x2dv) |
1197 | && FindProcShort (glUniformMatrix4x3dv) |
1198 | && FindProcShort (glGetUniformdv); |
1199 | |
1200 | // load GL_ARB_shader_subroutine (added to OpenGL 4.0 core) |
1201 | const bool hasShaderSubroutine = (isGlGreaterEqualShort (4, 0) || checkExtensionShort ("GL_ARB_shader_subroutine")) |
1202 | && FindProcShort (glGetSubroutineUniformLocation) |
1203 | && FindProcShort (glGetSubroutineIndex) |
1204 | && FindProcShort (glGetActiveSubroutineUniformiv) |
1205 | && FindProcShort (glGetActiveSubroutineUniformName) |
1206 | && FindProcShort (glGetActiveSubroutineName) |
1207 | && FindProcShort (glUniformSubroutinesuiv) |
1208 | && FindProcShort (glGetUniformSubroutineuiv) |
1209 | && FindProcShort (glGetProgramStageiv); |
1210 | |
1211 | // load GL_ARB_tessellation_shader (added to OpenGL 4.0 core) |
1212 | const bool hasTessellationShader = (isGlGreaterEqualShort (4, 0) || checkExtensionShort ("GL_ARB_tessellation_shader")) |
1213 | && FindProcShort (glPatchParameteri) |
1214 | && FindProcShort (glPatchParameterfv); |
1215 | |
1216 | // load GL_ARB_transform_feedback2 (added to OpenGL 4.0 core) |
1217 | const bool hasTrsfFeedback2 = (isGlGreaterEqualShort (4, 0) || checkExtensionShort ("GL_ARB_transform_feedback2")) |
1218 | && FindProcShort (glBindTransformFeedback) |
1219 | && FindProcShort (glDeleteTransformFeedbacks) |
1220 | && FindProcShort (glGenTransformFeedbacks) |
1221 | && FindProcShort (glIsTransformFeedback) |
1222 | && FindProcShort (glPauseTransformFeedback) |
1223 | && FindProcShort (glResumeTransformFeedback) |
1224 | && FindProcShort (glDrawTransformFeedback); |
1225 | |
1226 | // load GL_ARB_transform_feedback3 (added to OpenGL 4.0 core) |
1227 | const bool hasTrsfFeedback3 = (isGlGreaterEqualShort (4, 0) || checkExtensionShort ("GL_ARB_transform_feedback3")) |
1228 | && FindProcShort (glDrawTransformFeedbackStream) |
1229 | && FindProcShort (glBeginQueryIndexed) |
1230 | && FindProcShort (glEndQueryIndexed) |
1231 | && FindProcShort (glGetQueryIndexediv); |
1232 | |
1233 | // load OpenGL 4.0 new functions |
1234 | has40 = isGlGreaterEqualShort (4, 0) |
1235 | && hasDrawIndirect |
1236 | && hasShaderFP64 |
1237 | && hasShaderSubroutine |
1238 | && hasTessellationShader |
1239 | && hasTrsfFeedback2 |
1240 | && hasTrsfFeedback3 |
1241 | && FindProcShort (glMinSampleShading) |
1242 | && FindProcShort (glBlendEquationi) |
1243 | && FindProcShort (glBlendEquationSeparatei) |
1244 | && FindProcShort (glBlendFunci) |
1245 | && FindProcShort (glBlendFuncSeparatei); |
1246 | if (has40) |
1247 | { |
1248 | theCtx.arbTboRGB32 = true; // in core since OpenGL 4.0 |
1249 | } |
1250 | else |
1251 | { |
1252 | theCtx.checkWrongVersion (4, 0, aLastFailedProc); |
1253 | } |
1254 | |
1255 | // load GL_ARB_ES2_compatibility (added to OpenGL 4.1 core) |
1256 | const bool hasES2Compatibility = (isGlGreaterEqualShort (4, 1) || checkExtensionShort ("GL_ARB_ES2_compatibility")) |
1257 | && FindProcShort (glReleaseShaderCompiler) |
1258 | && FindProcShort (glShaderBinary) |
1259 | && FindProcShort (glGetShaderPrecisionFormat) |
1260 | && FindProcShort (glDepthRangef) |
1261 | && FindProcShort (glClearDepthf); |
1262 | |
1263 | // load GL_ARB_get_program_binary (added to OpenGL 4.1 core) |
1264 | const bool hasGetProgramBinary = (isGlGreaterEqualShort (4, 1) || checkExtensionShort ("GL_ARB_get_program_binary")) |
1265 | && FindProcShort (glGetProgramBinary) |
1266 | && FindProcShort (glProgramBinary) |
1267 | && FindProcShort (glProgramParameteri); |
1268 | |
1269 | |
1270 | // load GL_ARB_separate_shader_objects (added to OpenGL 4.1 core) |
1271 | const bool hasSeparateShaderObjects = (isGlGreaterEqualShort (4, 1) || checkExtensionShort ("GL_ARB_separate_shader_objects")) |
1272 | && FindProcShort (glUseProgramStages) |
1273 | && FindProcShort (glActiveShaderProgram) |
1274 | && FindProcShort (glCreateShaderProgramv) |
1275 | && FindProcShort (glBindProgramPipeline) |
1276 | && FindProcShort (glDeleteProgramPipelines) |
1277 | && FindProcShort (glGenProgramPipelines) |
1278 | && FindProcShort (glIsProgramPipeline) |
1279 | && FindProcShort (glGetProgramPipelineiv) |
1280 | && FindProcShort (glProgramUniform1i) |
1281 | && FindProcShort (glProgramUniform1iv) |
1282 | && FindProcShort (glProgramUniform1f) |
1283 | && FindProcShort (glProgramUniform1fv) |
1284 | && FindProcShort (glProgramUniform1d) |
1285 | && FindProcShort (glProgramUniform1dv) |
1286 | && FindProcShort (glProgramUniform1ui) |
1287 | && FindProcShort (glProgramUniform1uiv) |
1288 | && FindProcShort (glProgramUniform2i) |
1289 | && FindProcShort (glProgramUniform2iv) |
1290 | && FindProcShort (glProgramUniform2f) |
1291 | && FindProcShort (glProgramUniform2fv) |
1292 | && FindProcShort (glProgramUniform2d) |
1293 | && FindProcShort (glProgramUniform2dv) |
1294 | && FindProcShort (glProgramUniform2ui) |
1295 | && FindProcShort (glProgramUniform2uiv) |
1296 | && FindProcShort (glProgramUniform3i) |
1297 | && FindProcShort (glProgramUniform3iv) |
1298 | && FindProcShort (glProgramUniform3f) |
1299 | && FindProcShort (glProgramUniform3fv) |
1300 | && FindProcShort (glProgramUniform3d) |
1301 | && FindProcShort (glProgramUniform3dv) |
1302 | && FindProcShort (glProgramUniform3ui) |
1303 | && FindProcShort (glProgramUniform3uiv) |
1304 | && FindProcShort (glProgramUniform4i) |
1305 | && FindProcShort (glProgramUniform4iv) |
1306 | && FindProcShort (glProgramUniform4f) |
1307 | && FindProcShort (glProgramUniform4fv) |
1308 | && FindProcShort (glProgramUniform4d) |
1309 | && FindProcShort (glProgramUniform4dv) |
1310 | && FindProcShort (glProgramUniform4ui) |
1311 | && FindProcShort (glProgramUniform4uiv) |
1312 | && FindProcShort (glProgramUniformMatrix2fv) |
1313 | && FindProcShort (glProgramUniformMatrix3fv) |
1314 | && FindProcShort (glProgramUniformMatrix4fv) |
1315 | && FindProcShort (glProgramUniformMatrix2dv) |
1316 | && FindProcShort (glProgramUniformMatrix3dv) |
1317 | && FindProcShort (glProgramUniformMatrix4dv) |
1318 | && FindProcShort (glProgramUniformMatrix2x3fv) |
1319 | && FindProcShort (glProgramUniformMatrix3x2fv) |
1320 | && FindProcShort (glProgramUniformMatrix2x4fv) |
1321 | && FindProcShort (glProgramUniformMatrix4x2fv) |
1322 | && FindProcShort (glProgramUniformMatrix3x4fv) |
1323 | && FindProcShort (glProgramUniformMatrix4x3fv) |
1324 | && FindProcShort (glProgramUniformMatrix2x3dv) |
1325 | && FindProcShort (glProgramUniformMatrix3x2dv) |
1326 | && FindProcShort (glProgramUniformMatrix2x4dv) |
1327 | && FindProcShort (glProgramUniformMatrix4x2dv) |
1328 | && FindProcShort (glProgramUniformMatrix3x4dv) |
1329 | && FindProcShort (glProgramUniformMatrix4x3dv) |
1330 | && FindProcShort (glValidateProgramPipeline) |
1331 | && FindProcShort (glGetProgramPipelineInfoLog); |
1332 | |
1333 | // load GL_ARB_vertex_attrib_64bit (added to OpenGL 4.1 core) |
1334 | const bool hasVertAttrib64bit = (isGlGreaterEqualShort (4, 1) || checkExtensionShort ("GL_ARB_vertex_attrib_64bit")) |
1335 | && FindProcShort (glVertexAttribL1d) |
1336 | && FindProcShort (glVertexAttribL2d) |
1337 | && FindProcShort (glVertexAttribL3d) |
1338 | && FindProcShort (glVertexAttribL4d) |
1339 | && FindProcShort (glVertexAttribL1dv) |
1340 | && FindProcShort (glVertexAttribL2dv) |
1341 | && FindProcShort (glVertexAttribL3dv) |
1342 | && FindProcShort (glVertexAttribL4dv) |
1343 | && FindProcShort (glVertexAttribLPointer) |
1344 | && FindProcShort (glGetVertexAttribLdv); |
1345 | |
1346 | // load GL_ARB_viewport_array (added to OpenGL 4.1 core) |
1347 | const bool hasViewportArray = (isGlGreaterEqualShort (4, 1) || checkExtensionShort ("GL_ARB_viewport_array")) |
1348 | && FindProcShort (glViewportArrayv) |
1349 | && FindProcShort (glViewportIndexedf) |
1350 | && FindProcShort (glViewportIndexedfv) |
1351 | && FindProcShort (glScissorArrayv) |
1352 | && FindProcShort (glScissorIndexed) |
1353 | && FindProcShort (glScissorIndexedv) |
1354 | && FindProcShort (glDepthRangeArrayv) |
1355 | && FindProcShort (glDepthRangeIndexed) |
1356 | && FindProcShort (glGetFloati_v) |
1357 | && FindProcShort (glGetDoublei_v); |
1358 | |
1359 | has41 = isGlGreaterEqualShort (4, 1) |
1360 | && hasES2Compatibility |
1361 | && hasGetProgramBinary |
1362 | && hasSeparateShaderObjects |
1363 | && hasVertAttrib64bit |
1364 | && hasViewportArray; |
1365 | if (has41) |
1366 | { |
1367 | theCtx.core41 = (OpenGl_GlCore41* )this; |
1368 | if (!isCoreProfile) |
1369 | { |
1370 | theCtx.core41back = (OpenGl_GlCore41Back* )this; |
1371 | } |
1372 | } |
1373 | else |
1374 | { |
1375 | theCtx.checkWrongVersion (4, 1, aLastFailedProc); |
1376 | } |
1377 | |
1378 | // load GL_ARB_base_instance (added to OpenGL 4.2 core) |
1379 | const bool hasBaseInstance = (isGlGreaterEqualShort (4, 2) || checkExtensionShort ("GL_ARB_base_instance")) |
1380 | && FindProcShort (glDrawArraysInstancedBaseInstance) |
1381 | && FindProcShort (glDrawElementsInstancedBaseInstance) |
1382 | && FindProcShort (glDrawElementsInstancedBaseVertexBaseInstance); |
1383 | |
1384 | // load GL_ARB_transform_feedback_instanced (added to OpenGL 4.2 core) |
1385 | const bool hasTrsfFeedbackInstanced = (isGlGreaterEqualShort (4, 2) || checkExtensionShort ("GL_ARB_transform_feedback_instanced")) |
1386 | && FindProcShort (glDrawTransformFeedbackInstanced) |
1387 | && FindProcShort (glDrawTransformFeedbackStreamInstanced); |
1388 | |
1389 | // load GL_ARB_internalformat_query (added to OpenGL 4.2 core) |
1390 | const bool hasInternalFormatQuery = (isGlGreaterEqualShort (4, 2) || checkExtensionShort ("GL_ARB_internalformat_query")) |
1391 | && FindProcShort (glGetInternalformativ); |
1392 | |
1393 | // load GL_ARB_shader_atomic_counters (added to OpenGL 4.2 core) |
1394 | const bool hasShaderAtomicCounters = (isGlGreaterEqualShort (4, 2) || checkExtensionShort ("GL_ARB_shader_atomic_counters")) |
1395 | && FindProcShort (glGetActiveAtomicCounterBufferiv); |
1396 | |
1397 | // load GL_ARB_shader_image_load_store (added to OpenGL 4.2 core) |
1398 | const bool hasShaderImgLoadStore = (isGlGreaterEqualShort (4, 2) || checkExtensionShort ("GL_ARB_shader_image_load_store")) |
1399 | && FindProcShort (glBindImageTexture) |
1400 | && FindProcShort (glMemoryBarrier); |
1401 | |
1402 | // load GL_ARB_texture_storage (added to OpenGL 4.2 core) |
1403 | const bool hasTextureStorage = (isGlGreaterEqualShort (4, 2) || checkExtensionShort ("GL_ARB_texture_storage")) |
1404 | && FindProcShort (glTexStorage1D) |
1405 | && FindProcShort (glTexStorage2D) |
1406 | && FindProcShort (glTexStorage3D); |
1407 | |
1408 | has42 = isGlGreaterEqualShort (4, 2) |
1409 | && hasBaseInstance |
1410 | && hasTrsfFeedbackInstanced |
1411 | && hasInternalFormatQuery |
1412 | && hasShaderAtomicCounters |
1413 | && hasShaderImgLoadStore |
1414 | && hasTextureStorage; |
1415 | if (has42) |
1416 | { |
1417 | theCtx.core42 = (OpenGl_GlCore42* )this; |
1418 | if (!isCoreProfile) |
1419 | { |
1420 | theCtx.core42back = (OpenGl_GlCore42Back* )this; |
1421 | } |
1422 | } |
1423 | else |
1424 | { |
1425 | theCtx.checkWrongVersion (4, 2, aLastFailedProc); |
1426 | } |
1427 | |
1428 | has43 = isGlGreaterEqualShort (4, 3) |
1429 | && FindProcShort (glClearBufferData) |
1430 | && FindProcShort (glClearBufferSubData) |
1431 | && FindProcShort (glDispatchCompute) |
1432 | && FindProcShort (glDispatchComputeIndirect) |
1433 | && FindProcShort (glCopyImageSubData) |
1434 | && FindProcShort (glFramebufferParameteri) |
1435 | && FindProcShort (glGetFramebufferParameteriv) |
1436 | && FindProcShort (glGetInternalformati64v) |
1437 | && FindProcShort (glInvalidateTexSubImage) |
1438 | && FindProcShort (glInvalidateTexImage) |
1439 | && FindProcShort (glInvalidateBufferSubData) |
1440 | && FindProcShort (glInvalidateBufferData) |
1441 | && FindProcShort (glInvalidateFramebuffer) |
1442 | && FindProcShort (glInvalidateSubFramebuffer) |
1443 | && FindProcShort (glMultiDrawArraysIndirect) |
1444 | && FindProcShort (glMultiDrawElementsIndirect) |
1445 | && FindProcShort (glGetProgramInterfaceiv) |
1446 | && FindProcShort (glGetProgramResourceIndex) |
1447 | && FindProcShort (glGetProgramResourceName) |
1448 | && FindProcShort (glGetProgramResourceiv) |
1449 | && FindProcShort (glGetProgramResourceLocation) |
1450 | && FindProcShort (glGetProgramResourceLocationIndex) |
1451 | && FindProcShort (glShaderStorageBlockBinding) |
1452 | && FindProcShort (glTexBufferRange) |
1453 | && FindProcShort (glTexStorage2DMultisample) |
1454 | && FindProcShort (glTexStorage3DMultisample) |
1455 | && FindProcShort (glTextureView) |
1456 | && FindProcShort (glBindVertexBuffer) |
1457 | && FindProcShort (glVertexAttribFormat) |
1458 | && FindProcShort (glVertexAttribIFormat) |
1459 | && FindProcShort (glVertexAttribLFormat) |
1460 | && FindProcShort (glVertexAttribBinding) |
1461 | && FindProcShort (glVertexBindingDivisor) |
1462 | && FindProcShort (glDebugMessageControl) |
1463 | && FindProcShort (glDebugMessageInsert) |
1464 | && FindProcShort (glDebugMessageCallback) |
1465 | && FindProcShort (glGetDebugMessageLog) |
1466 | && FindProcShort (glPushDebugGroup) |
1467 | && FindProcShort (glPopDebugGroup) |
1468 | && FindProcShort (glObjectLabel) |
1469 | && FindProcShort (glGetObjectLabel) |
1470 | && FindProcShort (glObjectPtrLabel) |
1471 | && FindProcShort (glGetObjectPtrLabel); |
1472 | if (has43) |
1473 | { |
1474 | theCtx.core43 = (OpenGl_GlCore43* )this; |
1475 | if (!isCoreProfile) |
1476 | { |
1477 | theCtx.core43back = (OpenGl_GlCore43Back* )this; |
1478 | } |
1479 | } |
1480 | else |
1481 | { |
1482 | theCtx.checkWrongVersion (4, 3, aLastFailedProc); |
1483 | } |
1484 | |
1485 | // load GL_ARB_clear_texture (added to OpenGL 4.4 core) |
1486 | bool arbTexClear = (isGlGreaterEqualShort (4, 4) || checkExtensionShort ("GL_ARB_clear_texture")) |
1487 | && FindProcShort (glClearTexImage) |
1488 | && FindProcShort (glClearTexSubImage); |
1489 | |
1490 | has44 = isGlGreaterEqualShort (4, 4) |
1491 | && arbTexClear |
1492 | && FindProcShort (glBufferStorage) |
1493 | && FindProcShort (glBindBuffersBase) |
1494 | && FindProcShort (glBindBuffersRange) |
1495 | && FindProcShort (glBindTextures) |
1496 | && FindProcShort (glBindSamplers) |
1497 | && FindProcShort (glBindImageTextures) |
1498 | && FindProcShort (glBindVertexBuffers); |
1499 | if (has44) |
1500 | { |
1501 | theCtx.core44 = (OpenGl_GlCore44* )this; |
1502 | if (!isCoreProfile) |
1503 | { |
1504 | theCtx.core44back = (OpenGl_GlCore44Back* )this; |
1505 | } |
1506 | } |
1507 | else |
1508 | { |
1509 | theCtx.checkWrongVersion (4, 4, aLastFailedProc); |
1510 | } |
1511 | |
1512 | has45 = isGlGreaterEqualShort (4, 5) |
1513 | && FindProcShort (glBindVertexBuffers) |
1514 | && FindProcShort (glClipControl) |
1515 | && FindProcShort (glCreateTransformFeedbacks) |
1516 | && FindProcShort (glTransformFeedbackBufferBase) |
1517 | && FindProcShort (glTransformFeedbackBufferRange) |
1518 | && FindProcShort (glGetTransformFeedbackiv) |
1519 | && FindProcShort (glGetTransformFeedbacki_v) |
1520 | && FindProcShort (glGetTransformFeedbacki64_v) |
1521 | && FindProcShort (glCreateBuffers) |
1522 | && FindProcShort (glNamedBufferStorage) |
1523 | && FindProcShort (glNamedBufferData) |
1524 | && FindProcShort (glNamedBufferSubData) |
1525 | && FindProcShort (glCopyNamedBufferSubData) |
1526 | && FindProcShort (glClearNamedBufferData) |
1527 | && FindProcShort (glClearNamedBufferSubData) |
1528 | && FindProcShort (glMapNamedBuffer) |
1529 | && FindProcShort (glMapNamedBufferRange) |
1530 | && FindProcShort (glUnmapNamedBuffer) |
1531 | && FindProcShort (glFlushMappedNamedBufferRange) |
1532 | && FindProcShort (glGetNamedBufferParameteriv) |
1533 | && FindProcShort (glGetNamedBufferParameteri64v) |
1534 | && FindProcShort (glGetNamedBufferPointerv) |
1535 | && FindProcShort (glGetNamedBufferSubData) |
1536 | && FindProcShort (glCreateFramebuffers) |
1537 | && FindProcShort (glNamedFramebufferRenderbuffer) |
1538 | && FindProcShort (glNamedFramebufferParameteri) |
1539 | && FindProcShort (glNamedFramebufferTexture) |
1540 | && FindProcShort (glNamedFramebufferTextureLayer) |
1541 | && FindProcShort (glNamedFramebufferDrawBuffer) |
1542 | && FindProcShort (glNamedFramebufferDrawBuffers) |
1543 | && FindProcShort (glNamedFramebufferReadBuffer) |
1544 | && FindProcShort (glInvalidateNamedFramebufferData) |
1545 | && FindProcShort (glInvalidateNamedFramebufferSubData) |
1546 | && FindProcShort (glClearNamedFramebufferiv) |
1547 | && FindProcShort (glClearNamedFramebufferuiv) |
1548 | && FindProcShort (glClearNamedFramebufferfv) |
1549 | && FindProcShort (glClearNamedFramebufferfi) |
1550 | && FindProcShort (glBlitNamedFramebuffer) |
1551 | && FindProcShort (glCheckNamedFramebufferStatus) |
1552 | && FindProcShort (glGetNamedFramebufferParameteriv) |
1553 | && FindProcShort (glGetNamedFramebufferAttachmentParameteriv) |
1554 | && FindProcShort (glCreateRenderbuffers) |
1555 | && FindProcShort (glNamedRenderbufferStorage) |
1556 | && FindProcShort (glNamedRenderbufferStorageMultisample) |
1557 | && FindProcShort (glGetNamedRenderbufferParameteriv) |
1558 | && FindProcShort (glCreateTextures) |
1559 | && FindProcShort (glTextureBuffer) |
1560 | && FindProcShort (glTextureBufferRange) |
1561 | && FindProcShort (glTextureStorage1D) |
1562 | && FindProcShort (glTextureStorage2D) |
1563 | && FindProcShort (glTextureStorage3D) |
1564 | && FindProcShort (glTextureStorage2DMultisample) |
1565 | && FindProcShort (glTextureStorage3DMultisample) |
1566 | && FindProcShort (glTextureSubImage1D) |
1567 | && FindProcShort (glTextureSubImage2D) |
1568 | && FindProcShort (glTextureSubImage3D) |
1569 | && FindProcShort (glCompressedTextureSubImage1D) |
1570 | && FindProcShort (glCompressedTextureSubImage2D) |
1571 | && FindProcShort (glCompressedTextureSubImage3D) |
1572 | && FindProcShort (glCopyTextureSubImage1D) |
1573 | && FindProcShort (glCopyTextureSubImage2D) |
1574 | && FindProcShort (glCopyTextureSubImage3D) |
1575 | && FindProcShort (glTextureParameterf) |
1576 | && FindProcShort (glTextureParameterfv) |
1577 | && FindProcShort (glTextureParameteri) |
1578 | && FindProcShort (glTextureParameterIiv) |
1579 | && FindProcShort (glTextureParameterIuiv) |
1580 | && FindProcShort (glTextureParameteriv) |
1581 | && FindProcShort (glGenerateTextureMipmap) |
1582 | && FindProcShort (glBindTextureUnit) |
1583 | && FindProcShort (glGetTextureImage) |
1584 | && FindProcShort (glGetCompressedTextureImage) |
1585 | && FindProcShort (glGetTextureLevelParameterfv) |
1586 | && FindProcShort (glGetTextureLevelParameteriv) |
1587 | && FindProcShort (glGetTextureParameterfv) |
1588 | && FindProcShort (glGetTextureParameterIiv) |
1589 | && FindProcShort (glGetTextureParameterIuiv) |
1590 | && FindProcShort (glGetTextureParameteriv) |
1591 | && FindProcShort (glCreateVertexArrays) |
1592 | && FindProcShort (glDisableVertexArrayAttrib) |
1593 | && FindProcShort (glEnableVertexArrayAttrib) |
1594 | && FindProcShort (glVertexArrayElementBuffer) |
1595 | && FindProcShort (glVertexArrayVertexBuffer) |
1596 | && FindProcShort (glVertexArrayVertexBuffers) |
1597 | && FindProcShort (glVertexArrayAttribBinding) |
1598 | && FindProcShort (glVertexArrayAttribFormat) |
1599 | && FindProcShort (glVertexArrayAttribIFormat) |
1600 | && FindProcShort (glVertexArrayAttribLFormat) |
1601 | && FindProcShort (glVertexArrayBindingDivisor) |
1602 | && FindProcShort (glGetVertexArrayiv) |
1603 | && FindProcShort (glGetVertexArrayIndexediv) |
1604 | && FindProcShort (glGetVertexArrayIndexed64iv) |
1605 | && FindProcShort (glCreateSamplers) |
1606 | && FindProcShort (glCreateProgramPipelines) |
1607 | && FindProcShort (glCreateQueries) |
1608 | && FindProcShort (glGetQueryBufferObjecti64v) |
1609 | && FindProcShort (glGetQueryBufferObjectiv) |
1610 | && FindProcShort (glGetQueryBufferObjectui64v) |
1611 | && FindProcShort (glGetQueryBufferObjectuiv) |
1612 | && FindProcShort (glMemoryBarrierByRegion) |
1613 | && FindProcShort (glGetTextureSubImage) |
1614 | && FindProcShort (glGetCompressedTextureSubImage) |
1615 | && FindProcShort (glGetGraphicsResetStatus) |
1616 | && FindProcShort (glGetnCompressedTexImage) |
1617 | && FindProcShort (glGetnTexImage) |
1618 | && FindProcShort (glGetnUniformdv) |
1619 | && FindProcShort (glGetnUniformfv) |
1620 | && FindProcShort (glGetnUniformiv) |
1621 | && FindProcShort (glGetnUniformuiv) |
1622 | && FindProcShort (glReadnPixels) |
1623 | && FindProcShort (glGetnMapdv) |
1624 | && FindProcShort (glGetnMapfv) |
1625 | && FindProcShort (glGetnMapiv) |
1626 | && FindProcShort (glGetnPixelMapfv) |
1627 | && FindProcShort (glGetnPixelMapuiv) |
1628 | && FindProcShort (glGetnPixelMapusv) |
1629 | && FindProcShort (glGetnPolygonStipple) |
1630 | && FindProcShort (glGetnColorTable) |
1631 | && FindProcShort (glGetnConvolutionFilter) |
1632 | && FindProcShort (glGetnSeparableFilter) |
1633 | && FindProcShort (glGetnHistogram) |
1634 | && FindProcShort (glGetnMinmax) |
1635 | && FindProcShort (glTextureBarrier); |
1636 | if (has45) |
1637 | { |
1638 | theCtx.core45 = (OpenGl_GlCore45* )this; |
1639 | if (!isCoreProfile) |
1640 | { |
1641 | theCtx.core45back = (OpenGl_GlCore45Back* )this; |
1642 | } |
1643 | } |
1644 | else |
1645 | { |
1646 | theCtx.checkWrongVersion (4, 5, aLastFailedProc); |
1647 | } |
1648 | |
952a0565 |
1649 | has46 = isGlGreaterEqualShort (4, 6) |
1650 | && FindProcShort (glSpecializeShader) |
1651 | && FindProcShort (glMultiDrawArraysIndirectCount) |
1652 | && FindProcShort (glMultiDrawElementsIndirectCount) |
1653 | && FindProcShort (glPolygonOffsetClamp); |
1654 | if (has46) |
1655 | { |
1656 | theCtx.core46 = (OpenGl_GlCore46* )this; |
1657 | if (!isCoreProfile) |
1658 | { |
1659 | theCtx.core46back = (OpenGl_GlCore46Back* )this; |
1660 | } |
1661 | } |
1662 | else |
1663 | { |
1664 | theCtx.checkWrongVersion (4, 6, aLastFailedProc); |
1665 | } |
1666 | |
e44b849d |
1667 | // initialize debug context extension |
1668 | if (checkExtensionShort ("GL_ARB_debug_output")) |
1669 | { |
1670 | theCtx.arbDbg = NULL; |
1671 | if (has43) |
1672 | { |
1673 | theCtx.arbDbg = (OpenGl_ArbDbg* )this; |
1674 | } |
1675 | else if (theCtx.FindProc ("glDebugMessageControlARB", this->glDebugMessageControl) |
1676 | && theCtx.FindProc ("glDebugMessageInsertARB", this->glDebugMessageInsert) |
1677 | && theCtx.FindProc ("glDebugMessageCallbackARB", this->glDebugMessageCallback) |
1678 | && theCtx.FindProc ("glGetDebugMessageLogARB", this->glGetDebugMessageLog)) |
1679 | { |
1680 | theCtx.arbDbg = (OpenGl_ArbDbg* )this; |
1681 | } |
1682 | } |
1683 | |
1684 | // initialize FBO extension (ARB) |
1685 | if (hasFBO) |
1686 | { |
1687 | theCtx.arbFBO = (OpenGl_ArbFBO* )this; |
1688 | theCtx.arbFBOBlit = (OpenGl_ArbFBOBlit* )this; |
1689 | theCtx.extPDS = Standard_True; // extension for EXT, but part of ARB |
1690 | } |
1691 | |
1692 | // initialize GS extension (EXT) |
1693 | if (checkExtensionShort ("GL_EXT_geometry_shader4") |
1694 | && FindProcShort (glProgramParameteriEXT)) |
1695 | { |
1696 | theCtx.extGS = (OpenGl_ExtGS* )this; |
1697 | } |
1698 | |
1699 | // initialize bindless texture extension (ARB) |
1700 | if (checkExtensionShort ("GL_ARB_bindless_texture") |
1701 | && FindProcShort (glGetTextureHandleARB) |
1702 | && FindProcShort (glGetTextureSamplerHandleARB) |
1703 | && FindProcShort (glMakeTextureHandleResidentARB) |
1704 | && FindProcShort (glMakeTextureHandleNonResidentARB) |
1705 | && FindProcShort (glGetImageHandleARB) |
1706 | && FindProcShort (glMakeImageHandleResidentARB) |
1707 | && FindProcShort (glMakeImageHandleNonResidentARB) |
1708 | && FindProcShort (glUniformHandleui64ARB) |
1709 | && FindProcShort (glUniformHandleui64vARB) |
1710 | && FindProcShort (glProgramUniformHandleui64ARB) |
1711 | && FindProcShort (glProgramUniformHandleui64vARB) |
1712 | && FindProcShort (glIsTextureHandleResidentARB) |
1713 | && FindProcShort (glIsImageHandleResidentARB) |
1714 | && FindProcShort (glVertexAttribL1ui64ARB) |
1715 | && FindProcShort (glVertexAttribL1ui64vARB) |
1716 | && FindProcShort (glGetVertexAttribLui64vARB)) |
1717 | { |
1718 | theCtx.arbTexBindless = (OpenGl_ArbTexBindless* )this; |
1719 | } |
1720 | |
1721 | if (has30) |
1722 | { |
1723 | if (!has32 |
1724 | && checkExtensionShort ("GL_ARB_texture_multisample") |
1725 | && FindProcShort (glTexImage2DMultisample)) |
1726 | { |
1727 | // |
1728 | } |
1729 | if (!has43 |
1730 | && checkExtensionShort ("GL_ARB_texture_storage_multisample") |
1731 | && FindProcShort (glTexStorage2DMultisample)) |
1732 | { |
1733 | // |
1734 | } |
1735 | } |
1736 | #endif |
1737 | } |