~ubuntu-branches/ubuntu/precise/mesa/precise-updates

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/intel/intel_extensions_es.c

  • Committer: Package Import Robot
  • Author(s): Robert Hooker
  • Date: 2012-02-02 12:05:48 UTC
  • mfrom: (1.7.1) (3.3.27 sid)
  • Revision ID: package-import@ubuntu.com-20120202120548-nvkma85jq0h4coix
Tags: 8.0~rc2-0ubuntu4
Drop drisearchdir handling, it is no longer needed with multiarch
and dri-alternates being removed.

Show diffs side-by-side

added added

removed removed

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