Compare commits

...

15 Commits

Author SHA1 Message Date
Brian Paul
d4596584f6 more updates for 6.3 release 2005-07-20 18:07:11 +00:00
Brian Paul
6bb49eacfd updates for 6.3 release 2005-07-19 21:01:46 +00:00
Brian Paul
bfb5ea307e replace fprintf() calls with _mesa_problem() 2005-07-19 18:20:04 +00:00
Brian Paul
364ae78e69 remove fprintf() 2005-07-19 18:18:49 +00:00
Brian Paul
8d7d9c22f6 include driverfuncs.h 2005-07-19 15:34:44 +00:00
Brian Paul
2d47c07398 overlay planes test 2005-07-19 15:27:03 +00:00
Brian Paul
7e152b83cb s/clippping/clipping/ 2005-07-18 20:07:19 +00:00
Philippe Houdoin
ed886336e1 Fixed warnings by using GLUTProc type instead of anonymous (void *) for
GLUT callbacks.
2005-07-18 19:27:49 +00:00
Alan Hourihane
5343ae8304 re-enable the ffb driver 2005-07-18 13:53:03 +00:00
Alan Hourihane
df88dfe1df Fix the FFB driver for the renderbuffer changes
Support NEW INTERFACE as well
2005-07-18 13:52:34 +00:00
Alan Hourihane
c235a96a71 pass in the renderbuffer 2005-07-18 13:50:06 +00:00
Ian Romanick
aa8ff1e75d Missed this on the previous commit. 2005-07-18 12:33:03 +00:00
Ian Romanick
9bdfee3a47 Wrap every place that accesses a dispatch table with a macro. A new script-
generated file, called src/mesa/glapi/dispatch.h, is added.  This file
contains three macros for each API function.  It contains a GET, a SET, and
a CALL.  Each of the macros take a pointer to the context and a pointer to
the dispatch table.

In several threads on mesa3d-dev we discussed replacing _glapi_add_entrypoint
with a new function called _glapi_add_dispatch.  For this discussion, the
important difference between the two is that the caller of _glapi_add_dispatch
does *not* know what the dispatch offset will be at compile time.  Because of
this callers need to track the dispatch offset returned by
_glapi_add_dispatch.

http://marc.theaimsgroup.com/?t=111947074700001&r=1&w=2

The downside is that driver code then has to access the dispatch table two
different ways.  It accesses it using structure tags (e.g., exec->Begin) for
functions with fixed offsets and via a remap table (e.g., exec[
remap->NewExtensionFunction ]) for functions without fixed offsets. Yuck!

Using the macros allows both types of functions to be accessed
identically.  If a driver needs to set a pointer for Begin, it does
'SET_Begin(ctx, exec, my_begin_function)'.  If it needs to set a pointer
for NewExtensionFunction, it does 'SET_NewExtensionFunction(ctx, exec,
my_NewExtensionFunction_function)'.  Furthermore, if at some point in
the future a static offset is assigned for NewExtensionFunction, only
the macros need to change (instead of every single place that accesses a
table for that function).

This code differs slightly from the originally posted patches in that the
CALL, GET, and SET marcos no longer take a context pointer as a parameter.
Brian Paul had suggested that the remap table could be stored as a global
since it would be set at CreateScreen time and would be constant for all
contexts.  This change reflects that feedback.

http://marc.theaimsgroup.com/?t=112087194700001&r=1&w=2
2005-07-18 12:31:24 +00:00
Adam Jackson
e0e993c5ff XMesaResizeBuffers needs separate paths for client and server builds 2005-07-16 04:02:05 +00:00
Adam Jackson
c529f6bf70 strip out vestigial #ifdef HAVE_CONFIG_H stanzas, they're confusing the
modular X build
2005-07-16 00:56:20 +00:00
49 changed files with 5578 additions and 2677 deletions

View File

@@ -47,7 +47,7 @@ DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri
# ffb and gamma are missing because they have not been converted to use the new
# gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \
savage sis tdfx trident unichrome
savage sis tdfx trident unichrome ffb

View File

@@ -1,7 +1,7 @@
Mesa 6.3 release notes
month day, 2004
July 20, 2004
PLEASE READ!!!!
@@ -28,7 +28,8 @@ GL_OES_read_format - allows one to query the fastest glReadPixels format
GL_ARB_pixel_buffer_object - buffer objects for pixel read/write functions.
GL_EXT_framebuffer_object - allows render-to-texture and provides a
window-system indepedent Pbuffer facility
window-system indepedent Pbuffer facility.
The Mesa CVS tree contains a couple tests of this extension.
DirectFB driver, contributed by Claudio Ciccani. See docs/README.directfb
for details.
@@ -62,11 +63,21 @@ Note that textures, programs and buffers can be shared by several rendering
contexts so they can't be deleted until they're unbound in _all_ contexts.
GL_EXT_framebuffer_object changes
---------------------------------
XXX describe all the changes made for this extension.
Implementing this extension involved changing a lot of code (for the better).
The gl_framebuffer object now a collection of gl_renderbuffer objects.
Renderbuffers may store colors, stencil indices, or depth values. The
gl_framebuffer and gl_renderbuffer types are object-oriented in design.
All the old RGB, color index, stencil and depth-related span functions for
reading/writing pixels from/to buffers has changed. Now, all pixels are
read/written through a set of common renderbuffer functions (methods).
Most device drivers have been updated for these changes, but some haven't.
@@ -101,4 +112,4 @@ D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.3,v 3.10 2005/07/01 01:04:31 brianp Exp $
$Id: RELNOTES-6.3,v 3.12 2005/07/20 18:07:11 brianp Exp $

View File

@@ -1314,20 +1314,39 @@ Mesa Version History
- bug reports should to go bugzilla.freedesktop.org
6.3 Month day, 2004
6.3 July 20, 2004
New:
- GL_EXT_framebuffer_object extension
- GL_ARB_draw_buffers extension
- GL_ARB_pixel_buffer_object extension
- GL_OES_read_format extension (Ian Romanick)
- DirectFB driver (Claudio Ciccani)
- x86_64 vertex transformation code (Mikko T.)
- Updated GL/glext.h to version 29
Changes:
- added -stereo option for glxgears demo (Jacek Rosik)
- updated the PBuffer demo code in xdemos/ directory
- glDeleteTextures/Programs/Buffers() now makes the object ID
available for immediate re-use
- assorted 64-bit clean-ups fixes (x86_64 and Win64)
- lots of internal changes for GL_EXT_framebuffer_object
Bug fixes:
- some functions didn't support PBO functionality
- glGetTexImage didn't convert color index images to RGBA as required
- fragment program texcoords were sometimes wrong for points and lines
- fixed problem with negative dot product in arbfplight, fplight demos
- fixed bug in perspective correction of antialiased, textured lines
- querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
- fixed a couple per-pixel fog bugs (Soju Matsumoto)
- glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
- fixed float parsing bug in ARB frag/vert programs (bug 2520)
- XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
- GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
- glXChooseFBConfig() crashed if attribList pointer was NULL
- program state.light[n].spot.direction.w was wrong value (bug 3083)
- fragment program fog option required glEnable(GL_FOG) - wrong.
- glColorTable() could produce a Mesa implementation error (bug 3135)
- RasterPos could get corrupted by color index rendering path
- Removed bad XTranslateCoordinates call when rendering to Pixmaps
- glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
- fixed a few Darwin compilation problems

View File

