summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airliedfreedesktop.org>2004-09-07 09:56:19 +0000
committerDave Airlie <airliedfreedesktop.org>2004-09-07 09:56:19 +0000
commit0866b67fdb8503b38715da310ddf78dd15c92f8f (patch)
tree91dc529fd6fb8585de173c315ebbcb0d2ecd645d
parente520b72e8901058729780620e3a98b4014f736f2 (diff)
This patch enables GL_ARB_vertex_program and GL_NV_vertex_program
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
-rw-r--r--src/mesa/drivers/dri/common/xmlpool.h21
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c7
-rw-r--r--src/mesa/drivers/dri/r200/r200_screen.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_tcl.h1
5 files changed, 36 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/xmlpool.h b/src/mesa/drivers/dri/common/xmlpool.h
index 3547e954b8..7b8222e0a2 100644
--- a/src/mesa/drivers/dri/common/xmlpool.h
+++ b/src/mesa/drivers/dri/common/xmlpool.h
@@ -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
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 9afca20b7a..1db360def8 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -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 );
diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c
index 9b6557d186..49d564a737 100644
--- a/src/mesa/drivers/dri/r200/r200_screen.c
+++ b/src/mesa/drivers/dri/r200/r200_screen.c
@@ -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;
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index 8210d6cfbe..c6c436743f 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -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;
}
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.h b/src/mesa/drivers/dri/r200/r200_tcl.h
index f06aa8e4ff..b6ec8e28f8 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.h
+++ b/src/mesa/drivers/dri/r200/r200_tcl.h
@@ -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 )