Use GLX protocol code generated by glX_proto_send.py.

This commit is contained in:
Ian Romanick 2004-12-20 04:53:00 +00:00
parent 46be433c47
commit 0d84c68313
12 changed files with 6245 additions and 2556 deletions

View File

@ -24,12 +24,10 @@ C_SOURCES = \
compsize.c \
dispatch.c \
eval.c \
g_render.c \
g_single.c \
g_vendpriv.c \
glxcmds.c \
glxext.c \
glxextensions.c \
indirect.c \
indirect_init.c \
indirect_size.c \
indirect_window_pos.c \

View File

@ -1,750 +0,0 @@
/* $XFree86: xc/lib/GL/glx/g_render.c,v 1.8 2004/01/28 18:11:38 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
#include "packrender.h"
#include "size.h"
#include "indirect.h"
#define GLdouble_SIZE 8
#define GLclampd_SIZE 8
#define GLfloat_SIZE 4
#define GLclampf_SIZE 4
#define GLint_SIZE 4
#define GLuint_SIZE 4
#define GLenum_SIZE 4
#define GLbitfield_SIZE 4
#define GLshort_SIZE 2
#define GLushort_SIZE 2
#define GLbyte_SIZE 1
#define GLubyte_SIZE 1
#define GLboolean_SIZE 1
#define __GLX_PUT_GLdouble(offset,value) __GLX_PUT_DOUBLE(offset,value)
#define __GLX_PUT_GLclampd(offset,value) __GLX_PUT_DOUBLE(offset,value)
#define __GLX_PUT_GLfloat(offset,value) __GLX_PUT_FLOAT(offset,value)
#define __GLX_PUT_GLclampf(offset,value) __GLX_PUT_FLOAT(offset,value)
#define __GLX_PUT_GLint(offset,value) __GLX_PUT_LONG(offset,value)
#define __GLX_PUT_GLuint(offset,value) __GLX_PUT_LONG(offset,value)
#define __GLX_PUT_GLenum(offset,value) __GLX_PUT_LONG(offset,value)
#define __GLX_PUT_GLbitfield(offset,value) __GLX_PUT_LONG(offset,value)
#define __GLX_PUT_GLshort(offset,value) __GLX_PUT_SHORT(offset,value)
#define __GLX_PUT_GLushort(offset,value) __GLX_PUT_SHORT(offset,value)
#define __GLX_PUT_GLbyte(offset,value) __GLX_PUT_CHAR(offset,value)
#define __GLX_PUT_GLubyte(offset,value) __GLX_PUT_CHAR(offset,value)
#define __GLX_PUT_GLboolean(offset,value) __GLX_PUT_CHAR(offset,value)
#define __GLX_PUT_GLdouble_ARRAY(offset,ptr,count) __GLX_PUT_DOUBLE_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLclampd_ARRAY(offset,ptr,count) __GLX_PUT_DOUBLE_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLfloat_ARRAY(offset,ptr,count) __GLX_PUT_FLOAT_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLclampf_ARRAY(offset,ptr,count) __GLX_PUT_FLOAT_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLint_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLuint_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLenum_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLshort_ARRAY(offset,ptr,count) __GLX_PUT_SHORT_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLushort_ARRAY(offset,ptr,count) __GLX_PUT_SHORT_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLbyte_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLubyte_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count)
#define __GLX_PUT_GLboolean_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count)
#define RENDER_SIZE(t,c) (__GLX_PAD(4 + (t ## _SIZE * c)))
/* GLX protocol templates are named in the following manner. All templates
* begin with the string 'glxproto_'. Following is an optional list of
* scalar parameters. The scalars are listed as type and number. The most
* common being \c enum1 (one scalar enum) and \c enum2 (two scalar enums).
*
* The final part of the name describes the number of named-type parameters
* and how they are passed.
* - One or more digits followed by the letter s means
* that the specified number of parameters are passed as scalars. The macro
* \c glxproto_3s generates a function that takes 3 scalars, such as
* \c glVertex3f.
* - A capital C follwed by a lower-case v means that a constant
* sized vector is passed. Macros of this type take an extra parameter,
* which is the size of the vector. The invocation
* 'glxproto_Cv(Vertex3fv, X_GLrop_Vertexfv, GLfloat, 3)' would generate the
* correct protocol for the \c glVertex3fv function.
* - A capital V followed by a lower-case v means that a variable sized
* vector is passed. The function generated by these macros will call
* a co-function to determine the size of the vector. The name of the
* co-function is generated by prepending \c __gl and appending \c _size
* to the base name of the function. The invocation
* 'glxproto_enum1_Vv(Fogiv, X_GLrop_Fogiv, GLint)' would generate the
* correct protocol for the \c glFogiv function.
* - One or more digits without a following letter means that a function
* taking the specified number of scalar parameters and a function with a
* vector parameter of the specified size should be generated. The letter
* v is automatically appended to the name of the vector-based function in
* this case. The invocation
* 'glxproto_3(Vertex3f, X_GLrop_Vertex3fv, GLfloat)' would generate the
* correct protocol for both \c glVertex3f and \c glVertex3fv.
*
* glxproto_void is a special case for functions that take no parameters
* (i.e., glEnd).
*
* An addition form is 'glxvendr_'. This is identical to the other forms
* with the exception of taking an additional parameter (to the macro) which
* is a vendor string to append to the function name. The invocation
* 'glxproto_3(Foo3f, X_GLrop_Foo3fv, GLfloat)' would generate the functions
* 'glFoo3fv' and 'glFoo3f', and the invocation
* 'glxvendr_3(Foo3f, X_GLrop_Foo3fv, GLfloat, EXT)' would generate the
* functions 'glFoo3fvEXT' and 'glFoo3fEXT'.
*/
#define glxproto_void(name, rop) \
void __indirect_gl ## name (void) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
__GLX_BEGIN(rop, 4); \
__GLX_END(4); \
}
#define glxproto_Cv(name, rop, type, count) \
void __indirect_gl ## name (const type * v) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = RENDER_SIZE(type, count); \
__GLX_BEGIN(rop, cmdlen); \
if (count <= 4) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v[0]); \
if (count > 1) { __GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v[1]); } \
if (count > 2) { __GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v[2]); } \
if (count > 3) { __GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v[3]); } \
} else { \
__GLX_PUT_ ## type ## _ARRAY(4, v, count); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_Cv_transpose(name, rop, type, w) \
void __indirect_gl ## name (const type * v) \
{ \
__GLX_DECLARE_VARIABLES(); \
type t[ w * w ]; unsigned i, j; \
for (i = 0; i < w; i++) { \
for (j = 0; j < w; j++) { \
t[i*w+j] = v[j*w+i]; \
} \
} \
__GLX_LOAD_VARIABLES(); \
cmdlen = RENDER_SIZE(type, (w * w)); \
__GLX_BEGIN(rop, cmdlen); \
__GLX_PUT_ ## type ## _ARRAY(4, t, (w * w)); \
__GLX_END(cmdlen); \
}
#define glxproto_1s(name, rop, type) \
void __indirect_gl ## name (type v1) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = RENDER_SIZE(type, 1); \
__GLX_BEGIN(rop, cmdlen); \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_END(cmdlen); \
}
#define glxproto_2s(name, rop, type) \
void __indirect_gl ## name (type v1, type v2) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = RENDER_SIZE(type, 2); \
__GLX_BEGIN(rop, cmdlen); \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
__GLX_END(cmdlen); \
}
#define glxproto_3s(name, rop, type) \
void __indirect_gl ## name (type v1, type v2, type v3) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = RENDER_SIZE(type, 3); \
__GLX_BEGIN(rop, cmdlen); \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
__GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \
__GLX_END(cmdlen); \
}
#define glxproto_4s(name, rop, type) \
void __indirect_gl ## name (type v1, type v2, type v3, type v4) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = RENDER_SIZE(type, 4); \
__GLX_BEGIN(rop, cmdlen); \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
__GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \
__GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v4); \
__GLX_END(cmdlen); \
}
#define glxproto_6s(name, rop, type) \
void __indirect_gl ## name (type v1, type v2, type v3, type v4, type v5, type v6) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = RENDER_SIZE(type, 6); \
__GLX_BEGIN(rop, cmdlen); \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
__GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \
__GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v4); \
__GLX_PUT_ ## type (4 + (4 * type ## _SIZE), v5); \
__GLX_PUT_ ## type (4 + (5 * type ## _SIZE), v6); \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_1s(name, rop, type) \
void __indirect_gl ## name (GLenum e, type v1) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 4 + RENDER_SIZE(type, 1); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_LONG (4 + (1 * type ## _SIZE), e); \
} else { \
__GLX_PUT_LONG(4, e); \
__GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v1); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_1v(name, rop, type) \
void __indirect_gl ## name (GLenum e, const type * v) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 4 + RENDER_SIZE(type, 1); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v[0]); \
__GLX_PUT_LONG (4 + (1 * type ## _SIZE), e); \
} else { \
__GLX_PUT_LONG(4, e); \
__GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v[0]); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_2s(name, rop, type) \
void __indirect_gl ## name (GLenum e, type v1, type v2) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 4 + RENDER_SIZE(type, 2); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
__GLX_PUT_LONG (4 + (2 * type ## _SIZE), e); \
} else { \
__GLX_PUT_LONG(4, e); \
__GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (8 + (1 * type ## _SIZE), v2); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_2v(name, rop, type) \
void __indirect_gl ## name (GLenum e, const type * v) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 4 + RENDER_SIZE(type, 2); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v[0]); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v[1]); \
__GLX_PUT_LONG (4 + (2 * type ## _SIZE), e); \
} else { \
__GLX_PUT_LONG(4, e); \
__GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v[0]); \
__GLX_PUT_ ## type (8 + (1 * type ## _SIZE), v[1]); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_3s(name, rop, type) \
void __indirect_gl ## name (GLenum e, type v1, type v2, type v3) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 4 + RENDER_SIZE(type, 3); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
__GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \
__GLX_PUT_LONG (4 + (3 * type ## _SIZE), e); \
} else { \
__GLX_PUT_LONG(4, e); \
__GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (8 + (1 * type ## _SIZE), v2); \
__GLX_PUT_ ## type (8 + (2 * type ## _SIZE), v3); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_3v(name, rop, type) \
void __indirect_gl ## name (GLenum e, const type * v) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 4 + RENDER_SIZE(type, 3); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v[0]); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v[1]); \
__GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v[2]); \
__GLX_PUT_LONG (4 + (3 * type ## _SIZE), e); \
} else { \
__GLX_PUT_LONG(4, e); \
__GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v[0]); \
__GLX_PUT_ ## type (8 + (1 * type ## _SIZE), v[1]); \
__GLX_PUT_ ## type (8 + (2 * type ## _SIZE), v[2]); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_4s(name, rop, type) \
void __indirect_gl ## name (GLenum e, type v1, type v2, type v3, type v4) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 4 + RENDER_SIZE(type, 4); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
__GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \
__GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v4); \
__GLX_PUT_LONG (4 + (4 * type ## _SIZE), e); \
} else { \
__GLX_PUT_LONG(4, e); \
__GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v1); \
__GLX_PUT_ ## type (8 + (1 * type ## _SIZE), v2); \
__GLX_PUT_ ## type (8 + (2 * type ## _SIZE), v3); \
__GLX_PUT_ ## type (8 + (3 * type ## _SIZE), v4); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_4v(name, rop, type) \
void __indirect_gl ## name (GLenum e, const type * v) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 4 + RENDER_SIZE(type, 4); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v[0]); \
__GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v[1]); \
__GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v[2]); \
__GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v[3]); \
__GLX_PUT_LONG (4 + (4 * type ## _SIZE), e); \
} else { \
__GLX_PUT_LONG(4, e); \
__GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v[0]); \
__GLX_PUT_ ## type (8 + (1 * type ## _SIZE), v[1]); \
__GLX_PUT_ ## type (8 + (2 * type ## _SIZE), v[2]); \
__GLX_PUT_ ## type (8 + (3 * type ## _SIZE), v[3]); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum1_Vv(name, rop, type) \
void __indirect_gl ## name (GLenum pname, const type * v) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
compsize = __gl ## name ## _size(pname); \
cmdlen = 4 + RENDER_SIZE(type, compsize); \
__GLX_BEGIN(rop, cmdlen); \
__GLX_PUT_LONG(4, pname); \
__GLX_PUT_ ## type ## _ARRAY(8, v, compsize); \
__GLX_END(cmdlen); \
}
#define glxproto_enum2_1s(name, rop, type) \
void __indirect_gl ## name (GLenum target, GLenum pname, type v1) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
cmdlen = 8 + RENDER_SIZE(type, 1); \
__GLX_BEGIN(rop, cmdlen); \
if (type ## _SIZE == 8) { \
__GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
__GLX_PUT_LONG (4 + (1 * type ## _SIZE), target); \
__GLX_PUT_LONG (8 + (1 * type ## _SIZE), pname); \
} else { \
__GLX_PUT_LONG(4, target); \
__GLX_PUT_LONG(8, pname); \
__GLX_PUT_ ## type (12 + (0 * type ## _SIZE), v1); \
} \
__GLX_END(cmdlen); \
}
#define glxproto_enum2_Vv(name, rop, type) \
void __indirect_gl ## name (GLenum target, GLenum pname, const type * v) \
{ \
__GLX_DECLARE_VARIABLES(); \
__GLX_LOAD_VARIABLES(); \
compsize = __gl ## name ## _size(pname); \
cmdlen = 8 + RENDER_SIZE(type, compsize); \
__GLX_BEGIN(rop, cmdlen); \
__GLX_PUT_LONG(4, target); \
__GLX_PUT_LONG(8, pname); \
__GLX_PUT_ ## type ## _ARRAY(12, v, compsize); \
__GLX_END(cmdlen); \
}
#define GENERATE_GLX_PROTOCOL_FUNCTIONS
#include "indirect.h"
void __indirect_glRectdv(const GLdouble *v1, const GLdouble *v2)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_Rectdv,36);
__GLX_PUT_DOUBLE(4,v1[0]);
__GLX_PUT_DOUBLE(12,v1[1]);
__GLX_PUT_DOUBLE(20,v2[0]);
__GLX_PUT_DOUBLE(28,v2[1]);
__GLX_END(36);
}
void __indirect_glRectfv(const GLfloat *v1, const GLfloat *v2)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_Rectfv,20);
__GLX_PUT_FLOAT(4,v1[0]);
__GLX_PUT_FLOAT(8,v1[1]);
__GLX_PUT_FLOAT(12,v2[0]);
__GLX_PUT_FLOAT(16,v2[1]);
__GLX_END(20);
}
void __indirect_glRectiv(const GLint *v1, const GLint *v2)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_Rectiv,20);
__GLX_PUT_LONG(4,v1[0]);
__GLX_PUT_LONG(8,v1[1]);
__GLX_PUT_LONG(12,v2[0]);
__GLX_PUT_LONG(16,v2[1]);
__GLX_END(20);
}
void __indirect_glRectsv(const GLshort *v1, const GLshort *v2)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_Rectsv,12);
__GLX_PUT_SHORT(4,v1[0]);
__GLX_PUT_SHORT(6,v1[1]);
__GLX_PUT_SHORT(8,v2[0]);
__GLX_PUT_SHORT(10,v2[1]);
__GLX_END(12);
}
void __indirect_glLineStipple(GLint factor, GLushort pattern)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_LineStipple,12);
__GLX_PUT_LONG(4,factor);
__GLX_PUT_SHORT(8,pattern);
__GLX_END(12);
}
void __indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_Scissor,20);
__GLX_PUT_LONG(4,x);
__GLX_PUT_LONG(8,y);
__GLX_PUT_LONG(12,width);
__GLX_PUT_LONG(16,height);
__GLX_END(20);
}
void __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_MapGrid1d,24);
__GLX_PUT_DOUBLE(4,u1);
__GLX_PUT_DOUBLE(12,u2);
__GLX_PUT_LONG(20,un);
__GLX_END(24);
}
void __indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_MapGrid1f,16);
__GLX_PUT_LONG(4,un);
__GLX_PUT_FLOAT(8,u1);
__GLX_PUT_FLOAT(12,u2);
__GLX_END(16);
}
void __indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_MapGrid2d,44);
__GLX_PUT_DOUBLE(4,u1);
__GLX_PUT_DOUBLE(12,u2);
__GLX_PUT_DOUBLE(20,v1);
__GLX_PUT_DOUBLE(28,v2);
__GLX_PUT_LONG(36,un);
__GLX_PUT_LONG(40,vn);
__GLX_END(44);
}
void __indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_MapGrid2f,28);
__GLX_PUT_LONG(4,un);
__GLX_PUT_FLOAT(8,u1);
__GLX_PUT_FLOAT(12,u2);
__GLX_PUT_LONG(16,vn);
__GLX_PUT_FLOAT(20,v1);
__GLX_PUT_FLOAT(24,v2);
__GLX_END(28);
}
void __indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_StencilFunc,16);
__GLX_PUT_LONG(4,func);
__GLX_PUT_LONG(8,ref);
__GLX_PUT_LONG(12,mask);
__GLX_END(16);
}
void __indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyPixels,24);
__GLX_PUT_LONG(4,x);
__GLX_PUT_LONG(8,y);
__GLX_PUT_LONG(12,width);
__GLX_PUT_LONG(16,height);
__GLX_PUT_LONG(20,type);
__GLX_END(24);
}
void __indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_Viewport,20);
__GLX_PUT_LONG(4,x);
__GLX_PUT_LONG(8,y);
__GLX_PUT_LONG(12,width);
__GLX_PUT_LONG(16,height);
__GLX_END(20);
}
void __indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyTexImage1D,32);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,level);
__GLX_PUT_LONG(12,internalformat);
__GLX_PUT_LONG(16,x);
__GLX_PUT_LONG(20,y);
__GLX_PUT_LONG(24,width);
__GLX_PUT_LONG(28,border);
__GLX_END(32);
}
void __indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyTexImage2D,36);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,level);
__GLX_PUT_LONG(12,internalformat);
__GLX_PUT_LONG(16,x);
__GLX_PUT_LONG(20,y);
__GLX_PUT_LONG(24,width);
__GLX_PUT_LONG(28,height);
__GLX_PUT_LONG(32,border);
__GLX_END(36);
}
void __indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyTexSubImage1D,28);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,level);
__GLX_PUT_LONG(12,xoffset);
__GLX_PUT_LONG(16,x);
__GLX_PUT_LONG(20,y);
__GLX_PUT_LONG(24,width);
__GLX_END(28);
}
void __indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyTexSubImage2D,36);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,level);
__GLX_PUT_LONG(12,xoffset);
__GLX_PUT_LONG(16,yoffset);
__GLX_PUT_LONG(20,x);
__GLX_PUT_LONG(24,y);
__GLX_PUT_LONG(28,width);
__GLX_PUT_LONG(32,height);
__GLX_END(36);
}
void __indirect_glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if (n < 0) return;
cmdlen = 8+n*4+n*4;
__GLX_BEGIN(X_GLrop_PrioritizeTextures,cmdlen);
__GLX_PUT_LONG(4,n);
__GLX_PUT_LONG_ARRAY(8,textures,n);
__GLX_PUT_FLOAT_ARRAY(8+n*4,priorities,n);
__GLX_END(cmdlen);
}
void __indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyColorTable,24);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,internalformat);
__GLX_PUT_LONG(12,x);
__GLX_PUT_LONG(16,y);
__GLX_PUT_LONG(20,width);
__GLX_END(24);
}
void __indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyColorSubTable,24);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,start);
__GLX_PUT_LONG(12,x);
__GLX_PUT_LONG(16,y);
__GLX_PUT_LONG(20,width);
__GLX_END(24);
}
void __indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyConvolutionFilter1D,24);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,internalformat);
__GLX_PUT_LONG(12,x);
__GLX_PUT_LONG(16,y);
__GLX_PUT_LONG(20,width);
__GLX_END(24);
}
void __indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyConvolutionFilter2D,28);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,internalformat);
__GLX_PUT_LONG(12,x);
__GLX_PUT_LONG(16,y);
__GLX_PUT_LONG(20,width);
__GLX_PUT_LONG(24,height);
__GLX_END(28);
}
void __indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_Histogram,20);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,width);
__GLX_PUT_LONG(12,internalformat);
__GLX_PUT_CHAR(16,sink);
__GLX_END(20);
}
void __indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
__GLX_BEGIN(X_GLrop_CopyTexSubImage3D,40);
__GLX_PUT_LONG(4,target);
__GLX_PUT_LONG(8,level);
__GLX_PUT_LONG(12,xoffset);
__GLX_PUT_LONG(16,yoffset);
__GLX_PUT_LONG(20,zoffset);
__GLX_PUT_LONG(24,x);
__GLX_PUT_LONG(28,y);
__GLX_PUT_LONG(32,width);
__GLX_PUT_LONG(36,height);
__GLX_END(40);
}

