}
+/**
+ * Record a GL_INVALID_VALUE error when a invalid vertex attribute
+ * index is found.
+ */
static void
-enum_error(void)
+index_error(void)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_error(ctx, GL_INVALID_ENUM, "VertexAttribfNV");
+ _mesa_error(ctx, GL_INVALID_VALUE, "VertexAttribf(index)");
}
+
/* First level for NV_vertex_program:
*
* Check for errors at compile time?.
if (index < VERT_ATTRIB_MAX)
save_Attr1fNV(index, x);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr1fNV(index, v[0]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr2fNV(index, x, y);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr2fNV(index, v[0], v[1]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr3fNV(index, x, y, z);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr3fNV(index, v[0], v[1], v[2]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr4fNV(index, x, y, z, w);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr4fNV(index, v[0], v[1], v[2], v[3]);
else
- enum_error();
+ index_error();
}
if (index < VERT_ATTRIB_MAX)
save_Attr1fARB(index, x);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr1fARB(index, v[0]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr2fARB(index, x, y);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr2fARB(index, v[0], v[1]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr3fARB(index, x, y, z);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr3fARB(index, v[0], v[1], v[2]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr4fARB(index, x, y, z, w);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
if (index < VERT_ATTRIB_MAX)
save_Attr4fARB(index, v[0], v[1], v[2], v[3]);
else
- enum_error();
+ index_error();
}
#endif
-/* KW: Compile commands
+/**
+ * Save an error-generating command into display list.
*
- * Will appear in the list before the vertex buffer containing the
+ * KW: Will appear in the list before the vertex buffer containing the
* command that provoked the error. I don't see this as a problem.
*/
-void
-_mesa_save_error(GLcontext *ctx, GLenum error, const char *s)
+static void
+save_error(GLcontext *ctx, GLenum error, const char *s)
{
Node *n;
n = ALLOC_INSTRUCTION(ctx, OPCODE_ERROR, 2);
n[1].e = error;
n[2].data = (void *) s;
}
- /* execute already done */
}
-/*
+/**
* Compile an error into current display list.
*/
void
_mesa_compile_error(GLcontext *ctx, GLenum error, const char *s)
{
if (ctx->CompileFlag)
- _mesa_save_error(ctx, error, s);
-
+ save_error(ctx, error, s);
if (ctx->ExecuteFlag)
_mesa_error(ctx, error, s);
}
-
+/**
+ * Test if ID names a display list.
+ */
static GLboolean
islist(GLcontext *ctx, GLuint list)
{
* the absolute list number, not relative to ListBase.
* \param list - display list number
*/
-static void GLAPIENTRY
+static void
execute_list(GLcontext *ctx, GLuint list)
{
struct mesa_display_list *dlist;
Node *n;
GLboolean done;
- if (!CALL_IsList(GET_DISPATCH(), (list))) {
+ if (!islist(ctx, list)) {
_mesa_printf("%u is not a display list ID\n", list);
return;
}
- dlist =
- (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList,
- list);
+ dlist = (struct mesa_display_list *)
+ _mesa_HashLookup(ctx->Shared->DisplayList, list);
if (!dlist)
return;