@@ -38,6 +38,7 @@ a:visited {
<b>Download / Install</b>
<ul>
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Stable Release (6.2.1)</a>
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Devel Release (6.3)</a>
<li><a href="download.html" target="MainFrame">Downloading/Unpacking</a>
<li><a href="install.html" target="MainFrame">Compilation/Installation</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>

View File

@@ -11,6 +11,49 @@
<H1>News</H1>
<h2>July 20, 2005</h2>
<p>
Mesa 6.3 has been released.
This is a development release with new features, changes and bug fixes.
</p>
<pre>
New:
- GL_EXT_framebuffer_object extension
- GL_ARB_draw_buffers extension
- GL_ARB_pixel_buffer_object extension
- GL_OES_read_format extension (Ian Romanick)
- DirectFB driver (Claudio Ciccani)
- x86_64 vertex transformation code (Mikko T.)
Changes:
- added -stereo option for glxgears demo (Jacek Rosik)
- updated the PBuffer demo code in xdemos/ directory
- glDeleteTextures/Programs/Buffers() now makes the object ID
available for immediate re-use
- assorted 64-bit clean-ups fixes (x86_64 and Win64)
- lots of internal changes for GL_EXT_framebuffer_object
Bug fixes:
- some functions didn't support PBO functionality
- glGetTexImage didn't convert color index images to RGBA as required
- fragment program texcoords were sometimes wrong for points and lines
- fixed problem with negative dot product in arbfplight, fplight demos
- fixed bug in perspective correction of antialiased, textured lines
- querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
- fixed a couple per-pixel fog bugs (Soju Matsumoto)
- glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
- fixed float parsing bug in ARB frag/vert programs (bug 2520)
- XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
- GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
- glXChooseFBConfig() crashed if attribList pointer was NULL
- program state.light[n].spot.direction.w was wrong value (bug 3083)
- fragment program fog option required glEnable(GL_FOG) - wrong.
- glColorTable() could produce a Mesa implementation error (bug 3135)
- RasterPos could get corrupted by color index rendering path
- Removed bad XTranslateCoordinates call when rendering to Pixmaps
- glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
- fixed a few Darwin compilation problems
</pre>
<h2>December 9, 2004</h2>
<p>
Mesa 6.2.1 has been released.
@@ -962,6 +1005,6 @@ source code</a>.</p>
<hr>
$Id: news.html,v 3.20 2005/07/01 01:04:31 brianp Exp $
$Id: news.html,v 3.21 2005/07/20 18:07:11 brianp Exp $
</body>
</html>

View File

@@ -20,6 +20,7 @@ PROGS = glthreads \
glxswapcontrol \
manywin \
offset \
overlay \
pbinfo \
pbdemo \
wincopy \

245
progs/xdemos/overlay.c Normal file
View File

@@ -0,0 +1,245 @@
/*
* GLX overlay test/demo.
*
* Brian Paul
* 18 July 2005
*/
#include <GL/gl.h>
#include <GL/glx.h>
#include <X11/keysym.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
static int WinWidth = 300, WinHeight = 300;
static Window NormalWindow = 0;
static Window OverlayWindow = 0;
static GLXContext NormalContext = 0;
static GLXContext OverlayContext = 0;
static GLboolean RGBOverlay = GL_FALSE;
static GLfloat Angle = 0.0;
static void
RedrawNormal(Display *dpy)
{
glXMakeCurrent(dpy, NormalWindow, NormalContext);
glViewport(0, 0, WinWidth, WinHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glClearColor(0.5, 0.5, 0.5, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 0.0);
glPushMatrix();
glRotatef(Angle, 0, 0, 1);
glRectf(-0.8, -0.8, 0.8, 0.8);
glPopMatrix();
glXSwapBuffers(dpy, NormalWindow);
}
static void
RedrawOverlay(Display *dpy)
{
glXMakeCurrent(dpy, OverlayWindow, OverlayContext);
glViewport(0, 0, WinWidth, WinHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glClear(GL_COLOR_BUFFER_BIT);
if (RGBOverlay) {
glColor3f(0.0, 1.0, 1.0);
}
else {
glIndexi(2);
}
glBegin(GL_LINES);
glVertex2f(-1, -1);
glVertex2f(1, 1);
glVertex2f(1, -1);
glVertex2f(-1, 1);
glEnd();
glXSwapBuffers(dpy, OverlayWindow);
}
static Window
MakeWindow(Display *dpy, XVisualInfo *visinfo, Window parent,
unsigned int width, unsigned int height)
{
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
scrnum = DefaultScreen(dpy);
root = RootWindow(dpy, scrnum);
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow(dpy, parent, 0, 0, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr);
return win;
}
static void
MakeNormalWindow(Display *dpy)
{
int attrib[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
None };
int scrnum;
Window root;
XVisualInfo *visinfo;
scrnum = DefaultScreen(dpy);
root = RootWindow(dpy, scrnum);
visinfo = glXChooseVisual(dpy, scrnum, attrib);
if (!visinfo) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");
exit(1);
}
NormalWindow = MakeWindow(dpy, visinfo, root, WinWidth, WinHeight);
assert(NormalWindow);
NormalContext = glXCreateContext(dpy, visinfo, NULL, True);
assert(NormalContext);
}
static void
MakeOverlayWindow(Display *dpy)
{
int rgbAttribs[] = {
GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_LEVEL, 1,
None
};
int indexAttribs[] = {
/*GLX_RGBA, leave this out */
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_LEVEL, 1,
None
};
int scrnum;
Window root;
XVisualInfo *visinfo;
scrnum = DefaultScreen(dpy);
root = RootWindow(dpy, scrnum);
visinfo = glXChooseVisual(dpy, scrnum, rgbAttribs);
if (visinfo) {
printf("Found RGB overlay visual 0x%x\n", (int) visinfo->visualid);
RGBOverlay = GL_TRUE;
}
else {
visinfo = glXChooseVisual(dpy, scrnum, indexAttribs);
if (visinfo) {
printf("Found Color Index overlay visual 0x%x\n",
(int) visinfo->visualid);
/* XXX setup the colormap entries! */
}
else {
printf("Error: couldn't get an overlay visual!\n");
exit(1);
}
}
OverlayWindow = MakeWindow(dpy, visinfo, NormalWindow, WinWidth, WinHeight);
assert(OverlayWindow);
OverlayContext = glXCreateContext(dpy, visinfo, NULL, True);
assert(OverlayContext);
}
static void
EventLoop(Display *dpy)
{
XEvent event;
while (1) {
XNextEvent(dpy, &event);
switch (event.type) {
case Expose:
RedrawNormal(dpy);
RedrawOverlay(dpy);
break;
case ConfigureNotify:
WinWidth = event.xconfigure.width;
WinHeight = event.xconfigure.height;
if (event.xconfigure.window == NormalWindow)
XResizeWindow(dpy, OverlayWindow, WinWidth, WinHeight);
break;
case KeyPress:
{
char buffer[10];
int r, code;
code = XLookupKeysym(&event.xkey, 0);
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return;
}
else if (buffer[0] == ' ') {
Angle += 5.0;
RedrawNormal(dpy);
}
}
break;
default:
; /* nothing */
}
}
}
int
main(int argc, char *argv[])
{
Display *dpy = XOpenDisplay(NULL);
assert(dpy);
MakeNormalWindow(dpy);
MakeOverlayWindow(dpy);
XMapWindow(dpy, NormalWindow);
XMapWindow(dpy, OverlayWindow);
EventLoop(dpy);
glXDestroyContext(dpy, OverlayContext);
glXDestroyContext(dpy, NormalContext);
XDestroyWindow(dpy, OverlayWindow);
XDestroyWindow(dpy, NormalWindow);
return 0;
}

View File

@@ -53,145 +53,145 @@ glutExtensionSupported(const char *extension)
struct name_address_pair {
const char *name;
const void *address;
const GLUTproc address;
};
static struct name_address_pair glut_functions[] = {
{ "glutInit", (const void *) glutInit },
{ "glutInitDisplayMode", (const void *) glutInitDisplayMode },
{ "glutInitDisplayString", (const void *) glutInitDisplayString },
{ "glutInitWindowPosition", (const void *) glutInitWindowPosition },
{ "glutInitWindowSize", (const void *) glutInitWindowSize },
{ "glutMainLoop", (const void *) glutMainLoop },
{ "glutCreateWindow", (const void *) glutCreateWindow },
{ "glutCreateSubWindow", (const void *) glutCreateSubWindow },
{ "glutDestroyWindow", (const void *) glutDestroyWindow },
{ "glutPostRedisplay", (const void *) glutPostRedisplay },
{ "glutPostWindowRedisplay", (const void *) glutPostWindowRedisplay },
{ "glutSwapBuffers", (const void *) glutSwapBuffers },
{ "glutGetWindow", (const void *) glutGetWindow },
{ "glutSetWindow", (const void *) glutSetWindow },
{ "glutSetWindowTitle", (const void *) glutSetWindowTitle },
{ "glutSetIconTitle", (const void *) glutSetIconTitle },
{ "glutPositionWindow", (const void *) glutPositionWindow },
{ "glutReshapeWindow", (const void *) glutReshapeWindow },
{ "glutPopWindow", (const void *) glutPopWindow },
{ "glutPushWindow", (const void *) glutPushWindow },
{ "glutIconifyWindow", (const void *) glutIconifyWindow },
{ "glutShowWindow", (const void *) glutShowWindow },
{ "glutHideWindow", (const void *) glutHideWindow },
{ "glutFullScreen", (const void *) glutFullScreen },
{ "glutSetCursor", (const void *) glutSetCursor },
{ "glutWarpPointer", (const void *) glutWarpPointer },
{ "glutEstablishOverlay", (const void *) glutEstablishOverlay },
{ "glutRemoveOverlay", (const void *) glutRemoveOverlay },
{ "glutUseLayer", (const void *) glutUseLayer },
{ "glutPostOverlayRedisplay", (const void *) glutPostOverlayRedisplay },
{ "glutPostWindowOverlayRedisplay", (const void *) glutPostWindowOverlayRedisplay },
{ "glutShowOverlay", (const void *) glutShowOverlay },
{ "glutHideOverlay", (const void *) glutHideOverlay },
{ "glutCreateMenu", (const void *) glutCreateMenu },
{ "glutDestroyMenu", (const void *) glutDestroyMenu },
{ "glutGetMenu", (const void *) glutGetMenu },
{ "glutSetMenu", (const void *) glutSetMenu },
{ "glutAddMenuEntry", (const void *) glutAddMenuEntry },
{ "glutAddSubMenu", (const void *) glutAddSubMenu },
{ "glutChangeToMenuEntry", (const void *) glutChangeToMenuEntry },
{ "glutChangeToSubMenu", (const void *) glutChangeToSubMenu },
{ "glutRemoveMenuItem", (const void *) glutRemoveMenuItem },
{ "glutAttachMenu", (const void *) glutAttachMenu },
{ "glutDetachMenu", (const void *) glutDetachMenu },
{ "glutDisplayFunc", (const void *) glutDisplayFunc },
{ "glutReshapeFunc", (const void *) glutReshapeFunc },
{ "glutKeyboardFunc", (const void *) glutKeyboardFunc },
{ "glutMouseFunc", (const void *) glutMouseFunc },
{ "glutMotionFunc", (const void *) glutMotionFunc },
{ "glutPassiveMotionFunc", (const void *) glutPassiveMotionFunc },
{ "glutEntryFunc", (const void *) glutEntryFunc },
{ "glutVisibilityFunc", (const void *) glutVisibilityFunc },
{ "glutIdleFunc", (const void *) glutIdleFunc },
{ "glutTimerFunc", (const void *) glutTimerFunc },
{ "glutMenuStateFunc", (const void *) glutMenuStateFunc },
{ "glutSpecialFunc", (const void *) glutSpecialFunc },
{ "glutSpaceballMotionFunc", (const void *) glutSpaceballMotionFunc },
{ "glutSpaceballRotateFunc", (const void *) glutSpaceballRotateFunc },
{ "glutSpaceballButtonFunc", (const void *) glutSpaceballButtonFunc },
{ "glutButtonBoxFunc", (const void *) glutButtonBoxFunc },
{ "glutDialsFunc", (const void *) glutDialsFunc },
{ "glutTabletMotionFunc", (const void *) glutTabletMotionFunc },
{ "glutTabletButtonFunc", (const void *) glutTabletButtonFunc },
{ "glutMenuStatusFunc", (const void *) glutMenuStatusFunc },
{ "glutOverlayDisplayFunc", (const void *) glutOverlayDisplayFunc },
{ "glutWindowStatusFunc", (const void *) glutWindowStatusFunc },
// { "glutKeyboardUpFunc", (const void *) glutKeyboardUpFunc },
// { "glutSpecialUpFunc", (const void *) glutSpecialUpFunc },
// { "glutJoystickFunc", (const void *) glutJoystickFunc },
{ "glutSetColor", (const void *) glutSetColor },
{ "glutGetColor", (const void *) glutGetColor },
{ "glutCopyColormap", (const void *) glutCopyColormap },
{ "glutGet", (const void *) glutGet },
{ "glutDeviceGet", (const void *) glutDeviceGet },
{ "glutExtensionSupported", (const void *) glutExtensionSupported },
{ "glutGetModifiers", (const void *) glutGetModifiers },
{ "glutLayerGet", (const void *) glutLayerGet },
{ "glutGetProcAddress", (const void *) glutGetProcAddress },
{ "glutBitmapCharacter", (const void *) glutBitmapCharacter },
{ "glutBitmapWidth", (const void *) glutBitmapWidth },
{ "glutStrokeCharacter", (const void *) glutStrokeCharacter },
{ "glutStrokeWidth", (const void *) glutStrokeWidth },
{ "glutBitmapLength", (const void *) glutBitmapLength },
{ "glutStrokeLength", (const void *) glutStrokeLength },
{ "glutWireSphere", (const void *) glutWireSphere },
{ "glutSolidSphere", (const void *) glutSolidSphere },
{ "glutWireCone", (const void *) glutWireCone },
{ "glutSolidCone", (const void *) glutSolidCone },
{ "glutWireCube", (const void *) glutWireCube },
{ "glutSolidCube", (const void *) glutSolidCube },
{ "glutWireTorus", (const void *) glutWireTorus },
{ "glutSolidTorus", (const void *) glutSolidTorus },
{ "glutWireDodecahedron", (const void *) glutWireDodecahedron },
{ "glutSolidDodecahedron", (const void *) glutSolidDodecahedron },
{ "glutWireTeapot", (const void *) glutWireTeapot },
{ "glutSolidTeapot", (const void *) glutSolidTeapot },
{ "glutWireOctahedron", (const void *) glutWireOctahedron },
{ "glutSolidOctahedron", (const void *) glutSolidOctahedron },
{ "glutWireTetrahedron", (const void *) glutWireTetrahedron },
{ "glutSolidTetrahedron", (const void *) glutSolidTetrahedron },
{ "glutWireIcosahedron", (const void *) glutWireIcosahedron },
{ "glutSolidIcosahedron", (const void *) glutSolidIcosahedron },
{ "glutVideoResizeGet", (const void *) glutVideoResizeGet },
{ "glutSetupVideoResizing", (const void *) glutSetupVideoResizing },
{ "glutStopVideoResizing", (const void *) glutStopVideoResizing },
{ "glutVideoResize", (const void *) glutVideoResize },
{ "glutVideoPan", (const void *) glutVideoPan },
{ "glutReportErrors", (const void *) glutReportErrors },
// { "glutIgnoreKeyRepeat", (const void *) glutIgnoreKeyRepeat },
// { "glutSetKeyRepeat", (const void *) glutSetKeyRepeat },
// { "glutForceJoystickFunc", (const void *) glutForceJoystickFunc },
// { "glutGameModeString", (const void *) glutGameModeString },
// { "glutEnterGameMode", (const void *) glutEnterGameMode },
// { "glutLeaveGameMode", (const void *) glutLeaveGameMode },
// { "glutGameModeGet", (const void *) glutGameModeGet },
{ "glutInit", (const GLUTproc) glutInit },
{ "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode },
{ "glutInitDisplayString", (const GLUTproc) glutInitDisplayString },
{ "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition },
{ "glutInitWindowSize", (const GLUTproc) glutInitWindowSize },
{ "glutMainLoop", (const GLUTproc) glutMainLoop },
{ "glutCreateWindow", (const GLUTproc) glutCreateWindow },
{ "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow },
{ "glutDestroyWindow", (const GLUTproc) glutDestroyWindow },
{ "glutPostRedisplay", (const GLUTproc) glutPostRedisplay },
{ "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay },
{ "glutSwapBuffers", (const GLUTproc) glutSwapBuffers },
{ "glutGetWindow", (const GLUTproc) glutGetWindow },
{ "glutSetWindow", (const GLUTproc) glutSetWindow },
{ "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle },
{ "glutSetIconTitle", (const GLUTproc) glutSetIconTitle },
{ "glutPositionWindow", (const GLUTproc) glutPositionWindow },
{ "glutReshapeWindow", (const GLUTproc) glutReshapeWindow },
{ "glutPopWindow", (const GLUTproc) glutPopWindow },
{ "glutPushWindow", (const GLUTproc) glutPushWindow },
{ "glutIconifyWindow", (const GLUTproc) glutIconifyWindow },
{ "glutShowWindow", (const GLUTproc) glutShowWindow },
{ "glutHideWindow", (const GLUTproc) glutHideWindow },
{ "glutFullScreen", (const GLUTproc) glutFullScreen },
{ "glutSetCursor", (const GLUTproc) glutSetCursor },
{ "glutWarpPointer", (const GLUTproc) glutWarpPointer },
{ "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay },
{ "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay },
{ "glutUseLayer", (const GLUTproc) glutUseLayer },
{ "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay },
{ "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay },
{ "glutShowOverlay", (const GLUTproc) glutShowOverlay },
{ "glutHideOverlay", (const GLUTproc) glutHideOverlay },
{ "glutCreateMenu", (const GLUTproc) glutCreateMenu },
{ "glutDestroyMenu", (const GLUTproc) glutDestroyMenu },
{ "glutGetMenu", (const GLUTproc) glutGetMenu },
{ "glutSetMenu", (const GLUTproc) glutSetMenu },
{ "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry },
{ "glutAddSubMenu", (const GLUTproc) glutAddSubMenu },
{ "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry },
{ "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu },
{ "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem },
{ "glutAttachMenu", (const GLUTproc) glutAttachMenu },
{ "glutDetachMenu", (const GLUTproc) glutDetachMenu },
{ "glutDisplayFunc", (const GLUTproc) glutDisplayFunc },
{ "glutReshapeFunc", (const GLUTproc) glutReshapeFunc },
{ "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc },
{ "glutMouseFunc", (const GLUTproc) glutMouseFunc },
{ "glutMotionFunc", (const GLUTproc) glutMotionFunc },
{ "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc },
{ "glutEntryFunc", (const GLUTproc) glutEntryFunc },
{ "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc },
{ "glutIdleFunc", (const GLUTproc) glutIdleFunc },
{ "glutTimerFunc", (const GLUTproc) glutTimerFunc },
{ "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc },
{ "glutSpecialFunc", (const GLUTproc) glutSpecialFunc },
{ "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc },
{ "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc },
{ "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc },
{ "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc },
{ "glutDialsFunc", (const GLUTproc) glutDialsFunc },
{ "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc },
{ "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc },
{ "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc },
{ "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc },
{ "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc },
// { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc },
// { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc },
// { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc },
{ "glutSetColor", (const GLUTproc) glutSetColor },
{ "glutGetColor", (const GLUTproc) glutGetColor },
{ "glutCopyColormap", (const GLUTproc) glutCopyColormap },
{ "glutGet", (const GLUTproc) glutGet },
{ "glutDeviceGet", (const GLUTproc) glutDeviceGet },
{ "glutExtensionSupported", (const GLUTproc) glutExtensionSupported },
{ "glutGetModifiers", (const GLUTproc) glutGetModifiers },
{ "glutLayerGet", (const GLUTproc) glutLayerGet },
{ "glutGetProcAddress", (const GLUTproc) glutGetProcAddress },
{ "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter },
{ "glutBitmapWidth", (const GLUTproc) glutBitmapWidth },
{ "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter },
{ "glutStrokeWidth", (const GLUTproc) glutStrokeWidth },
{ "glutBitmapLength", (const GLUTproc) glutBitmapLength },
{ "glutStrokeLength", (const GLUTproc) glutStrokeLength },
{ "glutWireSphere", (const GLUTproc) glutWireSphere },
{ "glutSolidSphere", (const GLUTproc) glutSolidSphere },
{ "glutWireCone", (const GLUTproc) glutWireCone },
{ "glutSolidCone", (const GLUTproc) glutSolidCone },
{ "glutWireCube", (const GLUTproc) glutWireCube },
{ "glutSolidCube", (const GLUTproc) glutSolidCube },
{ "glutWireTorus", (const GLUTproc) glutWireTorus },
{ "glutSolidTorus", (const GLUTproc) glutSolidTorus },
{ "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron },
{ "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron },
{ "glutWireTeapot", (const GLUTproc) glutWireTeapot },
{ "glutSolidTeapot", (const GLUTproc) glutSolidTeapot },
{ "glutWireOctahedron", (const GLUTproc) glutWireOctahedron },
{ "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron },
{ "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron },
{ "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron },
{ "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron },
{ "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron },
{ "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet },
{ "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing },
{ "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing },
{ "glutVideoResize", (const GLUTproc) glutVideoResize },
{ "glutVideoPan", (const GLUTproc) glutVideoPan },
{ "glutReportErrors", (const GLUTproc) glutReportErrors },
// { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat },
// { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat },
// { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc },
// { "glutGameModeString", (const GLUTproc) glutGameModeString },
// { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode },
// { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode },
// { "glutGameModeGet", (const GLUTproc) glutGameModeGet },
{ NULL, NULL }
};
/* XXX This isn't an official GLUT function, yet */
void * GLUTAPIENTRY
GLUTproc GLUTAPIENTRY
glutGetProcAddress(const char *procName)
{
/* Try GLUT functions first */
int i;
for (i = 0; glut_functions[i].name; i++) {
if (strcmp(glut_functions[i].name, procName) == 0)
return (void *) glut_functions[i].address;
return glut_functions[i].address;
}
/* Try core GL functions */
#if defined(_WIN32)
return (void *) wglGetProcAddress((LPCSTR) procName);
return (GLUTProc) wglGetProcAddress((LPCSTR) procName);
#elif defined(GLX_ARB_get_proc_address)
return (void *) glXGetProcAddressARB((const GLubyte *) procName);
return (GLUTProc) glXGetProcAddressARB((const GLubyte *) procName);
#else
return NULL;
#endif

View File

@@ -37,10 +37,13 @@
#undef DEPTH_TRACE
static void
FFBWriteDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLdepth depth[], const GLubyte mask[])
static void FFBWriteDepthSpan( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
const void *values,
const GLubyte mask[] )
{
const GLuint *depth = (const GLuint *) values;
#ifdef DEPTH_TRACE
fprintf(stderr, "FFBWriteDepthSpan: n(%d) x(%d) y(%d)\n",
(int) n, x, y);
@@ -81,10 +84,28 @@ FFBWriteDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
}
}
static void
FFBWriteDepthPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
const GLdepth depth[], const GLubyte mask[])
static void FFBWriteMonoDepthSpan( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
const void *value, const GLubyte mask[] )
{
const GLuint depthVal = *((GLuint *) value);
GLuint depths[MAX_WIDTH];
GLuint i;
for (i = 0; i < n; i++)
depths[i] = depthVal;
FFBWriteDepthSpan(ctx, rb, n, x, y, depths, mask);
}
static void FFBWriteDepthPixels( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n,
const GLint x[],
const GLint y[],
const void *values,
const GLubyte mask[] )
{
const GLuint *depth = (const GLuint *) values;
#ifdef DEPTH_TRACE
fprintf(stderr, "FFBWriteDepthPixels: n(%d)\n", (int) n);
#endif
@@ -126,9 +147,12 @@ FFBWriteDepthPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
}
}
static void
FFBReadDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, GLdepth depth[])
static void FFBReadDepthSpan( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
void *values )
{
GLuint *depth = (GLuint *) values;
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
GLuint *zptr;
@@ -163,10 +187,13 @@ FFBReadDepthSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, GLdepth depth[])
UNLOCK_HARDWARE(fmesa);
}
static void
FFBReadDepthPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
GLdepth depth[])
static void FFBReadDepthPixels( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n,
const GLint x[], const GLint y[],
void *values )
{
GLuint *depth = (GLuint *) values;
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
char *zbase;
@@ -202,13 +229,17 @@ FFBReadDepthPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
UNLOCK_HARDWARE(fmesa);
}
void ffbDDInitDepthFuncs(GLcontext *ctx)
/**
* Plug in the Get/Put routines for the given driRenderbuffer.
*/
void
ffbSetDepthFunctions(driRenderbuffer *drb, const GLvisual *vis)
{
struct swrast_device_driver *swdd =
_swrast_GetDeviceDriverReference(ctx);
swdd->WriteDepthSpan = FFBWriteDepthSpan;
swdd->ReadDepthSpan = FFBReadDepthSpan;
swdd->WriteDepthPixels = FFBWriteDepthPixels;
swdd->ReadDepthPixels = FFBReadDepthPixels;
assert(drb->Base.InternalFormat == GL_DEPTH_COMPONENT16);
drb->Base.GetRow = FFBReadDepthSpan;
drb->Base.GetValues = FFBReadDepthPixels;
drb->Base.PutRow = FFBWriteDepthSpan;
drb->Base.PutMonoRow = FFBWriteMonoDepthSpan;
drb->Base.PutValues = FFBWriteDepthPixels;
drb->Base.PutMonoValues = NULL;
}

View File

@@ -3,6 +3,6 @@
#ifndef _FFB_DEPTH_H
#define _FFB_DEPTH_H
extern void ffbDDInitDepthFuncs(GLcontext *ctx);
void ffbSetDepthFunctions(driRenderbuffer *drb, const GLvisual *vis);
#endif /* !(_FFB_DEPTH_H) */

View File

@@ -116,27 +116,20 @@ do { GLuint p = *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)); \
#include <spantmp.h>
void ffbDDInitSpanFuncs(GLcontext *ctx)
/**
* Plug in the Get/Put routines for the given driRenderbuffer.
*/
void
ffbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
{
struct swrast_device_driver *swdd =
_swrast_GetDeviceDriverReference(ctx);
swdd->WriteRGBASpan = ffbWriteRGBASpan_888;
swdd->WriteRGBSpan = ffbWriteRGBSpan_888;
swdd->WriteRGBAPixels = ffbWriteRGBAPixels_888;
swdd->WriteMonoRGBASpan = ffbWriteMonoRGBASpan_888;
swdd->WriteMonoRGBAPixels = ffbWriteMonoRGBAPixels_888;
swdd->ReadRGBASpan = ffbReadRGBASpan_888;
swdd->ReadRGBAPixels = ffbReadRGBAPixels_888;
/* We don't support color index mode yet, but it will be
* very easy to do. -DaveM
*/
swdd->WriteCI8Span = NULL;
swdd->WriteCI32Span = NULL;
swdd->WriteMonoCISpan = NULL;
swdd->WriteCI32Pixels = NULL;
swdd->WriteMonoCIPixels = NULL;
swdd->ReadCI32Span = NULL;
swdd->ReadCI32Pixels = NULL;
assert(vis->redBits == 8);
assert(vis->greenBits == 8);
assert(vis->blueBits == 8);
drb->Base.GetRow = ffbReadRGBASpan_888;
drb->Base.GetValues = ffbReadRGBAPixels_888;
drb->Base.PutRow = ffbWriteRGBASpan_888;
drb->Base.PutRowRGB = ffbWriteRGBSpan_888;
drb->Base.PutMonoRow = ffbWriteMonoRGBASpan_888;
drb->Base.PutValues = ffbWriteRGBAPixels_888;
drb->Base.PutMonoValues = ffbWriteMonoRGBAPixels_888;
}

View File

@@ -3,6 +3,8 @@
#ifndef _FFB_SPAN_H
#define _FFB_SPAN_H
extern void ffbDDInitSpanFuncs(GLcontext *ctx);
#include "drirenderbuffer.h"
void ffbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis);
#endif /* !(_FFB_SPAN_H) */

View File

@@ -592,6 +592,8 @@ static void ffbDDColorMask(GLcontext *ctx,
new_pmask |= 0x0000ff00;
if (b)
new_pmask |= 0x00ff0000;
if (a)
new_pmask |= 0xff000000;
if (fmesa->pmask != new_pmask) {
fmesa->pmask = new_pmask;

View File

@@ -36,10 +36,12 @@
#undef STENCIL_TRACE
static void
FFBWriteStencilSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLstencil stencil[], const GLubyte mask[])
static void FFBWriteStencilSpan( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
const void *values, const GLubyte mask[] )
{
const GLubyte *stencil = (const GLubyte *) values;
#ifdef STENCIL_TRACE
fprintf(stderr, "FFBWriteStencilSpan: n(%d) x(%d) y(%d)\n",
(int) n, x, y);
@@ -79,10 +81,13 @@ FFBWriteStencilSpan(GLcontext *ctx, GLuint n, GLint x, GLint y,
}
}
static void
FFBWriteStencilPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
const GLstencil stencil[], const GLubyte mask[])
static void FFBWriteStencilPixels( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n,
const GLint x[], const GLint y[],
const void *values, const GLubyte mask[] )
{
const GLubyte *stencil = (const GLubyte *) values;
#ifdef STENCIL_TRACE
fprintf(stderr, "FFBWriteStencilPixels: n(%d)\n", (int) n);
#endif
@@ -124,9 +129,12 @@ FFBWriteStencilPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[]
}
}
static void
FFBReadStencilSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, GLstencil stencil[])
static void FFBReadStencilSpan( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y,
void *values)
{
GLubyte *stencil = (GLubyte *) values;
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
GLuint *zptr;
@@ -161,10 +169,12 @@ FFBReadStencilSpan(GLcontext *ctx, GLuint n, GLint x, GLint y, GLstencil stencil
UNLOCK_HARDWARE(fmesa);
}
static void
FFBReadStencilPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
GLstencil stencil[])
static void FFBReadStencilPixels( GLcontext *ctx,
struct gl_renderbuffer *rb,
GLuint n, const GLint x[], const GLint y[],
void *values )
{
GLubyte *stencil = (GLubyte *) values;
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = fmesa->driDrawable;
char *zbase;
@@ -200,22 +210,17 @@ FFBReadStencilPixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[],
UNLOCK_HARDWARE(fmesa);
}
void ffbDDInitStencilFuncs(GLcontext *ctx)
/**
* Plug in the Get/Put routines for the given driRenderbuffer.
*/
void
ffbSetStencilFunctions(driRenderbuffer *drb, const GLvisual *vis)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
struct swrast_device_driver *swdd =
_swrast_GetDeviceDriverReference(ctx);
if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS) {
swdd->WriteStencilSpan = FFBWriteStencilSpan;
swdd->ReadStencilSpan = FFBReadStencilSpan;
swdd->WriteStencilPixels = FFBWriteStencilPixels;
swdd->ReadStencilPixels = FFBReadStencilPixels;
} else {
swdd->WriteStencilSpan = NULL;
swdd->ReadStencilSpan = NULL;
swdd->WriteStencilPixels = NULL;
swdd->ReadStencilPixels = NULL;
}
assert(drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT);
drb->Base.GetRow = FFBReadStencilSpan;
drb->Base.GetValues = FFBReadStencilPixels;
drb->Base.PutRow = FFBWriteStencilSpan;
/*drb->Base.PutMonoRow = FFBWriteMonoStencilSpan;*/
drb->Base.PutValues = FFBWriteStencilPixels;
drb->Base.PutMonoValues = NULL;
}

View File

@@ -3,6 +3,6 @@
#ifndef _FFB_STENCIL_H
#define _FFB_STENCIL_H
extern void ffbDDInitStencilFuncs(GLcontext *ctx);
void ffbSetStencilFunctions(driRenderbuffer *drb, const GLvisual *vis);
#endif /* !(_FFB_STENCIL_H) */

View File

@@ -146,28 +146,28 @@ static void choose_normals(void)
}
if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) {
ctx->Exec->Normal3f = norm_tab[index].normal3f_single;
ctx->Exec->Normal3fv = norm_tab[index].normal3fv_single;
SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_single);
SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_single);
} else {
ctx->Exec->Normal3f = norm_tab[index].normal3f_multi;
ctx->Exec->Normal3fv = norm_tab[index].normal3fv_multi;
SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_multi);
SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_multi);
}
} else {
ctx->Exec->Normal3f = _mesa_noop_Normal3f;
ctx->Exec->Normal3fv = _mesa_noop_Normal3fv;
SET_Normal3f(ctx->Exec, _mesa_noop_Normal3f);
SET_Normal3fv(ctx->Exec, _mesa_noop_Normal3fv);
}
}
static void ffb_choose_Normal3f(GLfloat x, GLfloat y, GLfloat z)
{
choose_normals();
GL_CALL(Normal3f)(x, y, z);
CALL_Normal3f(GET_DISPATCH(), (x, y, z));
}
static void ffb_choose_Normal3fv(const GLfloat *v)
{
choose_normals();
GL_CALL(Normal3fv)(v);
CALL_Normal3fv(GET_DISPATCH(), (v));
}
/* Vertex functions: */
@@ -267,13 +267,14 @@ static void ffb_do_fallback(GLcontext *ctx)
* correctly:
*/
if (fmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END )
GL_CALL(Begin)(fmesa->imm.prim);
CALL_Begin(GET_DISPATCH(), (fmesa->imm.prim));
if (ctx->Light.Enabled) {
GL_CALL(Color4fv)(ctx->Current.Color); /* Catch ColorMaterial */
GL_CALL(Normal3fv)(current->normal);
/* Catch ColorMaterial */
CALL_Color4fv(GET_DISPATCH(), (ctx->Current.Color));
CALL_Normal3fv(GET_DISPATCH(), (current->normal));
} else {
GL_CALL(Color4fv)(current->color);
CALL_Color4fv(GET_DISPATCH(), (current->color));
}
}

View File

@@ -27,9 +27,12 @@
#include "ffb_xmesa.h"
#include "context.h"
#include "framebuffer.h"
#include "matrix.h"
#include "renderbuffer.h"
#include "simple_list.h"
#include "imports.h"
#include "utils.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -276,9 +279,6 @@ ffbCreateContext(const __GLcontextModes *mesaVis,
ffbDDExtensionsInit(ctx);
ffbDDInitDriverFuncs(ctx);
ffbDDInitStateFuncs(ctx);
ffbDDInitSpanFuncs(ctx);
ffbDDInitDepthFuncs(ctx);
ffbDDInitStencilFuncs(ctx);
ffbDDInitRenderFuncs(ctx);
/*ffbDDInitTexFuncs(ctx); not needed */
ffbDDInitBitmapFuncs(ctx);
@@ -322,16 +322,63 @@ ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
{
/* Mesa checks for pitch > 0, but ffb doesn't use pitches */
int bogusPitch = 1;
int bpp = 4; /* we've always got a 32bpp framebuffer */
int offset = 0; /* always at 0 for offset */
if (isPixmap) {
return GL_FALSE; /* not implemented */
}
else {
} else {
GLboolean swStencil = (mesaVis->stencilBits > 0 &&
mesaVis->depthBits != 24);
#if 0
driDrawPriv->driverPrivate = (void *)
_mesa_create_framebuffer(mesaVis,
GL_FALSE, /* software depth buffer? */
_mesa_create_framebuffer(mesaVis,
GL_FALSE, /* software depth buffer? */
mesaVis->stencilBits > 0,
mesaVis->accumRedBits > 0,
mesaVis->alphaBits > 0);
#else
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
{
driRenderbuffer *frontRb
= driNewRenderbuffer(GL_RGBA, bpp, offset, bogusPitch);
ffbSetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
}
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
= driNewRenderbuffer(GL_RGBA, bpp, offset, bogusPitch);
ffbSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
}
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
= driNewRenderbuffer(GL_DEPTH_COMPONENT16, bpp, offset, bogusPitch);
ffbSetDepthFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
= driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, bpp, offset,bogusPitch);
ffbSetStencilFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}
_mesa_add_soft_renderbuffers(fb,
GL_FALSE, /* color */
GL_FALSE, /* depth */
swStencil,
mesaVis->accumRedBits > 0,
GL_FALSE, /* alpha */
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
#endif
return (driDrawPriv->driverPrivate != NULL);
}
}
@@ -488,7 +535,7 @@ ffbMakeCurrent(__DRIcontextPrivate *driContextPriv,
fmesa->driDrawable = driDrawPriv;
_mesa_make_current2(fmesa->glCtx,
_mesa_make_current(fmesa->glCtx,
(GLframebuffer *) driDrawPriv->driverPrivate,
(GLframebuffer *) driReadPriv->driverPrivate);
@@ -520,7 +567,7 @@ ffbMakeCurrent(__DRIcontextPrivate *driContextPriv,
1, 0, 0, 0, 0);
}
} else {
_mesa_make_current(NULL, NULL);
_mesa_make_current(NULL, NULL, NULL);
}
return GL_TRUE;
@@ -551,30 +598,172 @@ void ffbXMesaUpdateState(ffbContextPtr fmesa)
}
}
static struct __DriverAPIRec ffbAPI = {
ffbInitDriver,
ffbDestroyScreen,
ffbCreateContext,
ffbDestroyContext,
ffbCreateBuffer,
ffbDestroyBuffer,
ffbSwapBuffers,
ffbMakeCurrent,
ffbUnbindContext
static const struct __DriverAPIRec ffbAPI = {
.InitDriver = ffbInitDriver,
.DestroyScreen = ffbDestroyScreen,
.CreateContext = ffbCreateContext,
.DestroyContext = ffbDestroyContext,
.CreateBuffer = ffbCreateBuffer,
.DestroyBuffer = ffbDestroyBuffer,
.SwapBuffers = ffbSwapBuffers,
.MakeCurrent = ffbMakeCurrent,
.UnbindContext = ffbUnbindContext,
.GetSwapInfo = NULL,
.GetMSC = NULL,
.WaitForMSC = NULL,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &ffbAPI);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static __GLcontextModes *
ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
{
__GLcontextModes * modes;
__GLcontextModes * m;
unsigned num_modes;
unsigned depth_buffer_factor;
unsigned back_buffer_factor;
GLenum fb_format;
GLenum fb_type;
/* GLX_SWAP_COPY_OML is only supported because the FFB driver doesn't
* support pageflipping at all.
*/
static const GLenum back_buffer_modes[] = {
GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
};
u_int8_t depth_bits_array[3];
u_int8_t stencil_bits_array[3];
depth_bits_array[0] = 0;
depth_bits_array[1] = depth_bits;
depth_bits_array[2] = depth_bits;
/* Just like with the accumulation buffer, always provide some modes
* with a stencil buffer. It will be a sw fallback, but some apps won't
* care about that.
*/
stencil_bits_array[0] = 0;
stencil_bits_array[1] = 0;
stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
back_buffer_factor = (have_back_buffer) ? 3 : 1;
num_modes = depth_buffer_factor * back_buffer_factor * 4;
if ( pixel_bits == 16 ) {
fb_format = GL_RGB;
fb_type = GL_UNSIGNED_SHORT_5_6_5;
}
else {
fb_format = GL_BGRA;
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
back_buffer_modes, back_buffer_factor,
GLX_TRUE_COLOR ) ) {
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__ );
return NULL;
}
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
back_buffer_modes, back_buffer_factor,
GLX_DIRECT_COLOR ) ) {
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__ );
return NULL;
}
/* Mark the visual as slow if there are "fake" stencil bits.
*/
for ( m = modes ; m != NULL ; m = m->next ) {
if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) {
m->visualRating = GLX_SLOW_CONFIG;
}
}
return modes;
}
#endif /* USE_NEW_INTERFACE */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
* requisite information about the system, and the driver initializes itself.
* This routine also fills in the linked list pointed to by \c driver_modes
* with the \c __GLcontextModes that the driver can support for windows or
* pbuffers.
*
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIversion * drm_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
__GLcontextModes ** driver_modes )
{
__DRIscreenPrivate *psp;
static const __DRIversion ddx_expected = { 0, 0, 1 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 0, 0, 1 };
if ( ! driCheckDriDdxDrmVersions2( "ffb",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
drm_version, & drm_expected ) ) {
return NULL;
}
psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &ffbAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
*driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE );
}
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -58,6 +58,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "tnl/t_context.h"
#include "tnl/t_array_api.h"
#include "dispatch.h"
static void r200VtxFmtFlushVertices( GLcontext *, GLuint );
static void count_func( const char *name, struct dynfn *l )
@@ -411,13 +413,13 @@ static void dispatch_multitexcoord( GLuint count, GLuint unit, GLfloat * f )
{
switch( count ) {
case 3:
GL_CALL(MultiTexCoord3fvARB)( GL_TEXTURE0+unit, f );
CALL_MultiTexCoord3fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f));
break;
case 2:
GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE0+unit, f );
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f));
break;
case 1:
GL_CALL(MultiTexCoord1fvARB)( GL_TEXTURE0+unit, f );
CALL_MultiTexCoord1fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f));
break;
default:
assert( count == 0 );
@@ -465,7 +467,7 @@ void VFMT_FALLBACK( const char *caller )
assert(rmesa->dma.flush == 0);
rmesa->vb.fell_back = GL_TRUE;
rmesa->vb.installed = GL_FALSE;
GL_CALL(Begin)( prim );
CALL_Begin(GET_DISPATCH(), (prim));
if (rmesa->vb.installed_color_3f_sz == 4)
alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
@@ -476,30 +478,30 @@ void VFMT_FALLBACK( const char *caller )
GLuint offset = 3;
if (ind0 & R200_VTX_N0) {
GL_CALL(Normal3fv)( &tmp[i][offset] );
CALL_Normal3fv(GET_DISPATCH(), (&tmp[i][offset]));
offset += 3;
}
if (ind0 & R200_VTX_DISCRETE_FOG) {
GL_CALL(FogCoordfvEXT)( &tmp[i][offset] );
CALL_FogCoordfvEXT(GET_DISPATCH(), (&tmp[i][offset]));
offset++;
}
if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
GL_CALL(Color4ubv)( (GLubyte *)&tmp[i][offset] );
CALL_Color4ubv(GET_DISPATCH(), ((GLubyte *)&tmp[i][offset]));
offset++;
}
else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
GL_CALL(Color4fv)( &tmp[i][offset] );
CALL_Color4fv(GET_DISPATCH(), (&tmp[i][offset]));
offset+=4;
}
else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
GL_CALL(Color3fv)( &tmp[i][offset] );
CALL_Color3fv(GET_DISPATCH(), (&tmp[i][offset]));
offset+=3;
}
if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) {
GL_CALL(SecondaryColor3ubvEXT)( (GLubyte *)&tmp[i][offset] );
CALL_SecondaryColor3ubvEXT(GET_DISPATCH(), ((GLubyte *)&tmp[i][offset]));
offset++;
}
@@ -509,42 +511,42 @@ void VFMT_FALLBACK( const char *caller )
offset += count;
}
GL_CALL(Vertex3fv)( &tmp[i][0] );
CALL_Vertex3fv(GET_DISPATCH(), (&tmp[i][0]));
}
/* Replay current vertex
*/
if (ind0 & R200_VTX_N0)
GL_CALL(Normal3fv)( rmesa->vb.normalptr );
CALL_Normal3fv(GET_DISPATCH(), (rmesa->vb.normalptr));
if (ind0 & R200_VTX_DISCRETE_FOG) {
GL_CALL(FogCoordfvEXT)( rmesa->vb.fogptr );
CALL_FogCoordfvEXT(GET_DISPATCH(), (rmesa->vb.fogptr));
}
if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
GL_CALL(Color4ub)( rmesa->vb.colorptr->red,
rmesa->vb.colorptr->green,
rmesa->vb.colorptr->blue,
rmesa->vb.colorptr->alpha );
CALL_Color4ub(GET_DISPATCH(), (rmesa->vb.colorptr->red,
rmesa->vb.colorptr->green,
rmesa->vb.colorptr->blue,
rmesa->vb.colorptr->alpha));
}
else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
GL_CALL(Color4fv)( rmesa->vb.floatcolorptr );
CALL_Color4fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
}
else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0) {
GL_CALL(Color4f)( rmesa->vb.floatcolorptr[0],
rmesa->vb.floatcolorptr[1],
rmesa->vb.floatcolorptr[2],
alpha );
CALL_Color4f(GET_DISPATCH(), (rmesa->vb.floatcolorptr[0],
rmesa->vb.floatcolorptr[1],
rmesa->vb.floatcolorptr[2],
alpha));
}
else {
GL_CALL(Color3fv)( rmesa->vb.floatcolorptr );
CALL_Color3fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
}
}
if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA)
GL_CALL(SecondaryColor3ubEXT)( rmesa->vb.specptr->red,
rmesa->vb.specptr->green,
rmesa->vb.specptr->blue );
CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (rmesa->vb.specptr->red,
rmesa->vb.specptr->green,
rmesa->vb.specptr->blue));
for ( unit = 0 ; unit < ctx->Const.MaxTextureUnits ; unit++ ) {
count = VTX_TEXn_COUNT( ind1, unit );
@@ -882,7 +884,7 @@ static void r200_Materialfv( GLenum face, GLenum pname,
if (rmesa->vb.prim[0] != GL_POLYGON+1) {
VFMT_FALLBACK( __FUNCTION__ );
GL_CALL(Materialfv)( face, pname, params );
CALL_Materialfv(GET_DISPATCH(), (face, pname, params));
return;
}
_mesa_noop_Materialfv( face, pname, params );
@@ -921,7 +923,7 @@ static void r200_Begin( GLenum mode )
r200VtxfmtValidate( ctx );
if (!rmesa->vb.installed) {
GL_CALL(Begin)( mode );
CALL_Begin(GET_DISPATCH(), (mode));
return;
}

View File

@@ -44,6 +44,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r200_vtxfmt.h"
#include "r200_tcl.h"
#include "dispatch.h"
/* Fallback versions of all the entrypoints for situations where
* codegen isn't available. This is still a lot faster than the
* vb/pipeline implementation in Mesa.
@@ -578,7 +580,7 @@ static void r200_MultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
break;
default:
VFMT_FALLBACK(__FUNCTION__);
GL_CALL(MultiTexCoord2fARB)(target, s, t);
CALL_MultiTexCoord2fARB(GET_DISPATCH(), (target, s, t));
return;
}
}
@@ -599,7 +601,7 @@ static void r200_MultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat
break;
default:
VFMT_FALLBACK(__FUNCTION__);
GL_CALL(MultiTexCoord3fARB)(target, s, t, r);
CALL_MultiTexCoord3fARB(GET_DISPATCH(), (target, s, t, r));
return;
}
}
@@ -683,15 +685,15 @@ static void choose_##FN ARGS1 \
fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \
\
if (dfn) \
ctx->Exec->FN = (FNTYPE)(dfn->code); \
SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
else { \
if (R200_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
ctx->Exec->FN = r200_##FN; \
SET_ ## FN (ctx->Exec, r200_##FN); \
} \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
ctx->Exec->FN ARGS2; \
CALL_ ## FN (ctx->Exec, ARGS2); \
}
@@ -715,7 +717,7 @@ static void choose_##FN ARGS1 \
key[1] = rmesa->vb.vtxfmt_1 & MASK1; \
\
if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_PK_RGBA) { \
ctx->Exec->FN = r200_##FN##_ub; \
SET_ ## FN (ctx->Exec, r200_##FN##_ub); \
} \
else if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_FP_RGB) { \
\
@@ -725,15 +727,15 @@ static void choose_##FN ARGS1 \
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \
r200_copy_to_current( ctx ); \
_mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \
ctx->Exec->FN ARGS2; \
CALL_ ## FN (ctx->Exec, ARGS2); \
return; \
} \
} \
\
ctx->Exec->FN = r200_##FN##_3f; \
SET_ ## FN (ctx->Exec, r200_##FN##_3f); \
} \
else { \
ctx->Exec->FN = r200_##FN##_4f; \
SET_ ## FN (ctx->Exec, r200_##FN##_4f); \
} \
\
\
@@ -743,13 +745,13 @@ static void choose_##FN ARGS1 \
if (dfn) { \
if (R200_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \
ctx->Exec->FN = (FNTYPE)dfn->code; \
SET_ ## FN (ctx->Exec, (FNTYPE)dfn->code); \
} \
else if (R200_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
ctx->Exec->FN ARGS2; \
CALL_ ## FN (ctx->Exec, ARGS2); \
}
@@ -778,16 +780,16 @@ static void choose_##FN ARGS1 \
fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \
\
if (dfn) \
ctx->Exec->FN = (FNTYPE)(dfn->code); \
SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
else { \
if (R200_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
ctx->Exec->FN = (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \
? r200_##FN##_ub : r200_##FN##_3f; \
SET_ ## FN (ctx->Exec, (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \
? r200_##FN##_ub : r200_##FN##_3f); \
} \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
ctx->Exec->FN ARGS2; \
CALL_ ## FN (ctx->Exec, ARGS2); \
}

View File

@@ -57,6 +57,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_swtcl.h"
#include "radeon_vtxfmt.h"
#include "dispatch.h"
static void radeonVtxfmtFlushVertices( GLcontext *, GLuint );
static void count_func( const char *name, struct dynfn *l )
@@ -387,7 +389,7 @@ static void VFMT_FALLBACK( const char *caller )
assert(rmesa->dma.flush == 0);
rmesa->vb.fell_back = GL_TRUE;
rmesa->vb.installed = GL_FALSE;
GL_CALL(Begin)( prim );
CALL_Begin(GET_DISPATCH(), (prim));
if (rmesa->vb.installed_color_3f_sz == 4)
alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
@@ -397,69 +399,69 @@ static void VFMT_FALLBACK( const char *caller )
for (i = 0 ; i < nrverts; i++) {
GLuint offset = 3;
if (ind & RADEON_CP_VC_FRMT_N0) {
GL_CALL(Normal3fv)( &tmp[i][offset] );
CALL_Normal3fv(GET_DISPATCH(), (&tmp[i][offset]));
offset += 3;
}
if (ind & RADEON_CP_VC_FRMT_PKCOLOR) {
radeon_color_t *col = (radeon_color_t *)&tmp[i][offset];
GL_CALL(Color4ub)( col->red, col->green, col->blue, col->alpha );
CALL_Color4ub(GET_DISPATCH(), (col->red, col->green, col->blue, col->alpha));
offset++;
}
else if (ind & RADEON_CP_VC_FRMT_FPALPHA) {
GL_CALL(Color4fv)( &tmp[i][offset] );
CALL_Color4fv(GET_DISPATCH(), (&tmp[i][offset]));
offset+=4;
}
else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
GL_CALL(Color3fv)( &tmp[i][offset] );
CALL_Color3fv(GET_DISPATCH(), (&tmp[i][offset]));
offset+=3;
}
if (ind & RADEON_CP_VC_FRMT_PKSPEC) {
radeon_color_t *spec = (radeon_color_t *)&tmp[i][offset];
GL_CALL(SecondaryColor3ubEXT)( spec->red, spec->green, spec->blue );
CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (spec->red, spec->green, spec->blue));
offset++;
}
if (ind & RADEON_CP_VC_FRMT_ST0) {
GL_CALL(TexCoord2fv)( &tmp[i][offset] );
CALL_TexCoord2fv(GET_DISPATCH(), (&tmp[i][offset]));
offset += 2;
}
if (ind & RADEON_CP_VC_FRMT_ST1) {
GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE1_ARB, &tmp[i][offset] );
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE1_ARB, &tmp[i][offset]));
offset += 2;
}
GL_CALL(Vertex3fv)( &tmp[i][0] );
CALL_Vertex3fv(GET_DISPATCH(), (&tmp[i][0]));
}
/* Replay current vertex
*/
if (ind & RADEON_CP_VC_FRMT_N0)
GL_CALL(Normal3fv)( rmesa->vb.normalptr );
CALL_Normal3fv(GET_DISPATCH(), (rmesa->vb.normalptr));
if (ind & RADEON_CP_VC_FRMT_PKCOLOR)
GL_CALL(Color4ub)( rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha );
CALL_Color4ub(GET_DISPATCH(), (rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha));
else if (ind & RADEON_CP_VC_FRMT_FPALPHA)
GL_CALL(Color4fv)( rmesa->vb.floatcolorptr );
CALL_Color4fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0)
GL_CALL(Color4f)( rmesa->vb.floatcolorptr[0],
rmesa->vb.floatcolorptr[1],
rmesa->vb.floatcolorptr[2],
alpha );
CALL_Color4f(GET_DISPATCH(), (rmesa->vb.floatcolorptr[0],
rmesa->vb.floatcolorptr[1],
rmesa->vb.floatcolorptr[2],
alpha));
else
GL_CALL(Color3fv)( rmesa->vb.floatcolorptr );
CALL_Color3fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
}
if (ind & RADEON_CP_VC_FRMT_PKSPEC)
GL_CALL(SecondaryColor3ubEXT)( rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue );
CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue));
if (ind & RADEON_CP_VC_FRMT_ST0)
GL_CALL(TexCoord2fv)( rmesa->vb.texcoordptr[0] );
CALL_TexCoord2fv(GET_DISPATCH(), (rmesa->vb.texcoordptr[0]));
if (ind & RADEON_CP_VC_FRMT_ST1)
GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1] );
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1]));
}
@@ -758,7 +760,7 @@ static void radeon_Materialfv( GLenum face, GLenum pname,
if (rmesa->vb.prim[0] != GL_POLYGON+1) {
VFMT_FALLBACK( __FUNCTION__ );
GL_CALL(Materialfv)( face, pname, params );
CALL_Materialfv(GET_DISPATCH(), (face, pname, params));
return;
}
_mesa_noop_Materialfv( face, pname, params );
@@ -797,7 +799,7 @@ static void radeon_Begin( GLenum mode )
radeonVtxfmtValidate( ctx );
if (!rmesa->vb.installed) {
GL_CALL(Begin)( mode );
CALL_Begin(GET_DISPATCH(), (mode));
return;
}

View File

@@ -41,6 +41,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_vtxfmt.h"
#include "dispatch.h"
/* Fallback versions of all the entrypoints for situations where
* codegen isn't available. This is still a lot faster than the
* vb/pipeline implementation in Mesa.
@@ -623,15 +625,15 @@ static void choose_##FN ARGS1 \
fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \
\
if (dfn) \
ctx->Exec->FN = (FNTYPE)(dfn->code); \
SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
else { \
if (RADEON_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
ctx->Exec->FN = radeon_##FN; \
SET_ ## FN (ctx->Exec, radeon_##FN); \
} \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
ctx->Exec->FN ARGS2; \
CALL_ ## FN (ctx->Exec, ARGS2); \
}
@@ -652,7 +654,7 @@ static void choose_##FN ARGS1 \
struct dynfn *dfn; \
\
if (rmesa->vb.vertex_format & ACTIVE_PKCOLOR) { \
ctx->Exec->FN = radeon_##FN##_ub; \
SET_ ## FN (ctx->Exec, radeon_##FN##_ub); \
} \
else if ((rmesa->vb.vertex_format & \
(ACTIVE_FPCOLOR|ACTIVE_FPALPHA)) == ACTIVE_FPCOLOR) { \
@@ -663,15 +665,15 @@ static void choose_##FN ARGS1 \
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \
radeon_copy_to_current( ctx ); \
_mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \
ctx->Exec->FN ARGS2; \
CALL_ ## FN (ctx->Exec, ARGS2); \
return; \
} \
} \
\
ctx->Exec->FN = radeon_##FN##_3f; \
SET_ ## FN (ctx->Exec, radeon_##FN##_3f); \
} \
else { \
ctx->Exec->FN = radeon_##FN##_4f; \
SET_ ## FN (ctx->Exec, radeon_##FN##_4f); \
} \
\
\
@@ -681,13 +683,13 @@ static void choose_##FN ARGS1 \
if (dfn) { \
if (RADEON_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \
ctx->Exec->FN = (FNTYPE)dfn->code; \
SET_ ## FN (ctx->Exec, (FNTYPE)dfn->code); \
} \
else if (RADEON_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
ctx->Exec->FN ARGS2; \
CALL_ ## FN (ctx->Exec, ARGS2); \
}
@@ -712,16 +714,16 @@ static void choose_##FN ARGS1 \
fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \
\
if (dfn) \
ctx->Exec->FN = (FNTYPE)(dfn->code); \
SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
else { \
if (RADEON_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
ctx->Exec->FN = ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \
? radeon_##FN##_ub : radeon_##FN##_3f; \
SET_ ## FN (ctx->Exec, ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \
? radeon_##FN##_ub : radeon_##FN##_3f); \
} \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
ctx->Exec->FN ARGS2; \
CALL_ ## FN (ctx->Exec, ARGS2); \
}

View File

@@ -31,14 +31,8 @@
#include <GL/vms_x_fix.h>
#endif
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#include "glheader.h"
#ifdef XFree86Server
# include "resource.h"

View File

@@ -2633,6 +2633,10 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
*/
void XMesaResizeBuffers( XMesaBuffer b )
{
#ifdef XFree86Server
GET_CURRENT_CONTEXT(ctx);
xmesa_resize_buffers(ctx, &(b->mesa_buffer), 0, 0);
#else
Window root;
int xpos, ypos;
unsigned int width, height, bw, depth;
@@ -2640,5 +2644,6 @@ void XMesaResizeBuffers( XMesaBuffer b )
XGetGeometry( b->xm_visual->display, b->frontxrb->pixmap,
&root, &xpos, &ypos, &width, &height, &bw, &depth);
xmesa_resize_buffers(ctx, &(b->mesa_buffer), width, height);
#endif
}

View File

@@ -7,7 +7,7 @@
TOP = ../../..
include $(TOP)/configs/current
OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h \
OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \
../main/enums.c \
../x86/glapi_x86.S \
../drivers/dri/common/extension_helper.h \
@@ -34,6 +34,9 @@ glapioffsets.h: $(COMMON) gl_offsets.py
glapitable.h: $(COMMON) gl_table.py
$(PYTHON2) $(PYTHON_FLAGS) gl_table.py > glapitable.h
dispatch.h: $(COMMON) gl_table.py
$(PYTHON2) $(PYTHON_FLAGS) gl_table.py -m remap_table > dispatch.h
../main/enums.c: $(COMMON) gl_enums.py
$(PYTHON2) $(PYTHON_FLAGS) gl_enums.py > ../main/enums.c

2498
src/mesa/glapi/dispatch.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -62,23 +62,110 @@ class PrintGlTable(gl_XML.gl_print_base):
return
class PrintRemapTable(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.header_tag = '_DISPATCH_H_'
self.name = "gl_table.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
return
def printRealHeader(self):
print """/**
* \\file dispatch.h
* Macros for handling GL dispatch tables.
*
* For each known GL function, there are 3 macros in this file. The first
* macro is named CALL_FuncName and is used to call that GL function using
* the specified dispatch table. The other 2 macros, called GET_FuncName
* can SET_FuncName, are used to get and set the dispatch pointer for the
* named function in the specified dispatch table.
*/
"""
return
def printBody(self, api):
print '#define CALL_by_offset(disp, cast, offset, parameters) \\'
print ' (*(cast (((_glapi_proc *)(disp))[offset]))) parameters'
print '#define GET_by_offset(disp, offset) \\'
print ' (((_glapi_proc *)(disp))[offset])'
print '#define SET_by_offset(disp, offset, fn) \\'
print ' ((((_glapi_proc *)(disp))[offset]) = fn)'
print ''
for f in api.functionIterateByOffset():
print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name)
print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name)
print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name)
return
abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
functions = []
abi_functions = []
count = 0
for f in api.functionIterateByOffset():
[category, num] = api.get_category_for_name( f.name )
if category not in abi:
functions.append( [f, count] )
count += 1
else:
abi_functions.append( f )
print 'struct _mesa_dispatch_remap_table {'
for [f, index] in functions:
print ' unsigned %s;' % (f.name)
print '};'
print ''
print '/* %u functions need remapping. */' % (count)
print ''
for f in abi_functions:
print '#define CALL_%s(disp, parameters) (*disp->%s) parameters' % (f.name, f.name)
for [f, index] in functions:
arg_string = gl_XML.create_parameter_string( f.parameters, 0 )
cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string)
print '#define CALL_%s(disp, parameters) (* (%s) (((_glapi_proc *)disp)[dispatch_remap.%s])) parameters' % (f.name, cast, f.name)
return
def show_usage():
print "Usage: %s [-f input_file_name]" % sys.argv[0]
print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0]
print " -m mode Mode can be 'table' or 'remap_table'."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
except Exception,e:
show_usage()
mode = "table"
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-m":
mode = val
if mode == "table":
printer = PrintGlTable()
elif mode == "remap_table":
printer = PrintRemapTable()
else:
show_usage()
api = gl_XML.parse_GL_API( file_name )
printer = PrintGlTable()
printer.Print( api )