View File

@ -1,664 +0,0 @@
/* $XFree86$ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
#include "packsingle.h"
#include "indirect.h"
void __indirect_glNewList(GLuint list, GLenum mode)
{
__GLX_SINGLE_DECLARE_VARIABLES();
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_NewList,8);
__GLX_SINGLE_PUT_LONG(0,list);
__GLX_SINGLE_PUT_LONG(4,mode);
__GLX_SINGLE_END();
}
void __indirect_glEndList(void)
{
__GLX_SINGLE_DECLARE_VARIABLES();
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_EndList,0);
__GLX_SINGLE_END();
}
void __indirect_glDeleteLists(GLuint list, GLsizei range)
{
__GLX_SINGLE_DECLARE_VARIABLES();
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_DeleteLists,8);
__GLX_SINGLE_PUT_LONG(0,list);
__GLX_SINGLE_PUT_LONG(4,range);
__GLX_SINGLE_END();
}
GLuint __indirect_glGenLists(GLsizei range)
{
__GLX_SINGLE_DECLARE_VARIABLES();
GLuint retval = 0;
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GenLists,4);
__GLX_SINGLE_PUT_LONG(0,range);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_RETVAL(retval, GLuint);
__GLX_SINGLE_END();
return retval;
}
void __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetLightfv,8);
__GLX_SINGLE_PUT_LONG(0,light);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetLightiv(GLenum light, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetLightiv,8);
__GLX_SINGLE_PUT_LONG(0,light);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble *v)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetMapdv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,query);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_DOUBLE(v);
} else {
__GLX_SINGLE_GET_DOUBLE_ARRAY(v,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat *v)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetMapfv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,query);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(v);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(v,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetMapiv(GLenum target, GLenum query, GLint *v)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetMapiv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,query);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(v);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(v,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetMaterialfv,8);
__GLX_SINGLE_PUT_LONG(0,face);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetMaterialiv,8);
__GLX_SINGLE_PUT_LONG(0,face);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetPixelMapfv(GLenum map, GLfloat *values)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetPixelMapfv,4);
__GLX_SINGLE_PUT_LONG(0,map);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(values);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(values,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetPixelMapuiv(GLenum map, GLuint *values)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetPixelMapuiv,4);
__GLX_SINGLE_PUT_LONG(0,map);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(values);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(values,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetPixelMapusv(GLenum map, GLushort *values)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetPixelMapusv,4);
__GLX_SINGLE_PUT_LONG(0,map);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_SHORT(values);
} else {
__GLX_SINGLE_GET_SHORT_ARRAY(values,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexEnvfv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexEnviv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexGendv,8);
__GLX_SINGLE_PUT_LONG(0,coord);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_DOUBLE(params);
} else {
__GLX_SINGLE_GET_DOUBLE_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexGenfv,8);
__GLX_SINGLE_PUT_LONG(0,coord);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexGeniv,8);
__GLX_SINGLE_PUT_LONG(0,coord);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexParameterfv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexParameteriv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexLevelParameterfv,12);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,level);
__GLX_SINGLE_PUT_LONG(8,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetTexLevelParameteriv,12);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,level);
__GLX_SINGLE_PUT_LONG(8,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
GLboolean __indirect_glIsList(GLuint list)
{
__GLX_SINGLE_DECLARE_VARIABLES();
GLboolean retval = 0;
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_IsList,4);
__GLX_SINGLE_PUT_LONG(0,list);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_RETVAL(retval, GLboolean);
__GLX_SINGLE_END();
return retval;
}
/*
* Somewhere between GLX 1.2 and 1.3 (in SGI's code anyway) the
* protocol for glAreTexturesResident, glDeleteTextures, glGenTextures,
* and glIsTexture() was changed. Before, calls to these functions
* generated protocol for the old GL_EXT_texture_object versions of those
* calls. In the newer code, this is actually corrected; calls to the
* 1.1 functions generate 1.1 protocol and calls to the EXT functions
* generate EXT protocol.
* Unfortunately, this correction causes an incompatibility. Specifically,
* an updated libGL.so will send protocol requests that the server won't
* be able to handle. For example, calling glGenTextures will generate a
* BadRequest error.
* For now, we'll keep generating EXT protocol from libGL. We'll update
* the server to understand both the 1.1 and EXT protocol ASAP. At some point
* in the future we'll correct libGL.so as well. That should be a smoother
* transition path.
*/
GLboolean __indirect_glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences)
{
#if 0 /* see comments above */
__GLX_SINGLE_DECLARE_VARIABLES();
GLboolean retval = 0;
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
if (n < 0) return retval;
cmdlen = 4+n*4;
__GLX_SINGLE_BEGIN(X_GLsop_AreTexturesResident,cmdlen);
__GLX_SINGLE_PUT_LONG(0,n);
__GLX_PUT_LONG_ARRAY(4,textures,n);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_RETVAL(retval, GLboolean);
__GLX_SINGLE_GET_CHAR_ARRAY(residences,n);
__GLX_SINGLE_END();
return retval;
#else
return __indirect_glAreTexturesResidentEXT(n, textures, residences);
#endif
}
void __indirect_glDeleteTextures(GLsizei n, const GLuint *textures)
{
#if 0 /* see comments above */
__GLX_SINGLE_DECLARE_VARIABLES();
__GLX_SINGLE_LOAD_VARIABLES();
if (n < 0) return;
cmdlen = 4+n*4;
__GLX_SINGLE_BEGIN(X_GLsop_DeleteTextures,cmdlen);
__GLX_SINGLE_PUT_LONG(0,n);
__GLX_PUT_LONG_ARRAY(4,textures,n);
__GLX_SINGLE_END();
#else
__indirect_glDeleteTexturesEXT(n, textures);
#endif
}
void __indirect_glGenTextures(GLsizei n, GLuint *textures)
{
#if 0 /* see comments above */
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GenTextures,4);
__GLX_SINGLE_PUT_LONG(0,n);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_LONG_ARRAY(textures,n);
__GLX_SINGLE_END();
#else
__indirect_glGenTexturesEXT(n, textures);
#endif
}
GLboolean __indirect_glIsTexture(GLuint texture)
{
#if 0 /* see comments above */
__GLX_SINGLE_DECLARE_VARIABLES();
GLboolean retval = 0;
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_IsTexture,4);
__GLX_SINGLE_PUT_LONG(0,texture);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_RETVAL(retval, GLboolean);
__GLX_SINGLE_END();
return retval;
#else
return __indirect_glIsTextureEXT(texture);
#endif
}
void __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetColorTableParameterfv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetColorTableParameteriv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetConvolutionParameterfv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetConvolutionParameteriv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetHistogramParameterfv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetHistogramParameteriv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetMinmaxParameterfv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_FLOAT(params);
} else {
__GLX_SINGLE_GET_FLOAT_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}
void __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetMinmaxParameteriv,8);
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,pname);
__GLX_SINGLE_READ_XREPLY();
__GLX_SINGLE_GET_SIZE(compsize);
if (compsize == 1) {
__GLX_SINGLE_GET_LONG(params);
} else {
__GLX_SINGLE_GET_LONG_ARRAY(params,compsize);
}
__GLX_SINGLE_END();
}

