intel_extensions.c revision 8affcd364bd99b7da44e565db91c6c0afbf9ce77
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 "intel_chipset.h"
29#include "intel_context.h"
30#include "intel_extensions.h"
31
32
33#define need_GL_ARB_framebuffer_object
34#define need_GL_ARB_occlusion_query
35#define need_GL_ARB_point_parameters
36#define need_GL_ARB_shader_objects
37#define need_GL_ARB_vertex_array_object
38#define need_GL_ARB_vertex_program
39#define need_GL_ARB_vertex_shader
40#define need_GL_ARB_window_pos
41#define need_GL_EXT_blend_color
42#define need_GL_EXT_blend_equation_separate
43#define need_GL_EXT_blend_func_separate
44#define need_GL_EXT_blend_minmax
45#define need_GL_EXT_cull_vertex
46#define need_GL_EXT_fog_coord
47#define need_GL_EXT_framebuffer_object
48#define need_GL_EXT_framebuffer_blit
49#define need_GL_EXT_point_parameters
50#define need_GL_EXT_secondary_color
51#define need_GL_EXT_stencil_two_side
52#define need_GL_APPLE_vertex_array_object
53#define need_GL_ATI_separate_stencil
54#define need_GL_ATI_envmap_bumpmap
55#define need_GL_NV_point_sprite
56#define need_GL_NV_vertex_program
57#define need_GL_VERSION_2_0
58#define need_GL_VERSION_2_1
59
60#include "extension_helper.h"
61
62
63/**
64 * Extension strings exported by the intel driver.
65 *
66 * Extensions supported by all chips supported by i830_dri, i915_dri, or
67 * i965_dri.
68 */
69static const struct dri_extension card_extensions[] = {
70   { "GL_ARB_half_float_pixel",           NULL },
71   { "GL_ARB_multitexture",               NULL },
72   { "GL_ARB_point_parameters",           GL_ARB_point_parameters_functions },
73   { "GL_ARB_texture_border_clamp",       NULL },
74   { "GL_ARB_texture_cube_map",           NULL },
75   { "GL_ARB_texture_env_add",            NULL },
76   { "GL_ARB_texture_env_combine",        NULL },
77   { "GL_ARB_texture_env_crossbar",       NULL },
78   { "GL_ARB_texture_env_dot3",           NULL },
79   { "GL_ARB_texture_mirrored_repeat",    NULL },
80   { "GL_ARB_texture_rectangle",          NULL },
81   { "GL_ARB_vertex_array_object",        GL_ARB_vertex_array_object_functions},
82   { "GL_ARB_vertex_program",             GL_ARB_vertex_program_functions },
83   { "GL_ARB_window_pos",                 GL_ARB_window_pos_functions },
84   { "GL_EXT_blend_color",                GL_EXT_blend_color_functions },
85   { "GL_EXT_blend_equation_separate",    GL_EXT_blend_equation_separate_functions },
86   { "GL_EXT_blend_func_separate",        GL_EXT_blend_func_separate_functions },
87   { "GL_EXT_blend_minmax",               GL_EXT_blend_minmax_functions },
88   { "GL_EXT_blend_logic_op",             NULL },
89   { "GL_EXT_blend_subtract",             NULL },
90   { "GL_EXT_cull_vertex",                GL_EXT_cull_vertex_functions },
91   { "GL_EXT_fog_coord",                  GL_EXT_fog_coord_functions },
92   { "GL_EXT_packed_depth_stencil",       NULL },
93   { "GL_EXT_secondary_color",            GL_EXT_secondary_color_functions },
94   { "GL_EXT_stencil_wrap",               NULL },
95   { "GL_EXT_texture_edge_clamp",         NULL },
96   { "GL_EXT_texture_env_combine",        NULL },
97   { "GL_EXT_texture_env_dot3",           NULL },
98   { "GL_EXT_texture_filter_anisotropic", NULL },
99   { "GL_EXT_texture_lod_bias",           NULL },
100   { "GL_3DFX_texture_compression_FXT1",  NULL },
101   { "GL_APPLE_client_storage",           NULL },
102   { "GL_APPLE_vertex_array_object",      GL_APPLE_vertex_array_object_functions},
103   { "GL_MESA_pack_invert",               NULL },
104   { "GL_MESA_ycbcr_texture",             NULL },
105   { "GL_NV_blend_square",                NULL },
106   { "GL_NV_point_sprite",                GL_NV_point_sprite_functions },
107   { "GL_NV_vertex_program",              GL_NV_vertex_program_functions },
108   { "GL_NV_vertex_program1_1",           NULL },
109   { "GL_SGIS_generate_mipmap",           NULL },
110   { NULL, NULL }
111};
112
113
114/** i915 / i945-only extensions */
115static const struct dri_extension i915_extensions[] = {
116   { "GL_ARB_depth_texture",              NULL },
117   { "GL_ARB_fragment_program",           NULL },
118   { "GL_ARB_shadow",                     NULL },
119   { "GL_ARB_texture_non_power_of_two",   NULL },
120   { "GL_ATI_texture_env_combine3",       NULL },
121   { "GL_EXT_shadow_funcs",               NULL },
122   { "GL_NV_texture_env_combine4",        NULL },
123   { NULL,                                NULL }
124};
125
126
127/** i965-only extensions */
128static const struct dri_extension brw_extensions[] = {
129   { "GL_ARB_depth_texture",              NULL },
130   { "GL_ARB_fragment_program",           NULL },
131   { "GL_ARB_fragment_program_shadow",    NULL },
132   { "GL_ARB_fragment_shader",            NULL },
133   { "GL_ARB_framebuffer_object",         GL_ARB_framebuffer_object_functions},
134   { "GL_ARB_occlusion_query",            GL_ARB_occlusion_query_functions },
135   { "GL_ARB_point_sprite", 		  NULL },
136   { "GL_ARB_shader_objects",             GL_ARB_shader_objects_functions },
137   { "GL_ARB_shading_language_100",       GL_VERSION_2_0_functions },
138   { "GL_ARB_shading_language_120",       GL_VERSION_2_1_functions },
139   { "GL_ARB_shadow",                     NULL },
140   { "GL_MESA_texture_signed_rgba",       NULL },
141   { "GL_ARB_texture_non_power_of_two",   NULL },
142   { "GL_ARB_vertex_shader",              GL_ARB_vertex_shader_functions },
143   { "GL_EXT_shadow_funcs",               NULL },
144   { "GL_EXT_stencil_two_side",           GL_EXT_stencil_two_side_functions },
145   { "GL_EXT_texture_sRGB",		  NULL },
146   { "GL_EXT_texture_swizzle",		  NULL },
147   { "GL_EXT_vertex_array_bgra",	  NULL },
148   { "GL_ATI_envmap_bumpmap",             GL_ATI_envmap_bumpmap_functions },
149   { "GL_ATI_separate_stencil",           GL_ATI_separate_stencil_functions },
150   { "GL_ATI_texture_env_combine3",       NULL },
151   { "GL_NV_texture_env_combine4",        NULL },
152   { NULL,                                NULL }
153};
154
155
156static const struct dri_extension arb_oq_extensions[] = {
157   { NULL, NULL }
158};
159
160
161static const struct dri_extension ttm_extensions[] = {
162   { "GL_ARB_pixel_buffer_object",      NULL },
163   { "GL_EXT_framebuffer_blit",         GL_EXT_framebuffer_blit_functions },
164   { "GL_EXT_framebuffer_object",       GL_EXT_framebuffer_object_functions },
165   { NULL, NULL }
166};
167
168
169/**
170 * Initializes potential list of extensions if ctx == NULL, or actually enables
171 * extensions for a context.
172 */
173void
174intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
175{
176   struct intel_context *intel = ctx?intel_context(ctx):NULL;
177
178   /* Disable imaging extension until convolution is working in teximage paths.
179    */
180   enable_imaging = GL_FALSE;
181
182   driInitExtensions(ctx, card_extensions, enable_imaging);
183
184   if (intel == NULL || intel->ttm)
185      driInitExtensions(ctx, ttm_extensions, GL_FALSE);
186
187   if (intel == NULL || IS_965(intel->intelScreen->deviceID))
188      driInitExtensions(ctx, brw_extensions, GL_FALSE);
189
190   if (intel == NULL || IS_915(intel->intelScreen->deviceID)
191       || IS_945(intel->intelScreen->deviceID))
192      driInitExtensions(ctx, i915_extensions, GL_FALSE);
193}
194