r300: Enable GL_ATI_separate_stencil in R300
authorIan Romanick <idr@freedesktop.org>
Sat, 10 Jan 2009 00:41:19 +0000 (16:41 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 23 Jan 2009 17:49:29 +0000 (09:49 -0800)
At this point, GL_EXT_stencil_two_side should probably be disabled.
It may be worth leaving it enabled because it has GLX protocol while
GL_ATI_separate_stencil does not.  I'll leave it to one of the r300
maintainers to make the call.

src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/radeon/radeon_screen.c

index 3743627..dc4cd57 100644 (file)
@@ -77,19 +77,21 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 int future_hw_tcl_on = 1;
 int hw_tcl_on = 1;
 
-#define need_GL_EXT_stencil_two_side
+#define need_GL_VERSION_2_0
 #define need_GL_ARB_multisample
 #define need_GL_ARB_point_parameters
 #define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_ARB_vertex_program
+#define need_GL_EXT_blend_equation_separate
+#define need_GL_EXT_blend_func_separate
 #define need_GL_EXT_blend_minmax
 //#define need_GL_EXT_fog_coord
+#define need_GL_EXT_gpu_program_parameters
 #define need_GL_EXT_multi_draw_arrays
 #define need_GL_EXT_secondary_color
-#define need_GL_EXT_blend_equation_separate
-#define need_GL_EXT_blend_func_separate
-#define need_GL_EXT_gpu_program_parameters
+#define need_GL_EXT_stencil_two_side
+#define need_GL_ATI_separate_stencil
 #define need_GL_NV_vertex_program
 #include "extension_helper.h"
 
@@ -130,6 +132,7 @@ const struct dri_extension card_extensions[] = {
   {"GL_EXT_texture_lod_bias",          NULL},
   {"GL_EXT_texture_mirror_clamp",      NULL},
   {"GL_EXT_texture_rectangle",         NULL},
+  {"GL_ATI_separate_stencil",          GL_ATI_separate_stencil_functions},
   {"GL_ATI_texture_env_combine3",      NULL},
   {"GL_ATI_texture_mirror_once",       NULL},
   {"GL_MESA_pack_invert",              NULL},
@@ -142,6 +145,16 @@ const struct dri_extension card_extensions[] = {
   /* *INDENT-ON* */
 };
 
+
+/**
+ * The GL 2.0 functions are needed to make display lists work with
+ * functions added by GL_ATI_separate_stencil.
+ */
+const struct dri_extension gl_20_extension[] = {
+  {"GL_VERSION_2_0",                   GL_VERSION_2_0_functions },
+};
+
+
 extern struct tnl_pipeline_stage _r300_render_stage;
 extern const struct tnl_pipeline_stage _r300_tcl_stage;
 
index 5f32dd5..f5665c4 100644 (file)
@@ -206,6 +206,8 @@ DRI_CONF_BEGIN
 DRI_CONF_END;
 static const GLuint __driNConfigOptions = 17;
 
+extern const struct dri_extension gl_20_extension[];
+
 #ifndef RADEON_DEBUG
 int RADEON_DEBUG = 0;
 
@@ -1140,6 +1142,7 @@ static void radeonDestroyContext(__DRIcontextPrivate * driContextPriv)
 
 #endif
 
+
 /**
  * This is the driver specific part of the createNewScreen entry point.
  *
@@ -1192,6 +1195,8 @@ radeonInitScreen(__DRIscreenPrivate *psp)
    driInitSingleExtension( NULL, NV_vp_extension );
    driInitSingleExtension( NULL, ATI_fs_extension );
    driInitExtensions( NULL, point_extensions, GL_FALSE );
+#elif defined(RADEON_COMMON_FOR_R300)
+   driInitSingleExtension( NULL, gl_20_extension );
 #endif
 
    if (!radeonInitDriver(psp))