mesa: add ARB_texture_buffer_range glTextureBufferRangeEXT function
[mesa.git] / src / mesa / main / eval.c
index d6e45d6e88725e108f6a96de300f776c35b405a3..86c8f75a1d25df5542d79fcf6378b80998e7cf46 100644 (file)
@@ -1,7 +1,6 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
  *
  * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
 
 #include "glheader.h"
 #include "imports.h"
-#include "colormac.h"
 #include "context.h"
 #include "eval.h"
 #include "macros.h"
-#include "mfeatures.h"
 #include "mtypes.h"
 #include "main/dispatch.h"
 
@@ -311,8 +309,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
    GLfloat *pnts;
    struct gl_1d_map *map = NULL;
 
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
-   ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
+   assert(type == GL_FLOAT || type == GL_DOUBLE);
 
    if (u1 == u2) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" );
@@ -368,7 +365,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
 
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
              GLint order, const GLfloat *points )
 {
@@ -376,7 +373,7 @@ _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
              GLint order, const GLdouble *points )
 {
@@ -394,8 +391,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
    GLfloat *pnts;
    struct gl_2d_map *map = NULL;
 
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
-   ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
+   assert(type == GL_FLOAT || type == GL_DOUBLE);
 
    if (u1==u2) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(u1,u2)" );
@@ -467,7 +463,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_Map2f( GLenum target,
              GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
              GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
@@ -478,7 +474,7 @@ _mesa_Map2f( GLenum target,
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_Map2d( GLenum target,
              GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
              GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
@@ -490,7 +486,7 @@ _mesa_Map2d( GLenum target,
 
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -501,8 +497,6 @@ _mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v )
    GLuint comps;
    GLsizei numBytes;
 
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
-
    comps = _mesa_evaluator_components(target);
    if (!comps) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(target)" );
@@ -511,7 +505,7 @@ _mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v )
 
    map1d = get_1d_map(ctx, target);
    map2d = get_2d_map(ctx, target);
-   ASSERT(map1d || map2d);
+   assert(map1d || map2d);
 
    switch (query) {
       case GL_COEFF:
@@ -576,13 +570,13 @@ overflow:
                " but %d bytes are required)", bufSize, numBytes );
 }
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v )
 {
    _mesa_GetnMapdvARB(target, query, INT_MAX, v);
 }
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -593,8 +587,6 @@ _mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v )
    GLuint comps;
    GLsizei numBytes;
 
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
-
    comps = _mesa_evaluator_components(target);
    if (!comps) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" );
@@ -603,7 +595,7 @@ _mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v )
 
    map1d = get_1d_map(ctx, target);
    map2d = get_2d_map(ctx, target);
-   ASSERT(map1d || map2d);
+   assert(map1d || map2d);
 
    switch (query) {
       case GL_COEFF:
@@ -669,14 +661,14 @@ overflow:
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v )
 {
    _mesa_GetnMapfvARB(target, query, INT_MAX, v);
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -687,8 +679,6 @@ _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v )
    GLuint comps;
    GLsizei numBytes;
 
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
-
    comps = _mesa_evaluator_components(target);
    if (!comps) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(target)" );
@@ -697,7 +687,7 @@ _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v )
 
    map1d = get_1d_map(ctx, target);
    map2d = get_2d_map(ctx, target);
-   ASSERT(map1d || map2d);
+   assert(map1d || map2d);
 
    switch (query) {
       case GL_COEFF:
@@ -763,18 +753,17 @@ overflow:
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_GetMapiv( GLenum target, GLenum query, GLint *v )
 {
    _mesa_GetnMapivARB(target, query, INT_MAX, v);
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
 {
    GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (un<1) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid1f" );
@@ -788,19 +777,18 @@ _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
 {
    _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 );
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
                  GLint vn, GLfloat v1, GLfloat v2 )
 {
    GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (un<1) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(un)" );
@@ -823,7 +811,7 @@ _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
                  GLint vn, GLdouble v1, GLdouble v2 )
 {
@@ -842,31 +830,6 @@ _mesa_install_eval_vtxfmt(struct _glapi_table *disp,
    SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv);
    SET_EvalPoint1(disp, vfmt->EvalPoint1);
    SET_EvalPoint2(disp, vfmt->EvalPoint2);
-
-   SET_EvalMesh1(disp, vfmt->EvalMesh1);
-   SET_EvalMesh2(disp, vfmt->EvalMesh2);
-}
-
-
-void
-_mesa_init_eval_dispatch(struct _glapi_table *disp)
-{
-   SET_GetMapdv(disp, _mesa_GetMapdv);
-   SET_GetMapfv(disp, _mesa_GetMapfv);
-   SET_GetMapiv(disp, _mesa_GetMapiv);
-   SET_Map1d(disp, _mesa_Map1d);
-   SET_Map1f(disp, _mesa_Map1f);
-   SET_Map2d(disp, _mesa_Map2d);
-   SET_Map2f(disp, _mesa_Map2f);
-   SET_MapGrid1d(disp, _mesa_MapGrid1d);
-   SET_MapGrid1f(disp, _mesa_MapGrid1f);
-   SET_MapGrid2d(disp, _mesa_MapGrid2d);
-   SET_MapGrid2f(disp, _mesa_MapGrid2f);
-
-   /* GL_ARB_robustness */
-   SET_GetnMapdvARB(disp, _mesa_GetnMapdvARB);
-   SET_GetnMapfvARB(disp, _mesa_GetnMapfvARB);
-   SET_GetnMapivARB(disp, _mesa_GetnMapivARB);
 }