intel: Kill intel_framebuffer_get_hiz_region()
[mesa.git] / src / mesa / drivers / dri / intel / intel_extensions_es.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 #include "main/mfeatures.h"
30
31 #include "intel_extensions.h"
32
33 static const char *common_extensions[] = {
34 /* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */
35 "GL_ARB_transpose_matrix",
36 "GL_ARB_window_pos",
37 "GL_EXT_blend_func_separate",
38 "GL_EXT_compiled_vertex_array",
39 "GL_EXT_framebuffer_blit",
40 "GL_IBM_multimode_draw_arrays",
41 "GL_MESA_window_pos",
42 "GL_NV_vertex_program",
43
44 /* Optional GLES1 or GLES2 */
45 #if FEATURE_OES_EGL_image
46 "GL_OES_EGL_image",
47 #endif
48 "GL_EXT_texture_filter_anisotropic",
49 "GL_EXT_packed_depth_stencil",
50 "GL_EXT_blend_minmax",
51
52 NULL
53 };
54
55 static const char *es1_extensions[] = {
56 /* Required by GLES1 */
57 "GL_ARB_multitexture",
58 "GL_ARB_texture_env_add",
59 "GL_ARB_texture_env_combine",
60 "GL_ARB_texture_env_dot3",
61 "GL_ARB_point_parameters",
62
63 /* Optional GLES1 */
64 "GL_EXT_blend_equation_separate",
65 "GL_EXT_blend_func_separate",
66 "GL_EXT_blend_subtract",
67 "GL_OES_draw_texture",
68 "GL_ARB_framebuffer_object",
69 "GL_EXT_framebuffer_object",
70 "GL_ARB_point_sprite",
71 "GL_EXT_stencil_wrap",
72 "GL_ARB_texture_cube_map",
73 "GL_ARB_texture_env_crossbar",
74 "GL_ARB_texture_mirrored_repeat",
75 "GL_EXT_texture_lod_bias",
76
77 NULL
78 };
79
80 static const char *es2_extensions[] = {
81 /* Required by GLES2 */
82 "GL_ARB_fragment_program",
83 "GL_ARB_fragment_shader",
84 "GL_ARB_shader_objects",
85 "GL_ARB_texture_cube_map",
86 "GL_ARB_texture_non_power_of_two",
87 "GL_ARB_vertex_shader",
88 "GL_EXT_blend_color",
89 "GL_EXT_blend_equation_separate",
90 "GL_EXT_blend_minmax",
91 "GL_NV_blend_square",
92
93 /* Optional GLES2 */
94 "GL_ARB_framebuffer_object",
95 "GL_ARB_depth_texture",
96 "GL_EXT_framebuffer_object",
97
98 NULL,
99 };
100
101 void
102 intelInitExtensionsES1(struct gl_context *ctx)
103 {
104 int i;
105
106 for (i = 0; common_extensions[i]; i++)
107 _mesa_enable_extension(ctx, common_extensions[i]);
108 for (i = 0; es1_extensions[i]; i++)
109 _mesa_enable_extension(ctx, es1_extensions[i]);
110 }
111
112 /**
113 * \brief Extensions to disable.
114 *
115 * These extensions must be manually disabled because they may have been
116 * enabled by default.
117 */
118 static const char* es2_extensions_disabled[] = {
119 "GL_OES_standard_derivatives",
120 NULL,
121 };
122
123 /**
124 * Initializes potential list of extensions if ctx == NULL, or actually enables
125 * extensions for a context.
126 */
127 void
128 intelInitExtensionsES2(struct gl_context *ctx)
129 {
130 int i;
131
132 for (i = 0; common_extensions[i]; i++)
133 _mesa_enable_extension(ctx, common_extensions[i]);
134 for (i = 0; es2_extensions[i]; i++)
135 _mesa_enable_extension(ctx, es2_extensions[i]);
136 for (i = 0; es2_extensions_disabled[i]; i++)
137 _mesa_disable_extension(ctx, es2_extensions_disabled[i]);
138 }