2 * Mesa 3-D graphics library
4 * Copyright (C) 2010 VMware, Inc. All Rights Reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
34 * Scans 'string' to see if it ends with 'ending'.
37 check_for_ending(const char *string
, const char *ending
)
39 const size_t len1
= strlen(string
);
40 const size_t len2
= strlen(ending
);
45 return strcmp(string
+ (len1
- len2
), ending
) == 0;
49 * Returns the gl override data
51 * version > 0 indicates there is an override requested
52 * fwd_context is only valid if version > 0
55 get_gl_override(gl_api api
, int *version
, bool *fwd_context
,
58 const char *env_var
= (api
== API_OPENGL_CORE
|| api
== API_OPENGL_COMPAT
)
59 ? "MESA_GL_VERSION_OVERRIDE" : "MESA_GLES_VERSION_OVERRIDE";
60 const char *version_str
;
62 static struct override_info
{
73 STATIC_ASSERT(ARRAY_SIZE(override
) == API_OPENGL_LAST
+ 1);
75 if (api
== API_OPENGLES
)
78 if (override
[api
].version
< 0) {
79 override
[api
].version
= 0;
81 version_str
= getenv(env_var
);
83 override
[api
].fc_suffix
= check_for_ending(version_str
, "FC");
84 override
[api
].compat_suffix
= check_for_ending(version_str
, "COMPAT");
86 n
= sscanf(version_str
, "%u.%u", &major
, &minor
);
88 fprintf(stderr
, "error: invalid value for %s: %s\n",
89 env_var
, version_str
);
90 override
[api
].version
= 0;
92 override
[api
].version
= major
* 10 + minor
;
94 /* There is no such thing as compatibility or forward-compatible for
95 * OpenGL ES 2.0 or 3.x APIs.
97 if ((override
[api
].version
< 30 && override
[api
].fc_suffix
) ||
98 (api
== API_OPENGLES2
&& (override
[api
].fc_suffix
||
99 override
[api
].compat_suffix
))) {
100 fprintf(stderr
, "error: invalid value for %s: %s\n",
101 env_var
, version_str
);
108 *version
= override
[api
].version
;
109 *fwd_context
= override
[api
].fc_suffix
;
110 *compat_context
= override
[api
].compat_suffix
;
114 * Builds the Mesa version string.
117 create_version_string(struct gl_context
*ctx
, const char *prefix
)
119 static const int max
= 100;
121 ctx
->VersionString
= malloc(max
);
122 if (ctx
->VersionString
) {
123 _mesa_snprintf(ctx
->VersionString
, max
,
124 "%s%u.%u%s Mesa " PACKAGE_VERSION MESA_GIT_SHA1
,
126 ctx
->Version
/ 10, ctx
->Version
% 10,
127 (ctx
->API
== API_OPENGL_CORE
) ? " (Core Profile)" :
128 (ctx
->API
== API_OPENGL_COMPAT
&& ctx
->Version
>= 32) ?
129 " (Compatibility Profile)" : ""
135 * Override the context's version and/or API type if the environment variables
136 * MESA_GL_VERSION_OVERRIDE or MESA_GLES_VERSION_OVERRIDE are set.
138 * Example uses of MESA_GL_VERSION_OVERRIDE:
140 * 2.1: select a compatibility (non-Core) profile with GL version 2.1.
141 * 3.0: select a compatibility (non-Core) profile with GL version 3.0.
142 * 3.0FC: select a Core+Forward Compatible profile with GL version 3.0.
143 * 3.1: select GL version 3.1 with GL_ARB_compatibility enabled per the driver default.
144 * 3.1FC: select GL version 3.1 with forward compatibility and GL_ARB_compatibility disabled.
145 * 3.1COMPAT: select GL version 3.1 with GL_ARB_compatibility enabled.
146 * X.Y: override GL version to X.Y without changing the profile.
147 * X.YFC: select a Core+Forward Compatible profile with GL version X.Y.
148 * X.YCOMPAT: select a Compatibility profile with GL version X.Y.
150 * Example uses of MESA_GLES_VERSION_OVERRIDE:
152 * 2.0: select GLES version 2.0.
153 * 3.0: select GLES version 3.0.
154 * 3.1: select GLES version 3.1.
157 _mesa_override_gl_version_contextless(struct gl_constants
*consts
,
158 gl_api
*apiOut
, GLuint
*versionOut
)
161 bool fwd_context
, compat_context
;
163 get_gl_override(*apiOut
, &version
, &fwd_context
, &compat_context
);
166 *versionOut
= version
;
168 /* Modify the API and context flags as needed. */
169 if (*apiOut
== API_OPENGL_CORE
|| *apiOut
== API_OPENGL_COMPAT
) {
170 if (version
>= 30 && fwd_context
) {
171 *apiOut
= API_OPENGL_CORE
;
172 consts
->ContextFlags
|= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT
;
173 } else if (compat_context
) {
174 *apiOut
= API_OPENGL_COMPAT
;
184 _mesa_override_gl_version(struct gl_context
*ctx
)
186 if (_mesa_override_gl_version_contextless(&ctx
->Const
, &ctx
->API
,
188 /* We need to include API in version string for OpenGL ES, otherwise
189 * application can not detect GLES via glGetString(GL_VERSION) query.
191 * From OpenGL ES 3.2 spec, Page 436:
193 * "The VERSION string is laid out as follows:
195 * OpenGL ES N.M vendor-specific information"
197 * From OpenGL 4.5 spec, Page 538:
199 * "The VERSION and SHADING_LANGUAGE_VERSION strings are laid out as
202 * <version number><space><vendor-specific information>"
204 create_version_string(ctx
, _mesa_is_gles(ctx
) ? "OpenGL ES " : "");
205 ctx
->Extensions
.Version
= ctx
->Version
;
210 * Override the context's GLSL version if the environment variable
211 * MESA_GLSL_VERSION_OVERRIDE is set. Valid values for
212 * MESA_GLSL_VERSION_OVERRIDE are integers, such as "130".
215 _mesa_override_glsl_version(struct gl_constants
*consts
)
217 const char *env_var
= "MESA_GLSL_VERSION_OVERRIDE";
221 version
= getenv(env_var
);
226 n
= sscanf(version
, "%u", &consts
->GLSLVersion
);
228 fprintf(stderr
, "error: invalid value for %s: %s\n", env_var
, version
);
234 * Examine enabled GL extensions to determine GL version.
237 compute_version(const struct gl_extensions
*extensions
,
238 const struct gl_constants
*consts
, gl_api api
)
240 GLuint major
, minor
, version
;
242 const bool ver_1_3
= (extensions
->ARB_texture_border_clamp
&&
243 extensions
->ARB_texture_cube_map
&&
244 extensions
->ARB_texture_env_combine
&&
245 extensions
->ARB_texture_env_dot3
);
246 const bool ver_1_4
= (ver_1_3
&&
247 extensions
->ARB_depth_texture
&&
248 extensions
->ARB_shadow
&&
249 extensions
->ARB_texture_env_crossbar
&&
250 extensions
->EXT_blend_color
&&
251 extensions
->EXT_blend_func_separate
&&
252 extensions
->EXT_blend_minmax
&&
253 extensions
->EXT_point_parameters
);
254 const bool ver_1_5
= (ver_1_4
&&
255 extensions
->ARB_occlusion_query
);
256 const bool ver_2_0
= (ver_1_5
&&
257 extensions
->ARB_point_sprite
&&
258 extensions
->ARB_vertex_shader
&&
259 extensions
->ARB_fragment_shader
&&
260 extensions
->ARB_texture_non_power_of_two
&&
261 extensions
->EXT_blend_equation_separate
&&
262 extensions
->EXT_stencil_two_side
);
263 const bool ver_2_1
= (ver_2_0
&&
264 extensions
->EXT_pixel_buffer_object
&&
265 extensions
->EXT_texture_sRGB
);
266 const bool ver_3_0
= (ver_2_1
&&
267 consts
->GLSLVersion
>= 130 &&
268 (consts
->MaxSamples
>= 4 || consts
->FakeSWMSAA
) &&
269 (api
== API_OPENGL_CORE
||
270 extensions
->ARB_color_buffer_float
) &&
271 extensions
->ARB_depth_buffer_float
&&
272 extensions
->ARB_half_float_vertex
&&
273 extensions
->ARB_map_buffer_range
&&
274 extensions
->ARB_shader_texture_lod
&&
275 extensions
->ARB_texture_float
&&
276 extensions
->ARB_texture_rg
&&
277 extensions
->ARB_texture_compression_rgtc
&&
278 extensions
->EXT_draw_buffers2
&&
279 extensions
->ARB_framebuffer_object
&&
280 extensions
->EXT_framebuffer_sRGB
&&
281 extensions
->EXT_packed_float
&&
282 extensions
->EXT_texture_array
&&
283 extensions
->EXT_texture_shared_exponent
&&
284 extensions
->EXT_transform_feedback
&&
285 extensions
->NV_conditional_render
);
286 const bool ver_3_1
= (ver_3_0
&&
287 consts
->GLSLVersion
>= 140 &&
288 extensions
->ARB_draw_instanced
&&
289 extensions
->ARB_texture_buffer_object
&&
290 extensions
->ARB_uniform_buffer_object
&&
291 extensions
->EXT_texture_snorm
&&
292 extensions
->NV_primitive_restart
&&
293 extensions
->NV_texture_rectangle
&&
294 consts
->Program
[MESA_SHADER_VERTEX
].MaxTextureImageUnits
>= 16);
295 const bool ver_3_2
= (ver_3_1
&&
296 consts
->GLSLVersion
>= 150 &&
297 extensions
->ARB_depth_clamp
&&
298 extensions
->ARB_draw_elements_base_vertex
&&
299 extensions
->ARB_fragment_coord_conventions
&&
300 extensions
->EXT_provoking_vertex
&&
301 extensions
->ARB_seamless_cube_map
&&
302 extensions
->ARB_sync
&&
303 extensions
->ARB_texture_multisample
&&
304 extensions
->EXT_vertex_array_bgra
);
305 const bool ver_3_3
= (ver_3_2
&&
306 consts
->GLSLVersion
>= 330 &&
307 extensions
->ARB_blend_func_extended
&&
308 extensions
->ARB_explicit_attrib_location
&&
309 extensions
->ARB_instanced_arrays
&&
310 extensions
->ARB_occlusion_query2
&&
311 extensions
->ARB_shader_bit_encoding
&&
312 extensions
->ARB_texture_rgb10_a2ui
&&
313 extensions
->ARB_timer_query
&&
314 extensions
->ARB_vertex_type_2_10_10_10_rev
&&
315 extensions
->EXT_texture_swizzle
);
316 /* ARB_sampler_objects is always enabled in mesa */
318 const bool ver_4_0
= (ver_3_3
&&
319 consts
->GLSLVersion
>= 400 &&
320 extensions
->ARB_draw_buffers_blend
&&
321 extensions
->ARB_draw_indirect
&&
322 extensions
->ARB_gpu_shader5
&&
323 extensions
->ARB_gpu_shader_fp64
&&
324 extensions
->ARB_sample_shading
&&
325 extensions
->ARB_tessellation_shader
&&
326 extensions
->ARB_texture_buffer_object_rgb32
&&
327 extensions
->ARB_texture_cube_map_array
&&
328 extensions
->ARB_texture_query_lod
&&
329 extensions
->ARB_transform_feedback2
&&
330 extensions
->ARB_transform_feedback3
);
331 const bool ver_4_1
= (ver_4_0
&&
332 consts
->GLSLVersion
>= 410 &&
333 extensions
->ARB_ES2_compatibility
&&
334 extensions
->ARB_shader_precision
&&
335 extensions
->ARB_vertex_attrib_64bit
&&
336 extensions
->ARB_viewport_array
);
337 const bool ver_4_2
= (ver_4_1
&&
338 consts
->GLSLVersion
>= 420 &&
339 extensions
->ARB_base_instance
&&
340 extensions
->ARB_conservative_depth
&&
341 extensions
->ARB_internalformat_query
&&
342 extensions
->ARB_shader_atomic_counters
&&
343 extensions
->ARB_shader_image_load_store
&&
344 extensions
->ARB_shading_language_420pack
&&
345 extensions
->ARB_shading_language_packing
&&
346 extensions
->ARB_texture_compression_bptc
&&
347 extensions
->ARB_transform_feedback_instanced
);
348 const bool ver_4_3
= (ver_4_2
&&
349 consts
->GLSLVersion
>= 430 &&
350 consts
->Program
[MESA_SHADER_VERTEX
].MaxUniformBlocks
>= 14 &&
351 extensions
->ARB_ES3_compatibility
&&
352 extensions
->ARB_arrays_of_arrays
&&
353 extensions
->ARB_compute_shader
&&
354 extensions
->ARB_copy_image
&&
355 extensions
->ARB_explicit_uniform_location
&&
356 extensions
->ARB_fragment_layer_viewport
&&
357 extensions
->ARB_framebuffer_no_attachments
&&
358 extensions
->ARB_internalformat_query2
&&
359 extensions
->ARB_robust_buffer_access_behavior
&&
360 extensions
->ARB_shader_image_size
&&
361 extensions
->ARB_shader_storage_buffer_object
&&
362 extensions
->ARB_stencil_texturing
&&
363 extensions
->ARB_texture_buffer_range
&&
364 extensions
->ARB_texture_query_levels
&&
365 extensions
->ARB_texture_view
);
366 const bool ver_4_4
= (ver_4_3
&&
367 consts
->GLSLVersion
>= 440 &&
368 consts
->MaxVertexAttribStride
>= 2048 &&
369 extensions
->ARB_buffer_storage
&&
370 extensions
->ARB_clear_texture
&&
371 extensions
->ARB_enhanced_layouts
&&
372 extensions
->ARB_query_buffer_object
&&
373 extensions
->ARB_texture_mirror_clamp_to_edge
&&
374 extensions
->ARB_texture_stencil8
&&
375 extensions
->ARB_vertex_type_10f_11f_11f_rev
);
376 const bool ver_4_5
= (ver_4_4
&&
377 consts
->GLSLVersion
>= 450 &&
378 extensions
->ARB_ES3_1_compatibility
&&
379 extensions
->ARB_clip_control
&&
380 extensions
->ARB_conditional_render_inverted
&&
381 extensions
->ARB_cull_distance
&&
382 extensions
->ARB_derivative_control
&&
383 extensions
->ARB_shader_texture_image_samples
&&
384 extensions
->NV_texture_barrier
);
385 const bool ver_4_6
= (ver_4_5
&&
386 consts
->GLSLVersion
>= 460 &&
387 /* extensions->ARB_gl_spirv */ 0 &&
388 /* extensions->ARB_spirv_extensions */ 0 &&
389 extensions
->ARB_indirect_parameters
&&
390 extensions
->ARB_pipeline_statistics_query
&&
391 extensions
->ARB_polygon_offset_clamp
&&
392 extensions
->ARB_shader_atomic_counter_ops
&&
393 extensions
->ARB_shader_draw_parameters
&&
394 extensions
->ARB_shader_group_vote
&&
395 extensions
->ARB_texture_filter_anisotropic
&&
396 extensions
->ARB_transform_feedback_overflow_query
);
467 version
= major
* 10 + minor
;
469 if (api
== API_OPENGL_CORE
&& version
< 31)
476 compute_version_es1(const struct gl_extensions
*extensions
)
478 /* OpenGL ES 1.0 is derived from OpenGL 1.3 */
479 const bool ver_1_0
= (extensions
->ARB_texture_env_combine
&&
480 extensions
->ARB_texture_env_dot3
);
481 /* OpenGL ES 1.1 is derived from OpenGL 1.5 */
482 const bool ver_1_1
= (ver_1_0
&&
483 extensions
->EXT_point_parameters
);
487 } else if (ver_1_0
) {
495 compute_version_es2(const struct gl_extensions
*extensions
,
496 const struct gl_constants
*consts
)
498 /* OpenGL ES 2.0 is derived from OpenGL 2.0 */
499 const bool ver_2_0
= (extensions
->ARB_texture_cube_map
&&
500 extensions
->EXT_blend_color
&&
501 extensions
->EXT_blend_func_separate
&&
502 extensions
->EXT_blend_minmax
&&
503 extensions
->ARB_vertex_shader
&&
504 extensions
->ARB_fragment_shader
&&
505 extensions
->ARB_texture_non_power_of_two
&&
506 extensions
->EXT_blend_equation_separate
);
507 /* FINISHME: This list isn't quite right. */
508 const bool ver_3_0
= (extensions
->ARB_half_float_vertex
&&
509 extensions
->ARB_internalformat_query
&&
510 extensions
->ARB_map_buffer_range
&&
511 extensions
->ARB_shader_texture_lod
&&
512 extensions
->ARB_texture_float
&&
513 extensions
->ARB_texture_rg
&&
514 extensions
->ARB_depth_buffer_float
&&
515 /* extensions->ARB_framebuffer_object && */
516 extensions
->EXT_framebuffer_sRGB
&&
517 extensions
->EXT_packed_float
&&
518 extensions
->EXT_texture_array
&&
519 extensions
->EXT_texture_shared_exponent
&&
520 extensions
->EXT_transform_feedback
&&
521 extensions
->ARB_draw_instanced
&&
522 extensions
->ARB_uniform_buffer_object
&&
523 extensions
->EXT_texture_snorm
&&
524 extensions
->NV_primitive_restart
&&
525 extensions
->OES_depth_texture_cube_map
);
526 const bool es31_compute_shader
=
527 consts
->MaxComputeWorkGroupInvocations
>= 128;
528 const bool ver_3_1
= (ver_3_0
&&
529 consts
->MaxVertexAttribStride
>= 2048 &&
530 extensions
->ARB_arrays_of_arrays
&&
531 es31_compute_shader
&&
532 extensions
->ARB_draw_indirect
&&
533 extensions
->ARB_explicit_uniform_location
&&
534 extensions
->ARB_framebuffer_no_attachments
&&
535 extensions
->ARB_shader_atomic_counters
&&
536 extensions
->ARB_shader_image_load_store
&&
537 extensions
->ARB_shader_image_size
&&
538 extensions
->ARB_shader_storage_buffer_object
&&
539 extensions
->ARB_shading_language_packing
&&
540 extensions
->ARB_stencil_texturing
&&
541 extensions
->ARB_texture_multisample
&&
542 extensions
->ARB_texture_gather
&&
543 extensions
->MESA_shader_integer_functions
&&
544 extensions
->EXT_shader_integer_mix
);
545 const bool ver_3_2
= (ver_3_1
&&
546 extensions
->EXT_draw_buffers2
&&
547 extensions
->KHR_blend_equation_advanced
&&
548 extensions
->KHR_robustness
&&
549 extensions
->KHR_texture_compression_astc_ldr
&&
550 extensions
->OES_copy_image
&&
551 extensions
->ARB_draw_buffers_blend
&&
552 extensions
->ARB_draw_elements_base_vertex
&&
553 extensions
->OES_geometry_shader
&&
554 extensions
->OES_primitive_bounding_box
&&
555 extensions
->OES_sample_variables
&&
556 extensions
->ARB_tessellation_shader
&&
557 extensions
->ARB_texture_border_clamp
&&
558 extensions
->OES_texture_buffer
&&
559 extensions
->OES_texture_cube_map_array
&&
560 extensions
->ARB_texture_stencil8
);
564 } else if (ver_3_1
) {
566 } else if (ver_3_0
) {
568 } else if (ver_2_0
) {
576 _mesa_get_version(const struct gl_extensions
*extensions
,
577 struct gl_constants
*consts
, gl_api api
)
580 case API_OPENGL_COMPAT
:
581 /* Disable higher GLSL versions for legacy contexts.
582 * This disallows creation of higher compatibility contexts. */
583 if (!consts
->AllowHigherCompatVersion
) {
584 consts
->GLSLVersion
= consts
->GLSLVersionCompat
;
587 case API_OPENGL_CORE
:
588 return compute_version(extensions
, consts
, api
);
590 return compute_version_es1(extensions
);
592 return compute_version_es2(extensions
, consts
);
598 * Set the context's Version and VersionString fields.
599 * This should only be called once as part of context initialization
600 * or to perform version check for GLX_ARB_create_context_profile.
603 _mesa_compute_version(struct gl_context
*ctx
)
608 ctx
->Version
= _mesa_get_version(&ctx
->Extensions
, &ctx
->Const
, ctx
->API
);
609 ctx
->Extensions
.Version
= ctx
->Version
;
611 /* Make sure that the GLSL version lines up with the GL version. In some
612 * cases it can be too high, e.g. if an extension is missing.
614 if (_mesa_is_desktop_gl(ctx
)) {
615 switch (ctx
->Version
) {
617 /* fall-through, GLSL 1.20 is the minimum we support */
619 ctx
->Const
.GLSLVersion
= 120;
622 ctx
->Const
.GLSLVersion
= 130;
625 ctx
->Const
.GLSLVersion
= 140;
628 ctx
->Const
.GLSLVersion
= 150;
631 if (ctx
->Version
>= 33)
632 ctx
->Const
.GLSLVersion
= ctx
->Version
* 10;
638 case API_OPENGL_COMPAT
:
639 case API_OPENGL_CORE
:
640 create_version_string(ctx
, "");
645 _mesa_problem(ctx
, "Incomplete OpenGL ES 1.0 support.");
648 create_version_string(ctx
, "OpenGL ES-CM ");
653 _mesa_problem(ctx
, "Incomplete OpenGL ES 2.0 support.");
656 create_version_string(ctx
, "OpenGL ES ");
661 if (ctx
->API
== API_OPENGL_COMPAT
&& ctx
->Version
>= 31)
662 ctx
->Extensions
.ARB_compatibility
= GL_TRUE
;
667 _mesa_get_driver_uuid(struct gl_context
*ctx
, GLint
*uuid
)
669 ctx
->Driver
.GetDriverUuid(ctx
, (char*) uuid
);
673 _mesa_get_device_uuid(struct gl_context
*ctx
, GLint
*uuid
)
675 ctx
->Driver
.GetDeviceUuid(ctx
, (char*) uuid
);
679 * Get the i-th GLSL version string. If index=0, return the most recent
681 * \param ctx context to query
682 * \param index which version string to return, or -1 if none
683 * \param versionOut returns the vesrion string
684 * \return total number of shading language versions.
687 _mesa_get_shading_language_version(const struct gl_context
*ctx
,
693 #define GLSL_VERSION(S) \
698 if (ctx
->Const
.GLSLVersion
>= 460)
700 if (ctx
->Const
.GLSLVersion
>= 450)
702 if (ctx
->Const
.GLSLVersion
>= 440)
704 if (ctx
->Const
.GLSLVersion
>= 430)
706 if (ctx
->Const
.GLSLVersion
>= 420)
708 if (ctx
->Const
.GLSLVersion
>= 410)
710 if (ctx
->Const
.GLSLVersion
>= 400)
712 if (ctx
->Const
.GLSLVersion
>= 330)
714 if (ctx
->Const
.GLSLVersion
>= 150)
716 if (ctx
->Const
.GLSLVersion
>= 140)
718 if (ctx
->Const
.GLSLVersion
>= 130)
720 if (ctx
->Const
.GLSLVersion
>= 120)
722 /* The GL spec says to return the empty string for GLSL 1.10 */
723 if (ctx
->Const
.GLSLVersion
>= 110)
727 if ((ctx
->API
== API_OPENGLES2
&& ctx
->Version
>= 32) ||
728 ctx
->Extensions
.ARB_ES3_2_compatibility
)
729 GLSL_VERSION("320 es");
730 if (_mesa_is_gles31(ctx
) || ctx
->Extensions
.ARB_ES3_1_compatibility
)
731 GLSL_VERSION("310 es");
732 if (_mesa_is_gles3(ctx
) || ctx
->Extensions
.ARB_ES3_compatibility
)
733 GLSL_VERSION("300 es");
734 if (ctx
->API
== API_OPENGLES2
|| ctx
->Extensions
.ARB_ES2_compatibility
)