View File

@@ -119,9 +119,9 @@ typedef pthread_mutex_t _glthread_Mutex;
extern struct _glapi_table * _glapi_DispatchTSD;
extern _glthread_TSD _gl_DispatchTSD;
#define GL_CALL(name) \
(((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \
? _glapi_DispatchTSD : (struct _glapi_table *) pthread_getspecific(_gl_DispatchTSD.key))-> name)
#define GET_DISPATCH() \
((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \
? _glapi_DispatchTSD : (struct _glapi_table *) pthread_getspecific(_gl_DispatchTSD.key))
#endif
#endif /* PTHREADS */
@@ -312,16 +312,16 @@ _glthread_SetTSD(_glthread_TSD *, void *);
extern __thread struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")));
# define GL_CALL(name) (*(_glapi_tls_Dispatch-> name))
#define GET_DISPATCH() _glapi_tls_Dispatch
#elif !defined(GL_CALL)
# if defined(THREADS)
extern struct _glapi_table * _glapi_DispatchTSD;
# define GL_CALL(name) \
(((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \
? _glapi_DispatchTSD : _glapi_get_dispatch())-> name)
# define GET_DISPATCH() \
((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \
? _glapi_DispatchTSD : _glapi_get_dispatch())
# else
# define GL_CALL(name) (*(_glapi_Dispatch-> name))
# define GET_DISPATCH() _glapi_Dispatch
# endif /* defined(THREADS) */
#endif /* ndef GL_CALL */

View File

@@ -33,12 +33,14 @@
#include "imports.h"
#include "macros.h"
#include "mtypes.h"
#include "glapioffsets.h"
#include "dispatch.h"
typedef void (GLAPIENTRY *array_func)( const void * );
typedef struct {
const struct gl_client_array *array;
array_func func;
int offset;
} AEarray;
typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data );
@@ -57,6 +59,7 @@ typedef struct {
#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context)
/*
* Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer
* in the range [0, 7]. Luckily these type tokens are sequentially
@@ -64,347 +67,104 @@ typedef struct {
*/
#define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 )
static void GLAPIENTRY Color3bv(const GLbyte *v)
{
GL_CALL(Color3bv)(v);
}
static void GLAPIENTRY Color3ubv(const GLubyte *v)
{
GL_CALL(Color3ubv)(v);
}
static void GLAPIENTRY Color3sv(const GLshort *v)
{
GL_CALL(Color3sv)(v);
}
static void GLAPIENTRY Color3usv(const GLushort *v)
{
GL_CALL(Color3usv)(v);
}
static void GLAPIENTRY Color3iv(const GLint *v)
{
GL_CALL(Color3iv)(v);
}
static void GLAPIENTRY Color3uiv(const GLuint *v)
{
GL_CALL(Color3uiv)(v);
}
static void GLAPIENTRY Color3fv(const GLfloat *v)
{
GL_CALL(Color3fv)(v);
}
static void GLAPIENTRY Color3dv(const GLdouble *v)
{
GL_CALL(Color3dv)(v);
}
static void GLAPIENTRY Color4bv(const GLbyte *v)
{
GL_CALL(Color4bv)(v);
}
static void GLAPIENTRY Color4ubv(const GLubyte *v)
{
GL_CALL(Color4ubv)(v);
}
static void GLAPIENTRY Color4sv(const GLshort *v)
{
GL_CALL(Color4sv)(v);
}
static void GLAPIENTRY Color4usv(const GLushort *v)
{
GL_CALL(Color4usv)(v);
}
static void GLAPIENTRY Color4iv(const GLint *v)
{
GL_CALL(Color4iv)(v);
}
static void GLAPIENTRY Color4uiv(const GLuint *v)
{
GL_CALL(Color4uiv)(v);
}
static void GLAPIENTRY Color4fv(const GLfloat *v)
{
GL_CALL(Color4fv)(v);
}
static void GLAPIENTRY Color4dv(const GLdouble *v)
{
GL_CALL(Color4dv)(v);
}
static const array_func ColorFuncs[2][8] = {
static const int ColorFuncs[2][8] = {
{
(array_func) Color3bv,
(array_func) Color3ubv,
(array_func) Color3sv,
(array_func) Color3usv,
(array_func) Color3iv,
(array_func) Color3uiv,
(array_func) Color3fv,
(array_func) Color3dv,
_gloffset_Color3bv,
_gloffset_Color3ubv,
_gloffset_Color3sv,
_gloffset_Color3usv,
_gloffset_Color3iv,
_gloffset_Color3uiv,
_gloffset_Color3fv,
_gloffset_Color3dv,
},
{
(array_func) Color4bv,
(array_func) Color4ubv,
(array_func) Color4sv,
(array_func) Color4usv,
(array_func) Color4iv,
(array_func) Color4uiv,
(array_func) Color4fv,
(array_func) Color4dv,
_gloffset_Color4bv,
_gloffset_Color4ubv,
_gloffset_Color4sv,
_gloffset_Color4usv,
_gloffset_Color4iv,
_gloffset_Color4uiv,
_gloffset_Color4fv,
_gloffset_Color4dv,
},
};
static void GLAPIENTRY Vertex2sv(const GLshort *v)
{
GL_CALL(Vertex2sv)(v);
}
static void GLAPIENTRY Vertex2iv(const GLint *v)
{
GL_CALL(Vertex2iv)(v);
}
static void GLAPIENTRY Vertex2fv(const GLfloat *v)
{
GL_CALL(Vertex2fv)(v);
}
static void GLAPIENTRY Vertex2dv(const GLdouble *v)
{
GL_CALL(Vertex2dv)(v);
}
static void GLAPIENTRY Vertex3sv(const GLshort *v)
{
GL_CALL(Vertex3sv)(v);
}
static void GLAPIENTRY Vertex3iv(const GLint *v)
{
GL_CALL(Vertex3iv)(v);
}
static void GLAPIENTRY Vertex3fv(const GLfloat *v)
{
GL_CALL(Vertex3fv)(v);
}
static void GLAPIENTRY Vertex3dv(const GLdouble *v)
{
GL_CALL(Vertex3dv)(v);
}
static void GLAPIENTRY Vertex4sv(const GLshort *v)
{
GL_CALL(Vertex4sv)(v);
}
static void GLAPIENTRY Vertex4iv(const GLint *v)
{
GL_CALL(Vertex4iv)(v);
}
static void GLAPIENTRY Vertex4fv(const GLfloat *v)
{
GL_CALL(Vertex4fv)(v);
}
static void GLAPIENTRY Vertex4dv(const GLdouble *v)
{
GL_CALL(Vertex4dv)(v);
}
static const array_func VertexFuncs[3][8] = {
static const int VertexFuncs[3][8] = {
{
NULL,
NULL,
(array_func) Vertex2sv,
NULL,
(array_func) Vertex2iv,
NULL,
(array_func) Vertex2fv,
(array_func) Vertex2dv,
-1,
-1,
_gloffset_Vertex2sv,
-1,
_gloffset_Vertex2iv,
-1,
_gloffset_Vertex2fv,
_gloffset_Vertex2dv,
},
{
NULL,
NULL,
(array_func) Vertex3sv,
NULL,
(array_func) Vertex3iv,
NULL,
(array_func) Vertex3fv,
(array_func) Vertex3dv,
-1,
-1,
_gloffset_Vertex3sv,
-1,
_gloffset_Vertex3iv,
-1,
_gloffset_Vertex3fv,
_gloffset_Vertex3dv,
},
{
NULL,
NULL,
(array_func) Vertex4sv,
NULL,
(array_func) Vertex4iv,
NULL,
(array_func) Vertex4fv,
(array_func) Vertex4dv,
-1,
-1,
_gloffset_Vertex4sv,
-1,
_gloffset_Vertex4iv,
-1,
_gloffset_Vertex4fv,
_gloffset_Vertex4dv,
},
};
static void GLAPIENTRY Indexubv(const GLubyte *c)
{
GL_CALL(Indexubv)(c);
}
static void GLAPIENTRY Indexsv(const GLshort *c)
{
GL_CALL(Indexsv)(c);
}
static void GLAPIENTRY Indexiv(const GLint *c)
{
GL_CALL(Indexiv)(c);
}
static void GLAPIENTRY Indexfv(const GLfloat *c)
{
GL_CALL(Indexfv)(c);
}
static void GLAPIENTRY Indexdv(const GLdouble *c)
{
GL_CALL(Indexdv)(c);
}
static const array_func IndexFuncs[8] = {
NULL,
(array_func) Indexubv,
(array_func) Indexsv,
NULL,
(array_func) Indexiv,
NULL,
(array_func) Indexfv,
(array_func) Indexdv,
static const int IndexFuncs[8] = {
-1,
_gloffset_Indexubv,
_gloffset_Indexsv,
-1,
_gloffset_Indexiv,
-1,
_gloffset_Indexfv,
_gloffset_Indexdv,
};
static void GLAPIENTRY Normal3bv(const GLbyte *v)
{
GL_CALL(Normal3bv)(v);
}
static void GLAPIENTRY Normal3sv(const GLshort *v)
{
GL_CALL(Normal3sv)(v);
}
static void GLAPIENTRY Normal3iv(const GLint *v)
{
GL_CALL(Normal3iv)(v);
}
static void GLAPIENTRY Normal3fv(const GLfloat *v)
{
GL_CALL(Normal3fv)(v);
}
static void GLAPIENTRY Normal3dv(const GLdouble *v)
{
GL_CALL(Normal3dv)(v);
}
static const array_func NormalFuncs[8] = {
(array_func) Normal3bv,
NULL,
(array_func) Normal3sv,
NULL,
(array_func) Normal3iv,
NULL,
(array_func) Normal3fv,
(array_func) Normal3dv,
static const int NormalFuncs[8] = {
_gloffset_Normal3bv,
-1,
_gloffset_Normal3sv,
-1,
_gloffset_Normal3iv,
-1,
_gloffset_Normal3fv,
_gloffset_Normal3dv,
};
/* Wrapper functions in case glSecondaryColor*EXT doesn't exist */
static void GLAPIENTRY SecondaryColor3bvEXT(const GLbyte *c)
{
GL_CALL(SecondaryColor3bvEXT)(c);
}
static void GLAPIENTRY SecondaryColor3ubvEXT(const GLubyte *c)
{
GL_CALL(SecondaryColor3ubvEXT)(c);
}
static void GLAPIENTRY SecondaryColor3svEXT(const GLshort *c)
{
GL_CALL(SecondaryColor3svEXT)(c);
}
static void GLAPIENTRY SecondaryColor3usvEXT(const GLushort *c)
{
GL_CALL(SecondaryColor3usvEXT)(c);
}
static void GLAPIENTRY SecondaryColor3ivEXT(const GLint *c)
{
GL_CALL(SecondaryColor3ivEXT)(c);
}
static void GLAPIENTRY SecondaryColor3uivEXT(const GLuint *c)
{
GL_CALL(SecondaryColor3uivEXT)(c);
}
static void GLAPIENTRY SecondaryColor3fvEXT(const GLfloat *c)
{
GL_CALL(SecondaryColor3fvEXT)(c);
}
static void GLAPIENTRY SecondaryColor3dvEXT(const GLdouble *c)
{
GL_CALL(SecondaryColor3dvEXT)(c);
}
static const array_func SecondaryColorFuncs[8] = {
(array_func) SecondaryColor3bvEXT,
(array_func) SecondaryColor3ubvEXT,
(array_func) SecondaryColor3svEXT,
(array_func) SecondaryColor3usvEXT,
(array_func) SecondaryColor3ivEXT,
(array_func) SecondaryColor3uivEXT,
(array_func) SecondaryColor3fvEXT,
(array_func) SecondaryColor3dvEXT,
static const int SecondaryColorFuncs[8] = {
_gloffset_SecondaryColor3bvEXT,
_gloffset_SecondaryColor3ubvEXT,
_gloffset_SecondaryColor3svEXT,
_gloffset_SecondaryColor3usvEXT,
_gloffset_SecondaryColor3ivEXT,
_gloffset_SecondaryColor3uivEXT,
_gloffset_SecondaryColor3fvEXT,
_gloffset_SecondaryColor3dvEXT,
};
/* Again, wrapper functions in case glSecondaryColor*EXT doesn't exist */
static void GLAPIENTRY FogCoordfvEXT(const GLfloat *f)
{
GL_CALL(FogCoordfvEXT)(f);
}
static void GLAPIENTRY FogCoorddvEXT(const GLdouble *f)
{
GL_CALL(FogCoorddvEXT)(f);
}
static const array_func FogCoordFuncs[8] = {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
(array_func) FogCoordfvEXT,
(array_func) FogCoorddvEXT
static const int FogCoordFuncs[8] = {
-1,
-1,
-1,
-1,
-1,
-1,
_gloffset_FogCoordfvEXT,
_gloffset_FogCoorddvEXT
};
/**********************************************************************/
@@ -413,330 +173,330 @@ static const array_func FogCoordFuncs[8] = {
static void GLAPIENTRY VertexAttrib1NbvNV(GLuint index, const GLbyte *v)
{
GL_CALL(VertexAttrib1fNV)(index, BYTE_TO_FLOAT(v[0]));
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0])));
}
static void GLAPIENTRY VertexAttrib1bvNV(GLuint index, const GLbyte *v)
{
GL_CALL(VertexAttrib1fNV)(index, v[0]);
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0]));
}
static void GLAPIENTRY VertexAttrib2NbvNV(GLuint index, const GLbyte *v)
{
GL_CALL(VertexAttrib2fNV)(index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]));
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])));
}
static void GLAPIENTRY VertexAttrib2bvNV(GLuint index, const GLbyte *v)
{
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1]));
}
static void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v)
{
GL_CALL(VertexAttrib3fNV)(index, BYTE_TO_FLOAT(v[0]),
BYTE_TO_FLOAT(v[1]),
BYTE_TO_FLOAT(v[2]));
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
BYTE_TO_FLOAT(v[1]),
BYTE_TO_FLOAT(v[2])));
}
static void GLAPIENTRY VertexAttrib3bvNV(GLuint index, const GLbyte *v)
{
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
static void GLAPIENTRY VertexAttrib4NbvNV(GLuint index, const GLbyte *v)
{
GL_CALL(VertexAttrib4fNV)(index, BYTE_TO_FLOAT(v[0]),
BYTE_TO_FLOAT(v[1]),
BYTE_TO_FLOAT(v[2]),
BYTE_TO_FLOAT(v[3]));
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
BYTE_TO_FLOAT(v[1]),
BYTE_TO_FLOAT(v[2]),
BYTE_TO_FLOAT(v[3])));
}
static void GLAPIENTRY VertexAttrib4bvNV(GLuint index, const GLbyte *v)
{
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
}
/* GL_UNSIGNED_BYTE attributes */
static void GLAPIENTRY VertexAttrib1NubvNV(GLuint index, const GLubyte *v)
{
GL_CALL(VertexAttrib1fNV)(index, UBYTE_TO_FLOAT(v[0]));
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0])));
}
static void GLAPIENTRY VertexAttrib1ubvNV(GLuint index, const GLubyte *v)
{
GL_CALL(VertexAttrib1fNV)(index, v[0]);
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0]));
}
static void GLAPIENTRY VertexAttrib2NubvNV(GLuint index, const GLubyte *v)
{
GL_CALL(VertexAttrib2fNV)(index, UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1]));
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1])));
}
static void GLAPIENTRY VertexAttrib2ubvNV(GLuint index, const GLubyte *v)
{
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1]));
}
static void GLAPIENTRY VertexAttrib3NubvNV(GLuint index, const GLubyte *v)
{
GL_CALL(VertexAttrib3fNV)(index, UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1]),
UBYTE_TO_FLOAT(v[2]));
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1]),
UBYTE_TO_FLOAT(v[2])));
}
static void GLAPIENTRY VertexAttrib3ubvNV(GLuint index, const GLubyte *v)
{
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
static void GLAPIENTRY VertexAttrib4NubvNV(GLuint index, const GLubyte *v)
{
GL_CALL(VertexAttrib4fNV)(index, UBYTE_TO_FLOAT(v[0]),
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
UBYTE_TO_FLOAT(v[1]),
UBYTE_TO_FLOAT(v[2]),
UBYTE_TO_FLOAT(v[3]));
UBYTE_TO_FLOAT(v[3])));
}
static void GLAPIENTRY VertexAttrib4ubvNV(GLuint index, const GLubyte *v)
{
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
}
/* GL_SHORT attributes */
static void GLAPIENTRY VertexAttrib1NsvNV(GLuint index, const GLshort *v)
{
GL_CALL(VertexAttrib1fNV)(index, SHORT_TO_FLOAT(v[0]));
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0])));
}
static void GLAPIENTRY VertexAttrib1svNV(GLuint index, const GLshort *v)
{
GL_CALL(VertexAttrib1fNV)(index, v[0]);
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0]));
}
static void GLAPIENTRY VertexAttrib2NsvNV(GLuint index, const GLshort *v)
{
GL_CALL(VertexAttrib2fNV)(index, SHORT_TO_FLOAT(v[0]),
SHORT_TO_FLOAT(v[1]));
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
SHORT_TO_FLOAT(v[1])));
}
static void GLAPIENTRY VertexAttrib2svNV(GLuint index, const GLshort *v)
{
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1]));
}
static void GLAPIENTRY VertexAttrib3NsvNV(GLuint index, const GLshort *v)
{
GL_CALL(VertexAttrib3fNV)(index, SHORT_TO_FLOAT(v[0]),
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
SHORT_TO_FLOAT(v[1]),
SHORT_TO_FLOAT(v[2]));
SHORT_TO_FLOAT(v[2])));
}
static void GLAPIENTRY VertexAttrib3svNV(GLuint index, const GLshort *v)
{
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
static void GLAPIENTRY VertexAttrib4NsvNV(GLuint index, const GLshort *v)
{
GL_CALL(VertexAttrib4fNV)(index, SHORT_TO_FLOAT(v[0]),
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
SHORT_TO_FLOAT(v[1]),
SHORT_TO_FLOAT(v[2]),
SHORT_TO_FLOAT(v[3]));
SHORT_TO_FLOAT(v[3])));
}
static void GLAPIENTRY VertexAttrib4svNV(GLuint index, const GLshort *v)
{
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
}
/* GL_UNSIGNED_SHORT attributes */
static void GLAPIENTRY VertexAttrib1NusvNV(GLuint index, const GLushort *v)
{
GL_CALL(VertexAttrib1fNV)(index, USHORT_TO_FLOAT(v[0]));
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0])));
}
static void GLAPIENTRY VertexAttrib1usvNV(GLuint index, const GLushort *v)
{
GL_CALL(VertexAttrib1fNV)(index, v[0]);
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0]));
}
static void GLAPIENTRY VertexAttrib2NusvNV(GLuint index, const GLushort *v)
{
GL_CALL(VertexAttrib2fNV)(index, USHORT_TO_FLOAT(v[0]),
USHORT_TO_FLOAT(v[1]));
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
USHORT_TO_FLOAT(v[1])));
}
static void GLAPIENTRY VertexAttrib2usvNV(GLuint index, const GLushort *v)
{
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1]));
}
static void GLAPIENTRY VertexAttrib3NusvNV(GLuint index, const GLushort *v)
{
GL_CALL(VertexAttrib3fNV)(index, USHORT_TO_FLOAT(v[0]),
USHORT_TO_FLOAT(v[1]),
USHORT_TO_FLOAT(v[2]));
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
USHORT_TO_FLOAT(v[1]),
USHORT_TO_FLOAT(v[2])));
}
static void GLAPIENTRY VertexAttrib3usvNV(GLuint index, const GLushort *v)
{
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
static void GLAPIENTRY VertexAttrib4NusvNV(GLuint index, const GLushort *v)
{
GL_CALL(VertexAttrib4fNV)(index, USHORT_TO_FLOAT(v[0]),
USHORT_TO_FLOAT(v[1]),
USHORT_TO_FLOAT(v[2]),
USHORT_TO_FLOAT(v[3]));
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
USHORT_TO_FLOAT(v[1]),
USHORT_TO_FLOAT(v[2]),
USHORT_TO_FLOAT(v[3])));
}
static void GLAPIENTRY VertexAttrib4usvNV(GLuint index, const GLushort *v)
{
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
}
/* GL_INT attributes */
static void GLAPIENTRY VertexAttrib1NivNV(GLuint index, const GLint *v)
{
GL_CALL(VertexAttrib1fNV)(index, INT_TO_FLOAT(v[0]));
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0])));
}
static void GLAPIENTRY VertexAttrib1ivNV(GLuint index, const GLint *v)
{
GL_CALL(VertexAttrib1fNV)(index, v[0]);
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0]));
}
static void GLAPIENTRY VertexAttrib2NivNV(GLuint index, const GLint *v)
{
GL_CALL(VertexAttrib2fNV)(index, INT_TO_FLOAT(v[0]),
INT_TO_FLOAT(v[1]));
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
INT_TO_FLOAT(v[1])));
}
static void GLAPIENTRY VertexAttrib2ivNV(GLuint index, const GLint *v)
{
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1]));
}
static void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v)
{
GL_CALL(VertexAttrib3fNV)(index, INT_TO_FLOAT(v[0]),
INT_TO_FLOAT(v[1]),
INT_TO_FLOAT(v[2]));
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
INT_TO_FLOAT(v[1]),
INT_TO_FLOAT(v[2])));
}
static void GLAPIENTRY VertexAttrib3ivNV(GLuint index, const GLint *v)
{
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
static void GLAPIENTRY VertexAttrib4NivNV(GLuint index, const GLint *v)
{
GL_CALL(VertexAttrib4fNV)(index, INT_TO_FLOAT(v[0]),
INT_TO_FLOAT(v[1]),
INT_TO_FLOAT(v[2]),
INT_TO_FLOAT(v[3]));
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
INT_TO_FLOAT(v[1]),
INT_TO_FLOAT(v[2]),
INT_TO_FLOAT(v[3])));
}
static void GLAPIENTRY VertexAttrib4ivNV(GLuint index, const GLint *v)
{
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
}
/* GL_UNSIGNED_INT attributes */
static void GLAPIENTRY VertexAttrib1NuivNV(GLuint index, const GLuint *v)
{
GL_CALL(VertexAttrib1fNV)(index, UINT_TO_FLOAT(v[0]));
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0])));
}
static void GLAPIENTRY VertexAttrib1uivNV(GLuint index, const GLuint *v)
{
GL_CALL(VertexAttrib1fNV)(index, v[0]);
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0]));
}
static void GLAPIENTRY VertexAttrib2NuivNV(GLuint index, const GLuint *v)
{
GL_CALL(VertexAttrib2fNV)(index, UINT_TO_FLOAT(v[0]),
UINT_TO_FLOAT(v[1]));
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
UINT_TO_FLOAT(v[1])));
}
static void GLAPIENTRY VertexAttrib2uivNV(GLuint index, const GLuint *v)
{
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1]));
}
static void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v)
{
GL_CALL(VertexAttrib3fNV)(index, UINT_TO_FLOAT(v[0]),
UINT_TO_FLOAT(v[1]),
UINT_TO_FLOAT(v[2]));
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
UINT_TO_FLOAT(v[1]),
UINT_TO_FLOAT(v[2])));
}
static void GLAPIENTRY VertexAttrib3uivNV(GLuint index, const GLuint *v)
{
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
static void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v)
{
GL_CALL(VertexAttrib4fNV)(index, UINT_TO_FLOAT(v[0]),
UINT_TO_FLOAT(v[1]),
UINT_TO_FLOAT(v[2]),
UINT_TO_FLOAT(v[3]));
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
UINT_TO_FLOAT(v[1]),
UINT_TO_FLOAT(v[2]),
UINT_TO_FLOAT(v[3])));
}
static void GLAPIENTRY VertexAttrib4uivNV(GLuint index, const GLuint *v)
{
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
}
/* GL_FLOAT attributes */
static void GLAPIENTRY VertexAttrib1fvNV(GLuint index, const GLfloat *v)
{
GL_CALL(VertexAttrib1fvNV)(index, v);
CALL_VertexAttrib1fvNV(GET_DISPATCH(), (index, v));
}
static void GLAPIENTRY VertexAttrib2fvNV(GLuint index, const GLfloat *v)
{
GL_CALL(VertexAttrib2fvNV)(index, v);
CALL_VertexAttrib2fvNV(GET_DISPATCH(), (index, v));
}
static void GLAPIENTRY VertexAttrib3fvNV(GLuint index, const GLfloat *v)
{
GL_CALL(VertexAttrib3fvNV)(index, v);
CALL_VertexAttrib3fvNV(GET_DISPATCH(), (index, v));
}
static void GLAPIENTRY VertexAttrib4fvNV(GLuint index, const GLfloat *v)
{
GL_CALL(VertexAttrib4fvNV)(index, v);
CALL_VertexAttrib4fvNV(GET_DISPATCH(), (index, v));
}
/* GL_DOUBLE attributes */
static void GLAPIENTRY VertexAttrib1dvNV(GLuint index, const GLdouble *v)
{
GL_CALL(VertexAttrib1dvNV)(index, v);
CALL_VertexAttrib1dvNV(GET_DISPATCH(), (index, v));
}
static void GLAPIENTRY VertexAttrib2dvNV(GLuint index, const GLdouble *v)
{
GL_CALL(VertexAttrib2dvNV)(index, v);
CALL_VertexAttrib2dvNV(GET_DISPATCH(), (index, v));
}
static void GLAPIENTRY VertexAttrib3dvNV(GLuint index, const GLdouble *v)
{
GL_CALL(VertexAttrib3dvNV)(index, v);
CALL_VertexAttrib3dvNV(GET_DISPATCH(), (index, v));
}
static void GLAPIENTRY VertexAttrib4dvNV(GLuint index, const GLdouble *v)
{
GL_CALL(VertexAttrib4dvNV)(index, v);
CALL_VertexAttrib4dvNV(GET_DISPATCH(), (index, v));
}
@@ -840,11 +600,6 @@ static attrib_func AttribFuncsNV[2][4][8] = {
}
};
static void GLAPIENTRY EdgeFlagv(const GLboolean *flag)
{
GL_CALL(EdgeFlagv)(flag);
}
/**********************************************************************/
@@ -887,32 +642,32 @@ static void _ae_update_state( GLcontext *ctx )
/* conventional vertex arrays */
if (ctx->Array.Index.Enabled) {
aa->array = &ctx->Array.Index;
aa->func = IndexFuncs[TYPE_IDX(aa->array->Type)];
aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
aa++;
}
if (ctx->Array.EdgeFlag.Enabled) {
aa->array = &ctx->Array.EdgeFlag;
aa->func = (array_func) EdgeFlagv;
aa->offset = _gloffset_EdgeFlagv;
aa++;
}
if (ctx->Array.Normal.Enabled) {
aa->array = &ctx->Array.Normal;
aa->func = NormalFuncs[TYPE_IDX(aa->array->Type)];
aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
aa++;
}
if (ctx->Array.Color.Enabled) {
aa->array = &ctx->Array.Color;
aa->func = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
aa++;
}
if (ctx->Array.SecondaryColor.Enabled) {
aa->array = &ctx->Array.SecondaryColor;
aa->func = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
aa++;
}
if (ctx->Array.FogCoord.Enabled) {
aa->array = &ctx->Array.FogCoord;
aa->func = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
aa++;
}
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
@@ -952,19 +707,19 @@ static void _ae_update_state( GLcontext *ctx )
*/
aa->array = &ctx->Array.VertexAttrib[0];
assert(aa->array->Size >= 2); /* XXX fix someday? */
aa->func = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
aa++;
}
else if (ctx->Array.Vertex.Enabled) {
aa->array = &ctx->Array.Vertex;
aa->func = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
aa++;
}
ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
ASSERT(aa - actx->arrays < 32);
at->func = NULL; /* terminate the list */
aa->func = NULL; /* terminate the list */
aa->offset = -1; /* terminate the list */
actx->NewState = 0;
}
@@ -982,6 +737,8 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt )
const AEcontext *actx = AE_CONTEXT(ctx);
const AEarray *aa;
const AEattrib *at;
const struct _glapi_table * const disp = GET_DISPATCH();
if (actx->NewState)
_ae_update_state( ctx );
@@ -995,11 +752,12 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt )
}
/* conventional arrays */
for (aa = actx->arrays; aa->func ; aa++) {
for (aa = actx->arrays; aa->offset != -1 ; aa++) {
const GLubyte *src = aa->array->BufferObj->Data
+ (uintptr_t) aa->array->Ptr
+ elt * aa->array->StrideB;
aa->func( src );
CALL_by_offset( disp, (array_func), aa->offset,
((const void *) src) );
}
}

