/* ** Copyright 1991-1993, Silicon Graphics, Inc. ** All Rights Reserved. ** ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.; ** the contents of this file may not be disclosed to third parties, copied or ** duplicated in any form, in whole or in part, without the prior written ** permission of Silicon Graphics, Inc. ** ** RESTRICTED RIGHTS LEGEND: ** Use, duplication or disclosure by the Government is subject to restrictions ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - ** rights reserved under the Copyright Laws of the United States. */ /* * AUTOMATICALLY UPDATED OR GENERATED BY SGI: DO NOT EDIT * IF YOU MUST MODIFY THIS FILE, PLEASE CONTACT ptar@sgi.com 415-390-1483 */ /* Client Side Procedure Table */ #include "precomp.h" #pragma hdrstop #include "glclt.h" #ifdef GL_METAFILE #include "metasup.h" #endif // There are now 2 tables! // One table is used for RGBA mode and the other is for CI mode. GLCLTPROCTABLE glCltRGBAProcTable = { /* Number of function entries in the table */ sizeof(GLDISPATCHTABLE) / sizeof(PROC), /* gl Entry points */ { glcltNewList , glcltEndList , glcltCallList , glcltCallLists , glcltDeleteLists , glcltGenLists , glcltListBase , glcltBegin , glcltBitmap , glcltColor3b_InRGBA , glcltColor3bv_InRGBA , glcltColor3d_InRGBA , glcltColor3dv_InRGBA , glcltColor3f_InRGBA , glcltColor3fv_InRGBA , glcltColor3i_InRGBA , glcltColor3iv_InRGBA , glcltColor3s_InRGBA , glcltColor3sv_InRGBA , glcltColor3ub_InRGBA , glcltColor3ubv_InRGBA , glcltColor3ui_InRGBA , glcltColor3uiv_InRGBA , glcltColor3us_InRGBA , glcltColor3usv_InRGBA , glcltColor4b_InRGBA , glcltColor4bv_InRGBA , glcltColor4d_InRGBA , glcltColor4dv_InRGBA , glcltColor4f_InRGBA , glcltColor4fv_InRGBA , glcltColor4i_InRGBA , glcltColor4iv_InRGBA , glcltColor4s_InRGBA , glcltColor4sv_InRGBA , glcltColor4ub_InRGBA , glcltColor4ubv_InRGBA , glcltColor4ui_InRGBA , glcltColor4uiv_InRGBA , glcltColor4us_InRGBA , glcltColor4usv_InRGBA , glcltEdgeFlag , glcltEdgeFlagv , glcltEnd , glcltIndexd_InRGBA , glcltIndexdv_InRGBA , glcltIndexf_InRGBA , glcltIndexfv_InRGBA , glcltIndexi_InRGBA , glcltIndexiv_InRGBA , glcltIndexs_InRGBA , glcltIndexsv_InRGBA , glcltNormal3b , glcltNormal3bv , glcltNormal3d , glcltNormal3dv , glcltNormal3f , glcltNormal3fv , glcltNormal3i , glcltNormal3iv , glcltNormal3s , glcltNormal3sv , glcltRasterPos2d , glcltRasterPos2dv , glcltRasterPos2f , glcltRasterPos2fv , glcltRasterPos2i , glcltRasterPos2iv , glcltRasterPos2s , glcltRasterPos2sv , glcltRasterPos3d , glcltRasterPos3dv , glcltRasterPos3f , glcltRasterPos3fv , glcltRasterPos3i , glcltRasterPos3iv , glcltRasterPos3s , glcltRasterPos3sv , glcltRasterPos4d , glcltRasterPos4dv , glcltRasterPos4f , glcltRasterPos4fv , glcltRasterPos4i , glcltRasterPos4iv , glcltRasterPos4s , glcltRasterPos4sv , glcltRectd , glcltRectdv , glcltRectf , glcltRectfv , glcltRecti , glcltRectiv , glcltRects , glcltRectsv , glcltTexCoord1d , glcltTexCoord1dv , glcltTexCoord1f , glcltTexCoord1fv , glcltTexCoord1i , glcltTexCoord1iv , glcltTexCoord1s , glcltTexCoord1sv , glcltTexCoord2d , glcltTexCoord2dv , glcltTexCoord2f , glcltTexCoord2fv , glcltTexCoord2i , glcltTexCoord2iv , glcltTexCoord2s , glcltTexCoord2sv , glcltTexCoord3d , glcltTexCoord3dv , glcltTexCoord3f , glcltTexCoord3fv , glcltTexCoord3i , glcltTexCoord3iv , glcltTexCoord3s , glcltTexCoord3sv , glcltTexCoord4d , glcltTexCoord4dv , glcltTexCoord4f , glcltTexCoord4fv , glcltTexCoord4i , glcltTexCoord4iv , glcltTexCoord4s , glcltTexCoord4sv , glcltVertex2d , glcltVertex2dv , glcltVertex2f , glcltVertex2fv , glcltVertex2i , glcltVertex2iv , glcltVertex2s , glcltVertex2sv , glcltVertex3d , glcltVertex3dv , glcltVertex3f , glcltVertex3fv , glcltVertex3i , glcltVertex3iv , glcltVertex3s , glcltVertex3sv , glcltVertex4d , glcltVertex4dv , glcltVertex4f , glcltVertex4fv , glcltVertex4i , glcltVertex4iv , glcltVertex4s , glcltVertex4sv , glcltClipPlane , glcltColorMaterial , glcltCullFace , glcltFogf , glcltFogfv , glcltFogi , glcltFogiv , glcltFrontFace , glcltHint , glcltLightf , glcltLightfv , glcltLighti , glcltLightiv , glcltLightModelf , glcltLightModelfv , glcltLightModeli , glcltLightModeliv , glcltLineStipple , glcltLineWidth , glcltMaterialf , glcltMaterialfv , glcltMateriali , glcltMaterialiv , glcltPointSize , glcltPolygonMode , glcltPolygonStipple , glcltScissor , glcltShadeModel , glcltTexParameterf , glcltTexParameterfv , glcltTexParameteri , glcltTexParameteriv , glcltTexImage1D , glcltTexImage2D , glcltTexEnvf , glcltTexEnvfv , glcltTexEnvi , glcltTexEnviv , glcltTexGend , glcltTexGendv , glcltTexGenf , glcltTexGenfv , glcltTexGeni , glcltTexGeniv , glcltFeedbackBuffer , glcltSelectBuffer , glcltRenderMode , glcltInitNames , glcltLoadName , glcltPassThrough , glcltPopName , glcltPushName , glcltDrawBuffer , glcltClear , glcltClearAccum , glcltClearIndex , glcltClearColor , glcltClearStencil , glcltClearDepth , glcltStencilMask , glcltColorMask , glcltDepthMask , glcltIndexMask , glcltAccum , glcltDisable , glcltEnable , glcltFinish , glcltFlush , glcltPopAttrib , glcltPushAttrib , glcltMap1d , glcltMap1f , glcltMap2d , glcltMap2f , glcltMapGrid1d , glcltMapGrid1f , glcltMapGrid2d , glcltMapGrid2f , glcltEvalCoord1d , glcltEvalCoord1dv , glcltEvalCoord1f , glcltEvalCoord1fv , glcltEvalCoord2d , glcltEvalCoord2dv , glcltEvalCoord2f , glcltEvalCoord2fv , glcltEvalMesh1 , glcltEvalPoint1 , glcltEvalMesh2 , glcltEvalPoint2 , glcltAlphaFunc , glcltBlendFunc , glcltLogicOp , glcltStencilFunc , glcltStencilOp , glcltDepthFunc , glcltPixelZoom , glcltPixelTransferf , glcltPixelTransferi , glcltPixelStoref , glcltPixelStorei , glcltPixelMapfv , glcltPixelMapuiv , glcltPixelMapusv , glcltReadBuffer , glcltCopyPixels , glcltReadPixels , glcltDrawPixels , glcltGetBooleanv , glcltGetClipPlane , glcltGetDoublev , glcltGetError , glcltGetFloatv , glcltGetIntegerv , glcltGetLightfv , glcltGetLightiv , glcltGetMapdv , glcltGetMapfv , glcltGetMapiv , glcltGetMaterialfv , glcltGetMaterialiv , glcltGetPixelMapfv , glcltGetPixelMapuiv , glcltGetPixelMapusv , glcltGetPolygonStipple , glcltGetString , glcltGetTexEnvfv , glcltGetTexEnviv , glcltGetTexGendv , glcltGetTexGenfv , glcltGetTexGeniv , glcltGetTexImage , glcltGetTexParameterfv , glcltGetTexParameteriv , glcltGetTexLevelParameterfv , glcltGetTexLevelParameteriv , glcltIsEnabled , glcltIsList , glcltDepthRange , glcltFrustum , glcltLoadIdentity , glcltLoadMatrixf , glcltLoadMatrixd , glcltMatrixMode , glcltMultMatrixf , glcltMultMatrixd , glcltOrtho , glcltPopMatrix , glcltPushMatrix , glcltRotated , glcltRotatef , glcltScaled , glcltScalef , glcltTranslated , glcltTranslatef , glcltViewport , glcltArrayElement , glcltBindTexture , glcltColorPointer , glcltDisableClientState , glcltDrawArrays , glcltDrawElements , glcltEdgeFlagPointer , glcltEnableClientState , glcltIndexPointer , glcltIndexub_InRGBA , glcltIndexubv_InRGBA , glcltInterleavedArrays , glcltNormalPointer , glcltPolygonOffset , glcltTexCoordPointer , glcltVertexPointer , glcltAreTexturesResident , glcltCopyTexImage1D , glcltCopyTexImage2D , glcltCopyTexSubImage1D , glcltCopyTexSubImage2D , glcltDeleteTextures , glcltGenTextures , glcltGetPointerv , glcltIsTexture , glcltPrioritizeTextures , glcltTexSubImage1D , glcltTexSubImage2D , glcltPopClientAttrib , glcltPushClientAttrib , } }; GLCLTPROCTABLE glCltCIProcTable = { /* Number of function entries in the table */ sizeof(GLDISPATCHTABLE) / sizeof(PROC), /* gl Entry points */ { glcltNewList , glcltEndList , glcltCallList , glcltCallLists , glcltDeleteLists , glcltGenLists , glcltListBase , glcltBegin , glcltBitmap , glcltColor3b_InCI , glcltColor3bv_InCI , glcltColor3d_InCI , glcltColor3dv_InCI , glcltColor3f_InCI , glcltColor3fv_InCI , glcltColor3i_InCI , glcltColor3iv_InCI , glcltColor3s_InCI , glcltColor3sv_InCI , glcltColor3ub_InCI , glcltColor3ubv_InCI , glcltColor3ui_InCI , glcltColor3uiv_InCI , glcltColor3us_InCI , glcltColor3usv_InCI , glcltColor4b_InCI , glcltColor4bv_InCI , glcltColor4d_InCI , glcltColor4dv_InCI , glcltColor4f_InCI , glcltColor4fv_InCI , glcltColor4i_InCI , glcltColor4iv_InCI , glcltColor4s_InCI , glcltColor4sv_InCI , glcltColor4ub_InCI , glcltColor4ubv_InCI , glcltColor4ui_InCI , glcltColor4uiv_InCI , glcltColor4us_InCI , glcltColor4usv_InCI , glcltEdgeFlag , glcltEdgeFlagv , glcltEnd , glcltIndexd_InCI , glcltIndexdv_InCI , glcltIndexf_InCI , glcltIndexfv_InCI , glcltIndexi_InCI , glcltIndexiv_InCI , glcltIndexs_InCI , glcltIndexsv_InCI , glcltNormal3b , glcltNormal3bv , glcltNormal3d , glcltNormal3dv , glcltNormal3f , glcltNormal3fv , glcltNormal3i , glcltNormal3iv , glcltNormal3s , glcltNormal3sv , glcltRasterPos2d , glcltRasterPos2dv , glcltRasterPos2f , glcltRasterPos2fv , glcltRasterPos2i , glcltRasterPos2iv , glcltRasterPos2s , glcltRasterPos2sv , glcltRasterPos3d , glcltRasterPos3dv , glcltRasterPos3f , glcltRasterPos3fv , glcltRasterPos3i , glcltRasterPos3iv , glcltRasterPos3s , glcltRasterPos3sv , glcltRasterPos4d , glcltRasterPos4dv , glcltRasterPos4f , glcltRasterPos4fv , glcltRasterPos4i , glcltRasterPos4iv , glcltRasterPos4s , glcltRasterPos4sv , glcltRectd , glcltRectdv , glcltRectf , glcltRectfv , glcltRecti , glcltRectiv , glcltRects , glcltRectsv , glcltTexCoord1d , glcltTexCoord1dv , glcltTexCoord1f , glcltTexCoord1fv , glcltTexCoord1i , glcltTexCoord1iv , glcltTexCoord1s , glcltTexCoord1sv , glcltTexCoord2d , glcltTexCoord2dv , glcltTexCoord2f , glcltTexCoord2fv , glcltTexCoord2i , glcltTexCoord2iv , glcltTexCoord2s , glcltTexCoord2sv , glcltTexCoord3d , glcltTexCoord3dv , glcltTexCoord3f , glcltTexCoord3fv , glcltTexCoord3i , glcltTexCoord3iv , glcltTexCoord3s , glcltTexCoord3sv , glcltTexCoord4d , glcltTexCoord4dv , glcltTexCoord4f , glcltTexCoord4fv , glcltTexCoord4i , glcltTexCoord4iv , glcltTexCoord4s , glcltTexCoord4sv , glcltVertex2d , glcltVertex2dv , glcltVertex2f , glcltVertex2fv , glcltVertex2i , glcltVertex2iv , glcltVertex2s , glcltVertex2sv , glcltVertex3d , glcltVertex3dv , glcltVertex3f , glcltVertex3fv , glcltVertex3i , glcltVertex3iv , glcltVertex3s , glcltVertex3sv , glcltVertex4d , glcltVertex4dv , glcltVertex4f , glcltVertex4fv , glcltVertex4i , glcltVertex4iv , glcltVertex4s , glcltVertex4sv , glcltClipPlane , glcltColorMaterial , glcltCullFace , glcltFogf , glcltFogfv , glcltFogi , glcltFogiv , glcltFrontFace , glcltHint , glcltLightf , glcltLightfv , glcltLighti , glcltLightiv , glcltLightModelf , glcltLightModelfv , glcltLightModeli , glcltLightModeliv , glcltLineStipple , glcltLineWidth , glcltMaterialf , glcltMaterialfv , glcltMateriali , glcltMaterialiv , glcltPointSize , glcltPolygonMode , glcltPolygonStipple , glcltScissor , glcltShadeModel , glcltTexParameterf , glcltTexParameterfv , glcltTexParameteri , glcltTexParameteriv , glcltTexImage1D , glcltTexImage2D , glcltTexEnvf , glcltTexEnvfv , glcltTexEnvi , glcltTexEnviv , glcltTexGend , glcltTexGendv , glcltTexGenf , glcltTexGenfv , glcltTexGeni , glcltTexGeniv , glcltFeedbackBuffer , glcltSelectBuffer , glcltRenderMode , glcltInitNames , glcltLoadName , glcltPassThrough , glcltPopName , glcltPushName , glcltDrawBuffer , glcltClear , glcltClearAccum , glcltClearIndex , glcltClearColor , glcltClearStencil , glcltClearDepth , glcltStencilMask , glcltColorMask , glcltDepthMask , glcltIndexMask , glcltAccum , glcltDisable , glcltEnable , glcltFinish , glcltFlush , glcltPopAttrib , glcltPushAttrib , glcltMap1d , glcltMap1f , glcltMap2d , glcltMap2f , glcltMapGrid1d , glcltMapGrid1f , glcltMapGrid2d , glcltMapGrid2f , glcltEvalCoord1d , glcltEvalCoord1dv , glcltEvalCoord1f , glcltEvalCoord1fv , glcltEvalCoord2d , glcltEvalCoord2dv , glcltEvalCoord2f , glcltEvalCoord2fv , glcltEvalMesh1 , glcltEvalPoint1 , glcltEvalMesh2 , glcltEvalPoint2 , glcltAlphaFunc , glcltBlendFunc , glcltLogicOp , glcltStencilFunc , glcltStencilOp , glcltDepthFunc , glcltPixelZoom , glcltPixelTransferf , glcltPixelTransferi , glcltPixelStoref , glcltPixelStorei , glcltPixelMapfv , glcltPixelMapuiv , glcltPixelMapusv , glcltReadBuffer , glcltCopyPixels , glcltReadPixels , glcltDrawPixels , glcltGetBooleanv , glcltGetClipPlane , glcltGetDoublev , glcltGetError , glcltGetFloatv , glcltGetIntegerv , glcltGetLightfv , glcltGetLightiv , glcltGetMapdv , glcltGetMapfv , glcltGetMapiv , glcltGetMaterialfv , glcltGetMaterialiv , glcltGetPixelMapfv , glcltGetPixelMapuiv , glcltGetPixelMapusv , glcltGetPolygonStipple , glcltGetString , glcltGetTexEnvfv , glcltGetTexEnviv , glcltGetTexGendv , glcltGetTexGenfv , glcltGetTexGeniv , glcltGetTexImage , glcltGetTexParameterfv , glcltGetTexParameteriv , glcltGetTexLevelParameterfv , glcltGetTexLevelParameteriv , glcltIsEnabled , glcltIsList , glcltDepthRange , glcltFrustum , glcltLoadIdentity , glcltLoadMatrixf , glcltLoadMatrixd , glcltMatrixMode , glcltMultMatrixf , glcltMultMatrixd , glcltOrtho , glcltPopMatrix , glcltPushMatrix , glcltRotated , glcltRotatef , glcltScaled , glcltScalef , glcltTranslated , glcltTranslatef , glcltViewport , glcltArrayElement , glcltBindTexture , glcltColorPointer , glcltDisableClientState , glcltDrawArrays , glcltDrawElements , glcltEdgeFlagPointer , glcltEnableClientState , glcltIndexPointer , glcltIndexub_InCI , glcltIndexubv_InCI , glcltInterleavedArrays , glcltNormalPointer , glcltPolygonOffset , glcltTexCoordPointer , glcltVertexPointer , glcltAreTexturesResident , glcltCopyTexImage1D , glcltCopyTexImage2D , glcltCopyTexSubImage1D , glcltCopyTexSubImage2D , glcltDeleteTextures , glcltGenTextures , glcltGetPointerv , glcltIsTexture , glcltPrioritizeTextures , glcltTexSubImage1D , glcltTexSubImage2D , glcltPopClientAttrib , glcltPushClientAttrib , } }; GLEXTPROCTABLE glExtProcTable = { /* Number of function entries in the table */ sizeof(GLEXTDISPATCHTABLE) / sizeof(PROC), /* gl EXT Entry points */ { glcltColorTableEXT, glcltColorSubTableEXT, glcltGetColorTableEXT, glcltGetColorTableParameterivEXT, glcltGetColorTableParameterfvEXT, } }; /******************************Public*Routine******************************\ * vInitTebCache * * Within the NT TEB, there is a table where OpenGL can cache OpenGL API * function pointers. In this area we can cache frequently used portions * of the dispatch table. Functions cached in this area can save a level * of indirection by avoiding deferencing the dispatch table pointer. * * History: * 06-Nov-1995 -by- Gilman Wong [gilmanw] * Wrote it. \**************************************************************************/ // The following table defines the ranges of the dispatch table that should // be cached in the TEB. Each pair of indices defines the start and end of // each range. int static gaiCacheFuncs[] = { INDEX_glCallList , INDEX_glCallLists , INDEX_glBegin , INDEX_glBegin , INDEX_glColor3b , INDEX_glNormal3sv , INDEX_glTexCoord1d , INDEX_glVertex4sv , INDEX_glMaterialf , INDEX_glMaterialiv , INDEX_glDisable , INDEX_glEnable , INDEX_glPopAttrib , INDEX_glPushAttrib , INDEX_glEvalCoord1d , INDEX_glEvalCoord2fv, INDEX_glEvalPoint1 , INDEX_glEvalPoint1 , INDEX_glEvalPoint2 , INDEX_glEvalPoint2 , INDEX_glLoadIdentity, INDEX_glMultMatrixd , INDEX_glPopMatrix , INDEX_glTranslatef , INDEX_glArrayElement, INDEX_glVertexPointer, INDEX_glGetPointerv, INDEX_glGetPointerv , INDEX_glPopClientAttrib, INDEX_glPushClientAttrib, INDEX_glColorTableEXT, INDEX_glColorSubTableEXT, }; void vInitTebCache(PVOID glTable) { int iRange, iCache; PROC *pfnCltDispatchTableFast; pfnCltDispatchTableFast = (PROC *)GLTEB_CLTDISPATCHTABLE_FAST(); // Copy each range of FPs, defined by the table gaiCacheFuncs, from the // dispatch table to the TEB FP cache. for ( iRange = 0, iCache = 0; iRange < (sizeof(gaiCacheFuncs) / sizeof(int)); iRange+=2 ) { PVOID pvCache; // ptr into FP cache within TEB PVOID pvDispatch; // ptr to current range within dispatch table int iNum; // number of FPs in current range to cache pvCache = (PVOID)&pfnCltDispatchTableFast[iCache]; pvDispatch = (PVOID)&((PROC *)glTable)[gaiCacheFuncs[iRange]]; iNum = gaiCacheFuncs[iRange+1] - gaiCacheFuncs[iRange] + 1; memcpy(pvCache, pvDispatch, iNum * sizeof(PROC)); iCache += iNum; } ASSERTOPENGL(iCache == sizeof(GLDISPATCHTABLE_FAST) / sizeof(PROC), "fast dispatch table not initialized properly\n"); } /******************************Public*Routine******************************\ * * SetCltProcTable * * Sets the client-side dispatch table or update the metafiling * dispatch table if capturing * * History: * Fri Jan 05 16:37:40 1996 -by- Drew Bliss [drewb] * Created * \**************************************************************************/ void SetCltProcTable(GLCLTPROCTABLE *pgcpt, GLEXTPROCTABLE *pgept, BOOL fForce) { #ifdef GL_METAFILE PLRC plrc; plrc = GLTEB_CLTCURRENTRC(); if (!fForce && plrc != NULL && plrc->fCapturing) { MetaSetCltProcTable(pgcpt, pgept); } else #endif { // Copy base proc table memcpy((PVOID) CURRENT_GLTEBINFO()->glCltDispatchTable, &pgcpt->glDispatchTable, pgcpt->cEntries * sizeof(PROC)); // If the given proc table doesn't have a complete set of entries, // pad it out with noops if (pgcpt->cEntries < OPENGL_VERSION_110_ENTRIES) { memcpy(((PROC *)CURRENT_GLTEBINFO()->glCltDispatchTable)+ pgcpt->cEntries, ((PROC *)&glNullCltProcTable.glDispatchTable)+ pgcpt->cEntries, (OPENGL_VERSION_110_ENTRIES-pgcpt->cEntries)*sizeof(PROC)); } // Copy extension proc table // This is a purely internal table so it should always have the // right number of entries ASSERTOPENGL(pgept->cEntries == glNullExtProcTable.cEntries, "Bad extension proc table\n"); memcpy(CURRENT_GLTEBINFO()->glCltDispatchTable+ GL_EXT_PROC_TABLE_OFFSET, &pgept->glDispatchTable, pgept->cEntries * sizeof(PROC)); vInitTebCache(CURRENT_GLTEBINFO()->glCltDispatchTable); } } /******************************Public*Routine******************************\ * * GetCltProcTable * * Gets the client-side dispatch table or the metafile capture * exec table depending on the metafile capture state * * History: * Fri Jan 05 19:11:26 1996 -by- Drew Bliss [drewb] * Created * \**************************************************************************/ void GetCltProcTable(GLCLTPROCTABLE *pgcpt, GLEXTPROCTABLE *pgept, BOOL fForce) { #ifdef GL_METAFILE PLRC plrc; plrc = GLTEB_CLTCURRENTRC(); if (!fForce && plrc != NULL && plrc->fCapturing) { MetaGetCltProcTable(pgcpt, pgept); } else #endif { memcpy(&pgcpt->glDispatchTable, (PVOID) CURRENT_GLTEBINFO()->glCltDispatchTable, pgcpt->cEntries * sizeof(PROC)); memcpy(&pgept->glDispatchTable, CURRENT_GLTEBINFO()->glCltDispatchTable+GL_EXT_PROC_TABLE_OFFSET, pgept->cEntries * sizeof(PROC)); } }