View File

@ -1,88 +0,0 @@
/* $XFree86$ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
#include "packvendpriv.h"
GLboolean __indirect_glAreTexturesResidentEXT(GLsizei n, const GLuint *textures, GLboolean *residences)
{
__GLX_VENDPRIV_DECLARE_VARIABLES();
GLboolean retval = 0;
xGLXVendorPrivReply reply;
__GLX_VENDPRIV_LOAD_VARIABLES();
if (n < 0) return retval;
cmdlen = 4+n*4;
__GLX_VENDPRIV_BEGIN(X_GLXVendorPrivateWithReply,X_GLvop_AreTexturesResidentEXT,cmdlen);
__GLX_VENDPRIV_PUT_LONG(0,n);
__GLX_PUT_LONG_ARRAY(4,textures,n);
__GLX_VENDPRIV_READ_XREPLY();
__GLX_VENDPRIV_GET_RETVAL(retval, GLboolean);
__GLX_VENDPRIV_GET_CHAR_ARRAY(residences,n);
__GLX_VENDPRIV_END();
return retval;
}
void __indirect_glDeleteTexturesEXT(GLsizei n, const GLuint *textures)
{
__GLX_VENDPRIV_DECLARE_VARIABLES();
__GLX_VENDPRIV_LOAD_VARIABLES();
if (n < 0) return;
cmdlen = 4+n*4;
__GLX_VENDPRIV_BEGIN(X_GLXVendorPrivate,X_GLvop_DeleteTexturesEXT,cmdlen);
__GLX_VENDPRIV_PUT_LONG(0,n);
__GLX_PUT_LONG_ARRAY(4,textures,n);
__GLX_VENDPRIV_END();
}
void __indirect_glGenTexturesEXT(GLsizei n, GLuint *textures)
{
__GLX_VENDPRIV_DECLARE_VARIABLES();
xGLXVendorPrivReply reply;
__GLX_VENDPRIV_LOAD_VARIABLES();
__GLX_VENDPRIV_BEGIN(X_GLXVendorPrivateWithReply,X_GLvop_GenTexturesEXT,4);
__GLX_VENDPRIV_PUT_LONG(0,n);
__GLX_VENDPRIV_READ_XREPLY();
__GLX_VENDPRIV_GET_LONG_ARRAY(textures,n);
__GLX_VENDPRIV_END();
}
GLboolean __indirect_glIsTextureEXT(GLuint texture)
{
__GLX_VENDPRIV_DECLARE_VARIABLES();
GLboolean retval = 0;
xGLXVendorPrivReply reply;
__GLX_VENDPRIV_LOAD_VARIABLES();
__GLX_VENDPRIV_BEGIN(X_GLXVendorPrivateWithReply,X_GLvop_IsTextureEXT,4);
__GLX_VENDPRIV_PUT_LONG(0,texture);
__GLX_VENDPRIV_READ_XREPLY();
__GLX_VENDPRIV_GET_RETVAL(retval, GLboolean);
__GLX_VENDPRIV_END();
return retval;
}

View File

@ -44,7 +44,7 @@
* \author Kevin E. Martin <kevin@precisioninsight.com>
*/
#include "packrender.h"
#include "glxclient.h"
#include <stdio.h>
#include <Xext.h>
#include <extutil.h>

