summaryrefslogtreecommitdiff
path: root/src/mesa/vbo
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo.h13
-rw-r--r--src/mesa/vbo/vbo_context.c5
-rw-r--r--src/mesa/vbo/vbo_context.h6
-rw-r--r--src/mesa/vbo/vbo_exec.c1
-rw-r--r--src/mesa/vbo/vbo_exec_api.c40
-rw-r--r--src/mesa/vbo/vbo_exec_array.c29
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c2
-rw-r--r--src/mesa/vbo/vbo_exec_eval.c1
-rw-r--r--src/mesa/vbo/vbo_save_api.c3
-rw-r--r--src/mesa/vbo/vbo_save_loopback.c3
-rw-r--r--src/mesa/vbo/vbo_split_inplace.c2
11 files changed, 90 insertions, 15 deletions
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 79d33d09c1..bd10956ee4 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -120,4 +120,17 @@ void vbo_use_buffer_objects(GLcontext *ctx);
void vbo_set_draw_func(GLcontext *ctx, vbo_draw_func func);
+void
+_vbo_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
+
+void
+_vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z);
+
+void
+_vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+
+void
+_vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params);
+
+
#endif
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index 235cee2429..dc7c534251 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -225,9 +225,10 @@ GLboolean _vbo_CreateContext( GLcontext *ctx )
* vtxfmt mechanism can be removed now.
*/
vbo_exec_init( ctx );
+#if FEATURE_dlist
vbo_save_init( ctx );
+#endif
-
return GL_TRUE;
}
@@ -246,7 +247,9 @@ void _vbo_DestroyContext( GLcontext *ctx )
}
vbo_exec_destroy(ctx);
+#if FEATURE_dlist
vbo_save_destroy(ctx);
+#endif
FREE(vbo_context(ctx));
ctx->swtnl_im = NULL;
}
diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h
index 013f81bdd5..bf405eb693 100644
--- a/src/mesa/vbo/vbo_context.h
+++ b/src/mesa/vbo/vbo_context.h
@@ -53,8 +53,10 @@
#include "vbo.h"
#include "vbo_attrib.h"
-#include "vbo_save.h"
#include "vbo_exec.h"
+#if FEATURE_dlist
+#include "vbo_save.h"
+#endif
struct vbo_context {
@@ -74,7 +76,9 @@ struct vbo_context {
struct vbo_exec_context exec;
+#if FEATURE_dlist
struct vbo_save_context save;
+#endif
/* Callback into the driver. This must always succeed, the driver
* is responsible for initiating any fallback actions required:
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index 1efa74945d..635f239acc 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -32,7 +32,6 @@
#include "main/context.h"
#include "main/macros.h"
#include "main/mtypes.h"
-#include "main/dlist.h"
#include "main/vtxfmt.h"
#include "vbo_context.h"
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 98580170e3..1e2a08bc8e 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -34,7 +34,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/context.h"
#include "main/macros.h"
#include "main/vtxfmt.h"
+#if FEATURE_dlist
#include "main/dlist.h"
+#endif
#include "main/state.h"
#include "main/light.h"
#include "main/api_arrayelt.h"
@@ -65,7 +67,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec )
GLuint last_begin = exec->vtx.prim[exec->vtx.prim_count-1].begin;
GLuint last_count;
- if (exec->ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) {
+ if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
GLint i = exec->vtx.prim_count - 1;
assert(i >= 0);
exec->vtx.prim[i].count = (exec->vtx.vert_count -
@@ -87,7 +89,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec )
*/
assert(exec->vtx.prim_count == 0);
- if (exec->ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) {
+ if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
exec->vtx.prim[0].mode = exec->ctx->Driver.CurrentExecPrimitive;
exec->vtx.prim[0].start = 0;
exec->vtx.prim[0].count = 0;
@@ -501,7 +503,7 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT( ctx );
- if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) {
+ if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
int i;
@@ -545,7 +547,7 @@ static void GLAPIENTRY vbo_exec_End( void )
{
GET_CURRENT_CONTEXT( ctx );
- if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) {
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
int idx = exec->vtx.vert_count;
int i = exec->vtx.prim_count - 1;
@@ -553,7 +555,7 @@ static void GLAPIENTRY vbo_exec_End( void )
exec->vtx.prim[i].end = 1;
exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start;
- ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
+ ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
if (exec->vtx.prim_count == VBO_MAX_PRIM)
vbo_exec_vtx_flush( exec );
@@ -569,8 +571,10 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec )
vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
vfmt->Begin = vbo_exec_Begin;
+#if FEATURE_dlist
vfmt->CallList = _mesa_CallList;
vfmt->CallLists = _mesa_CallLists;
+#endif
vfmt->End = vbo_exec_End;
vfmt->EvalCoord1f = vbo_exec_EvalCoord1f;
vfmt->EvalCoord1fv = vbo_exec_EvalCoord1fv;
@@ -765,3 +769,29 @@ static void reset_attrfv( struct vbo_exec_context *exec )
exec->vtx.vertex_size = 0;
}
+
+void
+_vbo_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
+{
+ vbo_Color4f(r, g, b, a);
+}
+
+
+void
+_vbo_Normal3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ vbo_Normal3f(x, y, z);
+}
+
+
+void
+_vbo_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ vbo_MultiTexCoord4f(target, s, t, r, q);
+}
+
+void
+_vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
+{
+ vbo_Materialfv(face, pname, params);
+}
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index a52521db64..e3d2fc51cb 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -30,6 +30,7 @@
#include "main/state.h"
#include "main/api_validate.h"
#include "main/api_noop.h"
+#include "main/varray.h"
#include "glapi/dispatch.h"
#include "vbo_context.h"
@@ -41,7 +42,7 @@ static void get_minmax_index( GLuint count, GLuint type,
GLuint *min_index,
GLuint *max_index)
{
- GLint i;
+ GLuint i;
switch(type) {
case GL_UNSIGNED_INT: {
@@ -400,3 +401,29 @@ void vbo_exec_array_destroy( struct vbo_exec_context *exec )
{
/* nothing to do */
}
+
+
+/* This API entrypoint is not ordinarily used */
+void GLAPIENTRY
+_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count)
+{
+ vbo_exec_DrawArrays(mode, first, count);
+}
+
+
+/* This API entrypoint is not ordinarily used */
+void GLAPIENTRY
+_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ vbo_exec_DrawElements(mode, count, type, indices);
+}
+
+
+/* This API entrypoint is not ordinarily used */
+void GLAPIENTRY
+_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
+ GLenum type, const GLvoid *indices)
+{
+ vbo_exec_DrawRangeElements(mode, start, end, count, type, indices);
+}
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 6bb6849a6a..3609a7452a 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -128,7 +128,7 @@ static GLuint vbo_copy_vertices( struct vbo_exec_context *exec )
for (i = 0 ; i < ovf ; i++)
_mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
return i;
- case GL_POLYGON+1:
+ case PRIM_OUTSIDE_BEGIN_END:
return 0;
default:
assert(0);
diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c
index 0ba5585d24..0c691b3a5c 100644
--- a/src/mesa/vbo/vbo_exec_eval.c
+++ b/src/mesa/vbo/vbo_exec_eval.c
@@ -26,7 +26,6 @@
*/
#include "main/glheader.h"
-#include "main/api_eval.h"
#include "main/context.h"
#include "main/macros.h"
#include "math/m_eval.h"
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index aded738143..f62be5c14c 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -864,6 +864,9 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
_ae_map_vbos( ctx );
+ if (ctx->Array.ElementArrayBufferObj->Name)
+ indices = ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Pointer, indices);
+
vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK );
switch (type) {
diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c
index f2cef698fb..92ca4ea95d 100644
--- a/src/mesa/vbo/vbo_save_loopback.c
+++ b/src/mesa/vbo/vbo_save_loopback.c
@@ -25,9 +25,6 @@
*
**************************************************************************/
-#include "swrast_setup/swrast_setup.h"
-#include "swrast/swrast.h"
-#include "tnl/tnl.h"
#include "main/context.h"
#include "main/glheader.h"
#include "main/enums.h"
diff --git a/src/mesa/vbo/vbo_split_inplace.c b/src/mesa/vbo/vbo_split_inplace.c
index 958afccd0c..fbc856e93b 100644
--- a/src/mesa/vbo/vbo_split_inplace.c
+++ b/src/mesa/vbo/vbo_split_inplace.c
@@ -58,7 +58,7 @@ struct split_context {
static void flush_vertex( struct split_context *split )
{
- GLint min_index, max_index;
+ GLuint min_index, max_index;
if (!split->dstprim_nr)
return;