r600: don't enable depth test if there is no depth buffer
[mesa.git] / src / gallium / state_trackers / dri / dri_extensions.c
1 /**************************************************************************
2 *
3 * Copyright 2009, VMware, Inc.
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 VMWARE 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 * Author: Keith Whitwell <keithw@vmware.com>
29 * Author: Jakob Bornecrantz <wallbraker@gmail.com>
30 */
31
32 #include "dri_screen.h"
33 #include "dri_context.h"
34 #include "state_tracker/st_context.h"
35
36 #define need_GL_ARB_map_buffer_range
37 #define need_GL_ARB_multisample
38 #define need_GL_ARB_occlusion_query
39 #define need_GL_ARB_point_parameters
40 #define need_GL_ARB_provoking_vertex
41 #define need_GL_ARB_shader_objects
42 #define need_GL_ARB_texture_compression
43 #define need_GL_ARB_vertex_array_object
44 #define need_GL_ARB_vertex_buffer_object
45 #define need_GL_ARB_vertex_program
46 #define need_GL_ARB_vertex_shader
47 #define need_GL_ARB_window_pos
48 #define need_GL_EXT_blend_color
49 #define need_GL_EXT_blend_equation_separate
50 #define need_GL_EXT_blend_func_separate
51 #define need_GL_EXT_blend_minmax
52 #define need_GL_EXT_cull_vertex
53 #define need_GL_EXT_draw_buffers2
54 #define need_GL_EXT_fog_coord
55 #define need_GL_EXT_framebuffer_object
56 #define need_GL_EXT_multi_draw_arrays
57 #define need_GL_EXT_provoking_vertex
58 #define need_GL_EXT_secondary_color
59 #define need_GL_EXT_stencil_two_side
60 #define need_GL_APPLE_vertex_array_object
61 #define need_GL_NV_vertex_program
62 #define need_GL_VERSION_2_0
63 #define need_GL_VERSION_2_1
64 #include "main/remap_helper.h"
65 #include "utils.h"
66
67 /**
68 * Extension strings exported by the driver.
69 */
70 static const struct dri_extension card_extensions[] = {
71 {"GL_ARB_fragment_shader", NULL},
72 {"GL_ARB_map_buffer_range", GL_ARB_map_buffer_range_functions},
73 {"GL_ARB_multisample", GL_ARB_multisample_functions},
74 {"GL_ARB_multitexture", NULL},
75 {"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions},
76 {"GL_ARB_pixel_buffer_object", NULL},
77 {"GL_ARB_provoking_vertex", GL_ARB_provoking_vertex_functions},
78 {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
79 {"GL_ARB_shading_language_100", GL_VERSION_2_0_functions },
80 {"GL_ARB_shading_language_120", GL_VERSION_2_1_functions },
81 {"GL_ARB_shader_objects", GL_ARB_shader_objects_functions},
82 {"GL_ARB_texture_border_clamp", NULL},
83 {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions},
84 {"GL_ARB_texture_cube_map", NULL},
85 {"GL_ARB_texture_env_add", NULL},
86 {"GL_ARB_texture_env_combine", NULL},
87 {"GL_ARB_texture_env_dot3", NULL},
88 {"GL_ARB_texture_mirrored_repeat", NULL},
89 {"GL_ARB_texture_non_power_of_two", NULL},
90 {"GL_ARB_texture_rectangle", NULL},
91 {"GL_ARB_vertex_array_object", GL_ARB_vertex_array_object_functions},
92 {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
93 {"GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions},
94 {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions},
95 {"GL_ARB_window_pos", GL_ARB_window_pos_functions},
96 {"GL_EXT_blend_color", GL_EXT_blend_color_functions},
97 {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions},
98 {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions},
99 {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
100 {"GL_EXT_blend_subtract", NULL},
101 {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions},
102 {"GL_EXT_draw_buffers2", GL_EXT_draw_buffers2_functions},
103 {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions},
104 {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
105 {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
106 {"GL_EXT_packed_depth_stencil", NULL},
107 {"GL_EXT_pixel_buffer_object", NULL},
108 {"GL_EXT_provoking_vertex", GL_EXT_provoking_vertex_functions},
109 {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
110 {"GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions},
111 {"GL_EXT_stencil_wrap", NULL},
112 {"GL_EXT_texture_edge_clamp", NULL},
113 {"GL_EXT_texture_env_combine", NULL},
114 {"GL_EXT_texture_env_dot3", NULL},
115 {"GL_EXT_texture_filter_anisotropic", NULL},
116 {"GL_EXT_texture_lod_bias", NULL},
117 {"GL_3DFX_texture_compression_FXT1", NULL},
118 {"GL_APPLE_client_storage", NULL},
119 {"GL_APPLE_vertex_array_object", GL_APPLE_vertex_array_object_functions},
120 {"GL_MESA_pack_invert", NULL},
121 {"GL_MESA_ycbcr_texture", NULL},
122 {"GL_NV_blend_square", NULL},
123 {"GL_NV_vertex_program", GL_NV_vertex_program_functions},
124 {"GL_NV_vertex_program1_1", NULL},
125 {"GL_SGIS_generate_mipmap", NULL},
126 {NULL, NULL}
127 };
128
129 void
130 dri_init_extensions(struct dri_context *ctx)
131 {
132 /* The card_extensions list should be pruned according to the
133 * capabilities of the pipe_screen. This is actually something
134 * that can/should be done inside st_create_context().
135 * XXX Not pruning is very bogus. Always all these extensions above
136 * will be advertized, regardless what st_init_extensions
137 * (which depends on the pipe cap bits) does.
138 */
139 driInitExtensions(ctx->st->ctx, card_extensions, GL_TRUE);
140 }
141
142 /* vim: set sw=3 ts=8 sts=3 expandtab: */