View File

@@ -36,6 +36,8 @@
#include "colormac.h"
#include "api_loopback.h"
#include "glthread.h"
#include "mtypes.h"
#include "dispatch.h"
/* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
* calls to a smaller set of driver-provided formats. Currently just
@@ -46,35 +48,35 @@
* listed in dd.h. The easiest way for a driver to do this is to
* install the supplied software t&l module.
*/
#define COLORF(r,g,b,a) GL_CALL(Color4f)(r,g,b,a)
#define VERTEX2(x,y) GL_CALL(Vertex2f)(x,y)
#define VERTEX3(x,y,z) GL_CALL(Vertex3f)(x,y,z)
#define VERTEX4(x,y,z,w) GL_CALL(Vertex4f)(x,y,z,w)
#define NORMAL(x,y,z) GL_CALL(Normal3f)(x,y,z)
#define TEXCOORD1(s) GL_CALL(TexCoord1f)(s)
#define TEXCOORD2(s,t) GL_CALL(TexCoord2f)(s,t)
#define TEXCOORD3(s,t,u) GL_CALL(TexCoord3f)(s,t,u)
#define TEXCOORD4(s,t,u,v) GL_CALL(TexCoord4f)(s,t,u,v)
#define INDEX(c) GL_CALL(Indexf)(c)
#define MULTI_TEXCOORD1(z,s) GL_CALL(MultiTexCoord1fARB)(z,s)
#define MULTI_TEXCOORD2(z,s,t) GL_CALL(MultiTexCoord2fARB)(z,s,t)
#define MULTI_TEXCOORD3(z,s,t,u) GL_CALL(MultiTexCoord3fARB)(z,s,t,u)
#define MULTI_TEXCOORD4(z,s,t,u,v) GL_CALL(MultiTexCoord4fARB)(z,s,t,u,v)
#define EVALCOORD1(x) GL_CALL(EvalCoord1f)(x)
#define EVALCOORD2(x,y) GL_CALL(EvalCoord2f)(x,y)
#define MATERIALFV(a,b,c) GL_CALL(Materialfv)(a,b,c)
#define RECTF(a,b,c,d) GL_CALL(Rectf)(a,b,c,d)
#define COLORF(r,g,b,a) CALL_Color4f(GET_DISPATCH(), (r,g,b,a))
#define VERTEX2(x,y) CALL_Vertex2f(GET_DISPATCH(), (x,y))
#define VERTEX3(x,y,z) CALL_Vertex3f(GET_DISPATCH(), (x,y,z))
#define VERTEX4(x,y,z,w) CALL_Vertex4f(GET_DISPATCH(), (x,y,z,w))
#define NORMAL(x,y,z) CALL_Normal3f(GET_DISPATCH(), (x,y,z))
#define TEXCOORD1(s) CALL_TexCoord1f(GET_DISPATCH(), (s))
#define TEXCOORD2(s,t) CALL_TexCoord2f(GET_DISPATCH(), (s,t))
#define TEXCOORD3(s,t,u) CALL_TexCoord3f(GET_DISPATCH(), (s,t,u))
#define TEXCOORD4(s,t,u,v) CALL_TexCoord4f(GET_DISPATCH(), (s,t,u,v))
#define INDEX(c) CALL_Indexf(GET_DISPATCH(), (c))
#define MULTI_TEXCOORD1(z,s) CALL_MultiTexCoord1fARB(GET_DISPATCH(), (z,s))
#define MULTI_TEXCOORD2(z,s,t) CALL_MultiTexCoord2fARB(GET_DISPATCH(), (z,s,t))
#define MULTI_TEXCOORD3(z,s,t,u) CALL_MultiTexCoord3fARB(GET_DISPATCH(), (z,s,t,u))
#define MULTI_TEXCOORD4(z,s,t,u,v) CALL_MultiTexCoord4fARB(GET_DISPATCH(), (z,s,t,u,v))
#define EVALCOORD1(x) CALL_EvalCoord1f(GET_DISPATCH(), (x))
#define EVALCOORD2(x,y) CALL_EvalCoord2f(GET_DISPATCH(), (x,y))
#define MATERIALFV(a,b,c) CALL_Materialfv(GET_DISPATCH(), (a,b,c))
#define RECTF(a,b,c,d) CALL_Rectf(GET_DISPATCH(), (a,b,c,d))
#define ATTRIB1NV(index,x) GL_CALL(VertexAttrib1fNV)(index,x)
#define ATTRIB2NV(index,x,y) GL_CALL(VertexAttrib2fNV)(index,x,y)
#define ATTRIB3NV(index,x,y,z) GL_CALL(VertexAttrib3fNV)(index,x,y,z)
#define ATTRIB4NV(index,x,y,z,w) GL_CALL(VertexAttrib4fNV)(index,x,y,z,w)
#define ATTRIB1ARB(index,x) GL_CALL(VertexAttrib1fARB)(index,x)
#define ATTRIB2ARB(index,x,y) GL_CALL(VertexAttrib2fARB)(index,x,y)
#define ATTRIB3ARB(index,x,y,z) GL_CALL(VertexAttrib3fARB)(index,x,y,z)
#define ATTRIB4ARB(index,x,y,z,w) GL_CALL(VertexAttrib4fARB)(index,x,y,z,w)
#define FOGCOORDF(x) GL_CALL(FogCoordfEXT)(x)
#define SECONDARYCOLORF(a,b,c) GL_CALL(SecondaryColor3fEXT)(a,b,c)
#define ATTRIB1NV(index,x) CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x))
#define ATTRIB2NV(index,x,y) CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y))
#define ATTRIB3NV(index,x,y,z) CALL_VertexAttrib3fNV(GET_DISPATCH(), (index,x,y,z))
#define ATTRIB4NV(index,x,y,z,w) CALL_VertexAttrib4fNV(GET_DISPATCH(), (index,x,y,z,w))
#define ATTRIB1ARB(index,x) CALL_VertexAttrib1fARB(GET_DISPATCH(), (index,x))
#define ATTRIB2ARB(index,x,y) CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,x,y))
#define ATTRIB3ARB(index,x,y,z) CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,x,y,z))
#define ATTRIB4ARB(index,x,y,z,w) CALL_VertexAttrib4fARB(GET_DISPATCH(), (index,x,y,z,w))
#define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x))
#define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c))
static void GLAPIENTRY
loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue )
@@ -1437,209 +1439,209 @@ loopback_VertexAttrib4NuivARB(GLuint index, const GLuint * v)
void
_mesa_loopback_init_api_table( struct _glapi_table *dest )
{
dest->Color3b = loopback_Color3b_f;
dest->Color3d = loopback_Color3d_f;
dest->Color3i = loopback_Color3i_f;
dest->Color3s = loopback_Color3s_f;
dest->Color3ui = loopback_Color3ui_f;
dest->Color3us = loopback_Color3us_f;
dest->Color3ub = loopback_Color3ub_f;
dest->Color4b = loopback_Color4b_f;
dest->Color4d = loopback_Color4d_f;
dest->Color4i = loopback_Color4i_f;
dest->Color4s = loopback_Color4s_f;
dest->Color4ui = loopback_Color4ui_f;
dest->Color4us = loopback_Color4us_f;
dest->Color4ub = loopback_Color4ub_f;
dest->Color3bv = loopback_Color3bv_f;
dest->Color3dv = loopback_Color3dv_f;
dest->Color3iv = loopback_Color3iv_f;
dest->Color3sv = loopback_Color3sv_f;
dest->Color3uiv = loopback_Color3uiv_f;
dest->Color3usv = loopback_Color3usv_f;
dest->Color3ubv = loopback_Color3ubv_f;
dest->Color4bv = loopback_Color4bv_f;
dest->Color4dv = loopback_Color4dv_f;
dest->Color4iv = loopback_Color4iv_f;
dest->Color4sv = loopback_Color4sv_f;
dest->Color4uiv = loopback_Color4uiv_f;
dest->Color4usv = loopback_Color4usv_f;
dest->Color4ubv = loopback_Color4ubv_f;
SET_Color3b(dest, loopback_Color3b_f);
SET_Color3d(dest, loopback_Color3d_f);
SET_Color3i(dest, loopback_Color3i_f);
SET_Color3s(dest, loopback_Color3s_f);
SET_Color3ui(dest, loopback_Color3ui_f);
SET_Color3us(dest, loopback_Color3us_f);
SET_Color3ub(dest, loopback_Color3ub_f);
SET_Color4b(dest, loopback_Color4b_f);
SET_Color4d(dest, loopback_Color4d_f);
SET_Color4i(dest, loopback_Color4i_f);
SET_Color4s(dest, loopback_Color4s_f);
SET_Color4ui(dest, loopback_Color4ui_f);
SET_Color4us(dest, loopback_Color4us_f);
SET_Color4ub(dest, loopback_Color4ub_f);
SET_Color3bv(dest, loopback_Color3bv_f);
SET_Color3dv(dest, loopback_Color3dv_f);
SET_Color3iv(dest, loopback_Color3iv_f);
SET_Color3sv(dest, loopback_Color3sv_f);
SET_Color3uiv(dest, loopback_Color3uiv_f);
SET_Color3usv(dest, loopback_Color3usv_f);
SET_Color3ubv(dest, loopback_Color3ubv_f);
SET_Color4bv(dest, loopback_Color4bv_f);
SET_Color4dv(dest, loopback_Color4dv_f);
SET_Color4iv(dest, loopback_Color4iv_f);
SET_Color4sv(dest, loopback_Color4sv_f);
SET_Color4uiv(dest, loopback_Color4uiv_f);
SET_Color4usv(dest, loopback_Color4usv_f);
SET_Color4ubv(dest, loopback_Color4ubv_f);
dest->SecondaryColor3bEXT = loopback_SecondaryColor3bEXT_f;
dest->SecondaryColor3dEXT = loopback_SecondaryColor3dEXT_f;
dest->SecondaryColor3iEXT = loopback_SecondaryColor3iEXT_f;
dest->SecondaryColor3sEXT = loopback_SecondaryColor3sEXT_f;
dest->SecondaryColor3uiEXT = loopback_SecondaryColor3uiEXT_f;
dest->SecondaryColor3usEXT = loopback_SecondaryColor3usEXT_f;
dest->SecondaryColor3ubEXT = loopback_SecondaryColor3ubEXT_f;
dest->SecondaryColor3bvEXT = loopback_SecondaryColor3bvEXT_f;
dest->SecondaryColor3dvEXT = loopback_SecondaryColor3dvEXT_f;
dest->SecondaryColor3ivEXT = loopback_SecondaryColor3ivEXT_f;
dest->SecondaryColor3svEXT = loopback_SecondaryColor3svEXT_f;
dest->SecondaryColor3uivEXT = loopback_SecondaryColor3uivEXT_f;
dest->SecondaryColor3usvEXT = loopback_SecondaryColor3usvEXT_f;
dest->SecondaryColor3ubvEXT = loopback_SecondaryColor3ubvEXT_f;
SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f);
SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f);
SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f);
SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f);
SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f);
SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f);
SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f);
SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f);
SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f);
SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f);
SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f);
SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f);
SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f);
SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f);
dest->Indexd = loopback_Indexd;
dest->Indexi = loopback_Indexi;
dest->Indexs = loopback_Indexs;
dest->Indexub = loopback_Indexub;
dest->Indexdv = loopback_Indexdv;
dest->Indexiv = loopback_Indexiv;
dest->Indexsv = loopback_Indexsv;
dest->Indexubv = loopback_Indexubv;
dest->Normal3b = loopback_Normal3b;
dest->Normal3d = loopback_Normal3d;
dest->Normal3i = loopback_Normal3i;
dest->Normal3s = loopback_Normal3s;
dest->Normal3bv = loopback_Normal3bv;
dest->Normal3dv = loopback_Normal3dv;
dest->Normal3iv = loopback_Normal3iv;
dest->Normal3sv = loopback_Normal3sv;
dest->TexCoord1d = loopback_TexCoord1d;
dest->TexCoord1i = loopback_TexCoord1i;
dest->TexCoord1s = loopback_TexCoord1s;
dest->TexCoord2d = loopback_TexCoord2d;
dest->TexCoord2s = loopback_TexCoord2s;
dest->TexCoord2i = loopback_TexCoord2i;
dest->TexCoord3d = loopback_TexCoord3d;
dest->TexCoord3i = loopback_TexCoord3i;
dest->TexCoord3s = loopback_TexCoord3s;
dest->TexCoord4d = loopback_TexCoord4d;
dest->TexCoord4i = loopback_TexCoord4i;
dest->TexCoord4s = loopback_TexCoord4s;
dest->TexCoord1dv = loopback_TexCoord1dv;
dest->TexCoord1iv = loopback_TexCoord1iv;
dest->TexCoord1sv = loopback_TexCoord1sv;
dest->TexCoord2dv = loopback_TexCoord2dv;
dest->TexCoord2iv = loopback_TexCoord2iv;
dest->TexCoord2sv = loopback_TexCoord2sv;
dest->TexCoord3dv = loopback_TexCoord3dv;
dest->TexCoord3iv = loopback_TexCoord3iv;
dest->TexCoord3sv = loopback_TexCoord3sv;
dest->TexCoord4dv = loopback_TexCoord4dv;
dest->TexCoord4iv = loopback_TexCoord4iv;
dest->TexCoord4sv = loopback_TexCoord4sv;
dest->Vertex2d = loopback_Vertex2d;
dest->Vertex2i = loopback_Vertex2i;
dest->Vertex2s = loopback_Vertex2s;
dest->Vertex3d = loopback_Vertex3d;
dest->Vertex3i = loopback_Vertex3i;
dest->Vertex3s = loopback_Vertex3s;
dest->Vertex4d = loopback_Vertex4d;
dest->Vertex4i = loopback_Vertex4i;
dest->Vertex4s = loopback_Vertex4s;
dest->Vertex2dv = loopback_Vertex2dv;
dest->Vertex2iv = loopback_Vertex2iv;
dest->Vertex2sv = loopback_Vertex2sv;
dest->Vertex3dv = loopback_Vertex3dv;
dest->Vertex3iv = loopback_Vertex3iv;
dest->Vertex3sv = loopback_Vertex3sv;
dest->Vertex4dv = loopback_Vertex4dv;
dest->Vertex4iv = loopback_Vertex4iv;
dest->Vertex4sv = loopback_Vertex4sv;
dest->MultiTexCoord1dARB = loopback_MultiTexCoord1dARB;
dest->MultiTexCoord1dvARB = loopback_MultiTexCoord1dvARB;
dest->MultiTexCoord1iARB = loopback_MultiTexCoord1iARB;
dest->MultiTexCoord1ivARB = loopback_MultiTexCoord1ivARB;
dest->MultiTexCoord1sARB = loopback_MultiTexCoord1sARB;
dest->MultiTexCoord1svARB = loopback_MultiTexCoord1svARB;
dest->MultiTexCoord2dARB = loopback_MultiTexCoord2dARB;
dest->MultiTexCoord2dvARB = loopback_MultiTexCoord2dvARB;
dest->MultiTexCoord2iARB = loopback_MultiTexCoord2iARB;
dest->MultiTexCoord2ivARB = loopback_MultiTexCoord2ivARB;
dest->MultiTexCoord2sARB = loopback_MultiTexCoord2sARB;
dest->MultiTexCoord2svARB = loopback_MultiTexCoord2svARB;
dest->MultiTexCoord3dARB = loopback_MultiTexCoord3dARB;
dest->MultiTexCoord3dvARB = loopback_MultiTexCoord3dvARB;
dest->MultiTexCoord3iARB = loopback_MultiTexCoord3iARB;
dest->MultiTexCoord3ivARB = loopback_MultiTexCoord3ivARB;
dest->MultiTexCoord3sARB = loopback_MultiTexCoord3sARB;
dest->MultiTexCoord3svARB = loopback_MultiTexCoord3svARB;
dest->MultiTexCoord4dARB = loopback_MultiTexCoord4dARB;
dest->MultiTexCoord4dvARB = loopback_MultiTexCoord4dvARB;
dest->MultiTexCoord4iARB = loopback_MultiTexCoord4iARB;
dest->MultiTexCoord4ivARB = loopback_MultiTexCoord4ivARB;
dest->MultiTexCoord4sARB = loopback_MultiTexCoord4sARB;
dest->MultiTexCoord4svARB = loopback_MultiTexCoord4svARB;
dest->EvalCoord2dv = loopback_EvalCoord2dv;
dest->EvalCoord2fv = loopback_EvalCoord2fv;
dest->EvalCoord2d = loopback_EvalCoord2d;
dest->EvalCoord1dv = loopback_EvalCoord1dv;
dest->EvalCoord1fv = loopback_EvalCoord1fv;
dest->EvalCoord1d = loopback_EvalCoord1d;
dest->Materialf = loopback_Materialf;
dest->Materiali = loopback_Materiali;
dest->Materialiv = loopback_Materialiv;
dest->Rectd = loopback_Rectd;
dest->Rectdv = loopback_Rectdv;
dest->Rectfv = loopback_Rectfv;
dest->Recti = loopback_Recti;
dest->Rectiv = loopback_Rectiv;
dest->Rects = loopback_Rects;
dest->Rectsv = loopback_Rectsv;
dest->FogCoorddEXT = loopback_FogCoorddEXT;
dest->FogCoorddvEXT = loopback_FogCoorddvEXT;
SET_Indexd(dest, loopback_Indexd);
SET_Indexi(dest, loopback_Indexi);
SET_Indexs(dest, loopback_Indexs);
SET_Indexub(dest, loopback_Indexub);
SET_Indexdv(dest, loopback_Indexdv);
SET_Indexiv(dest, loopback_Indexiv);
SET_Indexsv(dest, loopback_Indexsv);
SET_Indexubv(dest, loopback_Indexubv);
SET_Normal3b(dest, loopback_Normal3b);
SET_Normal3d(dest, loopback_Normal3d);
SET_Normal3i(dest, loopback_Normal3i);
SET_Normal3s(dest, loopback_Normal3s);
SET_Normal3bv(dest, loopback_Normal3bv);
SET_Normal3dv(dest, loopback_Normal3dv);
SET_Normal3iv(dest, loopback_Normal3iv);
SET_Normal3sv(dest, loopback_Normal3sv);
SET_TexCoord1d(dest, loopback_TexCoord1d);
SET_TexCoord1i(dest, loopback_TexCoord1i);
SET_TexCoord1s(dest, loopback_TexCoord1s);
SET_TexCoord2d(dest, loopback_TexCoord2d);
SET_TexCoord2s(dest, loopback_TexCoord2s);
SET_TexCoord2i(dest, loopback_TexCoord2i);
SET_TexCoord3d(dest, loopback_TexCoord3d);
SET_TexCoord3i(dest, loopback_TexCoord3i);
SET_TexCoord3s(dest, loopback_TexCoord3s);
SET_TexCoord4d(dest, loopback_TexCoord4d);
SET_TexCoord4i(dest, loopback_TexCoord4i);
SET_TexCoord4s(dest, loopback_TexCoord4s);
SET_TexCoord1dv(dest, loopback_TexCoord1dv);
SET_TexCoord1iv(dest, loopback_TexCoord1iv);
SET_TexCoord1sv(dest, loopback_TexCoord1sv);
SET_TexCoord2dv(dest, loopback_TexCoord2dv);
SET_TexCoord2iv(dest, loopback_TexCoord2iv);
SET_TexCoord2sv(dest, loopback_TexCoord2sv);
SET_TexCoord3dv(dest, loopback_TexCoord3dv);
SET_TexCoord3iv(dest, loopback_TexCoord3iv);
SET_TexCoord3sv(dest, loopback_TexCoord3sv);
SET_TexCoord4dv(dest, loopback_TexCoord4dv);
SET_TexCoord4iv(dest, loopback_TexCoord4iv);
SET_TexCoord4sv(dest, loopback_TexCoord4sv);
SET_Vertex2d(dest, loopback_Vertex2d);
SET_Vertex2i(dest, loopback_Vertex2i);
SET_Vertex2s(dest, loopback_Vertex2s);
SET_Vertex3d(dest, loopback_Vertex3d);
SET_Vertex3i(dest, loopback_Vertex3i);
SET_Vertex3s(dest, loopback_Vertex3s);
SET_Vertex4d(dest, loopback_Vertex4d);
SET_Vertex4i(dest, loopback_Vertex4i);
SET_Vertex4s(dest, loopback_Vertex4s);
SET_Vertex2dv(dest, loopback_Vertex2dv);
SET_Vertex2iv(dest, loopback_Vertex2iv);
SET_Vertex2sv(dest, loopback_Vertex2sv);
SET_Vertex3dv(dest, loopback_Vertex3dv);
SET_Vertex3iv(dest, loopback_Vertex3iv);
SET_Vertex3sv(dest, loopback_Vertex3sv);
SET_Vertex4dv(dest, loopback_Vertex4dv);
SET_Vertex4iv(dest, loopback_Vertex4iv);
SET_Vertex4sv(dest, loopback_Vertex4sv);
SET_MultiTexCoord1dARB(dest, loopback_MultiTexCoord1dARB);
SET_MultiTexCoord1dvARB(dest, loopback_MultiTexCoord1dvARB);
SET_MultiTexCoord1iARB(dest, loopback_MultiTexCoord1iARB);
SET_MultiTexCoord1ivARB(dest, loopback_MultiTexCoord1ivARB);
SET_MultiTexCoord1sARB(dest, loopback_MultiTexCoord1sARB);
SET_MultiTexCoord1svARB(dest, loopback_MultiTexCoord1svARB);
SET_MultiTexCoord2dARB(dest, loopback_MultiTexCoord2dARB);
SET_MultiTexCoord2dvARB(dest, loopback_MultiTexCoord2dvARB);
SET_MultiTexCoord2iARB(dest, loopback_MultiTexCoord2iARB);
SET_MultiTexCoord2ivARB(dest, loopback_MultiTexCoord2ivARB);
SET_MultiTexCoord2sARB(dest, loopback_MultiTexCoord2sARB);
SET_MultiTexCoord2svARB(dest, loopback_MultiTexCoord2svARB);
SET_MultiTexCoord3dARB(dest, loopback_MultiTexCoord3dARB);
SET_MultiTexCoord3dvARB(dest, loopback_MultiTexCoord3dvARB);
SET_MultiTexCoord3iARB(dest, loopback_MultiTexCoord3iARB);
SET_MultiTexCoord3ivARB(dest, loopback_MultiTexCoord3ivARB);
SET_MultiTexCoord3sARB(dest, loopback_MultiTexCoord3sARB);
SET_MultiTexCoord3svARB(dest, loopback_MultiTexCoord3svARB);
SET_MultiTexCoord4dARB(dest, loopback_MultiTexCoord4dARB);
SET_MultiTexCoord4dvARB(dest, loopback_MultiTexCoord4dvARB);
SET_MultiTexCoord4iARB(dest, loopback_MultiTexCoord4iARB);
SET_MultiTexCoord4ivARB(dest, loopback_MultiTexCoord4ivARB);
SET_MultiTexCoord4sARB(dest, loopback_MultiTexCoord4sARB);
SET_MultiTexCoord4svARB(dest, loopback_MultiTexCoord4svARB);
SET_EvalCoord2dv(dest, loopback_EvalCoord2dv);
SET_EvalCoord2fv(dest, loopback_EvalCoord2fv);
SET_EvalCoord2d(dest, loopback_EvalCoord2d);
SET_EvalCoord1dv(dest, loopback_EvalCoord1dv);
SET_EvalCoord1fv(dest, loopback_EvalCoord1fv);
SET_EvalCoord1d(dest, loopback_EvalCoord1d);
SET_Materialf(dest, loopback_Materialf);
SET_Materiali(dest, loopback_Materiali);
SET_Materialiv(dest, loopback_Materialiv);
SET_Rectd(dest, loopback_Rectd);
SET_Rectdv(dest, loopback_Rectdv);
SET_Rectfv(dest, loopback_Rectfv);
SET_Recti(dest, loopback_Recti);
SET_Rectiv(dest, loopback_Rectiv);
SET_Rects(dest, loopback_Rects);
SET_Rectsv(dest, loopback_Rectsv);
SET_FogCoorddEXT(dest, loopback_FogCoorddEXT);
SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT);
dest->VertexAttrib1sNV = loopback_VertexAttrib1sNV;
dest->VertexAttrib1dNV = loopback_VertexAttrib1dNV;
dest->VertexAttrib2sNV = loopback_VertexAttrib2sNV;
dest->VertexAttrib2dNV = loopback_VertexAttrib2dNV;
dest->VertexAttrib3sNV = loopback_VertexAttrib3sNV;
dest->VertexAttrib3dNV = loopback_VertexAttrib3dNV;
dest->VertexAttrib4sNV = loopback_VertexAttrib4sNV;
dest->VertexAttrib4dNV = loopback_VertexAttrib4dNV;
dest->VertexAttrib4ubNV = loopback_VertexAttrib4ubNV;
dest->VertexAttrib1svNV = loopback_VertexAttrib1svNV;
dest->VertexAttrib1dvNV = loopback_VertexAttrib1dvNV;
dest->VertexAttrib2svNV = loopback_VertexAttrib2svNV;
dest->VertexAttrib2dvNV = loopback_VertexAttrib2dvNV;
dest->VertexAttrib3svNV = loopback_VertexAttrib3svNV;
dest->VertexAttrib3dvNV = loopback_VertexAttrib3dvNV;
dest->VertexAttrib4svNV = loopback_VertexAttrib4svNV;
dest->VertexAttrib4dvNV = loopback_VertexAttrib4dvNV;
dest->VertexAttrib4ubvNV = loopback_VertexAttrib4ubvNV;
dest->VertexAttribs1svNV = loopback_VertexAttribs1svNV;
dest->VertexAttribs1fvNV = loopback_VertexAttribs1fvNV;
dest->VertexAttribs1dvNV = loopback_VertexAttribs1dvNV;
dest->VertexAttribs2svNV = loopback_VertexAttribs2svNV;
dest->VertexAttribs2fvNV = loopback_VertexAttribs2fvNV;
dest->VertexAttribs2dvNV = loopback_VertexAttribs2dvNV;
dest->VertexAttribs3svNV = loopback_VertexAttribs3svNV;
dest->VertexAttribs3fvNV = loopback_VertexAttribs3fvNV;
dest->VertexAttribs3dvNV = loopback_VertexAttribs3dvNV;
dest->VertexAttribs4svNV = loopback_VertexAttribs4svNV;
dest->VertexAttribs4fvNV = loopback_VertexAttribs4fvNV;
dest->VertexAttribs4dvNV = loopback_VertexAttribs4dvNV;
dest->VertexAttribs4ubvNV = loopback_VertexAttribs4ubvNV;
SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV);
SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV);
SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV);
SET_VertexAttrib2dNV(dest, loopback_VertexAttrib2dNV);
SET_VertexAttrib3sNV(dest, loopback_VertexAttrib3sNV);
SET_VertexAttrib3dNV(dest, loopback_VertexAttrib3dNV);
SET_VertexAttrib4sNV(dest, loopback_VertexAttrib4sNV);
SET_VertexAttrib4dNV(dest, loopback_VertexAttrib4dNV);
SET_VertexAttrib4ubNV(dest, loopback_VertexAttrib4ubNV);
SET_VertexAttrib1svNV(dest, loopback_VertexAttrib1svNV);
SET_VertexAttrib1dvNV(dest, loopback_VertexAttrib1dvNV);
SET_VertexAttrib2svNV(dest, loopback_VertexAttrib2svNV);
SET_VertexAttrib2dvNV(dest, loopback_VertexAttrib2dvNV);
SET_VertexAttrib3svNV(dest, loopback_VertexAttrib3svNV);
SET_VertexAttrib3dvNV(dest, loopback_VertexAttrib3dvNV);
SET_VertexAttrib4svNV(dest, loopback_VertexAttrib4svNV);
SET_VertexAttrib4dvNV(dest, loopback_VertexAttrib4dvNV);
SET_VertexAttrib4ubvNV(dest, loopback_VertexAttrib4ubvNV);
SET_VertexAttribs1svNV(dest, loopback_VertexAttribs1svNV);
SET_VertexAttribs1fvNV(dest, loopback_VertexAttribs1fvNV);
SET_VertexAttribs1dvNV(dest, loopback_VertexAttribs1dvNV);
SET_VertexAttribs2svNV(dest, loopback_VertexAttribs2svNV);
SET_VertexAttribs2fvNV(dest, loopback_VertexAttribs2fvNV);
SET_VertexAttribs2dvNV(dest, loopback_VertexAttribs2dvNV);
SET_VertexAttribs3svNV(dest, loopback_VertexAttribs3svNV);
SET_VertexAttribs3fvNV(dest, loopback_VertexAttribs3fvNV);
SET_VertexAttribs3dvNV(dest, loopback_VertexAttribs3dvNV);
SET_VertexAttribs4svNV(dest, loopback_VertexAttribs4svNV);
SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV);
SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV);
SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV);
dest->VertexAttrib1sARB = loopback_VertexAttrib1sARB;
dest->VertexAttrib1dARB = loopback_VertexAttrib1dARB;
dest->VertexAttrib2sARB = loopback_VertexAttrib2sARB;
dest->VertexAttrib2dARB = loopback_VertexAttrib2dARB;
dest->VertexAttrib3sARB = loopback_VertexAttrib3sARB;
dest->VertexAttrib3dARB = loopback_VertexAttrib3dARB;
dest->VertexAttrib4sARB = loopback_VertexAttrib4sARB;
dest->VertexAttrib4dARB = loopback_VertexAttrib4dARB;
dest->VertexAttrib1svARB = loopback_VertexAttrib1svARB;
dest->VertexAttrib1dvARB = loopback_VertexAttrib1dvARB;
dest->VertexAttrib2svARB = loopback_VertexAttrib2svARB;
dest->VertexAttrib2dvARB = loopback_VertexAttrib2dvARB;
dest->VertexAttrib3svARB = loopback_VertexAttrib3svARB;
dest->VertexAttrib3dvARB = loopback_VertexAttrib3dvARB;
dest->VertexAttrib4svARB = loopback_VertexAttrib4svARB;
dest->VertexAttrib4dvARB = loopback_VertexAttrib4dvARB;
dest->VertexAttrib4NubARB = loopback_VertexAttrib4NubARB;
dest->VertexAttrib4NubvARB = loopback_VertexAttrib4NubvARB;
dest->VertexAttrib4bvARB = loopback_VertexAttrib4bvARB;
dest->VertexAttrib4ivARB = loopback_VertexAttrib4ivARB;
dest->VertexAttrib4ubvARB = loopback_VertexAttrib4ubvARB;
dest->VertexAttrib4usvARB = loopback_VertexAttrib4usvARB;
dest->VertexAttrib4uivARB = loopback_VertexAttrib4uivARB;
dest->VertexAttrib4NbvARB = loopback_VertexAttrib4NbvARB;
dest->VertexAttrib4NsvARB = loopback_VertexAttrib4NsvARB;
dest->VertexAttrib4NivARB = loopback_VertexAttrib4NivARB;
dest->VertexAttrib4NusvARB = loopback_VertexAttrib4NusvARB;
dest->VertexAttrib4NuivARB = loopback_VertexAttrib4NuivARB;
SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB);
SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB);
SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB);
SET_VertexAttrib2dARB(dest, loopback_VertexAttrib2dARB);
SET_VertexAttrib3sARB(dest, loopback_VertexAttrib3sARB);
SET_VertexAttrib3dARB(dest, loopback_VertexAttrib3dARB);
SET_VertexAttrib4sARB(dest, loopback_VertexAttrib4sARB);
SET_VertexAttrib4dARB(dest, loopback_VertexAttrib4dARB);
SET_VertexAttrib1svARB(dest, loopback_VertexAttrib1svARB);
SET_VertexAttrib1dvARB(dest, loopback_VertexAttrib1dvARB);
SET_VertexAttrib2svARB(dest, loopback_VertexAttrib2svARB);
SET_VertexAttrib2dvARB(dest, loopback_VertexAttrib2dvARB);
SET_VertexAttrib3svARB(dest, loopback_VertexAttrib3svARB);
SET_VertexAttrib3dvARB(dest, loopback_VertexAttrib3dvARB);
SET_VertexAttrib4svARB(dest, loopback_VertexAttrib4svARB);
SET_VertexAttrib4dvARB(dest, loopback_VertexAttrib4dvARB);
SET_VertexAttrib4NubARB(dest, loopback_VertexAttrib4NubARB);
SET_VertexAttrib4NubvARB(dest, loopback_VertexAttrib4NubvARB);
SET_VertexAttrib4bvARB(dest, loopback_VertexAttrib4bvARB);
SET_VertexAttrib4ivARB(dest, loopback_VertexAttrib4ivARB);
SET_VertexAttrib4ubvARB(dest, loopback_VertexAttrib4ubvARB);
SET_VertexAttrib4usvARB(dest, loopback_VertexAttrib4usvARB);
SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB);
SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB);
SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB);
SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB);
SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB);
SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB);
}