5696
src/glx/x11/indirect.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -171,6 +171,7 @@ __glTexParameterfv_size( GLenum e )
case GL_GENERATE_MIPMAP:
/* case GL_GENERATE_MIPMAP_SGIS:*/
case GL_TEXTURE_LOD_BIAS:
/* case GL_TEXTURE_LOD_BIAS_EXT:*/
case GL_DEPTH_TEXTURE_MODE:
/* case GL_DEPTH_TEXTURE_MODE_ARB:*/
case GL_TEXTURE_COMPARE_MODE:

View File

@ -1,220 +0,0 @@
/* $XFree86: xc/lib/GL/glx/packvendpriv.h,v 1.5tsi Exp $ */
#ifndef __GLX_packvendpriv_h__
#define __GLX_packvendpriv_h__
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include "packrender.h"
/*
** The macros in this header convert wire protocol data types to the client
** machine's native data types. The header is part of the porting layer of
** the client library, and it is intended that hardware vendors will rewrite
** this header to suit their own machines.
*/
/*
** Dummy define to make the GetReqExtra macro happy. The value is not
** used, but instead the code in __GLX_VENDPRIV_BEGIN issues its own store
** to req->reqType with the proper code (our extension code).
*/
#define X_GLXVendpriv 0
/* Declare common variables used during a single command */
#define __GLX_VENDPRIV_DECLARE_VARIABLES() \
__GLXcontext *gc = __glXGetCurrentContext(); \
GLubyte *pc, *pixelHeaderPC; \
GLuint compsize, cmdlen; \
Display *dpy = gc->currentDpy; \
xGLXVendorPrivateReq *req
#define __GLX_VENDPRIV_LOAD_VARIABLES() \
pc = gc->pc; \
/* Muffle compilers */ \
pixelHeaderPC = 0; (void)pixelHeaderPC; \
compsize = 0; (void)compsize; \
cmdlen = 0; (void)cmdlen
/* Start a vendor private command */
#define __GLX_VENDPRIV_BEGIN(glxcode, opcode,bytes) \
if (dpy) { \
(void) __glXFlushRenderBuffer(gc, pc); \
LockDisplay(dpy); \
GetReqExtra(GLXVendorPrivate,bytes,req); \
req->reqType = gc->majorOpcode; \
req->glxCode = glxcode; \
req->vendorCode = opcode; \
req->contextTag = gc->currentContextTag; \
pc = ((GLubyte *)(req) + sz_xGLXVendorPrivateReq)
/* End a vendor private command */
#define __GLX_VENDPRIV_END() \
UnlockDisplay(dpy); \
SyncHandle(); \
}
/* Store data to sending for a vendor private command */
#define __GLX_VENDPRIV_PUT_CHAR(offset,a) \
*((INT8 *) (pc + offset)) = a
#ifndef CRAY
#define __GLX_VENDPRIV_PUT_SHORT(offset,a) \
*((INT16 *) (pc + offset)) = a
#define __GLX_VENDPRIV_PUT_LONG(offset,a) \
*((INT32 *) (pc + offset)) = a
#define __GLX_VENDPRIV_PUT_FLOAT(offset,a) \
*((FLOAT32 *) (pc + offset)) = a
#else
#define __GLX_VENDPRIV_PUT_SHORT(offset,a) \
{ GLubyte *cp = (pc+offset); \
int shift = (64-16) - ((int)(cp) >> (64-6)); \
*(int *)cp = (*(int *)cp & ~(0xffff << shift)) | ((a & 0xffff) << shift); }
#define __GLX_VENDPRIV_PUT_LONG(offset,a) \
{ GLubyte *cp = (pc+offset); \
int shift = (64-32) - ((int)(cp) >> (64-6)); \
*(int *)cp = (*(int *)cp & ~(0xffffffff << shift)) | ((a & 0xffffffff) << shift); }
#define __GLX_VENDPRIV_PUT_FLOAT(offset,a) \
gl_put_float(pc + offset, a)
#endif
/* Read support macros */
#define __GLX_VENDPRIV_READ_XREPLY() \
(void) _XReply(dpy, (xReply*) &reply, 0, False)
#define __GLX_VENDPRIV_GET_RETVAL(a,cast) \
a = (cast) reply.retval
#define __GLX_VENDPRIV_GET_SIZE(a) \
a = (GLint) reply.size
#ifndef _CRAY
#define __GLX_VENDPRIV_GET_CHAR(p) \
*p = *(GLbyte *)&reply.pad3;
#define __GLX_VENDPRIV_GET_SHORT(p) \
*p = *(GLshort *)&reply.pad3;
#define __GLX_VENDPRIV_GET_LONG(p) \
*p = *(GLint *)&reply.pad3;
#define __GLX_VENDPRIV_GET_FLOAT(p) \
*p = *(GLfloat *)&reply.pad3;
#else
#define __GLX_VENDPRIV_GET_CHAR(p) \
*p = reply.pad3 >> 24;
#define __GLX_VENDPRIV_GET_SHORT(p) \
{int t = reply.pad3 >> 16; \
*p = (t & 0x8000) ? (t | ~0xffff) : (t & 0xffff);}
#define __GLX_VENDPRIV_GET_LONG(p) \
{int t = reply.pad3; \
*p = (t & 0x80000000) ? (t | ~0xffffffff) : (t & 0xffffffff);}
#define PAD3OFFSET 16
#define __GLX_VENDPRIV_GET_FLOAT(p) \
*p = gl_ntoh_float((GLubyte *)&reply + PAD3OFFSET);
#define __GLX_VENDPRIV_GET_DOUBLE(p) \
*p = gl_ntoh_double((GLubyte *)&reply + PAD3OFFSET);
extern float gl_ntoh_float(GLubyte *);
extern float gl_ntoh_double(GLubyte *);
#endif
#ifndef _CRAY
#ifdef __GLX_ALIGN64
#define __GLX_VENDPRIV_GET_DOUBLE(p) \
__GLX_MEM_COPY(p, &reply.pad3, 8)
#else
#define __GLX_VENDPRIV_GET_DOUBLE(p) \
*p = *(GLdouble *)&reply.pad3
#endif
#endif
/* Get an array of typed data */
#define __GLX_VENDPRIV_GET_VOID_ARRAY(a,alen) \
{ \
GLint slop = alen*__GLX_SIZE_INT8 & 3; \
_XRead(dpy,(char *)a,alen*__GLX_SIZE_INT8); \
if (slop) _XEatData(dpy,4-slop); \
}
#define __GLX_VENDPRIV_GET_CHAR_ARRAY(a,alen) \
{ \
GLint slop = alen*__GLX_SIZE_INT8 & 3; \
_XRead(dpy,(char *)a,alen*__GLX_SIZE_INT8); \
if (slop) _XEatData(dpy,4-slop); \
}
#define __GLX_VENDPRIV_GET_SHORT_ARRAY(a,alen) \
{ \
GLint slop = (alen*__GLX_SIZE_INT16) & 3; \
_XRead(dpy,(char *)a,alen*__GLX_SIZE_INT16); \
if (slop) _XEatData(dpy,4-slop); \
}
#define __GLX_VENDPRIV_GET_LONG_ARRAY(a,alen) \
_XRead(dpy,(char *)a,alen*__GLX_SIZE_INT32);
#ifndef _CRAY
#define __GLX_VENDPRIV_GET_FLOAT_ARRAY(a,alen) \
_XRead(dpy,(char *)a,alen*__GLX_SIZE_FLOAT32);
#define __GLX_VENDPRIV_GET_DOUBLE_ARRAY(a,alen) \
_XRead(dpy,(char *)a,alen*__GLX_SIZE_FLOAT64);
#else
#define __GLX_VENDPRIV_GET_FLOAT_ARRAY(a,alen) \
gl_get_float_array(dpy,a,alen);
#define __GLX_VENDPRIV_GET_DOUBLE_ARRAY(a,alen) \
gl_get_double_array(dpy, a, alen);
extern void gl_get_float_array(Display *dpy, float *a, int alen);
extern void gl_get_double_array(Display *dpy, double *a, int alen);
#endif
#endif /* !__GLX_packvendpriv_h__ */

