Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / mesa / drivers / dri / intel / intel_extensions_es2.c
1 /**************************************************************************
2 *
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #include "main/extensions.h"
29
30 #include "intel_extensions.h"
31
32 static const char *es2_extensions[] = {
33 /* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */
34 "GL_ARB_draw_buffers",
35 "GL_ARB_multisample",
36 "GL_ARB_texture_compression",
37 "GL_ARB_transpose_matrix",
38 "GL_ARB_vertex_buffer_object",
39 "GL_ARB_window_pos",
40 "GL_EXT_blend_func_separate",
41 "GL_EXT_compiled_vertex_array",
42 "GL_EXT_framebuffer_blit",
43 "GL_EXT_multi_draw_arrays",
44 "GL_EXT_polygon_offset",
45 "GL_EXT_texture_object",
46 "GL_EXT_vertex_array",
47 "GL_IBM_multimode_draw_arrays",
48 "GL_MESA_window_pos",
49 "GL_NV_vertex_program",
50
51 /* Required by GLES2 */
52 "GL_ARB_fragment_program",
53 "GL_ARB_fragment_shader",
54 "GL_ARB_multitexture",
55 "GL_ARB_shader_objects",
56 "GL_ARB_texture_cube_map",
57 "GL_ARB_texture_mirrored_repeat",
58 "GL_ARB_texture_non_power_of_two",
59 "GL_ARB_vertex_shader",
60 "GL_EXT_blend_color",
61 "GL_EXT_blend_equation_separate",
62 "GL_EXT_blend_minmax",
63 "GL_EXT_blend_subtract",
64 "GL_EXT_stencil_wrap",
65
66 /* Optional GLES2 */
67 "GL_ARB_framebuffer_object",
68 "GL_EXT_texture_filter_anisotropic",
69 "GL_ARB_depth_texture",
70 "GL_EXT_packed_depth_stencil",
71 "GL_EXT_framebuffer_object",
72 "GL_EXT_texture_format_BGRA8888",
73
74 #if FEATURE_OES_EGL_image
75 "GL_OES_EGL_image",
76 #endif
77
78 NULL,
79 };
80
81 /**
82 * Initializes potential list of extensions if ctx == NULL, or actually enables
83 * extensions for a context.
84 */
85 void
86 intelInitExtensionsES2(struct gl_context *ctx)
87 {
88 int i;
89
90 /* Can't use driInitExtensions() since it uses extensions from
91 * main/remap_helper.h when called the first time. */
92
93 for (i = 0; es2_extensions[i]; i++)
94 _mesa_enable_extension(ctx, es2_extensions[i]);
95 }