View File

@@ -33,6 +33,7 @@
#include "macros.h"
#include "mtypes.h"
#include "dlist.h"
#include "dispatch.h"
/* In states where certain vertex components are required for t&l or
@@ -685,12 +686,12 @@ void GLAPIENTRY _mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2
ASSERT_OUTSIDE_BEGIN_END(ctx);
}
GL_CALL(Begin)( GL_QUADS );
GL_CALL(Vertex2f)( x1, y1 );
GL_CALL(Vertex2f)( x2, y1 );
GL_CALL(Vertex2f)( x2, y2 );
GL_CALL(Vertex2f)( x1, y2 );
GL_CALL(End)();
CALL_Begin(GET_DISPATCH(), (GL_QUADS));
CALL_Vertex2f(GET_DISPATCH(), (x1, y1));
CALL_Vertex2f(GET_DISPATCH(), (x2, y1));
CALL_Vertex2f(GET_DISPATCH(), (x2, y2));
CALL_Vertex2f(GET_DISPATCH(), (x1, y2));
CALL_End(GET_DISPATCH(), ());
}
@@ -706,10 +707,10 @@ void GLAPIENTRY _mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count)
if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
return;
GL_CALL(Begin)(mode);
CALL_Begin(GET_DISPATCH(), (mode));
for (i = 0; i < count; i++)
GL_CALL(ArrayElement)(start + i);
GL_CALL(End)();
CALL_ArrayElement(GET_DISPATCH(), (start + i));
CALL_End(GET_DISPATCH(), ());
}
@@ -722,27 +723,27 @@ void GLAPIENTRY _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
return;
GL_CALL(Begin)(mode);
CALL_Begin(GET_DISPATCH(), (mode));
switch (type) {
case GL_UNSIGNED_BYTE:
for (i = 0 ; i < count ; i++)
GL_CALL(ArrayElement)( ((GLubyte *)indices)[i] );
CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] ));
break;
case GL_UNSIGNED_SHORT:
for (i = 0 ; i < count ; i++)
GL_CALL(ArrayElement)( ((GLushort *)indices)[i] );
CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] ));
break;
case GL_UNSIGNED_INT:
for (i = 0 ; i < count ; i++)
GL_CALL(ArrayElement)( ((GLuint *)indices)[i] );
CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] ));
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
break;
}
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}
void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode,
@@ -755,7 +756,7 @@ void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode,
if (_mesa_validate_DrawRangeElements( ctx, mode,
start, end,
count, type, indices ))
GL_CALL(DrawElements)( mode, count, type, indices );
CALL_DrawElements(GET_DISPATCH(), (mode, count, type, indices));
}
/*
@@ -800,11 +801,11 @@ void GLAPIENTRY _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
du = ctx->Eval.MapGrid1du;
u = ctx->Eval.MapGrid1u1 + i1 * du;
GL_CALL(Begin)( prim );
CALL_Begin(GET_DISPATCH(), (prim));
for (i=i1;i<=i2;i++,u+=du) {
GL_CALL(EvalCoord1f)( u );
CALL_EvalCoord1f(GET_DISPATCH(), (u));
}
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}
@@ -839,38 +840,38 @@ void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1,
switch (mode) {
case GL_POINT:
GL_CALL(Begin)( GL_POINTS );
CALL_Begin(GET_DISPATCH(), (GL_POINTS));
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
for (u=u1,i=i1;i<=i2;i++,u+=du) {
GL_CALL(EvalCoord2f)(u, v );
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
}
}
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
break;
case GL_LINE:
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
GL_CALL(Begin)( GL_LINE_STRIP );
CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
for (u=u1,i=i1;i<=i2;i++,u+=du) {
GL_CALL(EvalCoord2f)(u, v );
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
}
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}
for (u=u1,i=i1;i<=i2;i++,u+=du) {
GL_CALL(Begin)( GL_LINE_STRIP );
CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
GL_CALL(EvalCoord2f)(u, v );
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
}
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}
break;
case GL_FILL:
for (v=v1,j=j1;j<j2;j++,v+=dv) {
GL_CALL(Begin)( GL_TRIANGLE_STRIP );
CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP));
for (u=u1,i=i1;i<=i2;i++,u+=du) {
GL_CALL(EvalCoord2f)(u, v );
GL_CALL(EvalCoord2f)(u, v+dv );
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv));
}
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}
break;
default:

View File

@@ -31,11 +31,6 @@
#ifndef CONFIG_H
#define CONFIG_H
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
/**
* \name OpenGL implementation limits
*/

