state_client.c revision b4a5af5b468b34352b8cef62209a3b3b88e5cf24
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
/*
* This file manages all the client-side state including:
* Vertex arrays
*/
#include "cr_mem.h"
#include "state.h"
#include "state/cr_statetypes.h"
#include "state/cr_statefuncs.h"
#include "state_internals.h"
const CRPixelPackState crStateNativePixelPacking = {
0, /* rowLength */
0, /* skipRows */
0, /* skipPixels */
1, /* alignment */
0, /* imageHeight */
0, /* skipImages */
GL_FALSE, /* swapBytes */
GL_FALSE, /* psLSBFirst */
};
void crStateClientInitBits (CRClientBits *c)
{
int i;
/* XXX why GLCLIENT_BIT_ALLOC? */
for ( i = 0; i < CR_MAX_TEXTURE_UNITS; i++ )
#ifdef CR_NV_vertex_program
for ( i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++ )
#endif
}
void crStateClientDestroyBits (CRClientBits *c)
{
int i;
crFree(c->v);
crFree(c->n);
crFree(c->c);
crFree(c->s);
crFree(c->i);
for ( i = 0; i < CR_MAX_TEXTURE_UNITS; i++ )
crFree(c->t[i]);
crFree(c->e);
crFree(c->f);
#ifdef CR_NV_vertex_program
for ( i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++ )
crFree(c->a[i]);
#endif
}
{
{
#ifndef IN_GUEST
#endif
}
}
void crStateClientDestroy(CRContext *g)
{
CRClientState *c = &(g->client);
#ifdef CR_EXT_compiled_vertex_array
{
unsigned int i;
crStateUnlockClientPointer(&c->array.v);
crStateUnlockClientPointer(&c->array.c);
crStateUnlockClientPointer(&c->array.f);
crStateUnlockClientPointer(&c->array.s);
crStateUnlockClientPointer(&c->array.e);
crStateUnlockClientPointer(&c->array.i);
crStateUnlockClientPointer(&c->array.n);
for (i = 0 ; i < CR_MAX_TEXTURE_UNITS ; i++)
{
crStateUnlockClientPointer(&c->array.t[i]);
}
for (i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++)
{
crStateUnlockClientPointer(&c->array.a[i]);
}
}
#endif
}
{
unsigned int i;
c->unpack.skipPixels = 0;
c->unpack.skipImages = 0;
c->unpack.imageHeight = 0;
c->pack.skipPixels = 0;
c->pack.skipImages = 0;
c->pack.imageHeight = 0;
/* ARB multitexture */
c->curClientTextureUnit = 0;
#ifdef CR_EXT_compiled_vertex_array
# ifdef IN_GUEST
# endif
#endif
/* vertex array */
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.v.prevStride = 0;
#endif
/* color array */
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.c.prevStride = 0;
#endif
/* fog array */
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.f.prevStride = 0;
#endif
/* secondary color array */
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.s.prevStride = 0;
#endif
/* edge flag array */
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.e.prevStride = 0;
#endif
/* color index array */
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.i.prevStride = 0;
#endif
/* normal array */
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.n.prevStride = 0;
#endif
/* texcoord arrays */
for (i = 0 ; i < CR_MAX_TEXTURE_UNITS ; i++)
{
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.t[i].prevStride = 0;
#endif
}
/* generic vertex attributes */
#ifdef CR_NV_vertex_program
for (i = 0; i < CR_MAX_VERTEX_ATTRIBS; i++) {
#ifdef CR_ARB_vertex_buffer_object
#endif
#ifdef CR_EXT_compiled_vertex_array
c->array.a[i].prevStride = 0;
#endif
}
#endif
}
/*
* PixelStore functions are here, not in state_pixel.c because this
* is client-side state, like vertex arrays.
*/
{
/* The GL SPEC says I can do this on page 76. */
switch( pname )
{
case GL_PACK_SWAP_BYTES:
case GL_PACK_LSB_FIRST:
case GL_UNPACK_SWAP_BYTES:
case GL_UNPACK_LSB_FIRST:
break;
default:
break;
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
if (g->current.inBeginEnd)
{
return;
}
FLUSH();
switch(pname) {
case GL_PACK_SWAP_BYTES:
break;
case GL_PACK_LSB_FIRST:
break;
case GL_PACK_ROW_LENGTH:
if (param < 0.0f)
{
return;
}
break;
#ifdef CR_OPENGL_VERSION_1_2
case GL_PACK_IMAGE_HEIGHT:
if (param < 0.0f)
{
return;
}
break;
#endif
case GL_PACK_SKIP_IMAGES:
if (param < 0.0f)
{
return;
}
break;
case GL_PACK_SKIP_PIXELS:
if (param < 0.0f)
{
return;
}
break;
case GL_PACK_SKIP_ROWS:
if (param < 0.0f)
{
return;
}
break;
case GL_PACK_ALIGNMENT:
{
return;
}
break;
case GL_UNPACK_SWAP_BYTES:
break;
case GL_UNPACK_LSB_FIRST:
break;
case GL_UNPACK_ROW_LENGTH:
if (param < 0.0f)
{
return;
}
break;
#ifdef CR_OPENGL_VERSION_1_2
case GL_UNPACK_IMAGE_HEIGHT:
if (param < 0.0f)
{
return;
}
break;
#endif
case GL_UNPACK_SKIP_IMAGES:
if (param < 0.0f)
{
return;
}
break;
case GL_UNPACK_SKIP_PIXELS:
if (param < 0.0f)
{
return;
}
break;
case GL_UNPACK_SKIP_ROWS:
if (param < 0.0f)
{
return;
}
break;
case GL_UNPACK_ALIGNMENT:
{
return;
}
break;
default:
return;
}
}
{
CRContext *g = GetCurrentContext();
switch (array)
{
#ifdef CR_NV_vertex_program
{
}
break;
#endif
case GL_VERTEX_ARRAY:
break;
case GL_COLOR_ARRAY:
break;
case GL_NORMAL_ARRAY:
break;
case GL_INDEX_ARRAY:
break;
case GL_TEXTURE_COORD_ARRAY:
break;
case GL_EDGE_FLAG_ARRAY:
break;
#ifdef CR_EXT_fog_coord
break;
#endif
#ifdef CR_EXT_secondary_color
if( g->extensions.EXT_secondary_color ){
}
else {
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "Invalid Enum passed to Enable/Disable Client State: SECONDARY_COLOR_ARRAY_EXT - EXT_secondary_color is not enabled." );
return;
}
break;
#endif
default:
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "Invalid Enum passed to Enable/Disable Client State: 0x%x", array );
return;
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
}
static void
{
CRContext *g = GetCurrentContext();
#ifdef CR_EXT_compiled_vertex_array
#endif
/* Calculate the bytes per index for address calculation */
switch (type)
{
case GL_BYTE:
case GL_UNSIGNED_BYTE:
break;
case GL_SHORT:
case GL_UNSIGNED_SHORT:
break;
case GL_INT:
case GL_UNSIGNED_INT:
break;
case GL_FLOAT:
break;
case GL_DOUBLE:
break;
default:
"Unknown type of vertex array: %d", type );
return;
}
/*
** Note: If stride==0 then we set the
** stride equal address offset
** therefore stride can never equal
** zero.
*/
if (stride)
else
#ifdef CR_ARB_vertex_buffer_object
{
}
#endif
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
{
return;
}
{
return;
}
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glVertexPointer: stride was negative: %d", stride);
return;
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
{
return;
}
{
return;
}
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glColorPointer: stride was negative: %d", stride);
return;
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
if ( !g->extensions.EXT_secondary_color )
{
crError( "glSecondaryColorPointerEXT called but EXT_secondary_color is disabled." );
return;
}
/*Note: According to opengl spec, only size==3 should be accepted here.
*But it turns out that most drivers accept size==4 here as well, and 4th value
*could even be accessed in shaders code.
*Having a strict check here, leads to difference between guest and host gpu states, which
*in turn could lead to crashes when using server side VBOs.
*@todo: add error reporting to state's VBO related functions and abort dispatching to
*real gpu on any failure to prevent other possible issues.
*/
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glSecondaryColorPointerEXT: invalid size: %d", size);
return;
}
{
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glSecondaryColorPointerEXT: invalid type: 0x%x", type);
return;
}
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glSecondaryColorPointerEXT: stride was negative: %d", stride);
return;
}
}
const GLvoid *p)
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
{
return;
}
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glIndexPointer: stride was negative: %d", stride);
return;
}
}
const GLvoid *p)
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
{
return;
}
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glNormalPointer: stride was negative: %d", stride);
return;
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
{
return;
}
{
return;
}
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glTexCoordPointer: stride was negative: %d", stride);
return;
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glTexCoordPointer: stride was negative: %d", stride);
return;
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
{
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glFogCoordPointerEXT: invalid type: 0x%x", type);
return;
}
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glFogCoordPointerEXT: stride was negative: %d", stride);
return;
}
}
void STATE_APIENTRY crStateVertexAttribPointerNV(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *p)
{
/* Extra error checking for NV arrays */
"glVertexAttribPointerNV: invalid type: 0x%x", type);
return;
}
}
void STATE_APIENTRY crStateVertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *p)
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
FLUSH();
if (index >= CR_MAX_VERTEX_ATTRIBS)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glVertexAttribPointerARB: invalid index: %d", (int) index);
return;
}
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glVertexAttribPointerARB: invalid size: %d", size);
return;
}
{
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glVertexAttribPointerARB: invalid type: 0x%x", type);
return;
}
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glVertexAttribPointerARB: stride was negative: %d", stride);
return;
}
}
{
CRContext *g = GetCurrentContext();
if (g->current.inBeginEnd) {
return;
}
if (index >= CR_MAX_VERTEX_ATTRIBS) {
"glGetVertexAttribPointervNV(index)");
return;
}
if (pname != GL_ATTRIB_ARRAY_POINTER_NV) {
"glGetVertexAttribPointervNV(pname)");
return;
}
}
{
}
/*
** Currently I treat Interleaved Arrays as if the
** user uses them as separate arrays.
** Certainly not the most efficient method but it
** lets me use the same glDrawArrays method.
*/
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
unsigned char *base = (unsigned char *) p;
if (g->current.inBeginEnd)
{
return;
}
FLUSH();
if (stride < 0)
{
crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "glInterleavedArrays: stride < 0: %d", stride);
return;
}
switch (format)
{
case GL_T4F_C4F_N3F_V4F:
case GL_T2F_C4F_N3F_V3F:
case GL_C4F_N3F_V3F:
case GL_T4F_V4F:
case GL_T2F_C3F_V3F:
case GL_T2F_N3F_V3F:
case GL_C3F_V3F:
case GL_N3F_V3F:
case GL_T2F_C4UB_V3F:
case GL_T2F_V3F:
case GL_C4UB_V3F:
case GL_V3F:
case GL_C4UB_V2F:
case GL_V2F:
break;
default:
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glInterleavedArrays: Unrecognized format: %d", format);
return;
}
/* p, size, type, stride, enabled, bytesPerIndex */
/*
** VertexPointer
*/
#ifdef CR_EXT_compiled_vertex_array
#endif
switch (format)
{
case GL_T4F_C4F_N3F_V4F:
break;
case GL_T2F_C4F_N3F_V3F:
break;
case GL_C4F_N3F_V3F:
break;
case GL_T4F_V4F:
break;
case GL_T2F_C3F_V3F:
break;
case GL_T2F_N3F_V3F:
break;
case GL_C3F_V3F:
break;
case GL_N3F_V3F:
break;
case GL_T2F_C4UB_V3F:
break;
case GL_T2F_V3F:
break;
case GL_C4UB_V3F:
break;
case GL_V3F:
break;
case GL_C4UB_V2F:
break;
case GL_V2F:
break;
default:
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glInterleavedArrays: Unrecognized format: %d", format);
return;
}
if (stride==0)
/*
** NormalPointer
*/
#ifdef CR_EXT_compiled_vertex_array
#endif
switch (format)
{
case GL_T4F_C4F_N3F_V4F:
break;
case GL_T2F_C4F_N3F_V3F:
break;
case GL_C4F_N3F_V3F:
break;
case GL_T2F_N3F_V3F:
break;
case GL_N3F_V3F:
break;
case GL_T4F_V4F:
case GL_T2F_C3F_V3F:
case GL_C3F_V3F:
case GL_T2F_C4UB_V3F:
case GL_T2F_V3F:
case GL_C4UB_V3F:
case GL_V3F:
case GL_C4UB_V2F:
case GL_V2F:
break;
default:
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glInterleavedArrays: Unrecognized format: %d", format);
return;
}
{
}
/*
** ColorPointer
*/
#ifdef CR_EXT_compiled_vertex_array
#endif
switch (format)
{
case GL_T4F_C4F_N3F_V4F:
break;
case GL_T2F_C4F_N3F_V3F:
break;
case GL_C4F_N3F_V3F:
break;
case GL_T2F_C3F_V3F:
break;
case GL_C3F_V3F:
break;
case GL_T2F_C4UB_V3F:
break;
case GL_C4UB_V3F:
break;
case GL_C4UB_V2F:
break;
case GL_T2F_N3F_V3F:
case GL_N3F_V3F:
case GL_T4F_V4F:
case GL_T2F_V3F:
case GL_V3F:
case GL_V2F:
break;
default:
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glInterleavedArrays: Unrecognized format: %d", format);
return;
}
/*
** TexturePointer
*/
#ifdef CR_EXT_compiled_vertex_array
#endif
switch (format)
{
case GL_T4F_C4F_N3F_V4F:
break;
case GL_T2F_C4F_N3F_V3F:
break;
case GL_T2F_C3F_V3F:
case GL_T2F_N3F_V3F:
break;
case GL_T2F_C4UB_V3F:
break;
case GL_T4F_V4F:
break;
case GL_T2F_V3F:
break;
case GL_C4UB_V3F:
case GL_C4UB_V2F:
case GL_C3F_V3F:
case GL_C4F_N3F_V3F:
case GL_N3F_V3F:
case GL_V3F:
case GL_V2F:
break;
default:
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glInterleavedArrays: Unrecognized format: %d", format);
return;
}
{
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
if (g->current.inBeginEnd)
{
return;
}
switch (pname)
{
case GL_VERTEX_ARRAY_POINTER:
break;
case GL_COLOR_ARRAY_POINTER:
break;
case GL_NORMAL_ARRAY_POINTER:
break;
case GL_INDEX_ARRAY_POINTER:
break;
break;
break;
#ifdef CR_EXT_fog_coord
break;
#endif
#ifdef CR_EXT_secondary_color
if( g->extensions.EXT_secondary_color ){
}
else {
crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "Invalid Enum passed to glGetPointerv: SECONDARY_COLOR_ARRAY_EXT - EXT_secondary_color is not enabled." );
return;
}
break;
#endif
/* do nothing - API switching should pick this up */
break;
default:
"glGetPointerv: invalid pname: %d", pname);
return;
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
if (g->current.inBeginEnd) {
return;
}
"glPushClientAttrib called with a full stack!" );
return;
}
FLUSH();
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
c->pixelStoreStackDepth++;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
c->vertexArrayStackDepth++;
}
/* dirty? - no, because we haven't really changed any state */
}
void STATE_APIENTRY crStatePopClientAttrib( void )
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
if (g->current.inBeginEnd) {
return;
}
if (c->attribStackDepth == 0) {
"glPopClientAttrib called with an empty stack!" );
return;
}
FLUSH();
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
if (c->pixelStoreStackDepth == 0) {
crError("bug in glPopClientAttrib (pixel store) ");
return;
}
c->pixelStoreStackDepth--;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
if (c->vertexArrayStackDepth == 0) {
crError("bug in glPopClientAttrib (vertex array) ");
return;
}
c->vertexArrayStackDepth--;
}
}
{
{
}
}
{
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
int i;
for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i)
{
{
break;
}
}
{
crDebug("crStateLockArraysEXT ignored because array %i have a bound VBO", i);
return;
}
#ifdef IN_GUEST
#endif
for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i)
{
}
}
{
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
int i;
{
crDebug("crStateUnlockArraysEXT ignored because arrays aren't locked");
return;
}
#ifdef IN_GUEST
#endif
for (i=0; i<CRSTATECLIENT_MAX_VERTEXARRAYS; ++i)
{
}
}
{
/* XXX todo */
crWarning("crStateVertexArrayRangeNV not implemented");
}
void STATE_APIENTRY crStateFlushVertexArrayRangeNV(void)
{
/* XXX todo */
crWarning("crStateFlushVertexArrayRangeNV not implemented");
}
/*Returns if the given clientpointer could be used on server side directly*/
#define CRSTATE_IS_SERVER_CP(cp) (!(cp).enabled || !(cp).p || ((cp).buffer && (cp).buffer->id) || ((cp).locked))
{
{
crDebug("CP(%s): enabled:%d ptr:%p buffer:%p buffer.name:%i locked: %i %s",
}
{
crDebug("CP(%s%i): enabled:%d ptr:%p buffer:%p buffer.name:%i locked: %i %s",
}
}
#ifdef DEBUG_misha
/* debugging */
//# define CR_NO_SERVER_ARRAYS
#endif
/*
* Determine if the enabled arrays all live on the server
* (via GL_ARB_vertex_buffer_object).
*/
{
#if defined(CR_ARB_vertex_buffer_object) && !defined(CR_NO_SERVER_ARRAYS)
CRContext *g = GetCurrentContext();
CRClientState *c = &(g->client);
int i;
&& CRSTATE_IS_SERVER_CP(c->array.n)
&& CRSTATE_IS_SERVER_CP(c->array.c)
&& CRSTATE_IS_SERVER_CP(c->array.i)
&& CRSTATE_IS_SERVER_CP(c->array.e)
&& CRSTATE_IS_SERVER_CP(c->array.s)
&& CRSTATE_IS_SERVER_CP(c->array.f);
if (res)
{
for (i = 0; (unsigned int)i < g->limits.maxTextureUnits; i++)
if (!CRSTATE_IS_SERVER_CP(c->array.t[i]))
{
break;
}
}
if (res)
{
for (i = 0; (unsigned int)i < g->limits.maxVertexProgramAttribs; i++)
if (!CRSTATE_IS_SERVER_CP(c->array.a[i]))
{
break;
}
}
#if defined(DEBUG) && 0
if (!res)
{
for (i = 0; (unsigned int)i < g->limits.maxTextureUnits; i++)
for (i = 0; (unsigned int)i < g->limits.maxVertexProgramAttribs; i++)
}
#endif
return res;
#else
return GL_FALSE;
#endif
}
GLuint crStateNeedDummyZeroVertexArray(CRContext *g, CRCurrentStatePointers *current, GLfloat *pZva)
{
#if defined(CR_ARB_vertex_buffer_object)
CRClientState *c = &(g->client);
int i;
return 0;
{
{
{
}
else
{
zvMax = ~0;
break;
}
}
}
if (zvMax)
{
}
return zvMax;
#else
return GL_FALSE;
#endif
}
/**
* Determine if there's a server-side array element buffer.
* Called by glDrawElements() in packing SPUs to determine if glDrawElements
* should be evaluated (unrolled) locally or if glDrawElements should be
* packed and sent to the server.
*/
{
#ifdef CR_ARB_vertex_buffer_object
CRContext *g = GetCurrentContext();
if (g->bufferobject.elementsBuffer &&
return GL_TRUE;
else
return GL_FALSE;
#else
return GL_FALSE;
#endif
}
void
{
int i;
#ifdef DEBUG_misha
{
}
#endif
/* one or more vertex pointers is dirty */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* normal */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* color */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* index */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* texcoords */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
curClientTextureUnit = i;
}
}
}
/* edge flag */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* secondary color */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* fog coord */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
#if defined(CR_NV_vertex_program) || defined(CR_ARB_vertex_program)
/* vertex attributes */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
}
#endif
}
if (idHwArrayBuffer != idHwInitialBuffer)
{
}
}
}
}
}
curClientTextureUnit = i;
}
}
}
}
}
else
}
}
}
{
}
}
void
{
int i;
#ifdef DEBUG_misha
{
}
#endif
/* one or more vertex pointers is dirty */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* normal */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* color */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* index */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* texcoords */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
curClientTextureUnit = i;
}
}
}
/* edge flag */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* secondary color */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
/* fog coord */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
#if defined(CR_NV_vertex_program) || defined(CR_ARB_vertex_program)
/* vertex attributes */
if (idHwArrayBufferUsed != idHwArrayBuffer)
{
}
}
}
}
#endif
}
if (idHwArrayBuffer != idHwInitialBuffer)
{
}
}
}
}
}
curClientTextureUnit = i;
}
}
}
}
}
else
}
}
}
{
}
{
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
}
{
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
}
}
{
if (index<7)
{
switch (index)
{
case 0: return &array->v;
case 1: return &array->c;
case 2: return &array->f;
case 3: return &array->s;
case 4: return &array->e;
case 5: return &array->i;
case 6: return &array->n;
}
}
{
}
else
{
}
/*silence the compiler warning*/
CRASSERT(false);
return NULL;
}