#define MESA_FUNCTION to __FUNCTION__ if MESA_DEBUG is defined.
void _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x )
{
GET_CURRENT_CONTEXT(ctx);
- if (index < 16) {
+ if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1);
}
else
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1f" );
}
void _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- if (index < 16) {
+ if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1);
}
else
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1fv" );
}
void _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
{
GET_CURRENT_CONTEXT(ctx);
- if (index < 16) {
+ if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1);
}
else
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2f" );
}
void _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- if (index < 16) {
+ if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1);
}
else
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2fv" );
}
void _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x,
GLfloat y, GLfloat z )
{
GET_CURRENT_CONTEXT(ctx);
- if (index < 16) {
+ if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1);
}
else
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3f" );
}
void _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- if (index < 16) {
+ if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], 1);
}
else
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3fv" );
}
void _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
GLfloat y, GLfloat z, GLfloat w )
{
GET_CURRENT_CONTEXT(ctx);
- if (index < 16) {
+ if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w);
}
else
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4f" );
}
void _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- if (index < 16) {
+ if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
}
else
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4fv" );
}
/* Material
void _mesa_noop_End( void )
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
}
#define FLUSH_VERTICES(ctx, newstate) \
do { \
if (MESA_VERBOSE & VERBOSE_STATE) \
- _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", __FUNCTION__); \
+ _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\
if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \
ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \
ctx->NewState |= newstate; \
#define FLUSH_CURRENT(ctx, newstate) \
do { \
if (MESA_VERBOSE & VERBOSE_STATE) \
- _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", __FUNCTION__); \
+ _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION); \
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \
ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \
ctx->NewState |= newstate; \
#ifdef MESA_DEBUG
extern int MESA_VERBOSE;
extern int MESA_DEBUG_FLAGS;
+# define MESA_FUNCTION __FUNCTION__
#else
# define MESA_VERBOSE 0
# define MESA_DEBUG_FLAGS 0
+# define MESA_FUNCTION "a function"
# ifndef NDEBUG
# define NDEBUG
# endif
if (tnl->save.currentsz[attr] == 0) {
assert(oldsz == 0);
tnl->save.dangling_attr_ref = attr;
- _mesa_debug(0, "%s: dangling reference attr %d\n",
- __FUNCTION__, attr);
+ _mesa_debug(0, "_save_upgrade_vertex: dangling reference attr %d\n",
+ attr);
#if 0
/* The current strategy is to punt these degenerate cases
static void enum_error( void )
{
GET_CURRENT_CONTEXT( ctx );
- _mesa_compile_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_compile_error( ctx, GL_INVALID_ENUM, "glVertexAttrib" );
}
static void _save_Vertex2f( GLfloat x, GLfloat y )
MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
break;
default:
- _mesa_compile_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_compile_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
return;
}
}
do { \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
\
- fprintf(stderr, "fallback %s inside begin/end\n", __FUNCTION__); \
+ /*fprintf(stderr, "fallback %s inside begin/end\n", __FUNCTION__);*/ \
\
if (tnl->save.initial_counter != tnl->save.counter || \
tnl->save.prim_count) \
static void _save_CallList( GLuint l )
{
GET_CURRENT_CONTEXT(ctx);
- fprintf(stderr, "%s\n", __FUNCTION__);
FALLBACK(ctx);
ctx->Save->CallList( l );
}
static void _save_CallLists( GLsizei n, GLenum type, const GLvoid *v )
{
GET_CURRENT_CONTEXT(ctx);
- fprintf(stderr, "%s\n", __FUNCTION__);
FALLBACK(ctx);
ctx->Save->CallLists( n, type, v );
}
const GLvoid *indices)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__);
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" );
}
const GLvoid *indices)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__);
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" );
}
static void _save_DrawArrays(GLenum mode, GLint start, GLsizei count)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__);
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" );
}
static void _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__);
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" );
}
static void _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__);
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" );
}
static void _save_EvalMesh2( GLenum mode, GLint i1, GLint i2,
GLint j1, GLint j2 )
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__);
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" );
}
static void _save_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT( ctx );
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive begin" );
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive glBegin" );
}
-
/*
* Mesa 3-D graphics library
* Version: 5.1
/* Degenerate case: list references current data and would
* require fixup. Take the easier option & loop it back.
*/
- _mesa_debug( 0, "%s: loopback dangling attr ref\n", __FUNCTION__);
+ _mesa_debug(ctx,
+ "tnl_playback_vertex_list: loopback dangling attr ref\n");
_tnl_loopback_vertex_list( ctx, data );
return;
}
static void enum_error( void )
{
GET_CURRENT_CONTEXT( ctx );
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib" );
}
static void _tnl_Vertex2f( GLfloat x, GLfloat y )
break;
default:
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__);
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
return;
}
MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
break;
default:
- _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
return;
}
}
ctx->Driver.CurrentExecPrimitive = mode;
}
else
- _mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
}
}
else
- _mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ );
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
}
#include "glheader.h"
#include "api_eval.h"
#include "context.h"
+#include "enums.h"
#include "state.h"
#include "macros.h"
#include "math/m_eval.h"
#include "t_vtx_api.h"
#include "t_pipeline.h"
+
static void _tnl_print_vtx( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter;
GLuint i;
- _mesa_debug(0, "%s: %u vertices %d primitives, %d vertsize\n",
- __FUNCTION__,
+ _mesa_debug(ctx, "_tnl_print_vtx: %u vertices %d primitives, %d vertsize\n",
count,
tnl->vtx.prim_count,
tnl->vtx.vertex_size);
GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter;
GLuint attr, i;
- if (0) fprintf(stderr, "%s: %d verts %d vertsize\n",
- __FUNCTION__, count, tnl->vtx.vertex_size);
+ if (0) fprintf(stderr, "_tnl_vb_bind_vtx(): %d verts %d vertsize\n",
+ count, tnl->vtx.vertex_size);
/* Setup constant data in the VB.
}
-
-
-
/*
* NOTE: Need to have calculated primitives by this point -- do it on the fly.
* NOTE: Old 'parity' issue is gone.
}
-
-
-
-
/**
* Execute the buffer and save copied verts.
*/
tnl->vtx.counter = tnl->vtx.initial_counter;
tnl->vtx.vbptr = tnl->vtx.buffer;
}
-
-
-
-
-