This patch enables GL_ARB_vertex_program and GL_NV_vertex_program
authorDave Airlie <airliedfreedesktop.org>
Tue, 7 Sep 2004 09:56:19 +0000 (09:56 +0000)
committerDave Airlie <airliedfreedesktop.org>
Tue, 7 Sep 2004 09:56:19 +0000 (09:56 +0000)
support in the r200 driver. Both extensions can be enabled via
options, GL_ARB_vertex_program is on by default, GL_NV_vertex_program
off. Option descriptions are in german, english and french.

From: Philipp Klaus Krause

src/mesa/drivers/dri/common/xmlpool.h
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_screen.c
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/r200/r200_tcl.h

index 3547e95..7b8222e 100644 (file)
@@ -273,4 +273,25 @@ DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
         DRI_CONF_DESC(de,"Anzahl der Textureinheiten") \
 DRI_CONF_OPT_END
 
+/* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program
+   On cards where there is no documentation (r200) or on rasterization-only hardware). */
+#define DRI_CONF_SECTION_SOFTWARE \
+DRI_CONF_SECTION_BEGIN \
+        DRI_CONF_DESC(de,"Funktionalität, die nicht durch die Hardware beschleunigt wird") \
+        DRI_CONF_DESC(en,"Features that are not hardware-accelerated")
+
+#define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
+DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
+        DRI_CONF_DESC(de,"GL_ARB_vertex_program aktivieren") \
+        DRI_CONF_DESC(en,"Enable GL_ARB_vertex_program") \
+        DRI_CONF_DESC(fr,"Activer GL_ARB_vertex_program") \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_NV_VERTEX_PROGRAM(def) \
+DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
+        DRI_CONF_DESC(de,"GL_NV_vertex_program aktivieren") \
+        DRI_CONF_DESC(en,"Enable GL_NV_vertex_program") \
+        DRI_CONF_DESC(fr,"Activer GL_NV_vertex_program") \
+DRI_CONF_OPT_END
+
 #endif
index 9afca20..1db360d 100644 (file)
@@ -62,7 +62,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r200_vtxfmt.h"
 #include "r200_maos.h"
 
-#define DRIVER_DATE    "20030328"
+#define DRIVER_DATE    "20040906"
 
 #include "vblank.h"
 #include "utils.h"
@@ -166,6 +166,7 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
    &_tnl_fog_coordinate_stage,
    &_tnl_texgen_stage,
    &_tnl_texture_transform_stage,
+   &_tnl_vertex_program_stage,
 
    /* Try again to go to tcl? 
     *     - no good for asymmetric-twoside (do with multipass)
@@ -406,6 +407,10 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
       _mesa_enable_extension( ctx, "GL_EXT_blend_equation_separate" );
       _mesa_enable_extension( ctx, "GL_EXT_blend_func_separate" );
    }
+   if(driQueryOptionb(&rmesa->optionCache, "arb_vertex_program"))
+      _mesa_enable_extension( ctx, "GL_ARB_vertex_program");
+   if(driQueryOptionb(&rmesa->optionCache, "nv_vertex_program"))
+      _mesa_enable_extension( ctx, "GL_NV_VERTEX_PROGRAM");
 
 #if 0
    r200InitDriverFuncs( ctx );
index 9b6557d..49d564a 100644 (file)
@@ -75,6 +75,10 @@ DRI_CONF_BEGIN
     DRI_CONF_SECTION_DEBUG
         DRI_CONF_NO_RAST(false)
     DRI_CONF_SECTION_END
+    DRI_CONF_SECTION_SOFTWARE
+        DRI_CONF_ARB_VERTEX_PROGRAM(true)
+        DRI_CONF_NV_VERTEX_PROGRAM(false)
+    DRI_CONF_SECTION_END
 DRI_CONF_END;
 static const GLuint __driNConfigOptions = 11;
 
index 8210d6c..c6c4367 100644 (file)
@@ -2043,6 +2043,10 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
       r200UpdateSpecular ( ctx );
       break;
 
+   case GL_VERTEX_PROGRAM_ARB:
+      TCL_FALLBACK(rmesa->glCtx, R200_TCL_FALLBACK_TCL_DISABLE, state);
+      break;
+
    default:
       return;
    }
index f06aa8e..b6ec8e2 100644 (file)
@@ -60,6 +60,7 @@ extern void r200TclFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
 #define R200_TCL_FALLBACK_TEXGEN_5          0x200 /* texgen, unit 5 */
 #define R200_TCL_FALLBACK_TCL_DISABLE       0x400 /* user disable */
 #define R200_TCL_FALLBACK_BITMAP            0x800 /* draw bitmap with points */
+#define R200_TCL_FALLBACK_VERTEX_PROGRAM    0x1000/* vertex program active */
 
 #define TCL_FALLBACK( ctx, bit, mode ) r200TclFallback( ctx, bit, mode )