diff options
author | Brian Paul <[email protected]> | 2010-07-01 16:30:00 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-07-01 20:03:32 -0600 |
commit | 44732103b2b7a8765299e586fb3b9bf91e32f6d4 (patch) | |
tree | 641ee09284052b65f24e208d4471f9872ebe9942 /src/mesa/main/version.c | |
parent | 120a9f46cd7cbe93f863a2fd6bdfe0cc5229f79f (diff) |
mesa: extension flags and version testing for GL 3.x features
Diffstat (limited to 'src/mesa/main/version.c')
-rw-r--r-- | src/mesa/main/version.c | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index dea3019d0bc..525d179621b 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -87,7 +87,70 @@ compute_version(GLcontext *ctx) ctx->Extensions.ARB_shading_language_120 && ctx->Extensions.EXT_pixel_buffer_object && ctx->Extensions.EXT_texture_sRGB); - if (ver_2_1) { + const GLboolean ver_3_0 = (ver_2_1 && + ctx->Extensions.ARB_half_float_pixel && + ctx->Extensions.ARB_map_buffer_range && + ctx->Extensions.ARB_texture_float && + ctx->Extensions.APPLE_vertex_array_object && + ctx->Extensions.EXT_draw_buffers2 && + ctx->Extensions.EXT_framebuffer_blit && + ctx->Extensions.EXT_framebuffer_multisample && + ctx->Extensions.EXT_framebuffer_object && + ctx->Extensions.EXT_framebuffer_sRGB && + ctx->Extensions.EXT_packed_depth_stencil && + ctx->Extensions.EXT_packed_float && + ctx->Extensions.EXT_shared_exponent && + ctx->Extensions.EXT_texture_array && + ctx->Extensions.EXT_texture_compression_rgtc && + ctx->Extensions.EXT_texture_integer && + ctx->Extensions.EXT_transform_feedback && + ctx->Extensions.NV_conditional_render); + const GLboolean ver_3_1 = (ver_3_0 && + ctx->Extensions.ARB_copy_buffer && + ctx->Extensions.ARB_draw_instanced && + ctx->Extensions.ARB_texture_buffer_object && + ctx->Extensions.ARB_uniform_buffer_object && + ctx->Extensions.NV_primitive_restart && + ctx->Extensions.NV_texture_rectangle && + ctx->Const.MaxVertexTextureImageUnits >= 16); + const GLboolean ver_3_2 = (ver_3_1 && + ctx->Extensions.ARB_depth_clamp && + ctx->Extensions.ARB_draw_elements_base_vertex && + ctx->Extensions.ARB_fragment_coord_conventions && + ctx->Extensions.ARB_geometry_shader4 && + ctx->Extensions.EXT_provoking_vertex && + ctx->Extensions.ARB_seamless_cube_map && + ctx->Extensions.ARB_sync && + ctx->Extensions.ARB_texture_multisample && + ctx->Extensions.EXT_vertex_array_bgra); + const GLboolean ver_3_3 = (ver_3_2 && + ctx->Extensions.ARB_blend_func_extended && + ctx->Extensions.ARB_explicit_attrib_location && + ctx->Extensions.ARB_instanced_arrays && + ctx->Extensions.ARB_occlusion_query2 && + ctx->Extensions.ARB_sampler_objects && + ctx->Extensions.ARB_texture_rgb10_a2ui && + ctx->Extensions.ARB_timer_query && + ctx->Extensions.ARB_vertex_type_2_10_10_10_rev && + ctx->Extensions.EXT_texture_swizzle); + + if (ver_3_3) { + major = 3; + minor = 3; + } + else if (ver_3_2) { + major = 3; + minor = 2; + } + else if (ver_3_1) { + major = 3; + minor = 1; + } + else if (ver_3_0) { + major = 3; + minor = 0; + } + else if (ver_2_1) { major = 2; minor = 1; } |