Path: blob/21.2-virgl/src/mapi/glapi/glapi_dispatch.c
4560 views
/*1* Mesa 3-D graphics library2*3* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the "Software"),7* to deal in the Software without restriction, including without limitation8* the rights to use, copy, modify, merge, publish, distribute, sublicense,9* and/or sell copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice shall be included13* in all copies or substantial portions of the Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS16* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR19* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,20* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR21* OTHER DEALINGS IN THE SOFTWARE.22*/232425/**26* \file glapi_dispatch.c27*28* This file generates all the gl* function entrypoints. This code is not29* used if optimized assembly stubs are available (e.g., using30* glapi/glapi_x86.S on IA32 or glapi/glapi_sparc.S on SPARC).31*32* \note33* This file is also used to build the client-side libGL that loads DRI-based34* device drivers. At build-time it is symlinked to src/glx.35*36* \author Brian Paul <[email protected]>37*/3839#include "glapi/glapi_priv.h"40#include "glapitable.h"414243#if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM))4445#if defined(_WIN32)46#define KEYWORD1 GLAPI47#else48#define KEYWORD1 PUBLIC49#endif5051#define KEYWORD2 GLAPIENTRY5253#define NAME(func) gl##func5455#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */5657#define F stdout58#define DISPATCH(FUNC, ARGS, MESSAGE) \59fprintf MESSAGE; \60GET_DISPATCH()->FUNC ARGS6162#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \63fprintf MESSAGE; \64return GET_DISPATCH()->FUNC ARGS6566#else6768#define DISPATCH(FUNC, ARGS, MESSAGE) \69GET_DISPATCH()->FUNC ARGS7071#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \72return GET_DISPATCH()->FUNC ARGS7374#endif /* logging */757677#ifndef GLAPIENTRY78#define GLAPIENTRY79#endif8081#ifdef GLX_INDIRECT_RENDERING82/* those link to libglapi.a should provide the entry points */83#define _GLAPI_SKIP_PROTO_ENTRY_POINTS84#endif8586/* These prototypes are necessary because GLES1 library builds will create87* dispatch functions for them. We can't directly include GLES/gl.h because88* it would conflict the previously-included GL/gl.h. Since GLES1 ABI is not89* expected to every add more functions, the path of least resistance is to90* just duplicate the prototypes for the functions that aren't already in91* desktop OpenGL.92*/93#include <GLES/glplatform.h>949596/* Redefine GL_API to avoid MSVC/MinGW warnings about different dllimport97* attributes for these prototypes vs those in the GLES/gl.h header.98*/99#undef GL_API100#define GL_API KEYWORD1101102GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);103GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);104GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);105GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat *equation);106GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);107108GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);109GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);110GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);111GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);112GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);113GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);114GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);115GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);116GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);117GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed *equation);118GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);119GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);120GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);121GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);122GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);123GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);124GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);125GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);126GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);127GL_API void GL_APIENTRY glLineWidthx (GLfixed width);128GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);129GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);130GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);131GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);132GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);133GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);134GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);135GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);136GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);137GL_API void GL_APIENTRY glPointSizex (GLfixed size);138GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);139GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);140GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);141GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);142GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);143GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);144GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);145GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);146GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);147GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);148GL_API void GL_APIENTRY glBlendBarrier (void);149GL_API void GL_APIENTRY glPrimitiveBoundingBox (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);150151/* Enable frame pointer elimination on Windows, otherwise forgetting to add152* APIENTRY to _mesa_* entrypoints will not cause crashes on debug builds, as153* the initial ESP value is saved in the EBP in the function prologue, then154* restored on the epilogue, clobbering any corruption in the ESP pointer due155* to mismatch in the callee calling convention.156*157* On MSVC it's not sufficient to enable /Oy -- other optimizations must be158* enabled or frame pointer will be used regardless.159*160* We don't do this when NDEBUG is defined since, frame pointer omission161* optimization compiler flag are already specified on release builds, and162* because on profile builds we must have frame pointers or certain profilers163* might fail to unwind the stack.164*/165#if defined(_WIN32) && !defined(NDEBUG)166# if defined(_MSC_VER)167# pragma optimize( "gty", on )168# elif defined(__GNUC__)169# pragma GCC optimize ("omit-frame-pointer")170# endif171#endif172173#include "glapitemp.h"174175#endif /* USE_X86_ASM */176177178