View File

@@ -66,19 +66,19 @@
#define F stdout
#define DISPATCH(FUNC, ARGS, MESSAGE) \
fprintf MESSAGE; \
GL_CALL(FUNC) ARGS;
CALL_ ## FUNC(GET_DISPATCH(), ARGS);
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
fprintf MESSAGE; \
return GL_CALL(FUNC) ARGS;
return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
#else
#define DISPATCH(FUNC, ARGS, MESSAGE) \
GL_CALL(FUNC) ARGS;
CALL_ ## FUNC(GET_DISPATCH(), ARGS);
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
return GL_CALL(FUNC) ARGS;
return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
#endif /* logging */
@@ -87,6 +87,7 @@
#define GLAPIENTRY
#endif
#include "dispatch.h"
#include "glapitemp.h"
#endif /* USE_X86_ASM */

File diff suppressed because it is too large Load Diff

View File

@@ -70,11 +70,6 @@
#include <stdarg.h>
/* This is no longer uses since we dumped autoconf/automake! */
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
/* Get typedefs for uintptr_t and friends */
#if defined(_WIN32)
#include <BaseTsd.h>

File diff suppressed because it is too large Load Diff

View File

@@ -358,7 +358,7 @@ static struct ureg get_temp( struct texenv_fragment_program *p )
bit = ffs( ~p->temp_in_use );
if (!bit) {
fprintf(stderr, "%s: out of temporaries\n", __FILE__);
_mesa_problem(NULL, "%s: out of temporaries\n", __FILE__);
exit(1);
}
@@ -383,7 +383,7 @@ static struct ureg get_tex_temp( struct texenv_fragment_program *p )
bit = ffs( ~p->temp_in_use );
if (!bit) {
fprintf(stderr, "%s: out of temporaries\n", __FILE__);
_mesa_problem(NULL, "%s: out of temporaries\n", __FILE__);
exit(1);
}
@@ -610,7 +610,7 @@ static struct ureg get_zero( struct texenv_fragment_program *p )
static void program_error( struct texenv_fragment_program *p, const char *msg )
{
fprintf(stderr, "%s\n", msg);
_mesa_problem(NULL, msg);
p->error = 1;
}
@@ -917,7 +917,8 @@ static void load_texture( struct texenv_fragment_program *p, GLuint unit )
struct ureg texcoord = register_input(p, FRAG_ATTRIB_TEX0+unit);
struct ureg tmp = get_tex_temp( p );
if (dim == TEXTURE_UNKNOWN_INDEX) program_error(p, "TexSrcBit");
if (dim == TEXTURE_UNKNOWN_INDEX)
program_error(p, "TexSrcBit");
/* TODO: Use D0_MASK_XY where possible.
*/

View File

@@ -33,7 +33,7 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
#include "dispatch.h"
#ifndef GL_BOOLEAN
#define GL_BOOLEAN 0x9999
@@ -851,7 +851,7 @@ _mesa_MultiDrawArraysEXT( GLenum mode, GLint *first,
for (i = 0; i < primcount; i++) {
if (count[i] > 0) {
(ctx->Exec->DrawArrays)(mode, first[i], count[i]);
CALL_DrawArrays(ctx->Exec, (mode, first[i], count[i]));
}
}
}
@@ -869,7 +869,7 @@ _mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type,
for (i = 0; i < primcount; i++) {
if (count[i] > 0) {
(ctx->Exec->DrawElements)(mode, count[i], type, indices[i]);
CALL_DrawElements(ctx->Exec, (mode, count[i], type, indices[i]));
}
}
}
@@ -889,7 +889,7 @@ _mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
for ( i = 0 ; i < primcount ; i++ ) {
if ( count[i] > 0 ) {
GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
(ctx->Exec->DrawArrays)( m, first[i], count[i] );
CALL_DrawArrays(ctx->Exec, ( m, first[i], count[i] ));
}
}
}
@@ -911,7 +911,7 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count,
for ( i = 0 ; i < primcount ; i++ ) {
if ( count[i] > 0 ) {
GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
(ctx->Exec->DrawElements)( m, count[i], type, indices[i] );
CALL_DrawElements(ctx->Exec, ( m, count[i], type, indices[i] ));
}
}
}

View File

