nouveau: move extension stuff into nouveau_screen.c
authorBen Skeggs <skeggsb@gmail.com>
Sat, 15 Dec 2007 13:31:26 +0000 (00:31 +1100)
committerBen Skeggs <skeggsb@gmail.com>
Sat, 15 Dec 2007 13:35:59 +0000 (00:35 +1100)
src/mesa/drivers/dri/nouveau_winsys/nouveau_context.c
src/mesa/drivers/dri/nouveau_winsys/nouveau_screen.c

index 03f1816c32342de2d2231ecff53d39980e04a2d8..9c524fa0017f391152d5e21b0f074c50cda6022e 100644 (file)
@@ -1,6 +1,7 @@
 #include "main/glheader.h"
 #include "glapi/glthread.h"
 #include <GL/internal/glcore.h>
+#include "utils.h"
 
 #include "state_tracker/st_public.h"
 #include "pipe/p_defines.h"
 #include "nouveau_screen.h"
 #include "nouveau_winsys_pipe.h"
 
-#define need_GL_ARB_fragment_program
-#define need_GL_ARB_multisample
-#define need_GL_ARB_occlusion_query
-#define need_GL_ARB_point_parameters
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_program
-#define need_GL_ARB_vertex_buffer_object
-#define need_GL_EXT_compiled_vertex_array
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_secondary_color
-#define need_GL_EXT_framebuffer_object
-#include "extension_helper.h"
-
-const struct dri_extension common_extensions[] =
-{
-       { NULL, 0 }
-};
-
-const struct dri_extension nv40_extensions[] =
-{
-       { "GL_ARB_fragment_program", NULL },
-       { "GL_ARB_multisample", GL_ARB_multisample_functions },
-       { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
-       { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
-       { "GL_ARB_texture_border_clamp", NULL },
-       { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
-       { "GL_ARB_texture_cube_map", NULL },
-       { "GL_ARB_texture_env_add", NULL },
-       { "GL_ARB_texture_env_combine", NULL },
-       { "GL_ARB_texture_env_crossbar", NULL },
-       { "GL_ARB_texture_env_dot3", NULL },
-       { "GL_ARB_texture_mirrored_repeat", NULL },
-       { "GL_ARB_texture_non_power_of_two", NULL },
-       { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
-       { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
-       { "GL_ATI_texture_env_combine3", NULL },
-       { "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions },
-       { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
-       { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
-       { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
-       { "GL_EXT_texture_edge_clamp", NULL },
-       { "GL_EXT_texture_env_add", NULL },
-       { "GL_EXT_texture_env_combine", NULL },
-       { "GL_EXT_texture_env_dot3", NULL },
-       { "GL_EXT_texture_mirror_clamp", NULL },
-       { "GL_NV_texture_rectangle", NULL },
-       { NULL, 0 }
-};
-
 #ifdef DEBUG
 static const struct dri_debug_control debug_control[] = {
        { "bo", DEBUG_BO },
index 5a957f48eb87e27844c05e0a95bc83f31fd48446..6324a591311060b5883dab5d783b9eaa791176ca 100644 (file)
 #error nouveau_drm.h version does not match expected version
 #endif
 
+/* Extension stuff, enabling of extensions handled by Gallium's GL state
+ * tracker.  But, we still need to define the entry points we want.
+ */
+#define need_GL_ARB_fragment_program
+#define need_GL_ARB_multisample
+#define need_GL_ARB_occlusion_query
+#define need_GL_ARB_point_parameters
+#define need_GL_ARB_shader_objects
+#define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_program
+#define need_GL_ARB_vertex_shader
+#define need_GL_ARB_vertex_buffer_object
+#define need_GL_EXT_compiled_vertex_array
+#define need_GL_EXT_fog_coord
+#define need_GL_EXT_secondary_color
+#define need_GL_EXT_framebuffer_object
+#define need_GL_VERSION_2_0
+#define need_GL_VERSION_2_1
+#include "extension_helper.h"
+
+const struct dri_extension card_extensions[] =
+{
+       { "GL_ARB_multisample", GL_ARB_multisample_functions },
+       { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
+       { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
+       { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions },
+       { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions },
+       { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions },
+       { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
+       { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
+       { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions },
+       { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
+       { "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions },
+       { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
+       { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
+       { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
+       { NULL, 0 }
+};
+
 PUBLIC const char __driConfigOptions[] =
 DRI_CONF_BEGIN
 DRI_CONF_END;
@@ -260,8 +299,7 @@ __driCreateNewScreen_20050727(__DRInativeDisplay *dpy, int scrn,
                                              (nv_dri->bpp == 16) ? 0 : 8,
                                              1);
 
-       driInitExtensions(NULL, common_extensions, GL_FALSE);
-       driInitExtensions(NULL, nv40_extensions, GL_FALSE);
+       driInitExtensions(NULL, card_extensions, GL_FALSE);
 
        return (void *)psp;
 }