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 3547e954b8edaf71895ded815f91330b34c7fd59..7b8222e0a20b3af4b52876dc9878058fe032b82a 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 9afca20b7a95513f6dff934d21549f4a42b0b5be..1db360def811b2c6a3dd5361f7258fe0cfd5c3a5 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 9b6557d1869f6cb81f7ef33b6a3739c5026f422a..49d564a737f456dc114acfcc7ea47ffb87174986 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 8210d6cfbe5f3b60de7bab18053f48fa39aa5998..c6c436743f5421d12c7976f899f41da9380d96c1 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 f06aa8e4ff91263c11a51098eb8c90343ca6ff0c..b6ec8e28f8b71dc9a61179631aeb393c0a884129 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 )