@@ -56,7 +56,7 @@
\
/* Save the swapped function's dispatch entry so it can be */ \
/* restored later. */ \
tnl->Swapped[tnl->SwapCount][0] = (void *)&(ctx->Exec->FUNC); \
tnl->Swapped[tnl->SwapCount][0] = (void *)&(GET_ ## FUNC (ctx->Exec)); \
*(func_ptr_t *)(tnl->Swapped[tnl->SwapCount]+1) = (func_ptr_t)TAG(FUNC); \
tnl->SwapCount++; \
\
@@ -64,7 +64,7 @@
_mesa_debug(ctx, " swapping gl" #FUNC"...\n" ); \
\
/* Install the tnl function pointer. */ \
ctx->Exec->FUNC = tnl->Current->FUNC; \
SET_ ## FUNC(ctx->Exec, tnl->Current->FUNC); \
}
#define TAG(x) neutral_##x
@@ -75,76 +75,76 @@
static void
install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt )
{
tab->ArrayElement = vfmt->ArrayElement;
tab->Color3f = vfmt->Color3f;
tab->Color3fv = vfmt->Color3fv;
tab->Color4f = vfmt->Color4f;
tab->Color4fv = vfmt->Color4fv;
tab->EdgeFlag = vfmt->EdgeFlag;
tab->EdgeFlagv = vfmt->EdgeFlagv;
tab->EvalCoord1f = vfmt->EvalCoord1f;
tab->EvalCoord1fv = vfmt->EvalCoord1fv;
tab->EvalCoord2f = vfmt->EvalCoord2f;
tab->EvalCoord2fv = vfmt->EvalCoord2fv;
tab->EvalPoint1 = vfmt->EvalPoint1;
tab->EvalPoint2 = vfmt->EvalPoint2;
tab->FogCoordfEXT = vfmt->FogCoordfEXT;
tab->FogCoordfvEXT = vfmt->FogCoordfvEXT;
tab->Indexf = vfmt->Indexf;
tab->Indexfv = vfmt->Indexfv;
tab->Materialfv = vfmt->Materialfv;
tab->MultiTexCoord1fARB = vfmt->MultiTexCoord1fARB;
tab->MultiTexCoord1fvARB = vfmt->MultiTexCoord1fvARB;
tab->MultiTexCoord2fARB = vfmt->MultiTexCoord2fARB;
tab->MultiTexCoord2fvARB = vfmt->MultiTexCoord2fvARB;
tab->MultiTexCoord3fARB = vfmt->MultiTexCoord3fARB;
tab->MultiTexCoord3fvARB = vfmt->MultiTexCoord3fvARB;
tab->MultiTexCoord4fARB = vfmt->MultiTexCoord4fARB;
tab->MultiTexCoord4fvARB = vfmt->MultiTexCoord4fvARB;
tab->Normal3f = vfmt->Normal3f;
tab->Normal3fv = vfmt->Normal3fv;
tab->SecondaryColor3fEXT = vfmt->SecondaryColor3fEXT;
tab->SecondaryColor3fvEXT = vfmt->SecondaryColor3fvEXT;
tab->TexCoord1f = vfmt->TexCoord1f;
tab->TexCoord1fv = vfmt->TexCoord1fv;
tab->TexCoord2f = vfmt->TexCoord2f;
tab->TexCoord2fv = vfmt->TexCoord2fv;
tab->TexCoord3f = vfmt->TexCoord3f;
tab->TexCoord3fv = vfmt->TexCoord3fv;
tab->TexCoord4f = vfmt->TexCoord4f;
tab->TexCoord4fv = vfmt->TexCoord4fv;
tab->Vertex2f = vfmt->Vertex2f;
tab->Vertex2fv = vfmt->Vertex2fv;
tab->Vertex3f = vfmt->Vertex3f;
tab->Vertex3fv = vfmt->Vertex3fv;
tab->Vertex4f = vfmt->Vertex4f;
tab->Vertex4fv = vfmt->Vertex4fv;
tab->CallList = vfmt->CallList;
tab->CallLists = vfmt->CallLists;
tab->Begin = vfmt->Begin;
tab->End = vfmt->End;
tab->VertexAttrib1fNV = vfmt->VertexAttrib1fNV;
tab->VertexAttrib1fvNV = vfmt->VertexAttrib1fvNV;
tab->VertexAttrib2fNV = vfmt->VertexAttrib2fNV;
tab->VertexAttrib2fvNV = vfmt->VertexAttrib2fvNV;
tab->VertexAttrib3fNV = vfmt->VertexAttrib3fNV;
tab->VertexAttrib3fvNV = vfmt->VertexAttrib3fvNV;
tab->VertexAttrib4fNV = vfmt->VertexAttrib4fNV;
tab->VertexAttrib4fvNV = vfmt->VertexAttrib4fvNV;
tab->VertexAttrib1fARB = vfmt->VertexAttrib1fARB;
tab->VertexAttrib1fvARB = vfmt->VertexAttrib1fvARB;
tab->VertexAttrib2fARB = vfmt->VertexAttrib2fARB;
tab->VertexAttrib2fvARB = vfmt->VertexAttrib2fvARB;
tab->VertexAttrib3fARB = vfmt->VertexAttrib3fARB;
tab->VertexAttrib3fvARB = vfmt->VertexAttrib3fvARB;
tab->VertexAttrib4fARB = vfmt->VertexAttrib4fARB;
tab->VertexAttrib4fvARB = vfmt->VertexAttrib4fvARB;
tab->Rectf = vfmt->Rectf;
tab->DrawArrays = vfmt->DrawArrays;
tab->DrawElements = vfmt->DrawElements;
tab->DrawRangeElements = vfmt->DrawRangeElements;
tab->EvalMesh1 = vfmt->EvalMesh1;
tab->EvalMesh2 = vfmt->EvalMesh2;
SET_ArrayElement(tab, vfmt->ArrayElement);
SET_Color3f(tab, vfmt->Color3f);
SET_Color3fv(tab, vfmt->Color3fv);
SET_Color4f(tab, vfmt->Color4f);
SET_Color4fv(tab, vfmt->Color4fv);
SET_EdgeFlag(tab, vfmt->EdgeFlag);
SET_EdgeFlagv(tab, vfmt->EdgeFlagv);
SET_EvalCoord1f(tab, vfmt->EvalCoord1f);
SET_EvalCoord1fv(tab, vfmt->EvalCoord1fv);
SET_EvalCoord2f(tab, vfmt->EvalCoord2f);
SET_EvalCoord2fv(tab, vfmt->EvalCoord2fv);
SET_EvalPoint1(tab, vfmt->EvalPoint1);
SET_EvalPoint2(tab, vfmt->EvalPoint2);
SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT);
SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT);
SET_Indexf(tab, vfmt->Indexf);
SET_Indexfv(tab, vfmt->Indexfv);
SET_Materialfv(tab, vfmt->Materialfv);
SET_MultiTexCoord1fARB(tab, vfmt->MultiTexCoord1fARB);
SET_MultiTexCoord1fvARB(tab, vfmt->MultiTexCoord1fvARB);
SET_MultiTexCoord2fARB(tab, vfmt->MultiTexCoord2fARB);
SET_MultiTexCoord2fvARB(tab, vfmt->MultiTexCoord2fvARB);
SET_MultiTexCoord3fARB(tab, vfmt->MultiTexCoord3fARB);
SET_MultiTexCoord3fvARB(tab, vfmt->MultiTexCoord3fvARB);
SET_MultiTexCoord4fARB(tab, vfmt->MultiTexCoord4fARB);
SET_MultiTexCoord4fvARB(tab, vfmt->MultiTexCoord4fvARB);
SET_Normal3f(tab, vfmt->Normal3f);
SET_Normal3fv(tab, vfmt->Normal3fv);
SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT);
SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT);
SET_TexCoord1f(tab, vfmt->TexCoord1f);
SET_TexCoord1fv(tab, vfmt->TexCoord1fv);
SET_TexCoord2f(tab, vfmt->TexCoord2f);
SET_TexCoord2fv(tab, vfmt->TexCoord2fv);
SET_TexCoord3f(tab, vfmt->TexCoord3f);
SET_TexCoord3fv(tab, vfmt->TexCoord3fv);
SET_TexCoord4f(tab, vfmt->TexCoord4f);
SET_TexCoord4fv(tab, vfmt->TexCoord4fv);
SET_Vertex2f(tab, vfmt->Vertex2f);
SET_Vertex2fv(tab, vfmt->Vertex2fv);
SET_Vertex3f(tab, vfmt->Vertex3f);
SET_Vertex3fv(tab, vfmt->Vertex3fv);
SET_Vertex4f(tab, vfmt->Vertex4f);
SET_Vertex4fv(tab, vfmt->Vertex4fv);
SET_CallList(tab, vfmt->CallList);
SET_CallLists(tab, vfmt->CallLists);
SET_Begin(tab, vfmt->Begin);
SET_End(tab, vfmt->End);
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);
SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV);
SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV);
SET_VertexAttrib2fvNV(tab, vfmt->VertexAttrib2fvNV);
SET_VertexAttrib3fNV(tab, vfmt->VertexAttrib3fNV);
SET_VertexAttrib3fvNV(tab, vfmt->VertexAttrib3fvNV);
SET_VertexAttrib4fNV(tab, vfmt->VertexAttrib4fNV);
SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV);
SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB);
SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB);
SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB);
SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvARB);
SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fARB);
SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB);
SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB);
SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB);
SET_Rectf(tab, vfmt->Rectf);
SET_DrawArrays(tab, vfmt->DrawArrays);
SET_DrawElements(tab, vfmt->DrawElements);
SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
SET_EvalMesh1(tab, vfmt->EvalMesh1);
SET_EvalMesh2(tab, vfmt->EvalMesh2);
ASSERT(tab->EvalMesh2);
}

View File

@@ -29,313 +29,315 @@
#define PRE_LOOPBACK( FUNC )
#endif
#include "dispatch.h"
static void GLAPIENTRY TAG(ArrayElement)( GLint i )
{
PRE_LOOPBACK( ArrayElement );
GL_CALL(ArrayElement)( i );
CALL_ArrayElement(GET_DISPATCH(), ( i ));
}
static void GLAPIENTRY TAG(Color3f)( GLfloat r, GLfloat g, GLfloat b )
{
PRE_LOOPBACK( Color3f );
GL_CALL(Color3f)( r, g, b );
CALL_Color3f(GET_DISPATCH(), ( r, g, b ));
}
static void GLAPIENTRY TAG(Color3fv)( const GLfloat *v )
{
PRE_LOOPBACK( Color3fv );
GL_CALL(Color3fv)( v );
CALL_Color3fv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
{
PRE_LOOPBACK( Color4f );
GL_CALL(Color4f)( r, g, b, a );
CALL_Color4f(GET_DISPATCH(), ( r, g, b, a ));
}
static void GLAPIENTRY TAG(Color4fv)( const GLfloat *v )
{
PRE_LOOPBACK( Color4fv );
GL_CALL(Color4fv)( v );
CALL_Color4fv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(EdgeFlag)( GLboolean e )
{
PRE_LOOPBACK( EdgeFlag );
GL_CALL(EdgeFlag)( e );
CALL_EdgeFlag(GET_DISPATCH(), ( e ));
}
static void GLAPIENTRY TAG(EdgeFlagv)( const GLboolean *v )
{
PRE_LOOPBACK( EdgeFlagv );
GL_CALL(EdgeFlagv)( v );
CALL_EdgeFlagv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(EvalCoord1f)( GLfloat s )
{
PRE_LOOPBACK( EvalCoord1f );
GL_CALL(EvalCoord1f)( s );
CALL_EvalCoord1f(GET_DISPATCH(), ( s ));
}
static void GLAPIENTRY TAG(EvalCoord1fv)( const GLfloat *v )
{
PRE_LOOPBACK( EvalCoord1fv );
GL_CALL(EvalCoord1fv)( v );
CALL_EvalCoord1fv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(EvalCoord2f)( GLfloat s, GLfloat t )
{
PRE_LOOPBACK( EvalCoord2f );
GL_CALL(EvalCoord2f)( s, t );
CALL_EvalCoord2f(GET_DISPATCH(), ( s, t ));
}
static void GLAPIENTRY TAG(EvalCoord2fv)( const GLfloat *v )
{
PRE_LOOPBACK( EvalCoord2fv );
GL_CALL(EvalCoord2fv)( v );
CALL_EvalCoord2fv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(EvalPoint1)( GLint i )
{
PRE_LOOPBACK( EvalPoint1 );
GL_CALL(EvalPoint1)( i );
CALL_EvalPoint1(GET_DISPATCH(), ( i ));
}
static void GLAPIENTRY TAG(EvalPoint2)( GLint i, GLint j )
{
PRE_LOOPBACK( EvalPoint2 );
GL_CALL(EvalPoint2)( i, j );
CALL_EvalPoint2(GET_DISPATCH(), ( i, j ));
}
static void GLAPIENTRY TAG(FogCoordfEXT)( GLfloat f )
{
PRE_LOOPBACK( FogCoordfEXT );
GL_CALL(FogCoordfEXT)( f );
CALL_FogCoordfEXT(GET_DISPATCH(), ( f ));
}
static void GLAPIENTRY TAG(FogCoordfvEXT)( const GLfloat *v )
{
PRE_LOOPBACK( FogCoordfvEXT );
GL_CALL(FogCoordfvEXT)( v );
CALL_FogCoordfvEXT(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(Indexf)( GLfloat f )
{
PRE_LOOPBACK( Indexf );
GL_CALL(Indexf)( f );
CALL_Indexf(GET_DISPATCH(), ( f ));
}
static void GLAPIENTRY TAG(Indexfv)( const GLfloat *v )
{
PRE_LOOPBACK( Indexfv );
GL_CALL(Indexfv)( v );
CALL_Indexfv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(Materialfv)( GLenum face, GLenum pname, const GLfloat *v )
{
PRE_LOOPBACK( Materialfv );
GL_CALL(Materialfv)( face, pname, v );
CALL_Materialfv(GET_DISPATCH(), ( face, pname, v ));
}
static void GLAPIENTRY TAG(MultiTexCoord1fARB)( GLenum target, GLfloat a )
{
PRE_LOOPBACK( MultiTexCoord1fARB );
GL_CALL(MultiTexCoord1fARB)( target, a );
CALL_MultiTexCoord1fARB(GET_DISPATCH(), ( target, a ));
}
static void GLAPIENTRY TAG(MultiTexCoord1fvARB)( GLenum target, const GLfloat *tc )
{
PRE_LOOPBACK( MultiTexCoord1fvARB );
GL_CALL(MultiTexCoord1fvARB)( target, tc );
CALL_MultiTexCoord1fvARB(GET_DISPATCH(), ( target, tc ));
}
static void GLAPIENTRY TAG(MultiTexCoord2fARB)( GLenum target, GLfloat s, GLfloat t )
{
PRE_LOOPBACK( MultiTexCoord2fARB );
GL_CALL(MultiTexCoord2fARB)( target, s, t );
CALL_MultiTexCoord2fARB(GET_DISPATCH(), ( target, s, t ));
}
static void GLAPIENTRY TAG(MultiTexCoord2fvARB)( GLenum target, const GLfloat *tc )
{
PRE_LOOPBACK( MultiTexCoord2fvARB );
GL_CALL(MultiTexCoord2fvARB)( target, tc );
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), ( target, tc ));
}
static void GLAPIENTRY TAG(MultiTexCoord3fARB)( GLenum target, GLfloat s,
GLfloat t, GLfloat r )
{
PRE_LOOPBACK( MultiTexCoord3fARB );
GL_CALL(MultiTexCoord3fARB)( target, s, t, r );
CALL_MultiTexCoord3fARB(GET_DISPATCH(), ( target, s, t, r ));
}
static void GLAPIENTRY TAG(MultiTexCoord3fvARB)( GLenum target, const GLfloat *tc )
{
PRE_LOOPBACK( MultiTexCoord3fvARB );
GL_CALL(MultiTexCoord3fvARB)( target, tc );
CALL_MultiTexCoord3fvARB(GET_DISPATCH(), ( target, tc ));
}
static void GLAPIENTRY TAG(MultiTexCoord4fARB)( GLenum target, GLfloat s,
GLfloat t, GLfloat r, GLfloat q )
{
PRE_LOOPBACK( MultiTexCoord4fARB );
GL_CALL(MultiTexCoord4fARB)( target, s, t, r, q );
CALL_MultiTexCoord4fARB(GET_DISPATCH(), ( target, s, t, r, q ));
}
static void GLAPIENTRY TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *tc )
{
PRE_LOOPBACK( MultiTexCoord4fvARB );
GL_CALL(MultiTexCoord4fvARB)( target, tc );
CALL_MultiTexCoord4fvARB(GET_DISPATCH(), ( target, tc ));
}
static void GLAPIENTRY TAG(Normal3f)( GLfloat x, GLfloat y, GLfloat z )
{
PRE_LOOPBACK( Normal3f );
GL_CALL(Normal3f)( x, y, z );
CALL_Normal3f(GET_DISPATCH(), ( x, y, z ));
}
static void GLAPIENTRY TAG(Normal3fv)( const GLfloat *v )
{
PRE_LOOPBACK( Normal3fv );
GL_CALL(Normal3fv)( v );
CALL_Normal3fv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(SecondaryColor3fEXT)( GLfloat r, GLfloat g, GLfloat b )
{
PRE_LOOPBACK( SecondaryColor3fEXT );
GL_CALL(SecondaryColor3fEXT)( r, g, b );
CALL_SecondaryColor3fEXT(GET_DISPATCH(), ( r, g, b ));
}
static void GLAPIENTRY TAG(SecondaryColor3fvEXT)( const GLfloat *v )
{
PRE_LOOPBACK( SecondaryColor3fvEXT );
GL_CALL(SecondaryColor3fvEXT)( v );
CALL_SecondaryColor3fvEXT(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(TexCoord1f)( GLfloat s )
{
PRE_LOOPBACK( TexCoord1f );
GL_CALL(TexCoord1f)( s );
CALL_TexCoord1f(GET_DISPATCH(), ( s ));
}
static void GLAPIENTRY TAG(TexCoord1fv)( const GLfloat *tc )
{
PRE_LOOPBACK( TexCoord1fv );
GL_CALL(TexCoord1fv)( tc );
CALL_TexCoord1fv(GET_DISPATCH(), ( tc ));
}
static void GLAPIENTRY TAG(TexCoord2f)( GLfloat s, GLfloat t )
{
PRE_LOOPBACK( TexCoord2f );
GL_CALL(TexCoord2f)( s, t );
CALL_TexCoord2f(GET_DISPATCH(), ( s, t ));
}
static void GLAPIENTRY TAG(TexCoord2fv)( const GLfloat *tc )
{
PRE_LOOPBACK( TexCoord2fv );
GL_CALL(TexCoord2fv)( tc );
CALL_TexCoord2fv(GET_DISPATCH(), ( tc ));
}
static void GLAPIENTRY TAG(TexCoord3f)( GLfloat s, GLfloat t, GLfloat r )
{
PRE_LOOPBACK( TexCoord3f );
GL_CALL(TexCoord3f)( s, t, r );
CALL_TexCoord3f(GET_DISPATCH(), ( s, t, r ));
}
static void GLAPIENTRY TAG(TexCoord3fv)( const GLfloat *tc )
{
PRE_LOOPBACK( TexCoord3fv );
GL_CALL(TexCoord3fv)( tc );
CALL_TexCoord3fv(GET_DISPATCH(), ( tc ));
}
static void GLAPIENTRY TAG(TexCoord4f)( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
{
PRE_LOOPBACK( TexCoord4f );
GL_CALL(TexCoord4f)( s, t, r, q );
CALL_TexCoord4f(GET_DISPATCH(), ( s, t, r, q ));
}
static void GLAPIENTRY TAG(TexCoord4fv)( const GLfloat *tc )
{
PRE_LOOPBACK( TexCoord4fv );
GL_CALL(TexCoord4fv)( tc );
CALL_TexCoord4fv(GET_DISPATCH(), ( tc ));
}
static void GLAPIENTRY TAG(Vertex2f)( GLfloat x, GLfloat y )
{
PRE_LOOPBACK( Vertex2f );
GL_CALL(Vertex2f)( x, y );
CALL_Vertex2f(GET_DISPATCH(), ( x, y ));
}
static void GLAPIENTRY TAG(Vertex2fv)( const GLfloat *v )
{
PRE_LOOPBACK( Vertex2fv );
GL_CALL(Vertex2fv)( v );
CALL_Vertex2fv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(Vertex3f)( GLfloat x, GLfloat y, GLfloat z )
{
PRE_LOOPBACK( Vertex3f );
GL_CALL(Vertex3f)( x, y, z );
CALL_Vertex3f(GET_DISPATCH(), ( x, y, z ));
}
static void GLAPIENTRY TAG(Vertex3fv)( const GLfloat *v )
{
PRE_LOOPBACK( Vertex3fv );
GL_CALL(Vertex3fv)( v );
CALL_Vertex3fv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(Vertex4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
PRE_LOOPBACK( Vertex4f );
GL_CALL(Vertex4f)( x, y, z, w );
CALL_Vertex4f(GET_DISPATCH(), ( x, y, z, w ));
}
static void GLAPIENTRY TAG(Vertex4fv)( const GLfloat *v )
{
PRE_LOOPBACK( Vertex4fv );
GL_CALL(Vertex4fv)( v );
CALL_Vertex4fv(GET_DISPATCH(), ( v ));
}
static void GLAPIENTRY TAG(CallList)( GLuint i )
{
PRE_LOOPBACK( CallList );
GL_CALL(CallList)( i );
CALL_CallList(GET_DISPATCH(), ( i ));
}
static void GLAPIENTRY TAG(CallLists)( GLsizei sz, GLenum type, const GLvoid *v )
{
PRE_LOOPBACK( CallLists );
GL_CALL(CallLists)( sz, type, v );
CALL_CallLists(GET_DISPATCH(), ( sz, type, v ));
}
static void GLAPIENTRY TAG(Begin)( GLenum mode )
{
PRE_LOOPBACK( Begin );
GL_CALL(Begin)( mode );
CALL_Begin(GET_DISPATCH(), ( mode ));
}
static void GLAPIENTRY TAG(End)( void )
{
PRE_LOOPBACK( End );
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}
static void GLAPIENTRY TAG(Rectf)( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
{
PRE_LOOPBACK( Rectf );
GL_CALL(Rectf)( x1, y1, x2, y2 );
CALL_Rectf(GET_DISPATCH(), ( x1, y1, x2, y2 ));
}
static void GLAPIENTRY TAG(DrawArrays)( GLenum mode, GLint start, GLsizei count )
{
PRE_LOOPBACK( DrawArrays );
GL_CALL(DrawArrays)( mode, start, count );
CALL_DrawArrays(GET_DISPATCH(), ( mode, start, count ));
}
static void GLAPIENTRY TAG(DrawElements)( GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices )
{
PRE_LOOPBACK( DrawElements );
GL_CALL(DrawElements)( mode, count, type, indices );
CALL_DrawElements(GET_DISPATCH(), ( mode, count, type, indices ));
}
static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start,
@@ -343,117 +345,117 @@ static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start,
GLenum type, const GLvoid *indices )
{
PRE_LOOPBACK( DrawRangeElements );
GL_CALL(DrawRangeElements)( mode, start, end, count, type, indices );
CALL_DrawRangeElements(GET_DISPATCH(), ( mode, start, end, count, type, indices ));
}
static void GLAPIENTRY TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 )
{
PRE_LOOPBACK( EvalMesh1 );
GL_CALL(EvalMesh1)( mode, i1, i2 );
CALL_EvalMesh1(GET_DISPATCH(), ( mode, i1, i2 ));
}
static void GLAPIENTRY TAG(EvalMesh2)( GLenum mode, GLint i1, GLint i2,
GLint j1, GLint j2 )
{
PRE_LOOPBACK( EvalMesh2 );
GL_CALL(EvalMesh2)( mode, i1, i2, j1, j2 );
CALL_EvalMesh2(GET_DISPATCH(), ( mode, i1, i2, j1, j2 ));
}
static void GLAPIENTRY TAG(VertexAttrib1fNV)( GLuint index, GLfloat x )
{
PRE_LOOPBACK( VertexAttrib1fNV );
GL_CALL(VertexAttrib1fNV)( index, x );
CALL_VertexAttrib1fNV(GET_DISPATCH(), ( index, x ));
}
static void GLAPIENTRY TAG(VertexAttrib1fvNV)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib1fvNV );
GL_CALL(VertexAttrib1fvNV)( index, v );
CALL_VertexAttrib1fvNV(GET_DISPATCH(), ( index, v ));
}
static void GLAPIENTRY TAG(VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y )
{
PRE_LOOPBACK( VertexAttrib2fNV );
GL_CALL(VertexAttrib2fNV)( index, x, y );
CALL_VertexAttrib2fNV(GET_DISPATCH(), ( index, x, y ));
}
static void GLAPIENTRY TAG(VertexAttrib2fvNV)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib2fvNV );
GL_CALL(VertexAttrib2fvNV)( index, v );
CALL_VertexAttrib2fvNV(GET_DISPATCH(), ( index, v ));
}
static void GLAPIENTRY TAG(VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z )
{
PRE_LOOPBACK( VertexAttrib3fNV );
GL_CALL(VertexAttrib3fNV)( index, x, y, z );
CALL_VertexAttrib3fNV(GET_DISPATCH(), ( index, x, y, z ));
}
static void GLAPIENTRY TAG(VertexAttrib3fvNV)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib3fvNV );
GL_CALL(VertexAttrib3fvNV)( index, v );
CALL_VertexAttrib3fvNV(GET_DISPATCH(), ( index, v ));
}
static void GLAPIENTRY TAG(VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
PRE_LOOPBACK( VertexAttrib4fNV );
GL_CALL(VertexAttrib4fNV)( index, x, y, z, w );
CALL_VertexAttrib4fNV(GET_DISPATCH(), ( index, x, y, z, w ));
}
static void GLAPIENTRY TAG(VertexAttrib4fvNV)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib4fvNV );
GL_CALL(VertexAttrib4fvNV)( index, v );
CALL_VertexAttrib4fvNV(GET_DISPATCH(), ( index, v ));
}
static void GLAPIENTRY TAG(VertexAttrib1fARB)( GLuint index, GLfloat x )
{
PRE_LOOPBACK( VertexAttrib1fARB );
GL_CALL(VertexAttrib1fARB)( index, x );
CALL_VertexAttrib1fARB(GET_DISPATCH(), ( index, x ));
}
static void GLAPIENTRY TAG(VertexAttrib1fvARB)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib1fvARB );
GL_CALL(VertexAttrib1fvARB)( index, v );
CALL_VertexAttrib1fvARB(GET_DISPATCH(), ( index, v ));
}
static void GLAPIENTRY TAG(VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y )
{
PRE_LOOPBACK( VertexAttrib2fARB );
GL_CALL(VertexAttrib2fARB)( index, x, y );
CALL_VertexAttrib2fARB(GET_DISPATCH(), ( index, x, y ));
}
static void GLAPIENTRY TAG(VertexAttrib2fvARB)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib2fvARB );
GL_CALL(VertexAttrib2fvARB)( index, v );
CALL_VertexAttrib2fvARB(GET_DISPATCH(), ( index, v ));
}
static void GLAPIENTRY TAG(VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z )
{
PRE_LOOPBACK( VertexAttrib3fARB );
GL_CALL(VertexAttrib3fARB)( index, x, y, z );
CALL_VertexAttrib3fARB(GET_DISPATCH(), ( index, x, y, z ));
}
static void GLAPIENTRY TAG(VertexAttrib3fvARB)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib3fvARB );
GL_CALL(VertexAttrib3fvARB)( index, v );
CALL_VertexAttrib3fvARB(GET_DISPATCH(), ( index, v ));
}
static void GLAPIENTRY TAG(VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
PRE_LOOPBACK( VertexAttrib4fARB );
GL_CALL(VertexAttrib4fARB)( index, x, y, z, w );
CALL_VertexAttrib4fARB(GET_DISPATCH(), ( index, x, y, z, w ));
}
static void GLAPIENTRY TAG(VertexAttrib4fvARB)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib4fvARB );
GL_CALL(VertexAttrib4fvARB)( index, v );
CALL_VertexAttrib4fvARB(GET_DISPATCH(), ( index, v ));
}

