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