View File

@ -44,31 +44,6 @@
** use the pixel header. See renderpix.c for those routines.
*/
void __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid *lists)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
compsize = (n <= 0) ? 0 : __glCallLists_size(type) * n;
cmdlen = __GLX_PAD(12 + compsize);
if (!gc->currentDpy) return;
if (cmdlen <= gc->maxSmallRenderCommandSize) {
/* Use GLXRender protocol to send small command */
__GLX_BEGIN_VARIABLE(X_GLrop_CallLists,cmdlen);
__GLX_PUT_LONG(4,n);
__GLX_PUT_LONG(8,type);
__GLX_PUT_CHAR_ARRAY(12,lists,compsize);
__GLX_END(cmdlen);
} else {
/* Use GLXRenderLarge protocol to send command */
__GLX_BEGIN_VARIABLE_LARGE(X_GLrop_CallLists,cmdlen+4);
__GLX_PUT_LONG(8,n);
__GLX_PUT_LONG(12,type);
__glXSendLargeCommand(gc, pc, 16, lists, compsize);
}
}
void __indirect_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
GLint order, const GLdouble *pnts)
{
@ -333,93 +308,6 @@ void __indirect_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustr, GLint
}
}
void __indirect_glPixelMapfv(GLenum map, GLint mapsize, const GLfloat *values)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if (mapsize < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
compsize = mapsize * __GLX_SIZE_FLOAT32;
cmdlen = 12+compsize;
if (!gc->currentDpy) return;
if (cmdlen <= gc->maxSmallRenderCommandSize) {
/* Use GLXRender protocol to send small command */
__GLX_BEGIN_VARIABLE(X_GLrop_PixelMapfv,cmdlen);
__GLX_PUT_LONG(4,map);
__GLX_PUT_LONG(8,mapsize);
__GLX_PUT_FLOAT_ARRAY(12,values,mapsize);
__GLX_END(cmdlen);
} else {
/* Use GLXRenderLarge protocol to send command */
__GLX_BEGIN_VARIABLE_LARGE(X_GLrop_PixelMapfv,cmdlen+4);
__GLX_PUT_LONG(8,map);
__GLX_PUT_LONG(12,mapsize);
__glXSendLargeCommand(gc, pc, 16, values, compsize);
}
}
void __indirect_glPixelMapuiv(GLenum map, GLint mapsize, const GLuint *values)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if (mapsize < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
compsize = mapsize * __GLX_SIZE_CARD32;
cmdlen = 12+compsize;
if (!gc->currentDpy) return;
if (cmdlen <= gc->maxSmallRenderCommandSize) {
/* Use GLXRender protocol to send small command */
__GLX_BEGIN_VARIABLE(X_GLrop_PixelMapuiv,cmdlen);
__GLX_PUT_LONG(4,map);
__GLX_PUT_LONG(8,mapsize);
__GLX_PUT_LONG_ARRAY(12,values,mapsize);
__GLX_END(cmdlen);
} else {
/* Use GLXRenderLarge protocol to send command */
__GLX_BEGIN_VARIABLE_LARGE(X_GLrop_PixelMapuiv,cmdlen+4);
__GLX_PUT_LONG(8,map);
__GLX_PUT_LONG(12,mapsize);
__glXSendLargeCommand(gc, pc, 16, values, compsize);
}
}
void __indirect_glPixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if (mapsize < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
compsize = mapsize * __GLX_SIZE_CARD16;
cmdlen = __GLX_PAD(12 + compsize);
if (!gc->currentDpy) return;
if (cmdlen <= gc->maxSmallRenderCommandSize) {
/* Use GLXRender protocol to send small command */
__GLX_BEGIN_VARIABLE(X_GLrop_PixelMapusv,cmdlen);
__GLX_PUT_LONG(4,map);
__GLX_PUT_LONG(8,mapsize);
__GLX_PUT_SHORT_ARRAY(12,values,mapsize);
__GLX_END(cmdlen);
} else {
/* Use GLXRenderLarge protocol to send command */
__GLX_BEGIN_VARIABLE_LARGE(X_GLrop_PixelMapusv,cmdlen+4);
__GLX_PUT_LONG(8,map);
__GLX_PUT_LONG(12,mapsize);
__glXSendLargeCommand(gc, pc, 16, values, compsize);
}
}
void __indirect_glEnable(GLenum cap)
{
__GLX_DECLARE_VARIABLES();
@ -473,41 +361,3 @@ void __indirect_glDisable(GLenum cap)
__GLX_PUT_LONG(4,cap);
__GLX_END(8);
}
void __indirect_glSampleCoverageARB( GLfloat value, GLboolean invert )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if (!gc->currentDpy) return;
__GLX_BEGIN(X_GLrop_SampleCoverageARB,12);
__GLX_PUT_FLOAT(4,value);
__GLX_PUT_CHAR(8,invert);
__GLX_END(12);
}
void __indirect_glSampleMaskSGIS( GLfloat value, GLboolean invert )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if (!gc->currentDpy) return;
__GLX_BEGIN(X_GLvop_SampleMaskSGIS,12);
__GLX_PUT_FLOAT(4,value);
__GLX_PUT_CHAR(8,invert);
__GLX_END(12);
}
void __indirect_glSamplePatternSGIS( GLenum pass )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if (!gc->currentDpy) return;
__GLX_BEGIN(X_GLvop_SamplePatternSGIS,8);
__GLX_PUT_LONG(4,pass);
__GLX_END(8);
}