View File

@@ -42,6 +42,8 @@
#include "arbprogparse.h"
#include "grammar_mesa.h"
#include "dispatch.h"
#ifndef __extension__
#if !defined(__GNUC__) || (__GNUC__ < 2) || \
((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7))
@@ -3884,7 +3886,8 @@ static int set_reg8 (GLcontext *ctx, grammar id, const byte *name, byte value)
static int extension_is_supported (const GLubyte *ext)
{
const GLubyte *extensions = GL_CALL(GetString)(GL_EXTENSIONS);
GET_CURRENT_CONTEXT(ctx);
const GLubyte *extensions = CALL_GetString(GET_DISPATCH(), (GL_EXTENSIONS));
const GLubyte *end = extensions + _mesa_strlen ((const char *) extensions);
const GLint ext_len = (GLint)_mesa_strlen ((const char *) ext);

View File

@@ -111,7 +111,7 @@ _swrast_mask_rgba_array(GLcontext *ctx, struct gl_renderbuffer *rb,
const GLint bMask = ctx->Color.ColorMask[BCOMP];
const GLint aMask = ctx->Color.ColorMask[ACOMP];
_swrast_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest );
_swrast_read_rgba_span( ctx, rb, n, x, y, dest );
for (i = 0; i < n; i++) {
if (!rMask) rgba[i][RCOMP] = dest[i][RCOMP];
if (!gMask) rgba[i][GCOMP] = dest[i][GCOMP];

View File

@@ -1365,7 +1365,7 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
else {
GLint skip, length;
if (x < 0) {
/* left edge clippping */
/* left edge clipping */
skip = -x;
length = (GLint) n - skip;
if (length < 0) {
@@ -1418,7 +1418,7 @@ _swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb,
else {
GLint skip, length;
if (x < 0) {
/* left edge clippping */
/* left edge clipping */
skip = -x;
length = (GLint) n - skip;
if (length < 0) {

View File

@@ -43,6 +43,7 @@
#include "t_save_api.h"
#include "t_context.h"
#include "t_pipeline.h"
#include "dispatch.h"
static void fallback_drawarrays( GLcontext *ctx, GLenum mode, GLint start,
GLsizei count )
@@ -52,10 +53,10 @@ static void fallback_drawarrays( GLcontext *ctx, GLenum mode, GLint start,
assert(!ctx->CompileFlag);
assert(ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1);
GL_CALL(Begin)(mode);
CALL_Begin(GET_DISPATCH(), (mode));
for (i = 0; i < count; i++)
GL_CALL(ArrayElement)( start + i );
GL_CALL(End)();
CALL_ArrayElement(GET_DISPATCH(), ( start + i ));
CALL_End(GET_DISPATCH(), ());
}
@@ -69,11 +70,11 @@ static void fallback_drawelements( GLcontext *ctx, GLenum mode, GLsizei count,
/* Here, indices will already reflect the buffer object if active */
GL_CALL(Begin)(mode);
CALL_Begin(GET_DISPATCH(), (mode));
for (i = 0 ; i < count ; i++) {
GL_CALL(ArrayElement)( indices[i] );
CALL_ArrayElement(GET_DISPATCH(), ( indices[i] ));
}
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}

View File

@@ -77,6 +77,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "api_arrayelt.h"
#include "vtxfmt.h"
#include "t_save_api.h"
#include "dispatch.h"
/*
* NOTE: Old 'parity' issue is gone, but copying can still be
@@ -1212,56 +1213,56 @@ static void GLAPIENTRY _save_EvalCoord1f( GLfloat u )
{
GET_CURRENT_CONTEXT(ctx);
FALLBACK(ctx);
ctx->Save->EvalCoord1f( u );
CALL_EvalCoord1f(ctx->Save, ( u ));
}
static void GLAPIENTRY _save_EvalCoord1fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
FALLBACK(ctx);
ctx->Save->EvalCoord1fv( v );
CALL_EvalCoord1fv(ctx->Save, ( v ));
}
static void GLAPIENTRY _save_EvalCoord2f( GLfloat u, GLfloat v )
{
GET_CURRENT_CONTEXT(ctx);
FALLBACK(ctx);
ctx->Save->EvalCoord2f( u, v );
CALL_EvalCoord2f(ctx->Save, ( u, v ));
}
static void GLAPIENTRY _save_EvalCoord2fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
FALLBACK(ctx);
ctx->Save->EvalCoord2fv( v );
CALL_EvalCoord2fv(ctx->Save, ( v ));
}
static void GLAPIENTRY _save_EvalPoint1( GLint i )
{
GET_CURRENT_CONTEXT(ctx);
FALLBACK(ctx);
ctx->Save->EvalPoint1( i );
CALL_EvalPoint1(ctx->Save, ( i ));
}
static void GLAPIENTRY _save_EvalPoint2( GLint i, GLint j )
{
GET_CURRENT_CONTEXT(ctx);
FALLBACK(ctx);
ctx->Save->EvalPoint2( i, j );
CALL_EvalPoint2(ctx->Save, ( i, j ));
}
static void GLAPIENTRY _save_CallList( GLuint l )
{
GET_CURRENT_CONTEXT(ctx);
FALLBACK(ctx);
ctx->Save->CallList( l );
CALL_CallList(ctx->Save, ( l ));
}
static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v )
{
GET_CURRENT_CONTEXT(ctx);
FALLBACK(ctx);
ctx->Save->CallLists( n, type, v );
CALL_CallLists(ctx->Save, ( n, type, v ));
}
@@ -1383,11 +1384,11 @@ static void GLAPIENTRY _save_OBE_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfl
{
GET_CURRENT_CONTEXT(ctx);
_save_NotifyBegin( ctx, GL_QUADS | PRIM_WEAK );
GL_CALL(Vertex2f)( x1, y1 );
GL_CALL(Vertex2f)( x2, y1 );
GL_CALL(Vertex2f)( x2, y2 );
GL_CALL(Vertex2f)( x1, y2 );
GL_CALL(End)();
CALL_Vertex2f(GET_DISPATCH(), ( x1, y1 ));
CALL_Vertex2f(GET_DISPATCH(), ( x2, y1 ));
CALL_Vertex2f(GET_DISPATCH(), ( x2, y2 ));
CALL_Vertex2f(GET_DISPATCH(), ( x1, y2 ));
CALL_End(GET_DISPATCH(), ());
}
@@ -1401,8 +1402,8 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co
_save_NotifyBegin( ctx, mode | PRIM_WEAK );
for (i = 0; i < count; i++)
GL_CALL(ArrayElement)(start + i);
GL_CALL(End)();
CALL_ArrayElement(GET_DISPATCH(), (start + i));
CALL_End(GET_DISPATCH(), ());
}
@@ -1420,22 +1421,22 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
switch (type) {
case GL_UNSIGNED_BYTE:
for (i = 0 ; i < count ; i++)
GL_CALL(ArrayElement)( ((GLubyte *)indices)[i] );
CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] ));
break;
case GL_UNSIGNED_SHORT:
for (i = 0 ; i < count ; i++)
GL_CALL(ArrayElement)( ((GLushort *)indices)[i] );
CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] ));
break;
case GL_UNSIGNED_INT:
for (i = 0 ; i < count ; i++)
GL_CALL(ArrayElement)( ((GLuint *)indices)[i] );
CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] ));
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
break;
}
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}
static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,

View File

@@ -35,6 +35,7 @@
#include "mtypes.h"
#include "t_context.h"
#include "t_save_api.h"
#include "dispatch.h"
/* If someone compiles a display list like:
* glBegin(Triangles)
@@ -70,22 +71,22 @@ typedef void (*attr_func)( GLcontext *ctx, GLint target, const GLfloat * );
/* Wrapper functions in case glVertexAttrib*fvNV doesn't exist */
static void VertexAttrib1fvNV(GLcontext *ctx, GLint target, const GLfloat *v)
{
ctx->Exec->VertexAttrib1fvNV(target, v);
CALL_VertexAttrib1fvNV(ctx->Exec, (target, v));
}
static void VertexAttrib2fvNV(GLcontext *ctx, GLint target, const GLfloat *v)
{
ctx->Exec->VertexAttrib2fvNV(target, v);
CALL_VertexAttrib2fvNV(ctx->Exec, (target, v));
}
static void VertexAttrib3fvNV(GLcontext *ctx, GLint target, const GLfloat *v)
{
ctx->Exec->VertexAttrib3fvNV(target, v);
CALL_VertexAttrib3fvNV(ctx->Exec, (target, v));
}
static void VertexAttrib4fvNV(GLcontext *ctx, GLint target, const GLfloat *v)
{
ctx->Exec->VertexAttrib4fvNV(target, v);
CALL_VertexAttrib4fvNV(ctx->Exec, (target, v));
}
static attr_func vert_attrfunc[4] = {
@@ -98,22 +99,22 @@ static attr_func vert_attrfunc[4] = {
static void VertexAttrib1fvARB(GLcontext *ctx, GLint target, const GLfloat *v)
{
ctx->Exec->VertexAttrib1fvARB(target, v);
CALL_VertexAttrib1fvARB(ctx->Exec, (target, v));
}
static void VertexAttrib2fvARB(GLcontext *ctx, GLint target, const GLfloat *v)
{
ctx->Exec->VertexAttrib2fvARB(target, v);
CALL_VertexAttrib2fvARB(ctx->Exec, (target, v));
}
static void VertexAttrib3fvARB(GLcontext *ctx, GLint target, const GLfloat *v)
{
ctx->Exec->VertexAttrib3fvARB(target, v);
CALL_VertexAttrib3fvARB(ctx->Exec, (target, v));
}
static void VertexAttrib4fvARB(GLcontext *ctx, GLint target, const GLfloat *v)
{
ctx->Exec->VertexAttrib4fvARB(target, v);
CALL_VertexAttrib4fvARB(ctx->Exec, (target, v));
}
static attr_func vert_attrfunc_arb[4] = {
@@ -133,10 +134,10 @@ static void mat_attr1fv( GLcontext *ctx, GLint target, const GLfloat *v )
{
switch (target) {
case _TNL_ATTRIB_MAT_FRONT_SHININESS:
ctx->Exec->Materialfv( GL_FRONT, GL_SHININESS, v );
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_SHININESS, v ));
break;
case _TNL_ATTRIB_MAT_BACK_SHININESS:
ctx->Exec->Materialfv( GL_BACK, GL_SHININESS, v );
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_SHININESS, v ));
break;
}
}
@@ -146,10 +147,10 @@ static void mat_attr3fv( GLcontext *ctx, GLint target, const GLfloat *v )
{
switch (target) {
case _TNL_ATTRIB_MAT_FRONT_INDEXES:
ctx->Exec->Materialfv( GL_FRONT, GL_COLOR_INDEXES, v );
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_COLOR_INDEXES, v ));
break;
case _TNL_ATTRIB_MAT_BACK_INDEXES:
ctx->Exec->Materialfv( GL_BACK, GL_COLOR_INDEXES, v );
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_COLOR_INDEXES, v ));
break;
}
}
@@ -159,28 +160,28 @@ static void mat_attr4fv( GLcontext *ctx, GLint target, const GLfloat *v )
{
switch (target) {
case _TNL_ATTRIB_MAT_FRONT_EMISSION:
ctx->Exec->Materialfv( GL_FRONT, GL_EMISSION, v );
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_EMISSION, v ));
break;
case _TNL_ATTRIB_MAT_BACK_EMISSION:
ctx->Exec->Materialfv( GL_BACK, GL_EMISSION, v );
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_EMISSION, v ));
break;
case _TNL_ATTRIB_MAT_FRONT_AMBIENT:
ctx->Exec->Materialfv( GL_FRONT, GL_AMBIENT, v );
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_AMBIENT, v ));
break;
case _TNL_ATTRIB_MAT_BACK_AMBIENT:
ctx->Exec->Materialfv( GL_BACK, GL_AMBIENT, v );
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_AMBIENT, v ));
break;
case _TNL_ATTRIB_MAT_FRONT_DIFFUSE:
ctx->Exec->Materialfv( GL_FRONT, GL_DIFFUSE, v );
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_DIFFUSE, v ));
break;
case _TNL_ATTRIB_MAT_BACK_DIFFUSE:
ctx->Exec->Materialfv( GL_BACK, GL_DIFFUSE, v );
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_DIFFUSE, v ));
break;
case _TNL_ATTRIB_MAT_FRONT_SPECULAR:
ctx->Exec->Materialfv( GL_FRONT, GL_SPECULAR, v );
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_SPECULAR, v ));
break;
case _TNL_ATTRIB_MAT_BACK_SPECULAR:
ctx->Exec->Materialfv( GL_BACK, GL_SPECULAR, v );
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_SPECULAR, v ));
break;
}
}
@@ -197,13 +198,13 @@ static attr_func mat_attrfunc[4] = {
static void index_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v)
{
(void) target;
ctx->Exec->Indexf(v[0]);
CALL_Indexf(ctx->Exec, (v[0]));
}
static void edgeflag_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v)
{
(void) target;
ctx->Exec->EdgeFlag((GLboolean)(v[0] == 1.0));
CALL_EdgeFlag(ctx->Exec, ((GLboolean)(v[0] == 1.0)));
}
struct loopback_attr {
@@ -228,7 +229,7 @@ static void loopback_prim( GLcontext *ctx,
GLuint k;
if (prim->mode & PRIM_BEGIN) {
GL_CALL(Begin)( prim->mode & PRIM_MODE_MASK );
CALL_Begin(GET_DISPATCH(), ( prim->mode & PRIM_MODE_MASK ));
}
else {
assert(i == 0);
@@ -253,7 +254,7 @@ static void loopback_prim( GLcontext *ctx,
}
if (prim->mode & PRIM_END) {
GL_CALL(End)();
CALL_End(GET_DISPATCH(), ());
}
else {
assert (i == list->prim_count-1);

View File

@@ -43,6 +43,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "t_vtx_api.h"
#include "simple_list.h"
#include "dispatch.h"
static void reset_attrfv( TNLcontext *tnl );
static tnl_attrfv_func choose[_TNL_MAX_ATTR_CODEGEN+1][4]; /* +1 for ERROR_ATTRIB */
@@ -749,7 +751,7 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode )
if (!(tnl->Driver.NotifyBegin &&
tnl->Driver.NotifyBegin( ctx, mode )))
ctx->Exec->Begin(mode);
CALL_Begin(ctx->Exec, (mode));
return;
}

View File

@@ -31,6 +31,7 @@
#include "macros.h"
#include "math/m_eval.h"
#include "t_vtx_api.h"
#include "dispatch.h"
static void clear_active_eval1( TNLcontext *tnl, GLuint attr )
@@ -165,9 +166,9 @@ void _tnl_do_EvalCoord1f(GLcontext* ctx, GLfloat u)
map->Order);
if (tnl->vtx.eval.map1[0].sz == 4)
GL_CALL(Vertex4fv)( vertex );
CALL_Vertex4fv(GET_DISPATCH(), ( vertex ));
else
GL_CALL(Vertex3fv)( vertex );
CALL_Vertex3fv(GET_DISPATCH(), ( vertex ));
}
}
@@ -244,9 +245,9 @@ void _tnl_do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v )
}
if (tnl->vtx.attrsz[0] == 4)
GL_CALL(Vertex4fv)( vertex );
CALL_Vertex4fv(GET_DISPATCH(), ( vertex ));
else
GL_CALL(Vertex3fv)( vertex );
CALL_Vertex3fv(GET_DISPATCH(), ( vertex ));
}
}

View File

@@ -287,12 +287,12 @@ static void TAG(choose_Color3f)( GLfloat r, GLfloat g, GLfloat b )
if ( ctx->Light.Enabled ) {
if ( ctx->Light.ColorMaterialEnabled ) {
ctx->Exec->Color3f = TAG(ColorMaterial3f);
SET_Color3f(ctx->Exec, TAG(ColorMaterial3f));
} else {
ctx->Exec->Color3f = _mesa_noop_Color3f;
SET_Color3f(ctx->Exec, _mesa_noop_Color3f);
}
} else {
ctx->Exec->Color3f = TAG(Color3f);
SET_Color3f(ctx->Exec, TAG(Color3f));
}
glColor3f( r, g, b );
}
@@ -303,12 +303,12 @@ static void TAG(choose_Color3fv)( const GLfloat *v )
if ( ctx->Light.Enabled ) {
if ( ctx->Light.ColorMaterialEnabled ) {
ctx->Exec->Color3fv = TAG(ColorMaterial3fv);
SET_Color3fv(ctx->Exec, TAG(ColorMaterial3fv));
} else {
ctx->Exec->Color3fv = _mesa_noop_Color3fv;
SET_Color3fv(ctx->Exec, _mesa_noop_Color3fv);
}
} else {
ctx->Exec->Color3fv = TAG(Color3fv);
SET_Color3fv(ctx->Exec, TAG(Color3fv));
}
glColor3fv( v );
}
@@ -319,12 +319,12 @@ static void TAG(choose_Color3ub)( GLubyte r, GLubyte g, GLubyte b )
if ( ctx->Light.Enabled ) {
if ( ctx->Light.ColorMaterialEnabled ) {
ctx->Exec->Color3ub = TAG(ColorMaterial3ub);
SET_Color3ub(ctx->Exec, TAG(ColorMaterial3ub));
} else {
ctx->Exec->Color3ub = _mesa_noop_Color3ub;
SET_Color3ub(ctx->Exec, _mesa_noop_Color3ub);
}
} else {
ctx->Exec->Color3ub = TAG(Color3ub);
SET_Color3ub(ctx->Exec, TAG(Color3ub));
}
glColor3ub( r, g, b );
}
@@ -335,12 +335,12 @@ static void TAG(choose_Color3ubv)( const GLubyte *v )
if ( ctx->Light.Enabled ) {
if ( ctx->Light.ColorMaterialEnabled ) {
ctx->Exec->Color3ubv = TAG(ColorMaterial3ubv);
SET_Color3ubv(ctx->Exec, TAG(ColorMaterial3ubv));
} else {
ctx->Exec->Color3ubv = _mesa_noop_Color3ubv;
SET_Color3ubv(ctx->Exec, _mesa_noop_Color3ubv);
}
} else {
ctx->Exec->Color3ubv = TAG(Color3ubv);
SET_Color3ubv(ctx->Exec, TAG(Color3ubv));
}
glColor3ubv( v );
}
@@ -351,12 +351,12 @@ static void TAG(choose_Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
if ( ctx->Light.Enabled ) {
if ( ctx->Light.ColorMaterialEnabled ) {
ctx->Exec->Color4f = TAG(ColorMaterial4f);
SET_Color4f(ctx->Exec, TAG(ColorMaterial4f));
} else {
ctx->Exec->Color4f = _mesa_noop_Color4f;
SET_Color4f(ctx->Exec, _mesa_noop_Color4f);
}
} else {
ctx->Exec->Color4f = TAG(Color4f);
SET_Color4f(ctx->Exec, TAG(Color4f));
}
glColor4f( r, g, b, a );
}
@@ -367,12 +367,12 @@ static void TAG(choose_Color4fv)( const GLfloat *v )
if ( ctx->Light.Enabled ) {
if ( ctx->Light.ColorMaterialEnabled ) {
ctx->Exec->Color4fv = TAG(ColorMaterial4fv);
SET_Color4fv(ctx->Exec, TAG(ColorMaterial4fv));
} else {
ctx->Exec->Color4fv = _mesa_noop_Color4fv;
SET_Color4fv(ctx->Exec, _mesa_noop_Color4fv);
}
} else {
ctx->Exec->Color4fv = TAG(Color4fv);
SET_Color4fv(ctx->Exec, TAG(Color4fv));
}
glColor4fv( v );
}
@@ -383,12 +383,12 @@ static void TAG(choose_Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a )
if ( ctx->Light.Enabled ) {
if ( ctx->Light.ColorMaterialEnabled ) {
ctx->Exec->Color4ub = TAG(ColorMaterial4ub);
SET_Color4ub(ctx->Exec, TAG(ColorMaterial4ub));
} else {
ctx->Exec->Color4ub = _mesa_noop_Color4ub;
SET_Color4ub(ctx->Exec, _mesa_noop_Color4ub);
}
} else {
ctx->Exec->Color4ub = TAG(Color4ub);
SET_Color4ub(ctx->Exec, TAG(Color4ub));
}
glColor4ub( r, g, b, a );
}
@@ -399,12 +399,12 @@ static void TAG(choose_Color4ubv)( const GLubyte *v )
if ( ctx->Light.Enabled ) {
if ( ctx->Light.ColorMaterialEnabled ) {
ctx->Exec->Color4ubv = TAG(ColorMaterial4ubv);
SET_Color4ubv(ctx->Exec, TAG(ColorMaterial4ubv));
} else {
ctx->Exec->Color4ubv = _mesa_noop_Color4ubv;
SET_Color4ubv(ctx->Exec, _mesa_noop_Color4ubv);
}
} else {
ctx->Exec->Color4ubv = TAG(Color4ubv);
SET_Color4ubv(ctx->Exec, TAG(Color4ubv));
}
glColor4ubv( v );
}

View File

@@ -1,4 +1,4 @@
/* $Id: common_x86_asm.h,v 1.11 2004/04/26 10:10:25 alanh Exp $ */
/* $Id: common_x86_asm.h,v 1.12 2005/07/16 00:56:20 ajax Exp $ */
/*
* Mesa 3-D graphics library
@@ -43,10 +43,6 @@
*/
#include "common_x86_features.h"
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#ifdef USE_X86_ASM
#include "x86.h"
#ifdef USE_3DNOW_ASM