View File

@ -113,20 +113,6 @@ GLenum __indirect_glGetError(void)
return retval;
}
void __indirect_glGetClipPlane(GLenum plane, GLdouble *equation)
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXSingleReply reply;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN(X_GLsop_GetClipPlane,4);
__GLX_SINGLE_PUT_LONG(0,plane);
__GLX_SINGLE_READ_XREPLY();
if (reply.length == 8) {
__GLX_SINGLE_GET_DOUBLE_ARRAY(equation,4);
}
__GLX_SINGLE_END();
}
#define CASE_ARRAY_ENABLE(enum_name,array,dest,gl_type) \
case GL_ ## enum_name ## _ARRAY: \
*dest = (gl_type) (IS_ARRAY_ENABLED(state, array)); break

View File

@ -4,34 +4,56 @@
# up to him/her to re-run this makefile and check in the newly generated files.
OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h ../x86/glapi_x86.S
OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h \
../x86/glapi_x86.S \
../../glx/x11/indirect.c \
../../glx/x11/indirect.h \
../../glx/x11/indirect_init.c \
../../glx/x11/indirect_size.h \
../../glx/x11/indirect_size.c
COMMON = gl_XML.pyc license.pyc gl_API.xml
PYTHON2 = python
all: $(OUTPUTS)
gl_XML.pyc: gl_XML.py
rm -f gl_XML.pyc > /dev/null
python2 -t -O gl_XML.py
$(PYTHON2) -t -O gl_XML.py
license.pyc: license.py
rm -f license.pyc > /dev/null
python2 -t -O license.py
$(PYTHON2) -t -O license.py
glprocs.h: $(COMMON) gl_procs.py
python2 -t gl_procs.py > glprocs.h
$(PYTHON2) -t gl_procs.py > glprocs.h
glapitemp.h: $(COMMON) gl_apitemp.py
python2 -t gl_apitemp.py > glapitemp.h
$(PYTHON2) -t gl_apitemp.py > glapitemp.h
glapioffsets.h: $(COMMON) gl_offsets.py
python2 -t gl_offsets.py > glapioffsets.h
$(PYTHON2) -t gl_offsets.py > glapioffsets.h
glapitable.h: $(COMMON) gl_table.py
python2 -t gl_table.py > glapitable.h
$(PYTHON2) -t gl_table.py > glapitable.h
../x86/glapi_x86.S: $(COMMON) gl_x86_asm.py
python2 -t gl_x86_asm.py > ../x86/glapi_x86.S
$(PYTHON2) -t gl_x86_asm.py > ../x86/glapi_x86.S
../../glx/x11/indirect.c: $(COMMON) glX_proto_send.py
$(PYTHON2) -t glX_proto_send.py -m proto > ../../glx/x11/indirect.c
../../glx/x11/indirect.h: $(COMMON) glX_proto_send.py
$(PYTHON2) -t glX_proto_send.py -m init_h > ../../glx/x11/indirect.h
../../glx/x11/indirect_init.c: $(COMMON) glX_proto_send.py
$(PYTHON2) -t glX_proto_send.py -m init_c > ../../glx/x11/indirect_init.c
../../glx/x11/indirect_size.h: $(COMMON) glX_proto_send.py
$(PYTHON2) -t glX_proto_send.py -m size_h > ../../glx/x11/indirect_size.h
../../glx/x11/indirect_size.c: $(COMMON) glX_proto_send.py
$(PYTHON2) -t glX_proto_send.py -m size_c > ../../glx/x11/indirect_size.c
clean:
rm -f *~ *.pyc