New upstream version 3.5.99.27

This commit is contained in:
geos_one
2025-08-08 20:00:36 +02:00
commit bc8d10cc33
4267 changed files with 1757978 additions and 0 deletions

341
nx-X11/programs/Xserver/GL/.gitignore vendored Normal file
View File

@@ -0,0 +1,341 @@
glx/DONE
glx/glcontextmodes.c
glx/glcontextmodes.h
glx/indirect_size.c
glx/indirect_size.h
mesa/X/DONE
mesa/X/compsize.c
mesa/X/driverfuncs.c
mesa/X/driverfuncs.h
mesa/X/xm_api.c
mesa/X/xm_buffer.c
mesa/X/xm_dd.c
mesa/X/xm_line.c
mesa/X/xm_span.c
mesa/X/xm_tri.c
mesa/array_cache/DONE
mesa/array_cache/ac_context.c
mesa/array_cache/ac_context.h
mesa/array_cache/ac_import.c
mesa/array_cache/acache.h
mesa/main/DONE
mesa/main/accum.c
mesa/main/accum.h
mesa/main/api_arrayelt.c
mesa/main/api_arrayelt.h
mesa/main/api_eval.h
mesa/main/api_loopback.c
mesa/main/api_loopback.h
mesa/main/api_noop.c
mesa/main/api_noop.h
mesa/main/api_validate.c
mesa/main/api_validate.h
mesa/main/attrib.c
mesa/main/attrib.h
mesa/main/blend.c
mesa/main/blend.h
mesa/main/bufferobj.c
mesa/main/bufferobj.h
mesa/main/buffers.c
mesa/main/buffers.h
mesa/main/clip.c
mesa/main/clip.h
mesa/main/colormac.h
mesa/main/colortab.c
mesa/main/colortab.h
mesa/main/config.h
mesa/main/context.c
mesa/main/context.h
mesa/main/convolve.c
mesa/main/convolve.h
mesa/main/dd.h
mesa/main/debug.c
mesa/main/debug.h
mesa/main/depth.c
mesa/main/depth.h
mesa/main/dispatch.c
mesa/main/dlist.c
mesa/main/dlist.h
mesa/main/drawpix.c
mesa/main/drawpix.h
mesa/main/enable.c
mesa/main/enable.h
mesa/main/enums.c
mesa/main/enums.h
mesa/main/eval.c
mesa/main/eval.h
mesa/main/execmem.c
mesa/main/extensions.c
mesa/main/extensions.h
mesa/main/fbobject.c
mesa/main/fbobject.h
mesa/main/feedback.c
mesa/main/feedback.h
mesa/main/fog.c
mesa/main/fog.h
mesa/main/framebuffer.c
mesa/main/framebuffer.h
mesa/main/get.c
mesa/main/get.h
mesa/main/getstring.c
mesa/main/glapi.c
mesa/main/glheader.h
mesa/main/glthread.c
mesa/main/hash.c
mesa/main/hash.h
mesa/main/hint.c
mesa/main/hint.h
mesa/main/histogram.c
mesa/main/histogram.h
mesa/main/image.c
mesa/main/image.h
mesa/main/imports.c
mesa/main/imports.h
mesa/main/light.c
mesa/main/light.h
mesa/main/lines.c
mesa/main/lines.h
mesa/main/macros.h
mesa/main/matrix.c
mesa/main/matrix.h
mesa/main/mm.c
mesa/main/mm.h
mesa/main/mtypes.h
mesa/main/occlude.c
mesa/main/occlude.h
mesa/main/pixel.c
mesa/main/pixel.h
mesa/main/points.c
mesa/main/points.h
mesa/main/polygon.c
mesa/main/polygon.h
mesa/main/rastpos.c
mesa/main/rastpos.h
mesa/main/renderbuffer.c
mesa/main/renderbuffer.h
mesa/main/simple_list.h
mesa/main/state.c
mesa/main/state.h
mesa/main/stencil.c
mesa/main/stencil.h
mesa/main/texcompress.c
mesa/main/texcompress.h
mesa/main/texcompress_fxt1.c
mesa/main/texcompress_s3tc.c
mesa/main/texenvprogram.c
mesa/main/texenvprogram.h
mesa/main/texformat.c
mesa/main/texformat.h
mesa/main/texformat_tmp.h
mesa/main/teximage.c
mesa/main/teximage.h
mesa/main/texobj.c
mesa/main/texobj.h
mesa/main/texrender.c
mesa/main/texrender.h
mesa/main/texstate.c
mesa/main/texstate.h
mesa/main/texstore.c
mesa/main/texstore.h
mesa/main/varray.c
mesa/main/varray.h
mesa/main/version.h
mesa/main/vtxfmt.c
mesa/main/vtxfmt.h
mesa/main/vtxfmt_tmp.h
mesa/math/DONE
mesa/math/m_clip_tmp.h
mesa/math/m_copy_tmp.h
mesa/math/m_debug.h
mesa/math/m_debug_clip.c
mesa/math/m_debug_norm.c
mesa/math/m_debug_util.h
mesa/math/m_debug_xform.c
mesa/math/m_dotprod_tmp.h
mesa/math/m_eval.c
mesa/math/m_eval.h
mesa/math/m_matrix.c
mesa/math/m_matrix.h
mesa/math/m_norm_tmp.h
mesa/math/m_trans_tmp.h
mesa/math/m_translate.c
mesa/math/m_translate.h
mesa/math/m_vector.c
mesa/math/m_vector.h
mesa/math/m_xform.c
mesa/math/m_xform.h
mesa/math/m_xform_tmp.h
mesa/math/mathmod.h
mesa/shader/DONE
mesa/shader/arbfragparse.c
mesa/shader/arbfragparse.h
mesa/shader/arbprogparse.c
mesa/shader/arbprogparse.h
mesa/shader/arbprogram.c
mesa/shader/arbprogram.h
mesa/shader/arbprogram_syn.h
mesa/shader/arbvertparse.c
mesa/shader/arbvertparse.h
mesa/shader/atifragshader.c
mesa/shader/atifragshader.h
mesa/shader/grammar/DONE
mesa/shader/grammar/grammar.c
mesa/shader/grammar/grammar.h
mesa/shader/grammar/grammar_mesa.c
mesa/shader/grammar/grammar_mesa.h
mesa/shader/grammar/grammar_syn.h
mesa/shader/nvfragparse.c
mesa/shader/nvfragparse.h
mesa/shader/nvfragprog.h
mesa/shader/nvprogram.c
mesa/shader/nvprogram.h
mesa/shader/nvvertexec.c
mesa/shader/nvvertexec.h
mesa/shader/nvvertparse.c
mesa/shader/nvvertparse.h
mesa/shader/nvvertprog.h
mesa/shader/program.c
mesa/shader/program.h
mesa/shader/shaderobjects.c
mesa/shader/shaderobjects.h
mesa/shader/shaderobjects_3dlabs.c
mesa/shader/shaderobjects_3dlabs.h
mesa/shader/slang/DONE
mesa/shader/slang/library/slang_common_builtin_gc.h
mesa/shader/slang/library/slang_common_builtin_gc_bin.h
mesa/shader/slang/library/slang_core_gc.h
mesa/shader/slang/library/slang_core_gc_bin.h
mesa/shader/slang/library/slang_fragment_builtin_gc.h
mesa/shader/slang/library/slang_fragment_builtin_gc_bin.h
mesa/shader/slang/library/slang_shader_syn.h
mesa/shader/slang/library/slang_version_syn.h
mesa/shader/slang/library/slang_vertex_builtin_gc.h
mesa/shader/slang/library/slang_vertex_builtin_gc_bin.h
mesa/shader/slang/slang_assemble.c
mesa/shader/slang/slang_assemble.h
mesa/shader/slang/slang_assemble_assignment.c
mesa/shader/slang/slang_assemble_assignment.h
mesa/shader/slang/slang_assemble_conditional.c
mesa/shader/slang/slang_assemble_conditional.h
mesa/shader/slang/slang_assemble_constructor.c
mesa/shader/slang/slang_assemble_constructor.h
mesa/shader/slang/slang_assemble_typeinfo.c
mesa/shader/slang/slang_assemble_typeinfo.h
mesa/shader/slang/slang_compile.c
mesa/shader/slang/slang_compile.h
mesa/shader/slang/slang_execute.c
mesa/shader/slang/slang_execute.h
mesa/shader/slang/slang_preprocess.c
mesa/shader/slang/slang_preprocess.h
mesa/shader/slang/slang_storage.c
mesa/shader/slang/slang_storage.h
mesa/shader/slang/slang_utility.c
mesa/shader/slang/slang_utility.h
mesa/shader/slang/traverse_wrap.h
mesa/swrast/DONE
mesa/swrast/s_aaline.c
mesa/swrast/s_aaline.h
mesa/swrast/s_aalinetemp.h
mesa/swrast/s_aatriangle.c
mesa/swrast/s_aatriangle.h
mesa/swrast/s_aatritemp.h
mesa/swrast/s_accum.c
mesa/swrast/s_accum.h
mesa/swrast/s_alpha.c
mesa/swrast/s_alpha.h
mesa/swrast/s_atifragshader.c
mesa/swrast/s_atifragshader.h
mesa/swrast/s_bitmap.c
mesa/swrast/s_blend.c
mesa/swrast/s_blend.h
mesa/swrast/s_buffers.c
mesa/swrast/s_context.c
mesa/swrast/s_context.h
mesa/swrast/s_copypix.c
mesa/swrast/s_depth.c
mesa/swrast/s_depth.h
mesa/swrast/s_drawpix.c
mesa/swrast/s_drawpix.h
mesa/swrast/s_feedback.c
mesa/swrast/s_feedback.h
mesa/swrast/s_fog.c
mesa/swrast/s_fog.h
mesa/swrast/s_imaging.c
mesa/swrast/s_lines.c
mesa/swrast/s_lines.h
mesa/swrast/s_linetemp.h
mesa/swrast/s_logic.c
mesa/swrast/s_logic.h
mesa/swrast/s_masking.c
mesa/swrast/s_masking.h
mesa/swrast/s_nvfragprog.c
mesa/swrast/s_nvfragprog.h
mesa/swrast/s_pixeltex.c
mesa/swrast/s_pixeltex.h
mesa/swrast/s_points.c
mesa/swrast/s_points.h
mesa/swrast/s_pointtemp.h
mesa/swrast/s_readpix.c
mesa/swrast/s_span.c
mesa/swrast/s_span.h
mesa/swrast/s_spantemp.h
mesa/swrast/s_stencil.c
mesa/swrast/s_stencil.h
mesa/swrast/s_texstore.c
mesa/swrast/s_texture.c
mesa/swrast/s_texture.h
mesa/swrast/s_triangle.c
mesa/swrast/s_triangle.h
mesa/swrast/s_trispan.h
mesa/swrast/s_tritemp.h
mesa/swrast/s_zoom.c
mesa/swrast/s_zoom.h
mesa/swrast/swrast.h
mesa/swrast_setup/DONE
mesa/swrast_setup/ss_context.c
mesa/swrast_setup/ss_context.h
mesa/swrast_setup/ss_triangle.c
mesa/swrast_setup/ss_triangle.h
mesa/swrast_setup/ss_tritmp.h
mesa/swrast_setup/swrast_setup.h
mesa/tnl/DONE
mesa/tnl/t_array_api.c
mesa/tnl/t_array_api.h
mesa/tnl/t_array_import.c
mesa/tnl/t_array_import.h
mesa/tnl/t_context.c
mesa/tnl/t_context.h
mesa/tnl/t_pipeline.c
mesa/tnl/t_pipeline.h
mesa/tnl/t_save_api.c
mesa/tnl/t_save_api.h
mesa/tnl/t_save_loopback.c
mesa/tnl/t_save_playback.c
mesa/tnl/t_vb_arbprogram.c
mesa/tnl/t_vb_arbprogram.h
mesa/tnl/t_vb_arbprogram_sse.c
mesa/tnl/t_vb_cliptmp.h
mesa/tnl/t_vb_cull.c
mesa/tnl/t_vb_fog.c
mesa/tnl/t_vb_light.c
mesa/tnl/t_vb_lighttmp.h
mesa/tnl/t_vb_normals.c
mesa/tnl/t_vb_points.c
mesa/tnl/t_vb_program.c
mesa/tnl/t_vb_render.c
mesa/tnl/t_vb_rendertmp.h
mesa/tnl/t_vb_texgen.c
mesa/tnl/t_vb_texmat.c
mesa/tnl/t_vb_vertex.c
mesa/tnl/t_vertex.c
mesa/tnl/t_vertex.h
mesa/tnl/t_vertex_generic.c
mesa/tnl/t_vertex_sse.c
mesa/tnl/t_vp_build.c
mesa/tnl/t_vp_build.h
mesa/tnl/t_vtx_api.c
mesa/tnl/t_vtx_api.h
mesa/tnl/t_vtx_eval.c
mesa/tnl/t_vtx_exec.c
mesa/tnl/t_vtx_generic.c
mesa/tnl/tnl.h

View File

@@ -0,0 +1,45 @@
#define IHaveModules
#include <Server.tmpl>
#define IHaveSubdirs
CORE_SUBDIR = mesa
SUBDIRS = glx $(CORE_SUBDIR)
#if BuildModuleInSubdir
SRCS = glx/module/?*.c $(MSRCS)
OBJS = glx/module/?*.o $(MOBJS)
#else
SRCS = glx/?*.c $(MSRCS)
OBJS = glx/?*.o $(MOBJS)
#endif
DONES = glx/DONE
INCLUDES = -Iinclude -I$(SERVERSRC)/include -I$(SERVERSRC)/mi \
-I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(XF86OSSRC)
DEPEND_DEFINES = $(EXT_DEFINES) DependDefines
DEFINES = $(GLX_DEFINES)
#if HasParallelMake
MakeMutex($(SUBDIRS) $(OBJS) $(DONES))
#endif
#if HasGnuMake || HasBsdMake
$(DONES): $(SUBDIRS)
#endif
ModuleObjectRule()
DepLibraryModuleTarget(glx,$(SUBDIRS) $(DONES) $(MOBJS),$(OBJS))
InstallLibraryModule(glx,$(MODULEDIR),extensions)
ForceSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
MakeLintLibSubdirs($(SUBDIRS))
LintSubdirs($(SUBDIRS))
InstallDriverSDKLibraryModule(glx,$(DRIVERSDKMODULEDIR),extensions)

View File

@@ -0,0 +1,178 @@
NULL =
/* Large PIC tables needed for SPARC builds */
#if defined(sparc) || defined(SparcArchitecture)
# define LargePICTable YES
PICFLAGS = LargePositionIndependentCFlags
#endif
#include <Server.tmpl>
LinkSourceFile(glcontextmodes.c, $(MESASRCDIR)/src/mesa/drivers/dri/common)
LinkSourceFile(glcontextmodes.h, $(MESASRCDIR)/src/mesa/drivers/dri/common)
LinkSourceFile(indirect_size.c, $(MESASRCDIR)/src/glx/x11)
LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11)
#if (!(defined(NXAgentServer) && NXAgentServer))
NXAGENT_SKIP_SRCS = \
glxext.c \
$(NULL)
NXAGENT_SKIP_OBJS = \
glxext.o \
$(NULL)
#else
NX_DEFINES = -DNXAGENT_SERVER
#endif
SRCS = global.c \
glxbuf.c \
glxcmds.c \
glxcmdsswap.c \
glxfb.c \
glximports.c \
glxmem.c \
glxpix.c \
glxscreens.c \
glxutil.c \
render2.c \
render2swap.c \
renderpix.c \
renderpixswap.c \
rensize.c \
rensizetab.c \
single2.c \
single2swap.c \
singlepix.c \
singlepixswap.c \
singlesize.c \
xfont.c \
g_disptab.c \
g_disptab_EXT.c \
g_render.c \
g_renderswap.c \
g_single.c \
g_singleswap.c \
glcontextmodes.c \
indirect_size.c \
$(MSRCS) \
$(NXAGENT_SKIP_SRCS) \
$(NULL)
OBJS = global.o \
glxbuf.o \
glxcmds.o \
glxcmdsswap.o \
glxfb.o \
glximports.o \
glxmem.o \
glxpix.o \
glxscreens.o \
glxutil.o \
render2.o \
render2swap.o \
renderpix.o \
renderpixswap.o \
rensize.o \
rensizetab.o \
single2.o \
single2swap.o \
singlepix.o \
singlepixswap.o \
singlesize.o \
xfont.o \
g_disptab.o \
g_disptab_EXT.o \
g_render.o \
g_renderswap.o \
g_single.o \
g_singleswap.o \
glcontextmodes.o \
indirect_size.o \
$(MOBJS) \
$(NXAGENT_SKIP_OBJS) \
$(NULL)
INCLUDES = -I$(SERVERSRC)/GL/glx \
-I$(SERVERSRC)/GL/include \
-I$(SERVERSRC)/include \
-I$(INCLUDESRC) \
-I$(MESASRCDIR)/include \
-I$(XINCLUDESRC) \
-I$(SERVERSRC)/mi \
-I$(EXTINCSRC) \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) \
`pkg-config --cflags-only-I pixman-1` \
$(NULL)
#if defined(DarwinArchitecture) && ((OSMajorVersion == 6 && OSMinorVersion < 3) || OSMajorVersion < 6)
NO_EXT_DEFS = -DMISSING_GL_EXTS
#endif
#if defined(Win32Architecture)
# undef __stdcall
APIENTRY_DEFS = -DAPIENTRY=__stdcall
#endif
XCOMM If you add "-DDEBUG" in DEFINES, then make sure you also
XCOMM add DEBUG to the define in ../mesa/src/X/xf86glx.c
DEFINES = \
$(GLX_DEFINES) \
$(NO_EXT_DEFS) \
$(APIENTRY_DEFS) \
$(NX_DEFINES) \
$(NULL)
NormalLibraryObjectRule()
NormalLibraryTarget(glx,$(OBJS))
#if defined(GlxUseWindows) && GlxUseWindows
clean::
RemoveFiles($(foreach obj,$(OBJS), stdcall/$(obj)))
includes::
MakeDir(stdcall)
SpecialObjectRule(stdcall/%.o,%.c,-DUSE_OPENGL32 -o $@)
NormalLibraryTarget(glx_stdcall,$(foreach obj,$(OBJS), stdcall/$(obj)))
#endif
SubdirLibraryRule($(OBJS))
LintLibraryTarget(glx,$(SRCS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
#ifdef LinkDirectory
LinkSourceFile(global.c,LinkDirectory)
LinkSourceFile(glxbuf.c,LinkDirectory)
LinkSourceFile(glxcmds.c,LinkDirectory)
LinkSourceFile(glxcmdsswap.c,LinkDirectory)
LinkSourceFile(glxext.c,LinkDirectory)
LinkSourceFile(glxfb.c,LinkDirectory)
LinkSourceFile(glximports.c,LinkDirectory)
LinkSourceFile(glxmem.c,LinkDirectory)
LinkSourceFile(glxpix.c,LinkDirectory)
LinkSourceFile(glxscreens.c,LinkDirectory)
LinkSourceFile(glxutil.c,LinkDirectory)
LinkSourceFile(render2.c,LinkDirectory)
LinkSourceFile(render2swap.c,LinkDirectory)
LinkSourceFile(renderpix.c,LinkDirectory)
LinkSourceFile(renderpixswap.c,LinkDirectory)
LinkSourceFile(rensize.c,LinkDirectory)
LinkSourceFile(rensizetab.c,LinkDirectory)
LinkSourceFile(single2.c,LinkDirectory)
LinkSourceFile(single2swap.c,LinkDirectory)
LinkSourceFile(singlepix.c,LinkDirectory)
LinkSourceFile(singlepixswap.c,LinkDirectory)
LinkSourceFile(singlesize.c,LinkDirectory)
LinkSourceFile(xfont.c,LinkDirectory)
LinkSourceFile(g_disptab.c,LinkDirectory)
LinkSourceFile(g_disptab_EXT.c,LinkDirectory)
LinkSourceFile(g_render.c,LinkDirectory)
LinkSourceFile(g_renderswap.c,LinkDirectory)
LinkSourceFile(g_single.c,LinkDirectory)
LinkSourceFile(g_singleswap.c,LinkDirectory)
#endif

View File

@@ -0,0 +1,838 @@
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
/*
** 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.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxext.h"
#include "g_disptab.h"
__GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXNoSuchSingleOpcode,
__glXRender,
__glXRenderLarge,
__glXCreateContext,
__glXDestroyContext,
__glXMakeCurrent,
__glXIsDirect,
__glXQueryVersion,
__glXWaitGL,
__glXWaitX,
__glXCopyContext,
__glXSwapBuffers,
__glXUseXFont,
__glXCreateGLXPixmap,
__glXGetVisualConfigs,
__glXDestroyGLXPixmap,
__glXVendorPrivate,
__glXVendorPrivateWithReply,
__glXQueryExtensionsString,
__glXQueryServerString,
__glXClientInfo,
__glXGetFBConfigs,
__glXCreatePixmap,
__glXDestroyGLXPixmap, /* glXDestroyPixmap */
__glXCreateNewContext,
__glXNoSuchSingleOpcode, /* glXQueryContext */
__glXMakeContextCurrent,
__glXNoSuchSingleOpcode, /* glXCreatePbuffer */
__glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
__glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXCreateWindow */
__glXNoSuchSingleOpcode, /* glXDestroyWindow */
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXDisp_NewList,
__glXDisp_EndList,
__glXDisp_DeleteLists,
__glXDisp_GenLists,
__glXDisp_FeedbackBuffer,
__glXDisp_SelectBuffer,
__glXDisp_RenderMode,
__glXDisp_Finish,
__glXDisp_PixelStoref,
__glXDisp_PixelStorei,
__glXDisp_ReadPixels,
__glXDisp_GetBooleanv,
__glXDisp_GetClipPlane,
__glXDisp_GetDoublev,
__glXDisp_GetError,
__glXDisp_GetFloatv,
__glXDisp_GetIntegerv,
__glXDisp_GetLightfv,
__glXDisp_GetLightiv,
__glXDisp_GetMapdv,
__glXDisp_GetMapfv,
__glXDisp_GetMapiv,
__glXDisp_GetMaterialfv,
__glXDisp_GetMaterialiv,
__glXDisp_GetPixelMapfv,
__glXDisp_GetPixelMapuiv,
__glXDisp_GetPixelMapusv,
__glXDisp_GetPolygonStipple,
__glXDisp_GetString,
__glXDisp_GetTexEnvfv,
__glXDisp_GetTexEnviv,
__glXDisp_GetTexGendv,
__glXDisp_GetTexGenfv,
__glXDisp_GetTexGeniv,
__glXDisp_GetTexImage,
__glXDisp_GetTexParameterfv,
__glXDisp_GetTexParameteriv,
__glXDisp_GetTexLevelParameterfv,
__glXDisp_GetTexLevelParameteriv,
__glXDisp_IsEnabled,
__glXDisp_IsList,
__glXDisp_Flush,
__glXDisp_AreTexturesResident,
__glXDisp_DeleteTextures,
__glXDisp_GenTextures,
__glXDisp_IsTexture,
__glXDisp_GetColorTable,
__glXDisp_GetColorTableParameterfv,
__glXDisp_GetColorTableParameteriv,
__glXDisp_GetConvolutionFilter,
__glXDisp_GetConvolutionParameterfv,
__glXDisp_GetConvolutionParameteriv,
__glXDisp_GetSeparableFilter,
__glXDisp_GetHistogram,
__glXDisp_GetHistogramParameterfv,
__glXDisp_GetHistogramParameteriv,
__glXDisp_GetMinmax,
__glXDisp_GetMinmaxParameterfv,
__glXDisp_GetMinmaxParameteriv,
};
__GLXdispatchRenderProcPtr __glXRenderTable[] = {
__glXNoSuchRenderOpcode,
__glXDisp_CallList,
__glXDisp_CallLists,
__glXDisp_ListBase,
__glXDisp_Begin,
__glXDisp_Bitmap,
__glXDisp_Color3bv,
__glXDisp_Color3dv,
__glXDisp_Color3fv,
__glXDisp_Color3iv,
__glXDisp_Color3sv,
__glXDisp_Color3ubv,
__glXDisp_Color3uiv,
__glXDisp_Color3usv,
__glXDisp_Color4bv,
__glXDisp_Color4dv,
__glXDisp_Color4fv,
__glXDisp_Color4iv,
__glXDisp_Color4sv,
__glXDisp_Color4ubv,
__glXDisp_Color4uiv,
__glXDisp_Color4usv,
__glXDisp_EdgeFlagv,
__glXDisp_End,
__glXDisp_Indexdv,
__glXDisp_Indexfv,
__glXDisp_Indexiv,
__glXDisp_Indexsv,
__glXDisp_Normal3bv,
__glXDisp_Normal3dv,
__glXDisp_Normal3fv,
__glXDisp_Normal3iv,
__glXDisp_Normal3sv,
__glXDisp_RasterPos2dv,
__glXDisp_RasterPos2fv,
__glXDisp_RasterPos2iv,
__glXDisp_RasterPos2sv,
__glXDisp_RasterPos3dv,
__glXDisp_RasterPos3fv,
__glXDisp_RasterPos3iv,
__glXDisp_RasterPos3sv,
__glXDisp_RasterPos4dv,
__glXDisp_RasterPos4fv,
__glXDisp_RasterPos4iv,
__glXDisp_RasterPos4sv,
__glXDisp_Rectdv,
__glXDisp_Rectfv,
__glXDisp_Rectiv,
__glXDisp_Rectsv,
__glXDisp_TexCoord1dv,
__glXDisp_TexCoord1fv,
__glXDisp_TexCoord1iv,
__glXDisp_TexCoord1sv,
__glXDisp_TexCoord2dv,
__glXDisp_TexCoord2fv,
__glXDisp_TexCoord2iv,
__glXDisp_TexCoord2sv,
__glXDisp_TexCoord3dv,
__glXDisp_TexCoord3fv,
__glXDisp_TexCoord3iv,
__glXDisp_TexCoord3sv,
__glXDisp_TexCoord4dv,
__glXDisp_TexCoord4fv,
__glXDisp_TexCoord4iv,
__glXDisp_TexCoord4sv,
__glXDisp_Vertex2dv,
__glXDisp_Vertex2fv,
__glXDisp_Vertex2iv,
__glXDisp_Vertex2sv,
__glXDisp_Vertex3dv,
__glXDisp_Vertex3fv,
__glXDisp_Vertex3iv,
__glXDisp_Vertex3sv,
__glXDisp_Vertex4dv,
__glXDisp_Vertex4fv,
__glXDisp_Vertex4iv,
__glXDisp_Vertex4sv,
__glXDisp_ClipPlane,
__glXDisp_ColorMaterial,
__glXDisp_CullFace,
__glXDisp_Fogf,
__glXDisp_Fogfv,
__glXDisp_Fogi,
__glXDisp_Fogiv,
__glXDisp_FrontFace,
__glXDisp_Hint,
__glXDisp_Lightf,
__glXDisp_Lightfv,
__glXDisp_Lighti,
__glXDisp_Lightiv,
__glXDisp_LightModelf,
__glXDisp_LightModelfv,
__glXDisp_LightModeli,
__glXDisp_LightModeliv,
__glXDisp_LineStipple,
__glXDisp_LineWidth,
__glXDisp_Materialf,
__glXDisp_Materialfv,
__glXDisp_Materiali,
__glXDisp_Materialiv,
__glXDisp_PointSize,
__glXDisp_PolygonMode,
__glXDisp_PolygonStipple,
__glXDisp_Scissor,
__glXDisp_ShadeModel,
__glXDisp_TexParameterf,
__glXDisp_TexParameterfv,
__glXDisp_TexParameteri,
__glXDisp_TexParameteriv,
__glXDisp_TexImage1D,
__glXDisp_TexImage2D,
__glXDisp_TexEnvf,
__glXDisp_TexEnvfv,
__glXDisp_TexEnvi,
__glXDisp_TexEnviv,
__glXDisp_TexGend,
__glXDisp_TexGendv,
__glXDisp_TexGenf,
__glXDisp_TexGenfv,
__glXDisp_TexGeni,
__glXDisp_TexGeniv,
__glXDisp_InitNames,
__glXDisp_LoadName,
__glXDisp_PassThrough,
__glXDisp_PopName,
__glXDisp_PushName,
__glXDisp_DrawBuffer,
__glXDisp_Clear,
__glXDisp_ClearAccum,
__glXDisp_ClearIndex,
__glXDisp_ClearColor,
__glXDisp_ClearStencil,
__glXDisp_ClearDepth,
__glXDisp_StencilMask,
__glXDisp_ColorMask,
__glXDisp_DepthMask,
__glXDisp_IndexMask,
__glXDisp_Accum,
__glXDisp_Disable,
__glXDisp_Enable,
__glXNoSuchRenderOpcode,
__glXDisp_PopAttrib,
__glXDisp_PushAttrib,
__glXDisp_Map1d,
__glXDisp_Map1f,
__glXDisp_Map2d,
__glXDisp_Map2f,
__glXDisp_MapGrid1d,
__glXDisp_MapGrid1f,
__glXDisp_MapGrid2d,
__glXDisp_MapGrid2f,
__glXDisp_EvalCoord1dv,
__glXDisp_EvalCoord1fv,
__glXDisp_EvalCoord2dv,
__glXDisp_EvalCoord2fv,
__glXDisp_EvalMesh1,
__glXDisp_EvalPoint1,
__glXDisp_EvalMesh2,
__glXDisp_EvalPoint2,
__glXDisp_AlphaFunc,
__glXDisp_BlendFunc,
__glXDisp_LogicOp,
__glXDisp_StencilFunc,
__glXDisp_StencilOp,
__glXDisp_DepthFunc,
__glXDisp_PixelZoom,
__glXDisp_PixelTransferf,
__glXDisp_PixelTransferi,
__glXDisp_PixelMapfv,
__glXDisp_PixelMapuiv,
__glXDisp_PixelMapusv,
__glXDisp_ReadBuffer,
__glXDisp_CopyPixels,
__glXDisp_DrawPixels,
__glXDisp_DepthRange,
__glXDisp_Frustum,
__glXDisp_LoadIdentity,
__glXDisp_LoadMatrixf,
__glXDisp_LoadMatrixd,
__glXDisp_MatrixMode,
__glXDisp_MultMatrixf,
__glXDisp_MultMatrixd,
__glXDisp_Ortho,
__glXDisp_PopMatrix,
__glXDisp_PushMatrix,
__glXDisp_Rotated,
__glXDisp_Rotatef,
__glXDisp_Scaled,
__glXDisp_Scalef,
__glXDisp_Translated,
__glXDisp_Translatef,
__glXDisp_Viewport,
__glXDisp_PolygonOffset,
__glXDisp_DrawArrays,
__glXDisp_Indexubv,
__glXDisp_ColorSubTable,
__glXDisp_CopyColorSubTable,
__glXDisp_ActiveTextureARB,
__glXDisp_MultiTexCoord1dvARB,
__glXDisp_MultiTexCoord1fvARB,
__glXDisp_MultiTexCoord1ivARB,
__glXDisp_MultiTexCoord1svARB,
__glXDisp_MultiTexCoord2dvARB,
__glXDisp_MultiTexCoord2fvARB,
__glXDisp_MultiTexCoord2ivARB,
__glXDisp_MultiTexCoord2svARB,
__glXDisp_MultiTexCoord3dvARB,
__glXDisp_MultiTexCoord3fvARB,
__glXDisp_MultiTexCoord3ivARB,
__glXDisp_MultiTexCoord3svARB,
__glXDisp_MultiTexCoord4dvARB,
__glXDisp_MultiTexCoord4fvARB,
__glXDisp_MultiTexCoord4ivARB,
__glXDisp_MultiTexCoord4svARB, /* 213 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode, /* 220 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXDisp_SampleCoverageARB,
#ifndef MISSING_GL_EXTS
__glXDisp_WindowPos3fARB /* 230 */
#else
__glXNoSuchRenderOpcode
#endif
};
__GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXNoSuchSingleOpcode,
__glXSwapRender,
__glXSwapRenderLarge,
__glXSwapCreateContext,
__glXSwapDestroyContext,
__glXSwapMakeCurrent,
__glXSwapIsDirect,
__glXSwapQueryVersion,
__glXSwapWaitGL,
__glXSwapWaitX,
__glXSwapCopyContext,
__glXSwapSwapBuffers,
__glXSwapUseXFont,
__glXSwapCreateGLXPixmap,
__glXSwapGetVisualConfigs,
__glXSwapDestroyGLXPixmap,
__glXSwapVendorPrivate,
__glXSwapVendorPrivateWithReply,
__glXSwapQueryExtensionsString,
__glXSwapQueryServerString,
__glXSwapClientInfo,
__glXSwapGetFBConfigs,
__glXSwapCreatePixmap,
__glXSwapDestroyGLXPixmap, /* glXDestroyPixmap */
__glXSwapCreateNewContext,
__glXNoSuchSingleOpcode, /* glXQueryContext */
__glXSwapMakeContextCurrent,
__glXNoSuchSingleOpcode, /* glXCreatePbuffer */
__glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
__glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXCreateWindow */
__glXNoSuchSingleOpcode, /* glXDestroyWindow */
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXDispSwap_NewList,
__glXDispSwap_EndList,
__glXDispSwap_DeleteLists,
__glXDispSwap_GenLists,
__glXDispSwap_FeedbackBuffer,
__glXDispSwap_SelectBuffer,
__glXDispSwap_RenderMode,
__glXDispSwap_Finish,
__glXDispSwap_PixelStoref,
__glXDispSwap_PixelStorei,
__glXDispSwap_ReadPixels,
__glXDispSwap_GetBooleanv,
__glXDispSwap_GetClipPlane,
__glXDispSwap_GetDoublev,
__glXDispSwap_GetError,
__glXDispSwap_GetFloatv,
__glXDispSwap_GetIntegerv,
__glXDispSwap_GetLightfv,
__glXDispSwap_GetLightiv,
__glXDispSwap_GetMapdv,
__glXDispSwap_GetMapfv,
__glXDispSwap_GetMapiv,
__glXDispSwap_GetMaterialfv,
__glXDispSwap_GetMaterialiv,
__glXDispSwap_GetPixelMapfv,
__glXDispSwap_GetPixelMapuiv,
__glXDispSwap_GetPixelMapusv,
__glXDispSwap_GetPolygonStipple,
__glXDispSwap_GetString,
__glXDispSwap_GetTexEnvfv,
__glXDispSwap_GetTexEnviv,
__glXDispSwap_GetTexGendv,
__glXDispSwap_GetTexGenfv,
__glXDispSwap_GetTexGeniv,
__glXDispSwap_GetTexImage,
__glXDispSwap_GetTexParameterfv,
__glXDispSwap_GetTexParameteriv,
__glXDispSwap_GetTexLevelParameterfv,
__glXDispSwap_GetTexLevelParameteriv,
__glXDispSwap_IsEnabled,
__glXDispSwap_IsList,
__glXDispSwap_Flush,
__glXDispSwap_AreTexturesResident,
__glXDispSwap_DeleteTextures,
__glXDispSwap_GenTextures,
__glXDispSwap_IsTexture,
__glXDispSwap_GetColorTable,
__glXDispSwap_GetColorTableParameterfv,
__glXDispSwap_GetColorTableParameteriv,
__glXDispSwap_GetConvolutionFilter,
__glXDispSwap_GetConvolutionParameterfv,
__glXDispSwap_GetConvolutionParameteriv,
__glXDispSwap_GetSeparableFilter,
__glXDispSwap_GetHistogram,
__glXDispSwap_GetHistogramParameterfv,
__glXDispSwap_GetHistogramParameteriv,
__glXDispSwap_GetMinmax,
__glXDispSwap_GetMinmaxParameterfv,
__glXDispSwap_GetMinmaxParameteriv,
};
__GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE] = {
__glXNoSuchRenderOpcode,
__glXDispSwap_CallList,
__glXDispSwap_CallLists,
__glXDispSwap_ListBase,
__glXDispSwap_Begin,
__glXDispSwap_Bitmap,
__glXDispSwap_Color3bv,
__glXDispSwap_Color3dv,
__glXDispSwap_Color3fv,
__glXDispSwap_Color3iv,
__glXDispSwap_Color3sv,
__glXDispSwap_Color3ubv,
__glXDispSwap_Color3uiv,
__glXDispSwap_Color3usv,
__glXDispSwap_Color4bv,
__glXDispSwap_Color4dv,
__glXDispSwap_Color4fv,
__glXDispSwap_Color4iv,
__glXDispSwap_Color4sv,
__glXDispSwap_Color4ubv,
__glXDispSwap_Color4uiv,
__glXDispSwap_Color4usv,
__glXDispSwap_EdgeFlagv,
__glXDispSwap_End,
__glXDispSwap_Indexdv,
__glXDispSwap_Indexfv,
__glXDispSwap_Indexiv,
__glXDispSwap_Indexsv,
__glXDispSwap_Normal3bv,
__glXDispSwap_Normal3dv,
__glXDispSwap_Normal3fv,
__glXDispSwap_Normal3iv,
__glXDispSwap_Normal3sv,
__glXDispSwap_RasterPos2dv,
__glXDispSwap_RasterPos2fv,
__glXDispSwap_RasterPos2iv,
__glXDispSwap_RasterPos2sv,
__glXDispSwap_RasterPos3dv,
__glXDispSwap_RasterPos3fv,
__glXDispSwap_RasterPos3iv,
__glXDispSwap_RasterPos3sv,
__glXDispSwap_RasterPos4dv,
__glXDispSwap_RasterPos4fv,
__glXDispSwap_RasterPos4iv,
__glXDispSwap_RasterPos4sv,
__glXDispSwap_Rectdv,
__glXDispSwap_Rectfv,
__glXDispSwap_Rectiv,
__glXDispSwap_Rectsv,
__glXDispSwap_TexCoord1dv,
__glXDispSwap_TexCoord1fv,
__glXDispSwap_TexCoord1iv,
__glXDispSwap_TexCoord1sv,
__glXDispSwap_TexCoord2dv,
__glXDispSwap_TexCoord2fv,
__glXDispSwap_TexCoord2iv,
__glXDispSwap_TexCoord2sv,
__glXDispSwap_TexCoord3dv,
__glXDispSwap_TexCoord3fv,
__glXDispSwap_TexCoord3iv,
__glXDispSwap_TexCoord3sv,
__glXDispSwap_TexCoord4dv,
__glXDispSwap_TexCoord4fv,
__glXDispSwap_TexCoord4iv,
__glXDispSwap_TexCoord4sv,
__glXDispSwap_Vertex2dv,
__glXDispSwap_Vertex2fv,
__glXDispSwap_Vertex2iv,
__glXDispSwap_Vertex2sv,
__glXDispSwap_Vertex3dv,
__glXDispSwap_Vertex3fv,
__glXDispSwap_Vertex3iv,
__glXDispSwap_Vertex3sv,
__glXDispSwap_Vertex4dv,
__glXDispSwap_Vertex4fv,
__glXDispSwap_Vertex4iv,
__glXDispSwap_Vertex4sv,
__glXDispSwap_ClipPlane,
__glXDispSwap_ColorMaterial,
__glXDispSwap_CullFace,
__glXDispSwap_Fogf,
__glXDispSwap_Fogfv,
__glXDispSwap_Fogi,
__glXDispSwap_Fogiv,
__glXDispSwap_FrontFace,
__glXDispSwap_Hint,
__glXDispSwap_Lightf,
__glXDispSwap_Lightfv,
__glXDispSwap_Lighti,
__glXDispSwap_Lightiv,
__glXDispSwap_LightModelf,
__glXDispSwap_LightModelfv,
__glXDispSwap_LightModeli,
__glXDispSwap_LightModeliv,
__glXDispSwap_LineStipple,
__glXDispSwap_LineWidth,
__glXDispSwap_Materialf,
__glXDispSwap_Materialfv,
__glXDispSwap_Materiali,
__glXDispSwap_Materialiv,
__glXDispSwap_PointSize,
__glXDispSwap_PolygonMode,
__glXDispSwap_PolygonStipple,
__glXDispSwap_Scissor,
__glXDispSwap_ShadeModel,
__glXDispSwap_TexParameterf,
__glXDispSwap_TexParameterfv,
__glXDispSwap_TexParameteri,
__glXDispSwap_TexParameteriv,
__glXDispSwap_TexImage1D,
__glXDispSwap_TexImage2D,
__glXDispSwap_TexEnvf,
__glXDispSwap_TexEnvfv,
__glXDispSwap_TexEnvi,
__glXDispSwap_TexEnviv,
__glXDispSwap_TexGend,
__glXDispSwap_TexGendv,
__glXDispSwap_TexGenf,
__glXDispSwap_TexGenfv,
__glXDispSwap_TexGeni,
__glXDispSwap_TexGeniv,
__glXDispSwap_InitNames,
__glXDispSwap_LoadName,
__glXDispSwap_PassThrough,
__glXDispSwap_PopName,
__glXDispSwap_PushName,
__glXDispSwap_DrawBuffer,
__glXDispSwap_Clear,
__glXDispSwap_ClearAccum,
__glXDispSwap_ClearIndex,
__glXDispSwap_ClearColor,
__glXDispSwap_ClearStencil,
__glXDispSwap_ClearDepth,
__glXDispSwap_StencilMask,
__glXDispSwap_ColorMask,
__glXDispSwap_DepthMask,
__glXDispSwap_IndexMask,
__glXDispSwap_Accum,
__glXDispSwap_Disable,
__glXDispSwap_Enable,
__glXNoSuchRenderOpcode,
__glXDispSwap_PopAttrib,
__glXDispSwap_PushAttrib,
__glXDispSwap_Map1d,
__glXDispSwap_Map1f,
__glXDispSwap_Map2d,
__glXDispSwap_Map2f,
__glXDispSwap_MapGrid1d,
__glXDispSwap_MapGrid1f,
__glXDispSwap_MapGrid2d,
__glXDispSwap_MapGrid2f,
__glXDispSwap_EvalCoord1dv,
__glXDispSwap_EvalCoord1fv,
__glXDispSwap_EvalCoord2dv,
__glXDispSwap_EvalCoord2fv,
__glXDispSwap_EvalMesh1,
__glXDispSwap_EvalPoint1,
__glXDispSwap_EvalMesh2,
__glXDispSwap_EvalPoint2,
__glXDispSwap_AlphaFunc,
__glXDispSwap_BlendFunc,
__glXDispSwap_LogicOp,
__glXDispSwap_StencilFunc,
__glXDispSwap_StencilOp,
__glXDispSwap_DepthFunc,
__glXDispSwap_PixelZoom,
__glXDispSwap_PixelTransferf,
__glXDispSwap_PixelTransferi,
__glXDispSwap_PixelMapfv,
__glXDispSwap_PixelMapuiv,
__glXDispSwap_PixelMapusv,
__glXDispSwap_ReadBuffer,
__glXDispSwap_CopyPixels,
__glXDispSwap_DrawPixels,
__glXDispSwap_DepthRange,
__glXDispSwap_Frustum,
__glXDispSwap_LoadIdentity,
__glXDispSwap_LoadMatrixf,
__glXDispSwap_LoadMatrixd,
__glXDispSwap_MatrixMode,
__glXDispSwap_MultMatrixf,
__glXDispSwap_MultMatrixd,
__glXDispSwap_Ortho,
__glXDispSwap_PopMatrix,
__glXDispSwap_PushMatrix,
__glXDispSwap_Rotated,
__glXDispSwap_Rotatef,
__glXDispSwap_Scaled,
__glXDispSwap_Scalef,
__glXDispSwap_Translated,
__glXDispSwap_Translatef,
__glXDispSwap_Viewport,
__glXDispSwap_PolygonOffset,
__glXDispSwap_DrawArrays,
__glXDispSwap_Indexubv,
__glXDispSwap_ColorSubTable,
__glXDispSwap_CopyColorSubTable,
__glXDispSwap_ActiveTextureARB,
__glXDispSwap_MultiTexCoord1dvARB,
__glXDispSwap_MultiTexCoord1fvARB,
__glXDispSwap_MultiTexCoord1ivARB,
__glXDispSwap_MultiTexCoord1svARB,
__glXDispSwap_MultiTexCoord2dvARB,
__glXDispSwap_MultiTexCoord2fvARB,
__glXDispSwap_MultiTexCoord2ivARB,
__glXDispSwap_MultiTexCoord2svARB,
__glXDispSwap_MultiTexCoord3dvARB,
__glXDispSwap_MultiTexCoord3fvARB,
__glXDispSwap_MultiTexCoord3ivARB,
__glXDispSwap_MultiTexCoord3svARB,
__glXDispSwap_MultiTexCoord4dvARB,
__glXDispSwap_MultiTexCoord4fvARB,
__glXDispSwap_MultiTexCoord4ivARB,
__glXDispSwap_MultiTexCoord4svARB, /* 213 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode, /* 220 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXDispSwap_SampleCoverageARB,
#ifndef MISSING_GL_EXTS
__glXDispSwap_WindowPos3fARB /* 230 */
#else
__glXNoSuchRenderOpcode
#endif
};

View File

@@ -0,0 +1,651 @@
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_g_disptab_h_
#define _GLX_g_disptab_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: 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.
*/
extern int __glXRender(__GLXclientState*, GLbyte*);
extern int __glXRenderLarge(__GLXclientState*, GLbyte*);
extern int __glXCreateContext(__GLXclientState*, GLbyte*);
extern int __glXDestroyContext(__GLXclientState*, GLbyte*);
extern int __glXMakeCurrent(__GLXclientState*, GLbyte*);
extern int __glXIsDirect(__GLXclientState*, GLbyte*);
extern int __glXQueryVersion(__GLXclientState*, GLbyte*);
extern int __glXWaitGL(__GLXclientState*, GLbyte*);
extern int __glXWaitX(__GLXclientState*, GLbyte*);
extern int __glXCopyContext(__GLXclientState*, GLbyte*);
extern int __glXSwapBuffers(__GLXclientState*, GLbyte*);
extern int __glXUseXFont(__GLXclientState*, GLbyte*);
extern int __glXCreateGLXPixmap(__GLXclientState*, GLbyte*);
extern int __glXGetVisualConfigs(__GLXclientState*, GLbyte*);
extern int __glXDestroyGLXPixmap(__GLXclientState*, GLbyte*);
extern int __glXVendorPrivate(__GLXclientState*, GLbyte*);
extern int __glXVendorPrivateWithReply(__GLXclientState*, GLbyte*);
extern int __glXQueryExtensionsString(__GLXclientState*, GLbyte*);
extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXClientInfo(__GLXclientState*, GLbyte*);
extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
extern int __glXGetFBConfigs(__GLXclientState*, GLbyte*);
extern int __glXCreateNewContext(__GLXclientState*, GLbyte*);
extern int __glXCreatePixmap(__GLXclientState*, GLbyte*);
extern int __glXDisp_NewList(__GLXclientState*, GLbyte*);
extern int __glXDisp_EndList(__GLXclientState*, GLbyte*);
extern int __glXDisp_DeleteLists(__GLXclientState*, GLbyte*);
extern int __glXDisp_GenLists(__GLXclientState*, GLbyte*);
extern int __glXDisp_FeedbackBuffer(__GLXclientState*, GLbyte*);
extern int __glXDisp_SelectBuffer(__GLXclientState*, GLbyte*);
extern int __glXDisp_RenderMode(__GLXclientState*, GLbyte*);
extern int __glXDisp_Finish(__GLXclientState*, GLbyte*);
extern int __glXDisp_PixelStoref(__GLXclientState*, GLbyte*);
extern int __glXDisp_PixelStorei(__GLXclientState*, GLbyte*);
extern int __glXDisp_ReadPixels(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetBooleanv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetClipPlane(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetDoublev(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetError(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetFloatv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetIntegerv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetLightfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetLightiv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMapdv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMapfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMapiv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMaterialfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMaterialiv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetPixelMapfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetPixelMapuiv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetPixelMapusv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetPolygonStipple(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetString(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexEnvfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexEnviv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexGendv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexGenfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexGeniv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexImage(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_IsEnabled(__GLXclientState*, GLbyte*);
extern int __glXDisp_IsList(__GLXclientState*, GLbyte*);
extern int __glXDisp_Flush(__GLXclientState*, GLbyte*);
extern int __glXDisp_AreTexturesResident(__GLXclientState*, GLbyte*);
extern int __glXDisp_DeleteTextures(__GLXclientState*, GLbyte*);
extern int __glXDisp_GenTextures(__GLXclientState*, GLbyte*);
extern int __glXDisp_IsTexture(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetColorTable(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetConvolutionFilter(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetSeparableFilter(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetHistogram(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMinmax(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
extern void __glXDisp_CallList(GLbyte*);
extern void __glXDisp_CallLists(GLbyte*);
extern void __glXDisp_ListBase(GLbyte*);
extern void __glXDisp_Begin(GLbyte*);
extern void __glXDisp_Bitmap(GLbyte*);
extern void __glXDisp_Color3bv(GLbyte*);
extern void __glXDisp_Color3dv(GLbyte*);
extern void __glXDisp_Color3fv(GLbyte*);
extern void __glXDisp_Color3iv(GLbyte*);
extern void __glXDisp_Color3sv(GLbyte*);
extern void __glXDisp_Color3ubv(GLbyte*);
extern void __glXDisp_Color3uiv(GLbyte*);
extern void __glXDisp_Color3usv(GLbyte*);
extern void __glXDisp_Color4bv(GLbyte*);
extern void __glXDisp_Color4dv(GLbyte*);
extern void __glXDisp_Color4fv(GLbyte*);
extern void __glXDisp_Color4iv(GLbyte*);
extern void __glXDisp_Color4sv(GLbyte*);
extern void __glXDisp_Color4ubv(GLbyte*);
extern void __glXDisp_Color4uiv(GLbyte*);
extern void __glXDisp_Color4usv(GLbyte*);
extern void __glXDisp_EdgeFlagv(GLbyte*);
extern void __glXDisp_End(GLbyte*);
extern void __glXDisp_Indexdv(GLbyte*);
extern void __glXDisp_Indexfv(GLbyte*);
extern void __glXDisp_Indexiv(GLbyte*);
extern void __glXDisp_Indexsv(GLbyte*);
extern void __glXDisp_Normal3bv(GLbyte*);
extern void __glXDisp_Normal3dv(GLbyte*);
extern void __glXDisp_Normal3fv(GLbyte*);
extern void __glXDisp_Normal3iv(GLbyte*);
extern void __glXDisp_Normal3sv(GLbyte*);
extern void __glXDisp_RasterPos2dv(GLbyte*);
extern void __glXDisp_RasterPos2fv(GLbyte*);
extern void __glXDisp_RasterPos2iv(GLbyte*);
extern void __glXDisp_RasterPos2sv(GLbyte*);
extern void __glXDisp_RasterPos3dv(GLbyte*);
extern void __glXDisp_RasterPos3fv(GLbyte*);
extern void __glXDisp_RasterPos3iv(GLbyte*);
extern void __glXDisp_RasterPos3sv(GLbyte*);
extern void __glXDisp_RasterPos4dv(GLbyte*);
extern void __glXDisp_RasterPos4fv(GLbyte*);
extern void __glXDisp_RasterPos4iv(GLbyte*);
extern void __glXDisp_RasterPos4sv(GLbyte*);
extern void __glXDisp_Rectdv(GLbyte*);
extern void __glXDisp_Rectfv(GLbyte*);
extern void __glXDisp_Rectiv(GLbyte*);
extern void __glXDisp_Rectsv(GLbyte*);
extern void __glXDisp_TexCoord1dv(GLbyte*);
extern void __glXDisp_TexCoord1fv(GLbyte*);
extern void __glXDisp_TexCoord1iv(GLbyte*);
extern void __glXDisp_TexCoord1sv(GLbyte*);
extern void __glXDisp_TexCoord2dv(GLbyte*);
extern void __glXDisp_TexCoord2fv(GLbyte*);
extern void __glXDisp_TexCoord2iv(GLbyte*);
extern void __glXDisp_TexCoord2sv(GLbyte*);
extern void __glXDisp_TexCoord3dv(GLbyte*);
extern void __glXDisp_TexCoord3fv(GLbyte*);
extern void __glXDisp_TexCoord3iv(GLbyte*);
extern void __glXDisp_TexCoord3sv(GLbyte*);
extern void __glXDisp_TexCoord4dv(GLbyte*);
extern void __glXDisp_TexCoord4fv(GLbyte*);
extern void __glXDisp_TexCoord4iv(GLbyte*);
extern void __glXDisp_TexCoord4sv(GLbyte*);
extern void __glXDisp_Vertex2dv(GLbyte*);
extern void __glXDisp_Vertex2fv(GLbyte*);
extern void __glXDisp_Vertex2iv(GLbyte*);
extern void __glXDisp_Vertex2sv(GLbyte*);
extern void __glXDisp_Vertex3dv(GLbyte*);
extern void __glXDisp_Vertex3fv(GLbyte*);
extern void __glXDisp_Vertex3iv(GLbyte*);
extern void __glXDisp_Vertex3sv(GLbyte*);
extern void __glXDisp_Vertex4dv(GLbyte*);
extern void __glXDisp_Vertex4fv(GLbyte*);
extern void __glXDisp_Vertex4iv(GLbyte*);
extern void __glXDisp_Vertex4sv(GLbyte*);
extern void __glXDisp_ClipPlane(GLbyte*);
extern void __glXDisp_ColorMaterial(GLbyte*);
extern void __glXDisp_CullFace(GLbyte*);
extern void __glXDisp_Fogf(GLbyte*);
extern void __glXDisp_Fogfv(GLbyte*);
extern void __glXDisp_Fogi(GLbyte*);
extern void __glXDisp_Fogiv(GLbyte*);
extern void __glXDisp_FrontFace(GLbyte*);
extern void __glXDisp_Hint(GLbyte*);
extern void __glXDisp_Lightf(GLbyte*);
extern void __glXDisp_Lightfv(GLbyte*);
extern void __glXDisp_Lighti(GLbyte*);
extern void __glXDisp_Lightiv(GLbyte*);
extern void __glXDisp_LightModelf(GLbyte*);
extern void __glXDisp_LightModelfv(GLbyte*);
extern void __glXDisp_LightModeli(GLbyte*);
extern void __glXDisp_LightModeliv(GLbyte*);
extern void __glXDisp_LineStipple(GLbyte*);
extern void __glXDisp_LineWidth(GLbyte*);
extern void __glXDisp_Materialf(GLbyte*);
extern void __glXDisp_Materialfv(GLbyte*);
extern void __glXDisp_Materiali(GLbyte*);
extern void __glXDisp_Materialiv(GLbyte*);
extern void __glXDisp_PointSize(GLbyte*);
extern void __glXDisp_PolygonMode(GLbyte*);
extern void __glXDisp_PolygonStipple(GLbyte*);
extern void __glXDisp_Scissor(GLbyte*);
extern void __glXDisp_ShadeModel(GLbyte*);
extern void __glXDisp_TexParameterf(GLbyte*);
extern void __glXDisp_TexParameterfv(GLbyte*);
extern void __glXDisp_TexParameteri(GLbyte*);
extern void __glXDisp_TexParameteriv(GLbyte*);
extern void __glXDisp_TexImage1D(GLbyte*);
extern void __glXDisp_TexImage2D(GLbyte*);
extern void __glXDisp_TexEnvf(GLbyte*);
extern void __glXDisp_TexEnvfv(GLbyte*);
extern void __glXDisp_TexEnvi(GLbyte*);
extern void __glXDisp_TexEnviv(GLbyte*);
extern void __glXDisp_TexGend(GLbyte*);
extern void __glXDisp_TexGendv(GLbyte*);
extern void __glXDisp_TexGenf(GLbyte*);
extern void __glXDisp_TexGenfv(GLbyte*);
extern void __glXDisp_TexGeni(GLbyte*);
extern void __glXDisp_TexGeniv(GLbyte*);
extern void __glXDisp_InitNames(GLbyte*);
extern void __glXDisp_LoadName(GLbyte*);
extern void __glXDisp_PassThrough(GLbyte*);
extern void __glXDisp_PopName(GLbyte*);
extern void __glXDisp_PushName(GLbyte*);
extern void __glXDisp_DrawBuffer(GLbyte*);
extern void __glXDisp_Clear(GLbyte*);
extern void __glXDisp_ClearAccum(GLbyte*);
extern void __glXDisp_ClearIndex(GLbyte*);
extern void __glXDisp_ClearColor(GLbyte*);
extern void __glXDisp_ClearStencil(GLbyte*);
extern void __glXDisp_ClearDepth(GLbyte*);
extern void __glXDisp_StencilMask(GLbyte*);
extern void __glXDisp_ColorMask(GLbyte*);
extern void __glXDisp_DepthMask(GLbyte*);
extern void __glXDisp_IndexMask(GLbyte*);
extern void __glXDisp_Accum(GLbyte*);
extern void __glXDisp_Disable(GLbyte*);
extern void __glXDisp_Enable(GLbyte*);
extern void __glXDisp_PopAttrib(GLbyte*);
extern void __glXDisp_PushAttrib(GLbyte*);
extern void __glXDisp_Map1d(GLbyte*);
extern void __glXDisp_Map1f(GLbyte*);
extern void __glXDisp_Map2d(GLbyte*);
extern void __glXDisp_Map2f(GLbyte*);
extern void __glXDisp_MapGrid1d(GLbyte*);
extern void __glXDisp_MapGrid1f(GLbyte*);
extern void __glXDisp_MapGrid2d(GLbyte*);
extern void __glXDisp_MapGrid2f(GLbyte*);
extern void __glXDisp_EvalCoord1dv(GLbyte*);
extern void __glXDisp_EvalCoord1fv(GLbyte*);
extern void __glXDisp_EvalCoord2dv(GLbyte*);
extern void __glXDisp_EvalCoord2fv(GLbyte*);
extern void __glXDisp_EvalMesh1(GLbyte*);
extern void __glXDisp_EvalPoint1(GLbyte*);
extern void __glXDisp_EvalMesh2(GLbyte*);
extern void __glXDisp_EvalPoint2(GLbyte*);
extern void __glXDisp_AlphaFunc(GLbyte*);
extern void __glXDisp_BlendFunc(GLbyte*);
extern void __glXDisp_LogicOp(GLbyte*);
extern void __glXDisp_StencilFunc(GLbyte*);
extern void __glXDisp_StencilOp(GLbyte*);
extern void __glXDisp_DepthFunc(GLbyte*);
extern void __glXDisp_PixelZoom(GLbyte*);
extern void __glXDisp_PixelTransferf(GLbyte*);
extern void __glXDisp_PixelTransferi(GLbyte*);
extern void __glXDisp_PixelMapfv(GLbyte*);
extern void __glXDisp_PixelMapuiv(GLbyte*);
extern void __glXDisp_PixelMapusv(GLbyte*);
extern void __glXDisp_ReadBuffer(GLbyte*);
extern void __glXDisp_CopyPixels(GLbyte*);
extern void __glXDisp_DrawPixels(GLbyte*);
extern void __glXDisp_DepthRange(GLbyte*);
extern void __glXDisp_Frustum(GLbyte*);
extern void __glXDisp_LoadIdentity(GLbyte*);
extern void __glXDisp_LoadMatrixf(GLbyte*);
extern void __glXDisp_LoadMatrixd(GLbyte*);
extern void __glXDisp_MatrixMode(GLbyte*);
extern void __glXDisp_MultMatrixf(GLbyte*);
extern void __glXDisp_MultMatrixd(GLbyte*);
extern void __glXDisp_Ortho(GLbyte*);
extern void __glXDisp_PopMatrix(GLbyte*);
extern void __glXDisp_PushMatrix(GLbyte*);
extern void __glXDisp_Rotated(GLbyte*);
extern void __glXDisp_Rotatef(GLbyte*);
extern void __glXDisp_Scaled(GLbyte*);
extern void __glXDisp_Scalef(GLbyte*);
extern void __glXDisp_Translated(GLbyte*);
extern void __glXDisp_Translatef(GLbyte*);
extern void __glXDisp_Viewport(GLbyte*);
extern void __glXDisp_PolygonOffset(GLbyte*);
extern void __glXDisp_DrawArrays(GLbyte*);
extern void __glXDisp_Indexubv(GLbyte*);
extern void __glXDisp_ColorSubTable(GLbyte*);
extern void __glXDisp_CopyColorSubTable(GLbyte*);
extern void __glXDisp_ActiveTextureARB(GLbyte*);
extern void __glXDisp_MultiTexCoord1dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord1fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord1ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord1svARB(GLbyte*);
extern void __glXDisp_MultiTexCoord2dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord2fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord2ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord2svARB(GLbyte*);
extern void __glXDisp_MultiTexCoord3dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord3fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord3ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord3svARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4svARB(GLbyte*);
extern void __glXDisp_SampleCoverageARB(GLbyte *);
extern void __glXDisp_WindowPos3fARB(GLbyte *);
extern int __glXSwapRender(__GLXclientState*, GLbyte*);
extern int __glXSwapRenderLarge(__GLXclientState*, GLbyte*);
extern int __glXSwapCreateContext(__GLXclientState*, GLbyte*);
extern int __glXSwapDestroyContext(__GLXclientState*, GLbyte*);
extern int __glXSwapMakeCurrent(__GLXclientState*, GLbyte*);
extern int __glXSwapIsDirect(__GLXclientState*, GLbyte*);
extern int __glXSwapQueryVersion(__GLXclientState*, GLbyte*);
extern int __glXSwapWaitGL(__GLXclientState*, GLbyte*);
extern int __glXSwapWaitX(__GLXclientState*, GLbyte*);
extern int __glXSwapCopyContext(__GLXclientState*, GLbyte*);
extern int __glXSwapSwapBuffers(__GLXclientState*, GLbyte*);
extern int __glXSwapUseXFont(__GLXclientState*, GLbyte*);
extern int __glXSwapCreateGLXPixmap(__GLXclientState*, GLbyte*);
extern int __glXSwapGetVisualConfigs(__GLXclientState*, GLbyte*);
extern int __glXSwapDestroyGLXPixmap(__GLXclientState*, GLbyte*);
extern int __glXSwapVendorPrivate(__GLXclientState*, GLbyte*);
extern int __glXSwapVendorPrivateWithReply(__GLXclientState*, GLbyte*);
extern int __glXSwapQueryExtensionsString(__GLXclientState*, GLbyte*);
extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
extern int __glXSwapGetFBConfigs(__GLXclientState*, GLbyte*);
extern int __glXSwapCreateNewContext(__GLXclientState*, GLbyte*);
extern int __glXSwapCreatePixmap(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_NewList(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_EndList(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_DeleteLists(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GenLists(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_FeedbackBuffer(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_SelectBuffer(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_RenderMode(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_Finish(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_PixelStoref(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_PixelStorei(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_ReadPixels(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetBooleanv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetClipPlane(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetDoublev(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetError(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetFloatv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetIntegerv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetLightfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetLightiv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMapdv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMapfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMapiv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMaterialfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMaterialiv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetPixelMapfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetPixelMapuiv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetPixelMapusv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetPolygonStipple(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetString(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexEnvfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexEnviv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexGendv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexGenfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexGeniv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexImage(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_IsEnabled(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_IsList(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_Flush(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_AreTexturesResident(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_DeleteTextures(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GenTextures(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_IsTexture(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetColorTable(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetConvolutionFilter(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetSeparableFilter(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetHistogram(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMinmax(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
extern void __glXDispSwap_CallList(GLbyte*);
extern void __glXDispSwap_CallLists(GLbyte*);
extern void __glXDispSwap_ListBase(GLbyte*);
extern void __glXDispSwap_Begin(GLbyte*);
extern void __glXDispSwap_Bitmap(GLbyte*);
extern void __glXDispSwap_Color3bv(GLbyte*);
extern void __glXDispSwap_Color3dv(GLbyte*);
extern void __glXDispSwap_Color3fv(GLbyte*);
extern void __glXDispSwap_Color3iv(GLbyte*);
extern void __glXDispSwap_Color3sv(GLbyte*);
extern void __glXDispSwap_Color3ubv(GLbyte*);
extern void __glXDispSwap_Color3uiv(GLbyte*);
extern void __glXDispSwap_Color3usv(GLbyte*);
extern void __glXDispSwap_Color4bv(GLbyte*);
extern void __glXDispSwap_Color4dv(GLbyte*);
extern void __glXDispSwap_Color4fv(GLbyte*);
extern void __glXDispSwap_Color4iv(GLbyte*);
extern void __glXDispSwap_Color4sv(GLbyte*);
extern void __glXDispSwap_Color4ubv(GLbyte*);
extern void __glXDispSwap_Color4uiv(GLbyte*);
extern void __glXDispSwap_Color4usv(GLbyte*);
extern void __glXDispSwap_EdgeFlagv(GLbyte*);
extern void __glXDispSwap_End(GLbyte*);
extern void __glXDispSwap_Indexdv(GLbyte*);
extern void __glXDispSwap_Indexfv(GLbyte*);
extern void __glXDispSwap_Indexiv(GLbyte*);
extern void __glXDispSwap_Indexsv(GLbyte*);
extern void __glXDispSwap_Normal3bv(GLbyte*);
extern void __glXDispSwap_Normal3dv(GLbyte*);
extern void __glXDispSwap_Normal3fv(GLbyte*);
extern void __glXDispSwap_Normal3iv(GLbyte*);
extern void __glXDispSwap_Normal3sv(GLbyte*);
extern void __glXDispSwap_RasterPos2dv(GLbyte*);
extern void __glXDispSwap_RasterPos2fv(GLbyte*);
extern void __glXDispSwap_RasterPos2iv(GLbyte*);
extern void __glXDispSwap_RasterPos2sv(GLbyte*);
extern void __glXDispSwap_RasterPos3dv(GLbyte*);
extern void __glXDispSwap_RasterPos3fv(GLbyte*);
extern void __glXDispSwap_RasterPos3iv(GLbyte*);
extern void __glXDispSwap_RasterPos3sv(GLbyte*);
extern void __glXDispSwap_RasterPos4dv(GLbyte*);
extern void __glXDispSwap_RasterPos4fv(GLbyte*);
extern void __glXDispSwap_RasterPos4iv(GLbyte*);
extern void __glXDispSwap_RasterPos4sv(GLbyte*);
extern void __glXDispSwap_Rectdv(GLbyte*);
extern void __glXDispSwap_Rectfv(GLbyte*);
extern void __glXDispSwap_Rectiv(GLbyte*);
extern void __glXDispSwap_Rectsv(GLbyte*);
extern void __glXDispSwap_TexCoord1dv(GLbyte*);
extern void __glXDispSwap_TexCoord1fv(GLbyte*);
extern void __glXDispSwap_TexCoord1iv(GLbyte*);
extern void __glXDispSwap_TexCoord1sv(GLbyte*);
extern void __glXDispSwap_TexCoord2dv(GLbyte*);
extern void __glXDispSwap_TexCoord2fv(GLbyte*);
extern void __glXDispSwap_TexCoord2iv(GLbyte*);
extern void __glXDispSwap_TexCoord2sv(GLbyte*);
extern void __glXDispSwap_TexCoord3dv(GLbyte*);
extern void __glXDispSwap_TexCoord3fv(GLbyte*);
extern void __glXDispSwap_TexCoord3iv(GLbyte*);
extern void __glXDispSwap_TexCoord3sv(GLbyte*);
extern void __glXDispSwap_TexCoord4dv(GLbyte*);
extern void __glXDispSwap_TexCoord4fv(GLbyte*);
extern void __glXDispSwap_TexCoord4iv(GLbyte*);
extern void __glXDispSwap_TexCoord4sv(GLbyte*);
extern void __glXDispSwap_Vertex2dv(GLbyte*);
extern void __glXDispSwap_Vertex2fv(GLbyte*);
extern void __glXDispSwap_Vertex2iv(GLbyte*);
extern void __glXDispSwap_Vertex2sv(GLbyte*);
extern void __glXDispSwap_Vertex3dv(GLbyte*);
extern void __glXDispSwap_Vertex3fv(GLbyte*);
extern void __glXDispSwap_Vertex3iv(GLbyte*);
extern void __glXDispSwap_Vertex3sv(GLbyte*);
extern void __glXDispSwap_Vertex4dv(GLbyte*);
extern void __glXDispSwap_Vertex4fv(GLbyte*);
extern void __glXDispSwap_Vertex4iv(GLbyte*);
extern void __glXDispSwap_Vertex4sv(GLbyte*);
extern void __glXDispSwap_ClipPlane(GLbyte*);
extern void __glXDispSwap_ColorMaterial(GLbyte*);
extern void __glXDispSwap_CullFace(GLbyte*);
extern void __glXDispSwap_Fogf(GLbyte*);
extern void __glXDispSwap_Fogfv(GLbyte*);
extern void __glXDispSwap_Fogi(GLbyte*);
extern void __glXDispSwap_Fogiv(GLbyte*);
extern void __glXDispSwap_FrontFace(GLbyte*);
extern void __glXDispSwap_Hint(GLbyte*);
extern void __glXDispSwap_Lightf(GLbyte*);
extern void __glXDispSwap_Lightfv(GLbyte*);
extern void __glXDispSwap_Lighti(GLbyte*);
extern void __glXDispSwap_Lightiv(GLbyte*);
extern void __glXDispSwap_LightModelf(GLbyte*);
extern void __glXDispSwap_LightModelfv(GLbyte*);
extern void __glXDispSwap_LightModeli(GLbyte*);
extern void __glXDispSwap_LightModeliv(GLbyte*);
extern void __glXDispSwap_LineStipple(GLbyte*);
extern void __glXDispSwap_LineWidth(GLbyte*);
extern void __glXDispSwap_Materialf(GLbyte*);
extern void __glXDispSwap_Materialfv(GLbyte*);
extern void __glXDispSwap_Materiali(GLbyte*);
extern void __glXDispSwap_Materialiv(GLbyte*);
extern void __glXDispSwap_PointSize(GLbyte*);
extern void __glXDispSwap_PolygonMode(GLbyte*);
extern void __glXDispSwap_PolygonStipple(GLbyte*);
extern void __glXDispSwap_Scissor(GLbyte*);
extern void __glXDispSwap_ShadeModel(GLbyte*);
extern void __glXDispSwap_TexParameterf(GLbyte*);
extern void __glXDispSwap_TexParameterfv(GLbyte*);
extern void __glXDispSwap_TexParameteri(GLbyte*);
extern void __glXDispSwap_TexParameteriv(GLbyte*);
extern void __glXDispSwap_TexImage1D(GLbyte*);
extern void __glXDispSwap_TexImage2D(GLbyte*);
extern void __glXDispSwap_TexEnvf(GLbyte*);
extern void __glXDispSwap_TexEnvfv(GLbyte*);
extern void __glXDispSwap_TexEnvi(GLbyte*);
extern void __glXDispSwap_TexEnviv(GLbyte*);
extern void __glXDispSwap_TexGend(GLbyte*);
extern void __glXDispSwap_TexGendv(GLbyte*);
extern void __glXDispSwap_TexGenf(GLbyte*);
extern void __glXDispSwap_TexGenfv(GLbyte*);
extern void __glXDispSwap_TexGeni(GLbyte*);
extern void __glXDispSwap_TexGeniv(GLbyte*);
extern void __glXDispSwap_InitNames(GLbyte*);
extern void __glXDispSwap_LoadName(GLbyte*);
extern void __glXDispSwap_PassThrough(GLbyte*);
extern void __glXDispSwap_PopName(GLbyte*);
extern void __glXDispSwap_PushName(GLbyte*);
extern void __glXDispSwap_DrawBuffer(GLbyte*);
extern void __glXDispSwap_Clear(GLbyte*);
extern void __glXDispSwap_ClearAccum(GLbyte*);
extern void __glXDispSwap_ClearIndex(GLbyte*);
extern void __glXDispSwap_ClearColor(GLbyte*);
extern void __glXDispSwap_ClearStencil(GLbyte*);
extern void __glXDispSwap_ClearDepth(GLbyte*);
extern void __glXDispSwap_StencilMask(GLbyte*);
extern void __glXDispSwap_ColorMask(GLbyte*);
extern void __glXDispSwap_DepthMask(GLbyte*);
extern void __glXDispSwap_IndexMask(GLbyte*);
extern void __glXDispSwap_Accum(GLbyte*);
extern void __glXDispSwap_Disable(GLbyte*);
extern void __glXDispSwap_Enable(GLbyte*);
extern void __glXDispSwap_PopAttrib(GLbyte*);
extern void __glXDispSwap_PushAttrib(GLbyte*);
extern void __glXDispSwap_Map1d(GLbyte*);
extern void __glXDispSwap_Map1f(GLbyte*);
extern void __glXDispSwap_Map2d(GLbyte*);
extern void __glXDispSwap_Map2f(GLbyte*);
extern void __glXDispSwap_MapGrid1d(GLbyte*);
extern void __glXDispSwap_MapGrid1f(GLbyte*);
extern void __glXDispSwap_MapGrid2d(GLbyte*);
extern void __glXDispSwap_MapGrid2f(GLbyte*);
extern void __glXDispSwap_EvalCoord1dv(GLbyte*);
extern void __glXDispSwap_EvalCoord1fv(GLbyte*);
extern void __glXDispSwap_EvalCoord2dv(GLbyte*);
extern void __glXDispSwap_EvalCoord2fv(GLbyte*);
extern void __glXDispSwap_EvalMesh1(GLbyte*);
extern void __glXDispSwap_EvalPoint1(GLbyte*);
extern void __glXDispSwap_EvalMesh2(GLbyte*);
extern void __glXDispSwap_EvalPoint2(GLbyte*);
extern void __glXDispSwap_AlphaFunc(GLbyte*);
extern void __glXDispSwap_BlendFunc(GLbyte*);
extern void __glXDispSwap_LogicOp(GLbyte*);
extern void __glXDispSwap_StencilFunc(GLbyte*);
extern void __glXDispSwap_StencilOp(GLbyte*);
extern void __glXDispSwap_DepthFunc(GLbyte*);
extern void __glXDispSwap_PixelZoom(GLbyte*);
extern void __glXDispSwap_PixelTransferf(GLbyte*);
extern void __glXDispSwap_PixelTransferi(GLbyte*);
extern void __glXDispSwap_PixelMapfv(GLbyte*);
extern void __glXDispSwap_PixelMapuiv(GLbyte*);
extern void __glXDispSwap_PixelMapusv(GLbyte*);
extern void __glXDispSwap_ReadBuffer(GLbyte*);
extern void __glXDispSwap_CopyPixels(GLbyte*);
extern void __glXDispSwap_DrawPixels(GLbyte*);
extern void __glXDispSwap_DepthRange(GLbyte*);
extern void __glXDispSwap_Frustum(GLbyte*);
extern void __glXDispSwap_LoadIdentity(GLbyte*);
extern void __glXDispSwap_LoadMatrixf(GLbyte*);
extern void __glXDispSwap_LoadMatrixd(GLbyte*);
extern void __glXDispSwap_MatrixMode(GLbyte*);
extern void __glXDispSwap_MultMatrixf(GLbyte*);
extern void __glXDispSwap_MultMatrixd(GLbyte*);
extern void __glXDispSwap_Ortho(GLbyte*);
extern void __glXDispSwap_PopMatrix(GLbyte*);
extern void __glXDispSwap_PushMatrix(GLbyte*);
extern void __glXDispSwap_Rotated(GLbyte*);
extern void __glXDispSwap_Rotatef(GLbyte*);
extern void __glXDispSwap_Scaled(GLbyte*);
extern void __glXDispSwap_Scalef(GLbyte*);
extern void __glXDispSwap_Translated(GLbyte*);
extern void __glXDispSwap_Translatef(GLbyte*);
extern void __glXDispSwap_Viewport(GLbyte*);
extern void __glXDispSwap_PolygonOffset(GLbyte*);
extern void __glXDispSwap_DrawArrays(GLbyte*);
extern void __glXDispSwap_Indexubv(GLbyte*);
extern void __glXDispSwap_ColorSubTable(GLbyte*);
extern void __glXDispSwap_CopyColorSubTable(GLbyte*);
extern void __glXDispSwap_ActiveTextureARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord1dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord1fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord1ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord1svARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord2dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord2fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord2ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord2svARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord3dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord3fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord3ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord3svARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte*);
extern void __glXDispSwap_SampleCoverageARB(GLbyte *);
extern void __glXDispSwap_WindowPos3fARB(GLbyte *);
#define __GLX_MIN_GLXCMD_OPCODE 1
#define __GLX_MAX_GLXCMD_OPCODE 20
#define __GLX_MIN_RENDER_OPCODE 1
/*#define __GLX_MAX_RENDER_OPCODE 213*/
#define __GLX_MAX_RENDER_OPCODE 230
#define __GLX_MIN_SINGLE_OPCODE 1
#define __GLX_MAX_SINGLE_OPCODE 159
#define __GLX_SINGLE_TABLE_SIZE 160
/*#define __GLX_RENDER_TABLE_SIZE 214*/
#define __GLX_RENDER_TABLE_SIZE 231
extern __GLXdispatchRenderProcPtr __glXRenderTable[__GLX_RENDER_TABLE_SIZE];
extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE];
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE];
extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE];
#endif /* _GLX_g_disptab_h_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,158 @@
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_g_disptab_EXT_h_
#define _GLX_g_disptab_EXT_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: 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.
*/
extern int __glXDisp_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
extern int __glXDisp_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
extern int __glXDisp_GenTexturesEXT(__GLXclientState*, GLbyte*);
extern int __glXDisp_IsTextureEXT(__GLXclientState*, GLbyte*);
extern void __glXDisp_ColorTable(GLbyte*);
extern void __glXDisp_ColorTableParameterfv(GLbyte*);
extern void __glXDisp_ColorTableParameteriv(GLbyte*);
extern void __glXDisp_CopyColorTable(GLbyte*);
extern void __glXDisp_BlendColor(GLbyte*);
extern void __glXDisp_BlendEquation(GLbyte*);
extern void __glXDisp_TexSubImage1D(GLbyte*);
extern void __glXDisp_TexSubImage2D(GLbyte*);
extern void __glXDisp_ConvolutionFilter1D(GLbyte*);
extern void __glXDisp_ConvolutionFilter2D(GLbyte*);
extern void __glXDisp_ConvolutionParameterf(GLbyte*);
extern void __glXDisp_ConvolutionParameterfv(GLbyte*);
extern void __glXDisp_ConvolutionParameteri(GLbyte*);
extern void __glXDisp_ConvolutionParameteriv(GLbyte*);
extern void __glXDisp_CopyConvolutionFilter1D(GLbyte*);
extern void __glXDisp_CopyConvolutionFilter2D(GLbyte*);
extern void __glXDisp_SeparableFilter2D(GLbyte*);
extern void __glXDisp_Histogram(GLbyte*);
extern void __glXDisp_Minmax(GLbyte*);
extern void __glXDisp_ResetHistogram(GLbyte*);
extern void __glXDisp_ResetMinmax(GLbyte*);
extern void __glXDisp_TexImage3D(GLbyte*);
extern void __glXDisp_TexSubImage3D(GLbyte*);
extern void __glXDisp_DrawArraysEXT(GLbyte*);
extern void __glXDisp_BindTexture(GLbyte*);
extern void __glXDisp_PrioritizeTextures(GLbyte*);
extern void __glXDisp_CopyTexImage1D(GLbyte*);
extern void __glXDisp_CopyTexImage2D(GLbyte*);
extern void __glXDisp_CopyTexSubImage1D(GLbyte*);
extern void __glXDisp_CopyTexSubImage2D(GLbyte*);
extern void __glXDisp_CopyTexSubImage3D(GLbyte*);
extern void __glXDisp_PointParameterfARB(GLbyte*);
extern void __glXDisp_PointParameterfvARB(GLbyte*);
extern void __glXDisp_FogCoordfv(GLbyte *);
extern void __glXDisp_FogCoorddv(GLbyte *);
extern void __glXDispSwap_FogCoordfv(GLbyte *);
extern void __glXDispSwap_FogCoorddv(GLbyte *);
extern void __glXDisp_SecondaryColor3bv(GLbyte *);
extern void __glXDisp_SecondaryColor3sv(GLbyte *);
extern void __glXDisp_SecondaryColor3iv(GLbyte *);
extern void __glXDisp_SecondaryColor3ubv(GLbyte *);
extern void __glXDisp_SecondaryColor3usv(GLbyte *);
extern void __glXDisp_SecondaryColor3uiv(GLbyte *);
extern void __glXDisp_SecondaryColor3fv(GLbyte *);
extern void __glXDisp_SecondaryColor3dv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3bv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3sv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3iv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3ubv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3usv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3uiv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3fv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3dv(GLbyte *);
extern void __glXDisp_BlendFuncSeparate(GLbyte *);
extern void __glXDispSwap_BlendFuncSeparate(GLbyte *);
extern void __glXDisp_PointParameteriNV(GLbyte *);
extern void __glXDisp_PointParameterivNV(GLbyte *);
extern void __glXDispSwap_PointParameteriNV(GLbyte *);
extern void __glXDispSwap_PointParameterivNV(GLbyte *);
extern void __glXDisp_ActiveStencilFaceEXT(GLbyte*);
extern int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GenTexturesEXT(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_IsTextureEXT(__GLXclientState*, GLbyte*);
extern void __glXDispSwap_ColorTable(GLbyte*);
extern void __glXDispSwap_ColorTableParameterfv(GLbyte*);
extern void __glXDispSwap_ColorTableParameteriv(GLbyte*);
extern void __glXDispSwap_CopyColorTable(GLbyte*);
extern void __glXDispSwap_BlendColor(GLbyte*);
extern void __glXDispSwap_BlendEquation(GLbyte*);
extern void __glXDispSwap_TexSubImage1D(GLbyte*);
extern void __glXDispSwap_TexSubImage2D(GLbyte*);
extern void __glXDispSwap_ConvolutionFilter1D(GLbyte*);
extern void __glXDispSwap_ConvolutionFilter2D(GLbyte*);
extern void __glXDispSwap_ConvolutionParameterf(GLbyte*);
extern void __glXDispSwap_ConvolutionParameterfv(GLbyte*);
extern void __glXDispSwap_ConvolutionParameteri(GLbyte*);
extern void __glXDispSwap_ConvolutionParameteriv(GLbyte*);
extern void __glXDispSwap_CopyConvolutionFilter1D(GLbyte*);
extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte*);
extern void __glXDispSwap_SeparableFilter2D(GLbyte*);
extern void __glXDispSwap_Histogram(GLbyte*);
extern void __glXDispSwap_Minmax(GLbyte*);
extern void __glXDispSwap_ResetHistogram(GLbyte*);
extern void __glXDispSwap_ResetMinmax(GLbyte*);
extern void __glXDispSwap_TexImage3D(GLbyte*);
extern void __glXDispSwap_TexSubImage3D(GLbyte*);
extern void __glXDispSwap_DrawArraysEXT(GLbyte*);
extern void __glXDispSwap_BindTexture(GLbyte*);
extern void __glXDispSwap_PrioritizeTextures(GLbyte*);
extern void __glXDispSwap_CopyTexImage1D(GLbyte*);
extern void __glXDispSwap_CopyTexImage2D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage1D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage2D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*);
extern void __glXDispSwap_PointParameterfARB(GLbyte*);
extern void __glXDispSwap_PointParameterfvARB(GLbyte*);
extern void __glXDispSwap_ActiveStencilFaceEXT(GLbyte*);
#define __GLX_MIN_RENDER_OPCODE_EXT 2053
#define __GLX_MAX_RENDER_OPCODE_EXT 4222
#define __GLX_MIN_VENDPRIV_OPCODE_EXT 11
#define __GLX_MAX_VENDPRIV_OPCODE_EXT 14
#define __GLX_VENDPRIV_TABLE_SIZE_EXT (__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1)
#define __GLX_RENDER_TABLE_SIZE_EXT (__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1)
extern __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
#endif /* _GLX_g_disptab_EXT_h_ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
/*
** The last context used by the server. It is the context that is current
** from the server's perspective.
*/
__GLXcontext *__glXLastContext;
/*
** X resources.
*/
RESTYPE __glXContextRes;
RESTYPE __glXClientRes;
RESTYPE __glXPixmapRes;
RESTYPE __glXSwapBarrierRes;
/*
** Error codes with the extension error base already added in.
*/
int __glXBadContext, __glXBadContextState, __glXBadDrawable, __glXBadPixmap;
int __glXBadContextTag, __glXBadCurrentWindow;
int __glXBadRenderRequest, __glXBadLargeRequest;
int __glXUnsupportedPrivateRequest;
/*
** Reply for most singles.
*/
xGLXSingleReply __glXReply;
/*
** A set of state for each client. The 0th one is unused because client
** indices start at 1, not 0.
*/
__GLXclientState *__glXClients[MAXCLIENTS+1];

View File

@@ -0,0 +1,295 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxutil.h"
#include "glxbuf.h"
#include "glxfb.h"
#include "glxmem.h"
#include "glxpix.h"
void
__glXFBInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
{
__GLdrawablePrivate *glPriv;
GLint rgbBits;
GLint accumBits;
glPriv = &glxPriv->glPriv;
rgbBits = modes->rgbBits;
accumBits = modes->accumRedBits + modes->accumGreenBits +
modes->accumBlueBits + modes->accumAlphaBits;
#if defined(__GL_ALIGNED_BUFFERS)
/* initialize pixel alignments (for more details see context.h) */
glPriv->xAlignment = 1;
glPriv->yAlignment = 1;
#endif
glxPriv->swapBuffers = __glXFBMemSwapBuffers;
glPriv->yInverted = GL_TRUE; /* Y is upside-down */
if (modes->doubleBufferMode) {
if (modes->colorIndexMode) {
__glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
__glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
} else {
__glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
__glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
}
} else {
if (modes->colorIndexMode) {
__glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
} else {
__glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
}
}
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
if (modes->maxAuxBuffers > 0) {
GLint i;
for (i=0; i < modes->maxAuxBuffers; i++) {
if (modes->colorIndexMode) {
__glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
} else {
__glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
}
}
}
#endif
if (modes->haveAccumBuffer) {
__glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
}
if (modes->haveDepthBuffer) {
__glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
}
if (modes->haveStencilBuffer) {
__glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
}
}
void
__glXPixInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
{
__GLdrawablePrivate *glPriv;
GLint rgbBits;
GLint accumBits;
assert(glxPriv->pGlxPixmap);
glPriv = &glxPriv->glPriv;
rgbBits = modes->rgbBits;
accumBits = modes->accumRedBits + modes->accumGreenBits +
modes->accumBlueBits + modes->accumAlphaBits;
#if defined(__GL_ALIGNED_BUFFERS)
/* initialize pixel alignments (for more details see context.h) */
glPriv->xAlignment = 1;
glPriv->yAlignment = 1;
#endif
glxPriv->swapBuffers = (GLboolean (*)(__GLXdrawablePrivate *))__glXNop;
glPriv->yInverted = GL_FALSE;
if (modes->doubleBufferMode) {
if (modes->colorIndexMode) {
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
glxPriv->drawId, glxPriv->pGlxPixmap);
__glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
} else {
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
glxPriv->drawId, glxPriv->pGlxPixmap);
__glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
}
} else {
if (modes->colorIndexMode) {
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
glxPriv->drawId, glxPriv->pGlxPixmap);
} else {
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
glxPriv->drawId, glxPriv->pGlxPixmap);
}
}
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
if (modes->maxAuxBuffers > 0) {
GLint i;
for (i=0; i < modes->maxAuxBuffers; i++) {
if (modes->colorIndexMode) {
__glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
} else {
__glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
}
}
}
#endif
if (modes->haveAccumBuffer) {
__glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
}
if (modes->haveDepthBuffer) {
__glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
}
if (modes->haveStencilBuffer) {
__glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
}
}
#define __GLX_SET_ACCEL_BUFFER_MASK(bm) \
if (status == GL_FALSE) return GL_FALSE; \
if (status == GL_TRUE) accelBufferMask |= bm; \
/* for __GL_BUFFER_FALLBACK don't do anything */
GLboolean
__glXResizeBuffers(__GLdrawablePrivate *glPriv,
GLint x, GLint y, GLuint width, GLuint height)
{
__GLcontextModes *modes;
__GLdrawableRegion *glRegion;
GLboolean status;
GLuint accelBufferMask;
modes = glPriv->modes;
accelBufferMask = 0;
status = (*glPriv->frontBuffer.resize)(&glPriv->frontBuffer,
x, y, width, height, glPriv,
__GL_FRONT_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_FRONT_BUFFER_MASK);
if (modes->doubleBufferMode) {
status = (*glPriv->backBuffer.resize)(&glPriv->backBuffer,
x, y, width, height, glPriv,
__GL_BACK_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_BACK_BUFFER_MASK);
}
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
if (modes->maxAuxBuffers > 0) {
GLint i;
for (i=0; i < modes->maxAuxBuffers; i++) {
status = (*glPriv->auxBuffers[i].resize)(&glPriv->auxBuffer[i],
x, y, width, height,
glPriv,
__GL_AUX_BUFFER_MASK(i));
__GLX_SET_ACCEL_BUFFER_MASK(__GL_AUX_BUFFER_MASK(i));
}
}
#endif
if (modes->haveAccumBuffer) {
status = (*glPriv->accumBuffer.resize)(&glPriv->accumBuffer,
x, y, width, height, glPriv,
__GL_ACCUM_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_ACCUM_BUFFER_MASK);
}
if (modes->haveDepthBuffer) {
status = (*glPriv->depthBuffer.resize)(&glPriv->depthBuffer,
x, y, width, height, glPriv,
__GL_DEPTH_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_DEPTH_BUFFER_MASK);
}
if (modes->haveStencilBuffer) {
status = (*glPriv->stencilBuffer.resize)(&glPriv->stencilBuffer,
x, y, width, height, glPriv,
__GL_STENCIL_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_STENCIL_BUFFER_MASK);
}
glPriv->accelBufferMask = accelBufferMask;
/* finally, update the ownership region */
glRegion = &glPriv->ownershipRegion;
glRegion->numRects = 1;
glRegion->rects[0].x0 = 0;
glRegion->rects[0].y0 = 0;
glRegion->rects[0].x1 = width;
glRegion->rects[0].y1 = height;
return GL_TRUE;
}
void
__glXFreeBuffers(__GLXdrawablePrivate *glxPriv)
{
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
__GLcontextModes *modes = glPriv->modes;
#endif
if (glPriv->frontBuffer.free) {
(*glPriv->frontBuffer.free)(&glPriv->frontBuffer, glPriv);
}
if (glPriv->backBuffer.free) {
(*glPriv->backBuffer.free)(&glPriv->backBuffer, glPriv);
}
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
if (modes->maxAuxBuffers > 0) {
GLint i;
for (i=0; i < modes->maxAuxBuffers; i++) {
if (glPriv->auxBuffer[i].free) {
(*glPriv->auxBuffer[i].free)(&glPriv->auxBuffer[i], glPriv);
}
}
}
#endif
if (glPriv->accumBuffer.free) {
(*glPriv->accumBuffer.free)(&glPriv->accumBuffer, glPriv);
}
if (glPriv->depthBuffer.free) {
(*glPriv->depthBuffer.free)(&glPriv->depthBuffer, glPriv);
}
if (glPriv->stencilBuffer.free) {
(*glPriv->stencilBuffer.free)(&glPriv->stencilBuffer, glPriv);
}
}

View File

@@ -0,0 +1,56 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _glxbuf_h_
#define _glxbuf_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.
**
*/
extern void __glXFBInitDrawable(__GLXdrawablePrivate *glxPriv,
__GLcontextModes *modes);
extern void __glXPixInitDrawable(__GLXdrawablePrivate *glxPriv,
__GLcontextModes *modes);
extern GLboolean __glXResizeBuffers(__GLdrawablePrivate *glPriv,
GLint x, GLint y,
GLuint width, GLuint height);
extern void __glXFreeBuffers(__GLXdrawablePrivate *glxPriv);
extern void __glXUpdatePalette(__GLXdrawablePrivate *);
#endif /* _glxbuf_h_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,888 @@
/*
** 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.
**
*/
#define FONT_PCF
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxutil.h"
#include <GL/glxtokens.h>
#include <unpack.h>
#include <g_disptab.h>
#include <g_disptab_EXT.h>
#include <pixmapstr.h>
#include <windowstr.h>
#include "glxext.h"
static int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
/************************************************************************/
/*
** Byteswapping versions of GLX commands. In most cases they just swap
** the incoming arguments and then call the unswapped routine. For commands
** that have replies, a separate swapping routine for the reply is provided;
** it is called at the end of the unswapped routine.
*/
int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->visual);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->shareList);
return DoCreateContext( cl, req->context, req->shareList, req->visual,
req->screen, req->isDirect );
}
int __glXSwapCreateNewContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->renderType);
__GLX_SWAP_INT(&req->shareList);
return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
req->screen, req->isDirect );
}
int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateContextWithConfigSGIXReq *req =
(xGLXCreateContextWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->renderType);
__GLX_SWAP_INT(&req->shareList);
return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
req->screen, req->isDirect );
}
int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
return __glXDestroyContext(cl, pc);
}
int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
{
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return DoMakeCurrent( cl, req->drawable, req->drawable,
req->context, req->oldContextTag );
}
int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
{
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->readdrawable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return DoMakeCurrent( cl, req->drawable, req->readdrawable,
req->context, req->oldContextTag );
}
int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
{
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->readable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return DoMakeCurrent( cl, req->drawable, req->readable,
req->context, req->oldContextTag );
}
int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
{
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
return __glXIsDirect(cl, pc);
}
int __glXSwapQueryVersion(__GLXclientState *cl, GLbyte *pc)
{
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->majorVersion);
__GLX_SWAP_INT(&req->minorVersion);
return __glXQueryVersion(cl, pc);
}
int __glXSwapWaitGL(__GLXclientState *cl, GLbyte *pc)
{
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
return __glXWaitGL(cl, pc);
}
int __glXSwapWaitX(__GLXclientState *cl, GLbyte *pc)
{
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
return __glXWaitX(cl, pc);
}
int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->source);
__GLX_SWAP_INT(&req->dest);
__GLX_SWAP_INT(&req->mask);
return __glXCopyContext(cl, pc);
}
int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
{
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&req->screen);
return DoGetVisualConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
{
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&req->screen);
return DoGetFBConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&req->screen);
return DoGetFBConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->visual);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return DoCreateGLXPixmap( cl, req->visual, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapCreatePixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->glxpixmap);
return __glXDestroyGLXPixmap(cl, pc);
}
int __glXSwapSwapBuffers(__GLXclientState *cl, GLbyte *pc)
{
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->drawable);
return __glXSwapBuffers(cl, pc);
}
int __glXSwapUseXFont(__GLXclientState *cl, GLbyte *pc)
{
xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->font);
__GLX_SWAP_INT(&req->first);
__GLX_SWAP_INT(&req->count);
__GLX_SWAP_INT(&req->listBase);
return __glXUseXFont(cl, pc);
}
int __glXSwapQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
{
xGLXQueryExtensionsStringReq *req = NULL;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
return __glXQueryExtensionsString(cl, pc);
}
int __glXSwapQueryServerString(__GLXclientState *cl, GLbyte *pc)
{
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->name);
return __glXQueryServerString(cl, pc);
}
int __glXSwapClientInfo(__GLXclientState *cl, GLbyte *pc)
{
xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->major);
__GLX_SWAP_INT(&req->minor);
__GLX_SWAP_INT(&req->numbytes);
return __glXClientInfo(cl, pc);
}
int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
{
xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
return __glXQueryContextInfoEXT(cl, pc);
}
/************************************************************************/
/*
** Swap replies.
*/
void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->contextTag);
WriteToClient(client, sz_xGLXMakeCurrentReply, reply);
}
void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
WriteToClient(client, sz_xGLXIsDirectReply, reply);
}
void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->majorVersion);
__GLX_SWAP_INT(&reply->minorVersion);
WriteToClient(client, sz_xGLXQueryVersionReply, reply);
}
void glxSwapQueryExtensionsStringReply(ClientPtr client,
xGLXQueryExtensionsStringReply *reply, char *buf)
{
int length = reply->length;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply);
__GLX_SWAP_INT_ARRAY((int *)buf, length);
WriteToClient(client, length << 2, buf);
}
void glxSwapQueryServerStringReply(ClientPtr client,
xGLXQueryServerStringReply *reply, char *buf)
{
int length = reply->length;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
WriteToClient(client, sz_xGLXQueryServerStringReply, reply);
/** no swap is needed for an array of chars **/
/* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
WriteToClient(client, length << 2, buf);
}
void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
{
int length = reply->length;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply);
__GLX_SWAP_INT_ARRAY((int *)buf, length);
WriteToClient(client, length << 2, buf);
}
/************************************************************************/
/*
** Render and Renderlarge are not in the GLX API. They are used by the GLX
** client library to send batches of GL rendering commands.
*/
int __glXSwapRender(__GLXclientState *cl, GLbyte *pc)
{
xGLXRenderReq *req;
ClientPtr client= cl->client;
int left, cmdlen, error;
int commandsDone;
CARD16 opcode;
__GLXrenderHeader *hdr;
__GLXcontext *cx;
__GLX_DECLARE_SWAP_VARIABLES;
/*
** NOTE: much of this code also appears in the nonswapping version of this
** routine, __glXRender(). Any changes made here should also be
** duplicated there.
*/
req = (xGLXRenderReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
cx = __glXForceCurrent(cl, req->contextTag, &error);
if (!cx) {
return error;
}
commandsDone = 0;
pc += sz_xGLXRenderReq;
left = (req->length << 2) - sz_xGLXRenderReq;
while (left > 0) {
__GLXrenderSizeData *entry;
int extra = 0;
void (* proc)(GLbyte *);
/*
** Verify that the header length and the overall length agree.
** Also, each command must be word aligned.
*/
hdr = (__GLXrenderHeader *) pc;
__GLX_SWAP_SHORT(&hdr->length);
__GLX_SWAP_SHORT(&hdr->opcode);
cmdlen = hdr->length;
opcode = hdr->opcode;
if (left < cmdlen)
return BadLength;
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
entry = &__glXRenderSizeTable[opcode];
proc = __glXSwapRenderTable[opcode];
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
entry = &__glXRenderSizeTable_EXT[index];
proc = __glXSwapRenderTable_EXT[index];
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
} else {
client->errorValue = commandsDone;
return __glXBadRenderRequest;
}
if (!entry->bytes) {
/* unused opcode */
client->errorValue = commandsDone;
return __glXBadRenderRequest;
}
if (cmdlen < entry->bytes) {
return BadLength;
}
if (entry->varsize) {
/* variable size command */
extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True,
left - __GLX_RENDER_HDR_SIZE);
if (extra < 0) {
return BadLength;
}
}
if (cmdlen != safe_pad(safe_add(entry->bytes, extra))) {
return BadLength;
}
/*
** Skip over the header and execute the command. We allow the
** caller to trash the command memory. This is useful especially
** for things that require double alignment - they can just shift
** the data towards lower memory (trashing the header) by 4 bytes
** and achieve the required alignment.
*/
(*proc)(pc + __GLX_RENDER_HDR_SIZE);
pc += cmdlen;
left -= cmdlen;
commandsDone++;
}
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
/*
** Execute a large rendering request (one that spans multiple X requests).
*/
int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
{
xGLXRenderLargeReq *req;
ClientPtr client= cl->client;
size_t dataBytes;
void (*proc)(GLbyte *);
__GLXrenderLargeHeader *hdr;
__GLXcontext *cx;
int error;
CARD16 opcode;
__GLX_DECLARE_SWAP_VARIABLES;
/*
** NOTE: much of this code also appears in the nonswapping version of this
** routine, __glXRenderLarge(). Any changes made here should also be
** duplicated there.
*/
REQUEST_AT_LEAST_SIZE(xGLXRenderLargeReq);
req = (xGLXRenderLargeReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->dataBytes);
__GLX_SWAP_SHORT(&req->requestNumber);
__GLX_SWAP_SHORT(&req->requestTotal);
cx = __glXForceCurrent(cl, req->contextTag, &error);
if (!cx) {
/* Reset in case this isn't 1st request. */
__glXResetLargeCommandStatus(cl);
return error;
}
if (safe_pad(req->dataBytes) < 0)
return BadLength;
dataBytes = req->dataBytes;
/*
** Check the request length.
*/
if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) {
client->errorValue = req->length;
/* Reset in case this isn't 1st request. */
__glXResetLargeCommandStatus(cl);
return BadLength;
}
pc += sz_xGLXRenderLargeReq;
if (cl->largeCmdRequestsSoFar == 0) {
__GLXrenderSizeData *entry;
int extra = 0;
int left = (req->length << 2) - sz_xGLXRenderLargeReq;
size_t cmdlen;
/*
** This is the first request of a multi request command.
** Make enough space in the buffer, then copy the entire request.
*/
if (req->requestNumber != 1) {
client->errorValue = req->requestNumber;
return __glXBadLargeRequest;
}
if (dataBytes < __GLX_RENDER_LARGE_HDR_SIZE)
return BadLength;
hdr = (__GLXrenderLargeHeader *) pc;
__GLX_SWAP_INT(&hdr->length);
__GLX_SWAP_INT(&hdr->opcode);
opcode = hdr->opcode;
if ((cmdlen = safe_pad(hdr->length)) < 0)
return BadLength;
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
entry = &__glXRenderSizeTable[opcode];
proc = __glXSwapRenderTable[opcode];
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
entry = &__glXRenderSizeTable_EXT[index];
proc = __glXSwapRenderTable_EXT[index];
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
} else {
client->errorValue = opcode;
return __glXBadLargeRequest;
}
if (!entry->bytes) {
/* unused opcode */
client->errorValue = opcode;
return __glXBadLargeRequest;
}
if (entry->varsize) {
/*
** If it's a variable-size command (a command whose length must
** be computed from its parameters), all the parameters needed
** will be in the 1st request, so it's okay to do this.
*/
extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, True,
left - __GLX_RENDER_LARGE_HDR_SIZE);
if (extra < 0) {
return BadLength;
}
}
/* the +4 is safe because we know entry->bytes is small */
if (cmdlen != safe_pad(safe_add(entry->bytes + 4, extra))) {
return BadLength;
}
/*
** Make enough space in the buffer, then copy the entire request.
*/
if (cl->largeCmdBufSize < cmdlen) {
if (!cl->largeCmdBuf) {
cl->largeCmdBuf = (GLbyte *) malloc(cmdlen);
} else {
cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen);
}
if (!cl->largeCmdBuf) {
return BadAlloc;
}
cl->largeCmdBufSize = cmdlen;
}
memcpy(cl->largeCmdBuf, pc, dataBytes);
cl->largeCmdBytesSoFar = dataBytes;
cl->largeCmdBytesTotal = cmdlen;
cl->largeCmdRequestsSoFar = 1;
cl->largeCmdRequestsTotal = req->requestTotal;
return Success;
} else {
/*
** We are receiving subsequent (i.e. not the first) requests of a
** multi request command.
*/
int bytesSoFar; /* including this packet */
/*
** Check the request number and the total request count.
*/
if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
client->errorValue = req->requestNumber;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
if (req->requestTotal != cl->largeCmdRequestsTotal) {
client->errorValue = req->requestTotal;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
/*
** Check that we didn't get too much data.
*/
if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) {
client->errorValue = dataBytes;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
if (bytesSoFar > cl->largeCmdBytesTotal) {
client->errorValue = dataBytes;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
cl->largeCmdBytesSoFar += dataBytes;
cl->largeCmdRequestsSoFar++;
if (req->requestNumber == cl->largeCmdRequestsTotal) {
/*
** This is the last request; it must have enough bytes to complete
** the command.
*/
/* NOTE: the pad macro below is needed because the client library
** pads the total byte count, but not the per-request byte counts.
** The Protocol Encoding says the total byte count should not be
** padded, so a proposal will be made to the ARB to relax the
** padding constraint on the total byte count, thus preserving
** backward compatibility. Meanwhile, the padding done below
** fixes a bug that did not allow large commands of odd sizes to
** be accepted by the server.
*/
if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) {
client->errorValue = dataBytes;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
/*
** The opcode and length field in the header had already been
** swapped when the first request was received.
*/
/*
** Use the opcode to index into the procedure table.
*/
opcode = hdr->opcode;
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
proc = __glXSwapRenderTable[opcode];
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
proc = __glXSwapRenderTable_EXT[index];
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
} else {
client->errorValue = opcode;
return __glXBadLargeRequest;
}
/*
** Skip over the header and execute the command.
*/
(*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
/*
** Reset for the next RenderLarge series.
*/
__glXResetLargeCommandStatus(cl);
} else {
/*
** This is neither the first nor the last request.
*/
}
return Success;
}
}
/************************************************************************/
/*
** No support is provided for the vendor-private requests other than
** allocating these entry points in the dispatch table.
*/
int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXVendorPrivateReq *req;
GLint vendorcode;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
req = (xGLXVendorPrivateReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->vendorCode);
vendorcode = req->vendorCode;
#ifndef __DARWIN__
switch( vendorcode ) {
case X_GLvop_SampleMaskSGIS:
__GLX_SWAP_FLOAT(pc + 4);
__GLX_SWAP_INT(pc + 8);
glSampleMaskSGIS(*(GLfloat *)(pc + 4),
*(GLboolean *)(pc + 8));
return Success;
case X_GLvop_SamplePatternSGIS:
__GLX_SWAP_INT(pc + 4);
glSamplePatternSGIS( *(GLenum *)(pc + 4));
return Success;
}
#endif
if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
(vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
(*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
return Success;
}
cl->client->errorValue = req->vendorCode;
return __glXUnsupportedPrivateRequest;
}
int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXVendorPrivateWithReplyReq *req;
GLint vendorcode;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq);
req = (xGLXVendorPrivateWithReplyReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->vendorCode);
vendorcode = req->vendorCode;
switch (vendorcode) {
case X_GLXvop_QueryContextInfoEXT:
return __glXSwapQueryContextInfoEXT(cl, pc);
case X_GLXvop_MakeCurrentReadSGI:
return __glXSwapMakeCurrentReadSGI(cl, pc);
case X_GLXvop_GetFBConfigsSGIX:
return __glXSwapGetFBConfigsSGIX(cl, pc);
case X_GLXvop_CreateContextWithConfigSGIX:
return __glXSwapCreateContextWithConfigSGIX(cl, pc);
case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
return __glXSwapCreateGLXPixmapWithConfigSGIX(cl, pc);
default:
break;
}
if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
(vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
return (*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
}
cl->client->errorValue = req->vendorCode;
return __glXUnsupportedPrivateRequest;
}

View File

@@ -0,0 +1,163 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_context_h_
#define _GLX_context_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.
**
*/
typedef struct __GLXcontextRec __GLXcontext;
/* XXX: should be defined somewhere globally */
#define CAPI
#include "GL/internal/glcore.h"
struct __GLXcontextRec {
/*
** list of context structs
*/
struct __GLXcontextRec *last;
struct __GLXcontextRec *next;
/*
** list of contexts bound to the same drawable
*/
struct __GLXcontextRec *nextDrawPriv;
struct __GLXcontextRec *nextReadPriv;
/*
** Opaque pointer the context object created by the GL that the
** server is bound with. Never dereferenced by this code, but used
** as a handle to feed to the routines in the screen info struct.
*/
__GLinterface *gc;
/*
** mode struct for this context
*/
__GLcontextModes *modes;
/*
** Pointer to screen info data for this context. This is set
** when the context is created.
*/
ScreenPtr pScreen;
__GLXscreenInfo *pGlxScreen;
/*
** This context is created with respect to this visual.
*/
VisualRec *pVisual;
/*
** The XID of this context.
*/
XID id;
/*
** The XID of the shareList context.
*/
XID share_id;
/*
** Visual id.
*/
VisualID vid;
/*
** screen number.
*/
GLint screen;
/*
** Whether this context's ID still exists.
*/
GLboolean idExists;
/*
** Whether this context is current for some client.
*/
GLboolean isCurrent;
/*
** Whether this context is a direct rendering context.
*/
GLboolean isDirect;
/*
** Window pending state
*/
GLuint pendingState;
/*
** This flag keeps track of whether there are unflushed GL commands.
*/
GLboolean hasUnflushedCommands;
/*
** Current rendering mode for this context.
*/
GLenum renderMode;
/*
** Buffers for feedback and selection.
*/
GLfloat *feedbackBuf;
GLint feedbackBufSize; /* number of elements allocated */
GLuint *selectBuf;
GLint selectBufSize; /* number of elements allocated */
/*
** Set only if current drawable is a glx pixmap.
*/
__GLXpixmap *drawPixmap;
__GLXpixmap *readPixmap;
/*
** The drawable private this context is bound to
*/
__GLXdrawablePrivate *drawPriv;
__GLXdrawablePrivate *readPriv;
};
/* pending state defines */
#define __GLX_PENDING_RESIZE 0x1
#define __GLX_PENDING_DESTROY 0x2
#define __GLX_PENDING_SWAP 0x4
#endif /* !__GLX_context_h__ */

View File

@@ -0,0 +1,111 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_drawable_h_
#define _GLX_drawable_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.
**
*/
typedef struct {
DrawablePtr pDraw;
__GLcontextModes *modes;
__GLXscreenInfo *pGlxScreen;
ScreenPtr pScreen;
Bool idExists;
int refcnt;
} __GLXpixmap;
struct __GLXdrawablePrivateRec {
/*
** list of drawable private structs
*/
struct __GLXdrawablePrivateRec *last;
struct __GLXdrawablePrivateRec *next;
DrawablePtr pDraw;
XID drawId;
__GLXpixmap *pGlxPixmap;
/*
** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above.
** Needed by the resource freer because pDraw might already have been
** freed.
*/
int type;
/*
** Configuration of the visual to which this drawable was created.
*/
__GLcontextModes *modes;
/*
** cached drawable size and origin
*/
GLint xorigin, yorigin;
GLint width, height;
/*
** Lists of contexts bound to this drawable. There are two lists here.
** One list is of the contexts that have this drawable bound for drawing,
** and the other is the list of contexts that have this drawable bound
** for reading.
*/
struct __GLXcontextRec *drawGlxc;
struct __GLXcontextRec *readGlxc;
/*
** "methods" that the drawble should be able to respond to.
*/
void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
void (*updatePalette)(struct __GLXdrawablePrivateRec *);
GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
/*
** The GL drawable (information shared between GLX and the GL core)
*/
__GLdrawablePrivate glPriv;
/*
** reference count
*/
int refCount;
};
#endif /* !__GLX_drawable_h__ */

View File

@@ -0,0 +1,57 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_error_h_
#define _GLX_error_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.
**
*/
/*
** Error codes. These have the extension error base added to them
** when the extension initializes.
*/
extern int __glXBadContext;
extern int __glXBadContextState;
extern int __glXBadDrawable;
extern int __glXBadPixmap;
extern int __glXBadCurrentWindow;
extern int __glXBadContextTag;
extern int __glXBadRenderRequest;
extern int __glXBadLargeRequest;
extern int __glXUnsupportedPrivateRequest;
#endif

View File

@@ -0,0 +1,465 @@
/*
** The contents of this file are subject to the GLX Public License Version 1.0
** (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, 2011 N. Shoreline Blvd., Mountain View, CA 94043
** or at http://www.sgi.com/software/opensource/glx/license.html.
**
** Software distributed under the License is distributed on an "AS IS"
** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
** language governing rights and limitations under the License.
**
** The Original Software is GLX version 1.2 source code, released February,
** 1999. The developer of the Original Software is Silicon Graphics, Inc.
** Those portions of the Subject Software created by Silicon Graphics, Inc.
** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include <windowstr.h>
#include <propertyst.h>
#include <os.h>
#include "g_disptab.h"
#include "unpack.h"
#include "glxutil.h"
#include "glxext.h"
#include "micmap.h"
void GlxWrapInitVisuals(miInitVisualsProcPtr *);
void GlxSetVisualConfigs(int nconfigs,
__GLXvisualConfig *configs, void **privates);
static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */;
/*
** Forward declarations.
*/
static int __glXDispatch(ClientPtr);
/*
** Called when the extension is reset.
*/
static void ResetExtension(ExtensionEntry* extEntry)
{
__glXFlushContextCache();
(*__glXExt->resetExtension)();
__glXScreenReset();
}
/*
** Initialize the per-client context storage.
*/
static void ResetClientState(int clientIndex)
{
__GLXclientState *cl = __glXClients[clientIndex];
if (cl->returnBuf) free(cl->returnBuf);
if (cl->largeCmdBuf) free(cl->largeCmdBuf);
if (cl->currentContexts) free(cl->currentContexts);
if (cl->GLClientextensions) free(cl->GLClientextensions);
memset(cl, 0, sizeof(__GLXclientState));
/*
** By default, assume that the client supports
** GLX major version 1 minor version 0 protocol.
*/
cl->GLClientmajorVersion = 1;
cl->GLClientminorVersion = 0;
}
/*
** Reset state used to keep track of large (multi-request) commands.
*/
void __glXResetLargeCommandStatus(__GLXclientState *cl)
{
cl->largeCmdBytesSoFar = 0;
cl->largeCmdBytesTotal = 0;
cl->largeCmdRequestsSoFar = 0;
cl->largeCmdRequestsTotal = 0;
}
/*
** This procedure is called when the client who created the context goes
** away OR when glXDestroyContext is called. In either case, all we do is
** flag that the ID is no longer valid, and (maybe) free the context.
** use.
*/
static int ContextGone(__GLXcontext* cx, XID id)
{
cx->idExists = GL_FALSE;
if (!cx->isCurrent) {
__glXFreeContext(cx);
}
return True;
}
/*
** Free a client's state.
*/
static int ClientGone(int clientIndex, XID id)
{
__GLXcontext *cx;
__GLXclientState *cl = __glXClients[clientIndex];
int i;
if (cl) {
/*
** Free all the contexts that are current for this client.
*/
for (i=0; i < cl->numCurrentContexts; i++) {
cx = cl->currentContexts[i];
if (cx) {
__glXDeassociateContext(cx);
cx->isCurrent = GL_FALSE;
if (!cx->idExists) {
__glXFreeContext(cx);
}
}
}
/*
** Re-initialize the client state structure. Don't free it because
** we'll probably get another client with this index and use the struct
** again. There is a maximum of MAXCLIENTS of these structures.
*/
ResetClientState(clientIndex);
}
return True;
}
/*
** Free a GLX Pixmap.
*/
static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id)
{
PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw;
pGlxPixmap->idExists = False;
if (!pGlxPixmap->refcnt) {
/*
** The DestroyPixmap routine should decrement the refcount and free
** only if it's zero.
*/
(*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
free(pGlxPixmap);
}
return True;
}
/*
** Free a context.
*/
GLboolean __glXFreeContext(__GLXcontext *cx)
{
if (cx->idExists || cx->isCurrent) return GL_FALSE;
if (!cx->isDirect) {
if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) {
return GL_FALSE;
}
}
if (cx->feedbackBuf) free(cx->feedbackBuf);
if (cx->selectBuf) free(cx->selectBuf);
free(cx);
if (cx == __glXLastContext) {
__glXFlushContextCache();
}
return GL_TRUE;
}
extern RESTYPE __glXSwapBarrierRes;
static int SwapBarrierGone(int screen, XID drawable)
{
if (__glXSwapBarrierFuncs &&
__glXSwapBarrierFuncs[screen].bindSwapBarrierFunc != NULL) {
__glXSwapBarrierFuncs[screen].bindSwapBarrierFunc(screen, drawable, 0);
}
FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
return True;
}
/************************************************************************/
/*
** These routines can be used to check whether a particular GL command
** has caused an error. Specifically, we use them to check whether a
** given query has caused an error, in which case a zero-length data
** reply is sent to the client.
*/
static GLboolean errorOccured = GL_FALSE;
/*
** The GL was will call this routine if an error occurs.
*/
void __glXErrorCallBack(__GLinterface *gc, GLenum code)
{
errorOccured = GL_TRUE;
}
/*
** Clear the error flag before calling the GL command.
*/
void __glXClearErrorOccured(void)
{
errorOccured = GL_FALSE;
}
/*
** Check if the GL command caused an error.
*/
GLboolean __glXErrorOccured(void)
{
return errorOccured;
}
/************************************************************************/
/*
** Initialize the GLX extension.
*/
void GlxExtensionInit(void)
{
ExtensionEntry *extEntry;
int i;
__glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
__glXClientRes = CreateNewResourceType((DeleteType)ClientGone);
__glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone);
/*
** Add extension to server extensions.
*/
extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS,
__GLX_NUMBER_ERRORS, __glXDispatch,
__glXDispatch, ResetExtension,
StandardMinorOpcode);
if (!extEntry) {
FatalError("__glXExtensionInit: AddExtensions failed\n");
return;
}
if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
return;
}
__glXBadContext = extEntry->errorBase + GLXBadContext;
__glXBadContextState = extEntry->errorBase + GLXBadContextState;
__glXBadDrawable = extEntry->errorBase + GLXBadDrawable;
__glXBadPixmap = extEntry->errorBase + GLXBadPixmap;
__glXBadContextTag = extEntry->errorBase + GLXBadContextTag;
__glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow;
__glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest;
__glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest;
__glXUnsupportedPrivateRequest = extEntry->errorBase +
GLXUnsupportedPrivateRequest;
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
/*
** Initialize table of client state. There is never a client 0.
*/
for (i=1; i <= MAXCLIENTS; i++) {
__glXClients[i] = 0;
}
/*
** Initialize screen specific data.
*/
__glXScreenInit(screenInfo.numScreens);
}
/************************************************************************/
Bool __glXCoreType(void)
{
return __glXExt->type;
}
/************************************************************************/
void GlxSetVisualConfigs(int nconfigs,
__GLXvisualConfig *configs, void **privates)
{
(*__glXExt->setVisualConfigs)(nconfigs, configs, privates);
}
static miInitVisualsProcPtr saveInitVisualsProc;
Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
int *nvisualp, int *ndepthp,
int *rootDepthp, VisualID *defaultVisp,
unsigned long sizes, int bitsPerRGB,
int preferredVis)
{
Bool ret;
if (saveInitVisualsProc) {
ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
rootDepthp, defaultVisp, sizes, bitsPerRGB,
preferredVis);
if (!ret)
return False;
}
(*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp,
defaultVisp, sizes, bitsPerRGB);
return True;
}
void
GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
{
saveInitVisualsProc = *initVisProc;
*initVisProc = GlxInitVisuals;
/* HACK: this shouldn't be done here but it's the earliest time */
__glXExt = __glXglDDXExtensionInfo(); /* from GLcore */
}
/************************************************************************/
void __glXFlushContextCache(void)
{
__glXLastContext = 0;
}
/*
** Make a context the current one for the GL (in this implementation, there
** is only one instance of the GL, and we use it to serve all GL clients by
** switching it between different contexts). While we are at it, look up
** a context by its tag and return its (__GLXcontext *).
*/
__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
int *error)
{
__GLXcontext *cx;
/*
** See if the context tag is legal; it is managed by the extension,
** so if it's invalid, we have an implementation error.
*/
cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag);
if (!cx) {
cl->client->errorValue = tag;
*error = __glXBadContextTag;
return 0;
}
if (!cx->isDirect) {
if (cx->drawPriv == NULL) {
/*
** The drawable has vanished. It must be a window, because only
** windows can be destroyed from under us; GLX pixmaps are
** refcounted and don't go away until no one is using them.
*/
*error = __glXBadCurrentWindow;
return 0;
}
}
if (cx == __glXLastContext) {
/* No need to re-bind */
return cx;
}
/* Make this context the current one for the GL. */
if (!cx->isDirect) {
if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) {
/* Bind failed, and set the error code. Bummer */
cl->client->errorValue = cx->id;
*error = __glXBadContextState;
return 0;
}
}
__glXLastContext = cx;
return cx;
}
/************************************************************************/
/*
** Top level dispatcher; all commands are executed from here down.
*/
#ifdef NXAGENT_SERVER
static int xorg__glXDispatch(ClientPtr client)
#else
static int __glXDispatch(ClientPtr client)
#endif
{
REQUEST(xGLXSingleReq);
CARD8 opcode;
int (*proc)(__GLXclientState *cl, GLbyte *pc);
__GLXclientState *cl;
opcode = stuff->glxCode;
cl = __glXClients[client->index];
if (!cl) {
cl = (__GLXclientState *) malloc(sizeof(__GLXclientState));
__glXClients[client->index] = cl;
if (!cl) {
return BadAlloc;
}
memset(cl, 0, sizeof(__GLXclientState));
}
if (!cl->inUse) {
/*
** This is first request from this client. Associate a resource
** with the client so we will be notified when the client dies.
*/
XID xid = FakeClientID(client->index);
if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) {
return BadAlloc;
}
ResetClientState(client->index);
cl->inUse = GL_TRUE;
cl->client = client;
}
/*
** Check for valid opcode.
*/
if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
return BadRequest;
}
/*
** If we're expecting a glXRenderLarge request, this better be one.
*/
if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) {
client->errorValue = stuff->glxCode;
return __glXBadLargeRequest;
}
/*
** Use the opcode to index into the procedure table.
*/
if (client->swapped)
proc = __glXSwapSingleTable[opcode];
else
proc = __glXSingleTable[opcode];
return (*proc)(cl, (GLbyte *) stuff);
}
int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc)
{
return BadRequest;
}
void __glXNoSuchRenderOpcode(GLbyte *pc)
{
return;
}

View File

@@ -0,0 +1,130 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _glxext_h_
#define _glxext_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.
**
*/
/*
* Added by VA Linux for XFree86 4.0.x
*/
typedef struct {
int type;
void (*resetExtension)(void);
Bool (*initVisuals)(
VisualPtr * visualp,
DepthPtr * depthp,
int * nvisualp,
int * ndepthp,
int * rootDepthp,
VisualID * defaultVisp,
unsigned long sizes,
int bitsPerRGB
);
void (*setVisualConfigs)(
int nconfigs,
__GLXvisualConfig *configs,
void **privates
);
} __GLXextensionInfo;
extern GLboolean __glXFreeContext(__GLXcontext *glxc);
extern void __glXFlushContextCache(void);
extern void __glXNoSuchRenderOpcode(GLbyte*);
extern int __glXNoSuchSingleOpcode(__GLXclientState*, GLbyte*);
extern void __glXErrorCallBack(__GLinterface *gc, GLenum code);
extern void __glXClearErrorOccured(void);
extern GLboolean __glXErrorOccured(void);
extern void __glXResetLargeCommandStatus(__GLXclientState*);
extern int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
extern int DoMakeCurrent( __GLXclientState *cl, GLXDrawable drawId,
GLXDrawable readId, GLXContextID contextId, GLXContextTag tag );
extern int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
GLboolean do_swap);
extern int DoGetFBConfigs(__GLXclientState *cl, unsigned screen,
GLboolean do_swap);
extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect);
extern int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
GLuint screenNum, XID pixmapId, XID glxpixmapId);
extern void GlxExtensionInit(void);
extern Bool __glXCoreType(void);
extern const char GLServerVersion[];
extern int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap);
extern int GlxInitVisuals(
VisualPtr * visualp,
DepthPtr * depthp,
int * nvisualp,
int * ndepthp,
int * rootDepthp,
VisualID * defaultVisp,
unsigned long sizes,
int bitsPerRGB,
int preferredVis
);
typedef struct {
void * (* queryHyperpipeNetworkFunc)(int, int *, int *);
void * (* queryHyperpipeConfigFunc)(int, int, int *, int *);
int (* destroyHyperpipeConfigFunc)(int, int);
void * (* hyperpipeConfigFunc)(int, int, int *, int *, void *);
} __GLXHyperpipeExtensionFuncs;
extern void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs);
extern __GLXHyperpipeExtensionFuncs *__glXHyperpipeFuncs;
typedef struct {
int (* bindSwapBarrierFunc)(int, XID, int);
int (* queryMaxSwapBarriersFunc)(int);
} __GLXSwapBarrierExtensionFuncs;
extern void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs);
extern __GLXSwapBarrierExtensionFuncs *__glXSwapBarrierFuncs;
#endif /* _glxext_h_ */

View File

@@ -0,0 +1,182 @@
/*
** 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.
**
*/
/*
** An implementation of a buffer which is part of the front buffer
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxutil.h"
#include "glxfb.h"
#include <gcstruct.h>
/* so we don't include glmath.h */
extern GLuint __glFloorLog2(GLuint);
typedef struct __GLFBbufferInfoRec {
GCPtr pGC;
} __GLFBbufferInfo;
extern PixmapPtr __glXPrivPixGetPtr(__GLdrawableBuffer *);
/* ---------------------------------------------------------- */
static GLboolean
Resize(__GLdrawableBuffer *buf,
GLint x, GLint y, GLuint width, GLuint height,
__GLdrawablePrivate *glPriv, GLuint bufferMask)
{
buf->width = width;
buf->height = height;
buf->byteWidth = width * buf->elementSize;
buf->outerWidth = width;
return GL_TRUE;
}
static void
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
/*
** Do a swap buffer with
** a memory surface as a back buffer
** a FB surface as a front buffer
*/
GLboolean
__glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv)
{
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
__GLdrawableBuffer *front = &glPriv->frontBuffer;
__GLdrawableBuffer *back = &glPriv->backBuffer;
__GLFBbufferInfo *bufferInfo;
GCPtr pGC;
GLint width, height, depth, pad;
GLubyte *buf;
bufferInfo = (__GLFBbufferInfo *) front->other;
pGC = bufferInfo->pGC;
width = back->width;
height = back->height;
depth = back->depth;
buf = back->base;
pad = back->outerWidth - back->width; /* back buffer padding */
/* adjust buffer padding. X wants left, GL has right */
buf -= pad;
ValidateGC(glxPriv->pDraw, pGC);
(*pGC->ops->PutImage)(glxPriv->pDraw, pGC,
depth,
0, 0, width, height,
pad, ZPixmap,
(char *)buf);
return GL_TRUE;
}
static void
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
__GLFBbufferInfo *bufferInfo;
bufferInfo = (__GLFBbufferInfo *) buf->other;
if (bufferInfo->pGC) {
FreeScratchGC(bufferInfo->pGC);
}
free(bufferInfo);
buf->other = NULL;
}
/*
** function to return the X GC of this buffer (to be used by DDX)
*/
GCPtr __glXFBGetGC(__GLdrawableBuffer *buf)
{
__GLFBbufferInfo *bufferInfo;
bufferInfo = (__GLFBbufferInfo *) buf->other;
if (bufferInfo) {
return bufferInfo->pGC;
} else {
return NULL;
}
}
void
__glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
{
__GLFBbufferInfo *bufferInfo;
__GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *) glPriv->other;
GCPtr pGC;
buf->depth = bits;
buf->width = buf->height = 0; /* to be filled during Update */
buf->handle = buf->base = NULL; /* to be filled during Update */
buf->size = 0;
buf->byteWidth = 0;
buf->elementSize = ((bits-1) / 8) + 1;
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
buf->resize = Resize;
buf->lock = Lock;
buf->unlock = Unlock;
buf->fill = NULL;
buf->free = Free;
/* allocate local information */
bufferInfo = (__GLFBbufferInfo *) malloc(sizeof(__GLFBbufferInfo));
buf->other = (void *) bufferInfo;
pGC = CreateScratchGC(glxPriv->pDraw->pScreen,
glxPriv->pDraw->depth);
bufferInfo->pGC = pGC;
(*pGC->funcs->ChangeClip)(pGC, CT_NONE, NULL, 0);
}

View File

@@ -0,0 +1,51 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _glxfb_h_
#define _glxfb_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.
**
*/
extern void __glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
GLint bits);
extern GCPtr __glXFBGetGC(__GLdrawableBuffer *buf);
extern GLboolean __glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv);
#endif /* _glxfb_h_ */

View File

@@ -0,0 +1,186 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "glxserver.h"
#include "glxcontext.h"
#include "glximports.h"
void *__glXImpMalloc(__GLcontext *gc, size_t size)
{
void *addr;
if (size == 0) {
return NULL;
}
addr = malloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
}
return addr;
}
void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize)
{
void *addr;
size_t size;
if ((numElements == 0) || (elementSize == 0)) {
return NULL;
}
size = numElements * elementSize;
addr = malloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
}
/* zero out memory */
memset(addr, 0, size);
return addr;
}
void __glXImpFree(__GLcontext *gc, void *addr)
{
if (addr) {
free(addr);
}
}
void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
{
void *newAddr;
if (addr) {
if (newSize == 0) {
free(addr);
return NULL;
}
newAddr = realloc(addr, newSize);
} else {
if (newSize == 0) {
return NULL;
}
newAddr = malloc(newSize);
}
if (newAddr == NULL) {
return NULL; /* XXX: out of memory error */
}
return newAddr;
}
void __glXImpWarning(__GLcontext *gc, char *msg)
{
ErrorF("%s",(char *)msg);
}
void __glXImpFatal(__GLcontext *gc, char *msg)
{
ErrorF("%s",(char *)msg);
abort();
}
char *__glXImpGetenv(__GLcontext *gc, const char *var)
{
return getenv(var);
}
int __glXImpAtoi(__GLcontext *gc, const char *str)
{
return atoi(str);
}
int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...)
{
va_list ap;
int ret;
/* have to deal with var args */
va_start(ap, fmt);
ret = vsprintf(str, fmt, ap);
va_end(ap);
return ret;
}
void *__glXImpFopen(__GLcontext *gc, const char *path, const char *mode)
{
return (void *) fopen(path, mode);
}
int __glXImpFclose(__GLcontext *gc, void *stream)
{
return fclose((FILE *)stream);
}
int __glXImpFprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
{
va_list ap;
int ret;
/* have to deal with var args */
va_start(ap, fmt);
ret = vfprintf((FILE *)stream, fmt, ap);
va_end(ap);
return ret;
}
__GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc)
{
__GLinterface *glci = (__GLinterface *) gc;
__GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
return &glrc->drawPriv->glPriv;
}
__GLdrawablePrivate *__glXImpGetReadablePrivate(__GLcontext *gc)
{
__GLinterface *glci = (__GLinterface *) gc;
__GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
return &glrc->readPriv->glPriv;
}

View File

@@ -0,0 +1,65 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _glximports_h_
#define _glximports_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.
**
*/
extern void *__glXImpMalloc(__GLcontext *gc, size_t size);
extern void *__glXImpCalloc(__GLcontext *gc, size_t nElem, size_t eSize);
extern void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize);
extern void __glXImpFree(__GLcontext *gc, void *addr);
extern void __glXImpWarning(__GLcontext *gc, char *msg);
extern void __glXImpFatal(__GLcontext *gc, char *msg);
extern char *__glXImpGetenv(__GLcontext *gc, const char *var);
extern int __glXImpAtoi(__GLcontext *gc, const char *str);
extern int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...);
extern void *__glXImpFopen(__GLcontext *gc, const char *path,
const char *mode);
extern int __glXImpFclose(__GLcontext *gc, void *stream);
extern int __glXImpFprintf(__GLcontext *gc, void *stream,
const char *fmt, ...);
extern __GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc);
extern __GLdrawablePrivate *__glXImpGetReadablePrivate(__GLcontext *gc);
#endif /* _glximports_h_ */

View File

@@ -0,0 +1,150 @@
/*
** 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.
**
*/
/*
** Implementation of a buffer in main memory
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxmem.h"
#include "glxext.h"
#include "GL/internal/glcore.h"
/* don't want to include glmath.h */
extern GLuint __glFloorLog2(GLuint);
/* ---------------------------------------------------------- */
#define BUF_ALIGN 32 /* x86 cache alignment (used for assembly paths) */
#define BUF_ALIGN_MASK (BUF_ALIGN-1)
static GLboolean
Resize(__GLdrawableBuffer *buf,
GLint x, GLint y, GLuint width, GLuint height,
__GLdrawablePrivate *glPriv, GLuint bufferMask)
{
GLuint newSize;
void *ubase;
GLint pixelWidth;
GLint alignedWidth;
/*
** Note:
** buf->handle : unaligned base
** buf->base : aligned base
*/
pixelWidth = BUF_ALIGN / buf->elementSize;
alignedWidth = (width & ~(pixelWidth-1)) + pixelWidth;
newSize = alignedWidth * height * buf->elementSize;
/*
** Only allocate buffer space for the SGI core.
** Mesa and Aqua handle their own buffer allocations.
*/
#if defined(__GL_BUFFER_SIZE_TRACKS_WINDOW)
if (__glXCoreType() == GL_CORE_SGI) {
#else
if (newSize > buf->size && __glXCoreType() == GL_CORE_SGI) {
#endif
if (buf->handle) {
ubase = (*glPriv->realloc)(buf->handle, newSize + BUF_ALIGN_MASK);
if (ubase == NULL) {
return GL_FALSE;
}
} else {
ubase = (*glPriv->malloc)(newSize + BUF_ALIGN_MASK);
if (ubase == NULL) {
return GL_FALSE;
}
}
buf->size = newSize;
buf->handle = ubase;
buf->base = (void *)(((size_t)ubase + BUF_ALIGN_MASK) &
(unsigned int) ~BUF_ALIGN_MASK);
assert(((size_t)buf->base % BUF_ALIGN) == 0);
}
buf->width = width;
buf->height = height;
buf->byteWidth = alignedWidth * buf->elementSize;
buf->outerWidth = alignedWidth;
return GL_TRUE;
}
static void
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
if (buf->handle) {
(*glPriv->free)(buf->handle);
buf->handle = NULL;
}
}
void
__glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
{
buf->width = buf->height = 0; /* to be filled during Update */
buf->depth = bits;
buf->size = 0;
buf->handle = buf->base = NULL; /* to be filled during Update */
buf->byteWidth = 0;
buf->elementSize = ((bits - 1) / 8) + 1;
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
buf->resize = Resize;
buf->lock = Lock;
buf->unlock = Unlock;
buf->fill = NULL;
buf->free = Free;
}

View File

@@ -0,0 +1,47 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _glxmem_h_
#define _glxmem_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.
**
*/
extern void __glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
GLint bits);
#endif /* _glxmem_h_ */

View File

@@ -0,0 +1,131 @@
/*
** 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.
**
*/
/*
** An implementation of a glx pixmap buffer
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxutil.h"
#include "glxpix.h"
#include <gcstruct.h>
/* don't want to include glmath.h */
extern GLuint __glFloorLog2(GLuint);
typedef struct __GLPixBufferInfoRec {
GCPtr pGC;
} __GLPixBufferInfo;
/* ---------------------------------------------------------- */
static GLboolean
Resize(__GLdrawableBuffer *buf,
GLint x, GLint y, GLuint width, GLuint height,
__GLdrawablePrivate *glPriv, GLuint bufferMask)
{
buf->width = width;
buf->height = width;
buf->byteWidth = width * buf->elementSize;
buf->outerWidth = width;
return GL_TRUE;
}
static void
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
__GLPixBufferInfo *bufferInfo;
if (LookupIDByType((XID)(long)buf->handle, __glXPixmapRes)) {
FreeResource((XID)(long)buf->handle, FALSE);
buf->handle = NULL;
}
bufferInfo = (__GLPixBufferInfo *) buf->other;
if (bufferInfo->pGC) {
FreeScratchGC(bufferInfo->pGC);
}
free(bufferInfo);
buf->other = NULL;
}
void
__glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap)
{
__GLPixBufferInfo *bufferInfo;
buf->width = buf->height = 0; /* to be filled during Update */
buf->depth = bits;
buf->size = 0;
buf->base = NULL;
buf->byteWidth = 0;
buf->elementSize = ((bits-1) / 8) + 1;
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
buf->handle = (void *)(long) glxpixmapId;
pGlxPixmap->refcnt++;
buf->resize = Resize;
buf->lock = Lock;
buf->unlock = Unlock;
buf->fill = NULL;
buf->free = Free;
/* allocate local information */
bufferInfo = (__GLPixBufferInfo *) malloc(sizeof(__GLPixBufferInfo));
buf->other = (void *) bufferInfo;
bufferInfo->pGC = CreateScratchGC(pGlxPixmap->pDraw->pScreen,
pGlxPixmap->pDraw->depth);
}

View File

@@ -0,0 +1,47 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _glxpix_h_
#define _glxpix_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.
**
*/
extern void __glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap);
#endif /* _glxpix_h_ */

View File

@@ -0,0 +1,373 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include <signal.h>
#include <windowstr.h>
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
const char GLServerVersion[] = "1.2";
static const char GLServerExtensions[] =
"GL_ARB_depth_texture "
"GL_ARB_imaging "
"GL_ARB_multitexture "
"GL_ARB_point_parameters "
"GL_ARB_point_sprite "
"GL_ARB_shadow "
"GL_ARB_shadow_ambient "
"GL_ARB_texture_border_clamp "
"GL_ARB_texture_cube_map "
"GL_ARB_texture_env_add "
"GL_ARB_texture_env_combine "
"GL_ARB_texture_env_crossbar "
"GL_ARB_texture_env_dot3 "
"GL_ARB_texture_mirrored_repeat "
"GL_ARB_transpose_matrix "
"GL_ARB_window_pos "
"GL_EXT_abgr "
"GL_EXT_bgra "
"GL_EXT_blend_color "
"GL_EXT_blend_func_separate "
"GL_EXT_blend_logic_op "
"GL_EXT_blend_minmax "
"GL_EXT_blend_subtract "
"GL_EXT_clip_volume_hint "
"GL_EXT_copy_texture "
"GL_EXT_draw_range_elements "
"GL_EXT_fog_coord "
"GL_EXT_multi_draw_arrays "
"GL_EXT_packed_pixels "
"GL_EXT_polygon_offset "
"GL_EXT_rescale_normal "
"GL_EXT_secondary_color "
"GL_EXT_separate_specular_color "
"GL_EXT_shadow_funcs "
"GL_EXT_stencil_two_side "
"GL_EXT_stencil_wrap "
"GL_EXT_subtexture "
"GL_EXT_texture "
"GL_EXT_texture3D "
"GL_EXT_texture_edge_clamp "
"GL_EXT_texture_env_add "
"GL_EXT_texture_env_combine "
"GL_EXT_texture_env_dot3 "
"GL_EXT_texture_lod "
"GL_EXT_texture_lod_bias "
"GL_EXT_texture_object "
"GL_EXT_texture_rectangle "
"GL_EXT_vertex_array "
"GL_APPLE_packed_pixels "
"GL_ATI_texture_mirror_once "
"GL_ATI_texture_env_combine3 "
"GL_HP_occlusion_test "
"GL_IBM_texture_mirrored_repeat "
"GL_MESA_pack_invert "
"GL_MESA_ycbcr_texture "
"GL_NV_blend_square "
"GL_NV_point_sprite "
"GL_NV_texgen_reflection "
"GL_NV_texture_rectangle "
"GL_SGIS_generate_mipmap "
"GL_SGIS_texture_border_clamp "
"GL_SGIS_texture_edge_clamp "
"GL_SGIS_texture_lod "
"GL_SGIX_depth_texture "
"GL_SGIX_shadow "
"GL_SGIX_shadow_ambient "
;
/*
** We have made the simplifying assuption that the same extensions are
** supported across all screens in a multi-screen system.
*/
static char GLXServerVendorName[] = "SGI";
static char GLXServerVersion[] = "1.2";
static char GLXServerExtensions[] =
"GLX_ARB_multisample "
"GLX_EXT_visual_info "
"GLX_EXT_visual_rating "
"GLX_EXT_import_context "
"GLX_OML_swap_method "
"GLX_SGI_make_current_read "
#ifndef __DARWIN__
"GLX_SGIS_multisample "
"GLX_SGIX_hyperpipe "
"GLX_SGIX_swap_barrier "
#endif
"GLX_SGIX_fbconfig "
;
/*
* __glDDXScreenInfo comes from GLcore, so we can't resolve this symbol at
* module open time. Leave a placeholder, and fill this in when we first
* need it (in __glXScreenInit). XXX Why make this an array?
*/
static __GLXscreenInfo *__glXScreens[] = {
NULL /* &__glDDXScreenInfo */ ,
};
static GLint __glXNumStaticScreens =
(sizeof __glXScreens / sizeof __glXScreens[0]);
__GLXscreenInfo *__glXActiveScreens;
GLint __glXNumActiveScreens;
__GLXSwapBarrierExtensionFuncs *__glXSwapBarrierFuncs = NULL;
static int __glXNumSwapBarrierFuncs = 0;
__GLXHyperpipeExtensionFuncs *__glXHyperpipeFuncs = NULL;
static int __glXNumHyperpipeFuncs = 0;
RESTYPE __glXDrawableRes;
__GLXscreenInfo *__glXgetActiveScreen(int num) {
return &__glXActiveScreens[num];
}
/*
** Destroy routine that gets called when a drawable is freed. A drawable
** contains the ancillary buffers needed for rendering.
*/
static Bool DrawableGone(__GLXdrawablePrivate *glxPriv, XID xid)
{
__GLXcontext *cx, *cx1;
/*
** Use glxPriv->type to figure out what kind of drawable this is. Don't
** use glxPriv->pDraw->type because by the time this routine is called,
** the pDraw might already have been freed.
*/
if (glxPriv->type == DRAWABLE_WINDOW) {
/*
** When a window is destroyed, notify all context bound to
** it, that there are no longer bound to anything.
*/
for (cx = glxPriv->drawGlxc; cx; cx = cx1) {
cx1 = cx->nextDrawPriv;
cx->pendingState |= __GLX_PENDING_DESTROY;
}
for (cx = glxPriv->readGlxc; cx; cx = cx1) {
cx1 = cx->nextReadPriv;
cx->pendingState |= __GLX_PENDING_DESTROY;
}
}
/*
** set the size to 0, so that context that may still be using this
** drawable not do anything harmful
*/
glxPriv->xorigin = 0;
glxPriv->yorigin = 0;
glxPriv->width = 0;
glxPriv->height = 0;
__glXUnrefDrawablePrivate(glxPriv);
return True;
}
/*
** This hook gets called when a window moves or changes size.
*/
static Bool PositionWindow(WindowPtr pWin, int x, int y)
{
ScreenPtr pScreen;
__GLXcontext *glxc;
__GLXdrawablePrivate *glxPriv;
Bool ret;
/*
** Call wrapped position window routine
*/
pScreen = pWin->drawable.pScreen;
pScreen->PositionWindow =
__glXActiveScreens[pScreen->myNum].WrappedPositionWindow;
ret = (*pScreen->PositionWindow)(pWin, x, y);
pScreen->PositionWindow = PositionWindow;
/*
** Tell all contexts rendering into this window that the window size
** has changed.
*/
glxPriv = (__GLXdrawablePrivate *) LookupIDByType(pWin->drawable.id,
__glXDrawableRes);
if (glxPriv == NULL) {
/*
** This window is not being used by the OpenGL.
*/
return ret;
}
/*
** resize the drawable
*/
/* first change the drawable size */
if (__glXResizeDrawableBuffers(glxPriv) == GL_FALSE) {
/* resize failed! */
/* XXX: what can we possibly do here? */
ret = False;
}
/* mark contexts as needing resize */
for (glxc = glxPriv->drawGlxc; glxc; glxc = glxc->nextDrawPriv) {
glxc->pendingState |= __GLX_PENDING_RESIZE;
}
for (glxc = glxPriv->readGlxc; glxc; glxc = glxc->nextReadPriv) {
glxc->pendingState |= __GLX_PENDING_RESIZE;
}
return ret;
}
/*
** Wrap our own PositionWindow routine around the server's, so we can
** be notified when a window changes size
*/
static void wrapPositionWindow(int screen)
{
ScreenPtr pScreen = screenInfo.screens[screen];
__glXActiveScreens[screen].WrappedPositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = PositionWindow;
}
/*
* If your DDX driver wants to register support for swap barriers or hyperpipe
* topology, it should call __glXHyperpipeInit() or __glXSwapBarrierInit()
* with a dispatch table of functions to handle the requests. In the XFree86
* DDX, for example, you would call these near the bottom of the driver's
* ScreenInit method, after DRI has been initialized.
*
* This should be replaced with a better method when we teach the server how
* to load DRI drivers.
*/
void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs)
{
if (__glXNumHyperpipeFuncs < screen + 1) {
__glXHyperpipeFuncs = realloc(__glXHyperpipeFuncs,
(screen+1) * sizeof(__GLXHyperpipeExtensionFuncs));
__glXNumHyperpipeFuncs = screen + 1;
}
__glXHyperpipeFuncs[screen].queryHyperpipeNetworkFunc =
*funcs->queryHyperpipeNetworkFunc;
__glXHyperpipeFuncs[screen].queryHyperpipeConfigFunc =
*funcs->queryHyperpipeConfigFunc;
__glXHyperpipeFuncs[screen].destroyHyperpipeConfigFunc =
*funcs->destroyHyperpipeConfigFunc;
__glXHyperpipeFuncs[screen].hyperpipeConfigFunc =
*funcs->hyperpipeConfigFunc;
}
void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs)
{
if (__glXNumSwapBarrierFuncs < screen + 1) {
__glXSwapBarrierFuncs = realloc(__glXSwapBarrierFuncs,
(screen+1) * sizeof(__GLXSwapBarrierExtensionFuncs));
__glXNumSwapBarrierFuncs = screen + 1;
}
__glXSwapBarrierFuncs[screen].bindSwapBarrierFunc =
funcs->bindSwapBarrierFunc;
__glXSwapBarrierFuncs[screen].queryMaxSwapBarriersFunc =
funcs->queryMaxSwapBarriersFunc;
}
void __glXScreenInit(GLint numscreens)
{
GLint i,j;
__glXScreens[0] = __glXglDDXScreenInfo(); /* from GLcore */
/*
** This alloc has to work or else the server might as well core dump.
*/
__glXActiveScreens =
(__GLXscreenInfo *) malloc(sizeof(__GLXscreenInfo) * numscreens);
for (i=0; i < numscreens; i++) {
/*
** Probe each static screen to see which exists.
*/
for (j=0; j < __glXNumStaticScreens; j++) {
if ((*__glXScreens[j]->screenProbe)(i)) {
__glXActiveScreens[i] = *__glXScreens[j];
__glXActiveScreens[i].numUsableVisuals = __glXActiveScreens[i].numVisuals;
__glXActiveScreens[i].GLextensions = strdup(GLServerExtensions);
__glXActiveScreens[i].GLXvendor = strdup(GLXServerVendorName);
__glXActiveScreens[i].GLXversion = strdup(GLXServerVersion);
__glXActiveScreens[i].GLXextensions = strdup(GLXServerExtensions);
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
wrapPositionWindow(i);
}
}
}
__glXNumActiveScreens = numscreens;
}
void __glXScreenReset(void)
{
int i;
for (i = 0; i < __glXNumActiveScreens; i++) {
free(__glXActiveScreens[i].GLXvendor);
free(__glXActiveScreens[i].GLXversion);
free(__glXActiveScreens[i].GLXextensions);
free(__glXActiveScreens[i].GLextensions);
}
free(__glXActiveScreens);
free(__glXHyperpipeFuncs);
free(__glXSwapBarrierFuncs);
__glXNumHyperpipeFuncs = 0;
__glXNumSwapBarrierFuncs = 0;
__glXHyperpipeFuncs = NULL;
__glXSwapBarrierFuncs = NULL;
__glXActiveScreens = NULL;
__glXNumActiveScreens = 0;
}

View File

@@ -0,0 +1,102 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_screens_h_
#define _GLX_screens_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.
**
*/
/* XXX: should be defined somewhere globally */
#define CAPI
#include "GL/internal/glcore.h"
/*
** Screen dependent data. These methods are the interface between the DIX
** and DDX layers of the GLX server extension. The methods provide an
** interface for context management on a screen.
*/
typedef struct {
/*
** Probe the screen and see if it supports GL rendering. It will
** return GL_FALSE if it doesn't, GL_TRUE otherwise.
*/
Bool (*screenProbe)(int screen);
/*
** Create a context using configuration information from modes.
** Use imports as callbacks back to the OS. Return an opaque handle
** on the context (NULL if failure).
*/
__GLinterface *(*createContext)(__GLimports *imports,
__GLcontextModes *modes,
__GLinterface *shareGC);
/*
** Create a buffer using information from glxPriv. This routine
** sets up any wrappers necessary to resize, swap or destroy the
** buffer.
*/
void (*createBuffer)(__GLXdrawablePrivate *glxPriv);
/**
* Linked list of valid context modes for this screen.
*/
__GLcontextModes *modes;
void **pVisualPriv;
GLint numVisuals;
GLint numUsableVisuals;
char *GLextensions;
char *GLXvendor;
char *GLXversion;
char *GLXextensions;
/*
** Things that are not statically set.
*/
Bool (*WrappedPositionWindow)(WindowPtr pWin, int x, int y);
} __GLXscreenInfo;
extern void __glXScreenInit(GLint);
extern void __glXScreenReset(void);
#endif /* !__GLX_screens_h__ */

View File

@@ -0,0 +1,326 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_server_h_
#define _GLX_server_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 <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#include <nx-X11/Xmd.h>
#include <misc.h>
#include <dixstruct.h>
#include <pixmapstr.h>
#include <gcstruct.h>
#include <extnsionst.h>
#include <resource.h>
#include <scrnintstr.h>
#include "protocol-versions.h"
#include <limits.h>
/*
** The X header misc.h defines these math functions.
*/
#undef abs
#undef fabs
#define GL_GLEXT_PROTOTYPES /* we want prototypes */
#include <GL/gl.h>
#include <GL/glxproto.h>
#include <GL/glxint.h>
/* For glxscreens.h */
typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
#include "glxscreens.h"
#include "glxdrawable.h"
#include "glxcontext.h"
#include "glxerror.h"
#define GLX_SERVER_MAJOR_VERSION SERVER_GLX_MAJOR_VERSION
#define GLX_SERVER_MINOR_VERSION SERVER_GLX_MINOR_VERSION
#ifndef True
#define True 1
#endif
#ifndef False
#define False 0
#endif
/*
** GLX resources.
*/
typedef XID GLXContextID;
typedef XID GLXPixmap;
typedef XID GLXDrawable;
typedef struct __GLXcontextRec *GLXContext;
typedef struct __GLXclientStateRec __GLXclientState;
extern __GLXscreenInfo *__glXActiveScreens;
extern GLint __glXNumActiveScreens;
extern __GLXscreenInfo *__glXgetActiveScreen(int num);
/************************************************************************/
/*
** The last context used (from the server's persective) is cached.
*/
extern __GLXcontext *__glXLastContext;
extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
/*
** Macros to set, unset, and retrieve the flag that says whether a context
** has unflushed commands.
*/
#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
/************************************************************************/
/*
** State kept per client.
*/
struct __GLXclientStateRec {
/*
** Whether this structure is currently being used to support a client.
*/
Bool inUse;
/*
** Buffer for returned data.
*/
GLbyte *returnBuf;
GLint returnBufSize;
/*
** Keep track of large rendering commands, which span multiple requests.
*/
GLint largeCmdBytesSoFar; /* bytes received so far */
GLint largeCmdBytesTotal; /* total bytes expected */
GLint largeCmdRequestsSoFar; /* requests received so far */
GLint largeCmdRequestsTotal; /* total requests expected */
GLbyte *largeCmdBuf;
GLint largeCmdBufSize;
/*
** Keep a list of all the contexts that are current for this client's
** threads.
*/
__GLXcontext **currentContexts;
GLint numCurrentContexts;
/* Back pointer to X client record */
ClientPtr client;
int GLClientmajorVersion;
int GLClientminorVersion;
char *GLClientextensions;
};
extern __GLXclientState *__glXClients[];
/************************************************************************/
/*
** Dispatch tables.
*/
typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
/*
* Dispatch for GLX commands.
*/
typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
extern __GLXprocPtr __glXProcTable[];
/*
* Tables for computing the size of each rendering command.
*/
typedef struct {
int bytes;
int (*varsize)(GLbyte *pc, Bool swap, int left);
} __GLXrenderSizeData;
extern __GLXrenderSizeData __glXRenderSizeTable[];
extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
/************************************************************************/
/*
** X resources.
*/
extern RESTYPE __glXContextRes;
extern RESTYPE __glXClientRes;
extern RESTYPE __glXPixmapRes;
extern RESTYPE __glXDrawableRes;
/************************************************************************/
/*
** Prototypes.
*/
extern char *__glXcombine_strings(const char *, const char *);
/*
** Routines for sending swapped replies.
*/
extern void __glXSwapMakeCurrentReply(ClientPtr client,
xGLXMakeCurrentReply *reply);
extern void __glXSwapIsDirectReply(ClientPtr client,
xGLXIsDirectReply *reply);
extern void __glXSwapQueryVersionReply(ClientPtr client,
xGLXQueryVersionReply *reply);
extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
xGLXQueryContextInfoEXTReply *reply,
int *buf);
extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
xGLXQueryExtensionsStringReply *reply, char *buf);
extern void glxSwapQueryServerStringReply(ClientPtr client,
xGLXQueryServerStringReply *reply, char *buf);
/*
* Routines for computing the size of variably-sized rendering commands.
*/
static __inline__ int
safe_add(int a, int b)
{
if (a < 0 || b < 0)
return -1;
if (INT_MAX - a < b)
return -1;
return a + b;
}
static __inline__ int
safe_mul(int a, int b)
{
if (a < 0 || b < 0)
return -1;
if (a == 0 || b == 0)
return 0;
if (a > INT_MAX / b)
return -1;
return a * b;
}
static __inline__ int
safe_pad(int a)
{
int ret;
if (a < 0)
return -1;
if ((ret = safe_add(a, 3)) < 0)
return -1;
return ret & (GLuint)~3;
}
extern int __glXTypeSize(GLenum enm);
extern int __glXImageSize(GLenum format, GLenum type,
GLenum target, GLsizei w, GLsizei h, GLsizei d,
GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
GLint alignment);
extern int __glXCallListsReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXBitmapReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXFogfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXFogivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXLightfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXLightivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXMap1dReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXMap1fReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXMap2dReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXMap2fReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXDrawArraysSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap, int reqlen );
extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXColorTableReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap, int reqlen);
/*
* Routines for computing the size of returned data.
*/
extern int __glXConvolutionParameterivSize(GLenum pname);
extern int __glXConvolutionParameterfvSize(GLenum pname);
extern int __glXColorTableParameterfvSize(GLenum pname);
extern int __glXColorTableParameterivSize(GLenum pname);
extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap, int reqlen);
extern int __glXPointParameterivReqSize(GLbyte *pc, Bool swap, int reqlen);
#endif /* !__GLX_server_h__ */

View File

@@ -0,0 +1,433 @@
/*
** 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.
**
*/
#define FONT_PCF
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include "glxserver.h"
#include <GL/glxtokens.h>
#include <unpack.h>
#include <pixmapstr.h>
#include <windowstr.h>
#include "glxutil.h"
#include "glxbuf.h"
#include "GL/internal/glcore.h"
#include "GL/glxint.h"
#include "glcontextmodes.h"
/************************************************************************/
void __glXNop(void) {}
/************************************************************************/
/* Context stuff */
/*
** associate a context with a drawable
*/
void
__glXAssociateContext(__GLXcontext *glxc)
{
glxc->nextDrawPriv = glxc->drawPriv->drawGlxc;
glxc->drawPriv->drawGlxc = glxc;
__glXRefDrawablePrivate(glxc->drawPriv);
glxc->nextReadPriv = glxc->readPriv->readGlxc;
glxc->readPriv->readGlxc = glxc;
__glXRefDrawablePrivate(glxc->readPriv);
}
/*
** Deassociate a context from a drawable
*/
void
__glXDeassociateContext(__GLXcontext *glxc)
{
__GLXcontext *curr, *prev;
prev = NULL;
for ( curr = glxc->drawPriv->drawGlxc
; curr != NULL
; prev = curr, curr = curr->nextDrawPriv ) {
if (curr == glxc) {
/* found context. Deassociate. */
if (prev == NULL) {
glxc->drawPriv->drawGlxc = curr->nextDrawPriv;
} else {
prev->nextDrawPriv = curr->nextDrawPriv;
}
curr->nextDrawPriv = NULL;
__glXUnrefDrawablePrivate(glxc->drawPriv);
break;
}
}
prev = NULL;
for ( curr = glxc->readPriv->readGlxc
; curr != NULL
; prev = curr, curr = curr->nextReadPriv ) {
if (curr == glxc) {
/* found context. Deassociate. */
if (prev == NULL) {
glxc->readPriv->readGlxc = curr->nextReadPriv;
} else {
prev->nextReadPriv = curr->nextReadPriv;
}
curr->nextReadPriv = NULL;
__glXUnrefDrawablePrivate(glxc->readPriv);
break;
}
}
}
/************************************************************************/
void
__glXGetDrawableSize(__GLdrawablePrivate *glPriv,
GLint *x, GLint *y, GLuint *width, GLuint *height)
{
__GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
if (glxPriv) {
*x = glxPriv->xorigin;
*y = glxPriv->yorigin;
*width = glxPriv->width;
*height = glxPriv->height;
} else {
*x = *y = *width = *height = 0;
}
}
GLboolean
__glXResizeDrawable(__GLdrawablePrivate *glPriv)
{
/* nothing to be done here */
return GL_TRUE;
}
/*****************************************************************************/
/* accessing the drawable private */
static void
LockDP(__GLdrawablePrivate *glPriv, __GLcontext *gc)
{
__GLinterface *glci = (__GLinterface *) gc;
__GLXcontext *glxc = (__GLXcontext *) glci->imports.other;
/* quick exit test */
if ((glxc->pendingState &
(__GLX_PENDING_RESIZE |
__GLX_PENDING_DESTROY |
__GLX_PENDING_SWAP)) == 0x0)
return;
/* some pending state. Deal with it */
if (glxc->pendingState & __GLX_PENDING_RESIZE) {
glxc->pendingState &= ~__GLX_PENDING_RESIZE;
(*glci->exports.notifyResize)(gc);
assert((glxc->pendingState & __GLX_PENDING_RESIZE) == 0x0);
}
if (glxc->pendingState & __GLX_PENDING_DESTROY) {
glxc->pendingState &= ~__GLX_PENDING_DESTROY;
assert(glxc->drawPriv->xorigin == 0);
assert(glxc->drawPriv->yorigin == 0);
assert(glxc->drawPriv->width == 0);
assert(glxc->drawPriv->height == 0);
assert(glxc->readPriv->xorigin == 0);
assert(glxc->readPriv->yorigin == 0);
assert(glxc->readPriv->width == 0);
assert(glxc->readPriv->height == 0);
(*glci->exports.notifyDestroy)(gc);
__glXDeassociateContext(glxc);
assert((glxc->pendingState & __GLX_PENDING_DESTROY) == 0x0);
}
if (glxc->pendingState & __GLX_PENDING_SWAP) {
glxc->pendingState &= ~__GLX_PENDING_SWAP;
(*glci->exports.notifySwapBuffers)(gc);
assert((glxc->pendingState & __GLX_PENDING_SWAP) == 0x0);
}
}
static void
UnlockDP(__GLdrawablePrivate *glPriv)
{
}
/*****************************************************************************/
/* Drawable private stuff */
void
__glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
{
glxPriv->refCount++;
}
void
__glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
{
glxPriv->refCount--;
if (glxPriv->refCount == 0) {
__glXDestroyDrawablePrivate(glxPriv);
}
}
__GLXdrawablePrivate *
__glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId,
__GLcontextModes *modes)
{
__GLXdrawablePrivate *glxPriv;
__GLdrawablePrivate *glPriv;
__GLXscreenInfo *pGlxScreen;
glxPriv = (__GLXdrawablePrivate *) malloc(sizeof(*glxPriv));
memset(glxPriv, 0, sizeof(__GLXdrawablePrivate));
glxPriv->type = pDraw->type;
glxPriv->pDraw = pDraw;
glxPriv->drawId = drawId;
/* if not a pixmap, lookup will fail, so pGlxPixmap will be NULL */
glxPriv->pGlxPixmap = (__GLXpixmap *)
LookupIDByType(drawId, __glXPixmapRes);
/* since we are creating the drawablePrivate, drawId should be new */
if (!AddResource(drawId, __glXDrawableRes, glxPriv)) {
/* oops! */
free(glxPriv);
return NULL;
}
/* fill up glPriv */
glPriv = &glxPriv->glPriv;
glPriv->modes = (__GLcontextModes *) malloc(sizeof(__GLcontextModes));
*glPriv->modes = *modes;
glPriv->malloc = malloc;
glPriv->calloc = calloc;
glPriv->realloc = realloc;
glPriv->free = free;
glPriv->addSwapRect = NULL;
glPriv->setClipRect = (void (*)(__GLdrawablePrivate *, GLint, GLint, GLsizei, GLsizei)) __glXNop;
glPriv->lockDP = LockDP;
glPriv->unlockDP = UnlockDP;
glPriv->getDrawableSize = __glXGetDrawableSize;
glPriv->resize = __glXResizeDrawable;
glPriv->other = glxPriv;
/* allocate a one-rect ownership region */
glPriv->ownershipRegion.rects =
(__GLregionRect *)calloc(1, sizeof(__GLregionRect));
glPriv->ownershipRegion.numRects = 1;
glxPriv->freeBuffers = __glXFreeBuffers;
glxPriv->updatePalette = (void (*)(__GLXdrawablePrivate *)) __glXNop;
pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
if (glxPriv->type == DRAWABLE_WINDOW) {
VisualID vid = wVisual((WindowPtr)pDraw);
glxPriv->modes = _gl_context_modes_find_visual( pGlxScreen->modes, vid );
__glXFBInitDrawable(glxPriv, modes);
} else {
glxPriv->modes = glxPriv->pGlxPixmap->modes;
__glXPixInitDrawable(glxPriv, modes);
}
/* initialize the core's private buffer information */
(*pGlxScreen->createBuffer)(glxPriv);
return glxPriv;
}
GLboolean
__glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv)
{
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
/* remove the drawable from the drawable list */
FreeResourceByType(glxPriv->drawId, __glXDrawableRes, FALSE);
/* Have the core free any memory it may have attached to the drawable */
if (glPriv->freePrivate) {
(*glPriv->freePrivate)(glPriv);
}
/* Free any framebuffer memory attached to the drawable */
if (glxPriv->freeBuffers) {
(*glxPriv->freeBuffers)(glxPriv);
}
/* Free the drawable Private */
free(glxPriv->glPriv.modes);
free(glxPriv->glPriv.ownershipRegion.rects);
free(glxPriv);
return GL_TRUE;
}
__GLXdrawablePrivate *
__glXFindDrawablePrivate(XID drawId)
{
__GLXdrawablePrivate *glxPriv;
glxPriv = (__GLXdrawablePrivate *)LookupIDByType(drawId, __glXDrawableRes);
return glxPriv;
}
__GLXdrawablePrivate *
__glXGetDrawablePrivate(DrawablePtr pDraw, XID drawId,
__GLcontextModes *modes)
{
__GLXdrawablePrivate *glxPriv;
glxPriv = __glXFindDrawablePrivate(drawId);
if (glxPriv == NULL) {
glxPriv = __glXCreateDrawablePrivate(pDraw, drawId, modes);
if (glxPriv) {
__glXRefDrawablePrivate(glxPriv);
}
}
return glxPriv;
}
void
__glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv)
{
if (glxPriv) {
if (glxPriv->pDraw) {
glxPriv->xorigin = glxPriv->pDraw->x;
glxPriv->yorigin = glxPriv->pDraw->y;
glxPriv->width = glxPriv->pDraw->width;
glxPriv->height = glxPriv->pDraw->height;
}
}
}
/*
** resize/move the drawable. Called during the actual resize callback
** to update the drawable side of the buffers
*/
GLboolean
__glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv)
{
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
GLint x, y;
GLuint w, h;
#if defined(__GL_ALIGNED_BUFFERS)
GLint xAlignment, yAlignment;
GLint xOffset, yOffset;
GLint xStart, xEnd;
GLint yStart, yEnd;
GLuint xAlignedMask, yAlignedMask;
#endif
GLboolean status = GL_TRUE;
__glXCacheDrawableSize(glxPriv);
w = glxPriv->width;
h = glxPriv->height;
x = glxPriv->xorigin;
y = glxPriv->yorigin;
#if defined(__GL_ALIGNED_BUFFERS)
xAlignment = glPriv->xAlignment;
yAlignment = glPriv->yAlignment;
xOffset = x & (xAlignment-1);
yOffset = y & (yAlignment-1);
xAlignedMask = ~(xAlignment-1);
yAlignedMask = ~(yAlignment-1);
xStart = x; xEnd = x+w;
yStart = y; yEnd = y+h;
xStart &= xAlignedMask;
if (xEnd & ~xAlignedMask) {
xEnd = (xEnd&xAlignedMask) + xAlignment;
}
yStart &= yAlignedMask;
if (yEnd & ~yAlignedMask) {
yEnd = (yEnd&yAlignedMask) + yAlignment;
}
x = xStart; y = yStart;
w = xEnd-xStart; h = yEnd-yStart;
#endif
if ((x != glPriv->xOrigin) ||
(y != glPriv->yOrigin) ||
#if defined(__GL_ALIGNED_BUFFERS)
(xOffset != glPriv->xOffset) ||
(yOffset != glPriv->yOffset) ||
#endif
(w != glPriv->width) ||
(h != glPriv->height) ||
(!w && !h)) {
/* set up the glPriv info */
glPriv->width = w;
glPriv->height = h;
glPriv->xOrigin = x;
glPriv->yOrigin = y;
#if defined(__GL_ALIGNED_BUFFERS)
glPriv->xOffset = xOffset;
glPriv->yOffset = yOffset;
#endif
/* notify the buffers */
status = __glXResizeBuffers(glPriv, x, y, w, h);
}
return status;
}
/************************************************************************/

View File

@@ -0,0 +1,77 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _glxcmds_h_
#define _glxcmds_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.
**
*/
extern void __glXNop(void);
/* relate contexts with drawables */
extern void __glXAssociateContext(__GLXcontext *glxc);
extern void __glXDeassociateContext(__GLXcontext *glxc);
/* drawable operation */
extern void __glXGetDrawableSize(__GLdrawablePrivate *glPriv,
GLint *x, GLint *y,
GLuint *width, GLuint *height);
extern GLboolean __glXResizeDrawable(__GLdrawablePrivate *glPriv);
extern GLboolean __glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv);
/* drawable management */
extern void __glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
extern void __glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
extern __GLXdrawablePrivate *__glXCreateDrawablePrivate(DrawablePtr pDraw,
XID glxpixmapId,
__GLcontextModes *modes);
extern GLboolean __glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv);
extern __GLXdrawablePrivate *__glXFindDrawablePrivate(XID glxpixmapId);
extern __GLXdrawablePrivate *__glXGetDrawablePrivate(DrawablePtr pDraw,
XID glxpixmapId,
__GLcontextModes *modes);
extern void __glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv);
/* context helper routines */
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
/* init helper routines */
extern void *__glXglDDXScreenInfo(void);
extern void *__glXglDDXExtensionInfo(void);
#endif /* _glxcmds_h_ */

View File

@@ -0,0 +1,55 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _impsize_h_
#define _impsize_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.
**
*/
/*
** These are defined in libsampleGL.a. They are not technically part of
** the defined interface between libdixGL.a and libsampleGL.a (that interface
** being the functions in the __glXScreenInfo structure, plus the OpenGL API
** itself), but we thought it was better to call these routines than to
** replicate the code in here.
*/
#include "indirect_size.h"
extern int __glDrawPixels_size(GLenum format, GLenum type, GLsizei w,GLsizei h);
#endif /* _impsize_h_ */

View File

@@ -0,0 +1,269 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <glxserver.h>
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
#include "indirect_size.h"
void __glXDisp_Map1f(GLbyte *pc)
{
GLint order, k;
GLfloat u1, u2, *points;
GLenum target;
target = *(GLenum *)(pc + 0);
order = *(GLint *)(pc + 12);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
points = (GLfloat *)(pc + 16);
k = __glMap1f_size(target);
glMap1f(target, u1, u2, k, order, points);
}
void __glXDisp_Map2f(GLbyte *pc)
{
GLint uorder, vorder, ustride, vstride, k;
GLfloat u1, u2, v1, v2, *points;
GLenum target;
target = *(GLenum *)(pc + 0);
uorder = *(GLint *)(pc + 12);
vorder = *(GLint *)(pc + 24);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
v1 = *(GLfloat *)(pc + 16);
v2 = *(GLfloat *)(pc + 20);
points = (GLfloat *)(pc + 28);
k = __glMap2f_size(target);
ustride = vorder * k;
vstride = k;
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDisp_Map1d(GLbyte *pc)
{
GLint order, k;
#ifdef __GLX_ALIGN64
GLint compsize;
#endif
GLenum target;
GLdouble u1, u2, *points;
target = *(GLenum*) (pc + 16);
order = *(GLint*) (pc + 20);
k = __glMap1d_size(target);
#ifdef __GLX_ALIGN64
if (order < 0 || k < 0) {
compsize = 0;
} else {
compsize = order * k;
}
#endif
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
pc += 24;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap1d(target, u1, u2, k, order, points);
}
void __glXDisp_Map2d(GLbyte *pc)
{
GLdouble u1, u2, v1, v2, *points;
GLint uorder, vorder, ustride, vstride, k;
#ifdef __GLX_ALIGN64
GLint compsize;
#endif
GLenum target;
target = *(GLenum *)(pc + 32);
uorder = *(GLint *)(pc + 36);
vorder = *(GLint *)(pc + 40);
k = __glMap2d_size(target);
#ifdef __GLX_ALIGN64
if (vorder < 0 || uorder < 0 || k < 0) {
compsize = 0;
} else {
compsize = uorder * vorder * k;
}
#endif
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
__GLX_GET_DOUBLE(v1,pc+16);
__GLX_GET_DOUBLE(v2,pc+24);
pc += 44;
ustride = vorder * k;
vstride = k;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDisp_CallLists(GLbyte *pc)
{
GLenum type;
GLsizei n;
type = *(GLenum *)(pc + 4);
n = *(GLsizei *)(pc + 0);
glCallLists(n, type, pc + 8);
}
void __glXDisp_DrawArrays(GLbyte *pc)
{
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
__GLXdispatchDrawArraysComponentHeader *compHeader;
GLint numVertexes = hdr->numVertexes;
GLint numComponents = hdr->numComponents;
GLenum primType = hdr->primType;
GLint stride = 0;
int i;
pc += sizeof(__GLXdispatchDrawArraysHeader);
compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
/* compute stride (same for all component arrays) */
for (i = 0; i < numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
/* set up component arrays */
for (i = 0; i < numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
GLenum component = compHeader[i].component;
switch (component) {
case GL_VERTEX_ARRAY:
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(numVals, datatype, stride, pc);
break;
case GL_NORMAL_ARRAY:
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(datatype, stride, pc);
break;
case GL_COLOR_ARRAY:
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(numVals, datatype, stride, pc);
break;
case GL_INDEX_ARRAY:
glEnableClientState(GL_INDEX_ARRAY);
glIndexPointer(datatype, stride, pc);
break;
case GL_TEXTURE_COORD_ARRAY:
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(numVals, datatype, stride, pc);
break;
case GL_EDGE_FLAG_ARRAY:
glEnableClientState(GL_EDGE_FLAG_ARRAY);
glEdgeFlagPointer(stride, (const GLboolean *)pc);
break;
case GL_SECONDARY_COLOR_ARRAY:
glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
glSecondaryColorPointer(numVals, datatype, stride, pc);
break;
case GL_FOG_COORD_ARRAY:
glEnableClientState(GL_FOG_COORD_ARRAY);
glFogCoordPointer(datatype, stride, pc);
break;
default:
break;
}
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
glDrawArrays(primType, 0, numVertexes);
/* turn off anything we might have turned on */
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_INDEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_EDGE_FLAG_ARRAY);
glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
glDisableClientState(GL_FOG_COORD_ARRAY);
}
void __glXDisp_DrawArraysEXT(GLbyte *pc)
{
__glXDisp_DrawArrays(pc);
}

View File

@@ -0,0 +1,391 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
#include "indirect_size.h"
void __glXDispSwap_Map1f(GLbyte *pc)
{
GLint order, k;
GLfloat u1, u2, *points;
GLenum target;
GLint compsize;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(pc + 0);
__GLX_SWAP_INT(pc + 12);
__GLX_SWAP_FLOAT(pc + 4);
__GLX_SWAP_FLOAT(pc + 8);
target = *(GLenum *)(pc + 0);
order = *(GLint *)(pc + 12);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
points = (GLfloat *)(pc + 16);
k = __glMap1f_size(target);
if (order <= 0 || k < 0) {
/* Erroneous command. */
compsize = 0;
} else {
compsize = order * k;
}
__GLX_SWAP_FLOAT_ARRAY(points, compsize);
glMap1f(target, u1, u2, k, order, points);
}
void __glXDispSwap_Map2f(GLbyte *pc)
{
GLint uorder, vorder, ustride, vstride, k;
GLfloat u1, u2, v1, v2, *points;
GLenum target;
GLint compsize;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(pc + 0);
__GLX_SWAP_INT(pc + 12);
__GLX_SWAP_INT(pc + 24);
__GLX_SWAP_FLOAT(pc + 4);
__GLX_SWAP_FLOAT(pc + 8);
__GLX_SWAP_FLOAT(pc + 16);
__GLX_SWAP_FLOAT(pc + 20);
target = *(GLenum *)(pc + 0);
uorder = *(GLint *)(pc + 12);
vorder = *(GLint *)(pc + 24);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
v1 = *(GLfloat *)(pc + 16);
v2 = *(GLfloat *)(pc + 20);
points = (GLfloat *)(pc + 28);
k = __glMap2f_size(target);
ustride = vorder * k;
vstride = k;
if (vorder <= 0 || uorder <= 0 || k < 0) {
/* Erroneous command. */
compsize = 0;
} else {
compsize = uorder * vorder * k;
}
__GLX_SWAP_FLOAT_ARRAY(points, compsize);
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDispSwap_Map1d(GLbyte *pc)
{
GLint order, k, compsize;
GLenum target;
GLdouble u1, u2, *points;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_DOUBLE(pc + 0);
__GLX_SWAP_DOUBLE(pc + 8);
__GLX_SWAP_INT(pc + 16);
__GLX_SWAP_INT(pc + 20);
target = *(GLenum*) (pc + 16);
order = *(GLint*) (pc + 20);
k = __glMap1d_size(target);
if (order <= 0 || k < 0) {
/* Erroneous command. */
compsize = 0;
} else {
compsize = order * k;
}
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
__GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize);
pc += 24;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap1d(target, u1, u2, k, order, points);
}
void __glXDispSwap_Map2d(GLbyte *pc)
{
GLdouble u1, u2, v1, v2, *points;
GLint uorder, vorder, ustride, vstride, k, compsize;
GLenum target;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_DOUBLE(pc + 0);
__GLX_SWAP_DOUBLE(pc + 8);
__GLX_SWAP_DOUBLE(pc + 16);
__GLX_SWAP_DOUBLE(pc + 24);
__GLX_SWAP_INT(pc + 32);
__GLX_SWAP_INT(pc + 36);
__GLX_SWAP_INT(pc + 40);
target = *(GLenum *)(pc + 32);
uorder = *(GLint *)(pc + 36);
vorder = *(GLint *)(pc + 40);
k = __glMap2d_size(target);
if (vorder <= 0 || uorder <= 0 || k < 0) {
/* Erroneous command. */
compsize = 0;
} else {
compsize = uorder * vorder * k;
}
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
__GLX_GET_DOUBLE(v1,pc+16);
__GLX_GET_DOUBLE(v2,pc+24);
__GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize);
pc += 44;
ustride = vorder * k;
vstride = k;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDispSwap_CallLists(GLbyte *pc)
{
GLenum type;
GLsizei n;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(pc + 4);
__GLX_SWAP_INT(pc + 0);
type = *(GLenum *)(pc + 4);
n = *(GLsizei *)(pc + 0);
switch (type) {
case GL_BYTE:
case GL_UNSIGNED_BYTE:
case GL_2_BYTES:
case GL_3_BYTES:
case GL_4_BYTES:
break;
case GL_SHORT:
case GL_UNSIGNED_SHORT:
__GLX_SWAP_SHORT_ARRAY(pc+8, n);
break;
case GL_INT:
case GL_UNSIGNED_INT:
__GLX_SWAP_INT_ARRAY(pc+8, n);
break;
case GL_FLOAT:
__GLX_SWAP_FLOAT_ARRAY(pc+8, n);
break;
}
glCallLists(n, type, pc+8);
}
static void swapArray(GLint numVals, GLenum datatype,
GLint stride, GLint numVertexes, GLbyte *pc)
{
int i,j;
__GLX_DECLARE_SWAP_VARIABLES;
switch (datatype) {
case GL_BYTE:
case GL_UNSIGNED_BYTE:
/* don't need to swap */
return;
case GL_SHORT:
case GL_UNSIGNED_SHORT:
for (i=0; i<numVertexes; i++) {
GLshort *pVal = (GLshort *) pc;
for (j=0; j<numVals; j++) {
__GLX_SWAP_SHORT(&pVal[j]);
}
pc += stride;
}
break;
case GL_INT:
case GL_UNSIGNED_INT:
for (i=0; i<numVertexes; i++) {
GLint *pVal = (GLint *) pc;
for (j=0; j<numVals; j++) {
__GLX_SWAP_INT(&pVal[j]);
}
pc += stride;
}
break;
case GL_FLOAT:
for (i=0; i<numVertexes; i++) {
GLfloat *pVal = (GLfloat *) pc;
for (j=0; j<numVals; j++) {
__GLX_SWAP_FLOAT(&pVal[j]);
}
pc += stride;
}
break;
case GL_DOUBLE:
for (i=0; i<numVertexes; i++) {
GLdouble *pVal = (GLdouble *) pc;
for (j=0; j<numVals; j++) {
__GLX_SWAP_DOUBLE(&pVal[j]);
}
pc += stride;
}
break;
default:
return;
}
}
void __glXDispSwap_DrawArrays(GLbyte *pc)
{
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
__GLXdispatchDrawArraysComponentHeader *compHeader;
GLint numVertexes = hdr->numVertexes;
GLint numComponents = hdr->numComponents;
GLenum primType = hdr->primType;
GLint stride = 0;
int i;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&numVertexes);
__GLX_SWAP_INT(&numComponents);
__GLX_SWAP_INT(&primType);
pc += sizeof(__GLXdispatchDrawArraysHeader);
compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
/* compute stride (same for all component arrays) */
for (i=0; i<numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
GLenum component = compHeader[i].component;
__GLX_SWAP_INT(&datatype);
__GLX_SWAP_INT(&numVals);
__GLX_SWAP_INT(&component);
stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
/* set up component arrays */
for (i=0; i<numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
GLenum component = compHeader[i].component;
swapArray(numVals, datatype, stride, numVertexes, pc);
switch (component) {
case GL_VERTEX_ARRAY:
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(numVals, datatype, stride, pc);
break;
case GL_NORMAL_ARRAY:
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(datatype, stride, pc);
break;
case GL_COLOR_ARRAY:
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(numVals, datatype, stride, pc);
break;
case GL_INDEX_ARRAY:
glEnableClientState(GL_INDEX_ARRAY);
glIndexPointer(datatype, stride, pc);
break;
case GL_TEXTURE_COORD_ARRAY:
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(numVals, datatype, stride, pc);
break;
case GL_EDGE_FLAG_ARRAY:
glEnableClientState(GL_EDGE_FLAG_ARRAY);
glEdgeFlagPointer(stride, (const GLboolean *)pc);
break;
default:
break;
}
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
glDrawArrays(primType, 0, numVertexes);
/* turn off anything we might have turned on */
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_INDEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_EDGE_FLAG_ARRAY);
}
void __glXDispSwap_DrawArraysEXT(GLbyte *pc)
{
__glXDispSwap_DrawArrays(pc);
}

View File

@@ -0,0 +1,310 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
void __glXDisp_PolygonStipple(GLbyte *pc)
{
__GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glPolygonStipple((GLubyte *)(hdr+1));
}
void __glXDisp_Bitmap(GLbyte *pc)
{
__GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glBitmap((GLsizei) hdr->width,
(GLsizei) hdr->height,
(GLfloat) hdr->xorig,
(GLfloat) hdr->yorig,
(GLfloat) hdr->xmove,
(GLfloat) hdr->ymove,
(GLubyte *)(hdr+1));
}
void __glXDisp_TexImage1D(GLbyte *pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexImage1D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->components,
(GLsizei) hdr->width,
(GLint) hdr->border,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexImage2D(GLbyte *pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexImage2D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->components,
(GLsizei) hdr->width,
(GLsizei) hdr->height,
(GLint) hdr->border,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexImage3D(GLbyte *pc)
{
__GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_DrawPixels(GLbyte *pc)
{
__GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glDrawPixels((GLsizei) hdr->width,
(GLsizei) hdr->height,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexSubImage1D(GLbyte *pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexSubImage1D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->xoffset,
(GLsizei) hdr->width,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexSubImage2D(GLbyte *pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexSubImage2D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->xoffset,
(GLint) hdr->yoffset,
(GLsizei) hdr->width,
(GLsizei) hdr->height,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexSubImage3D(GLbyte *pc)
{
__GLXdispatchTexSubImage3DHeader *hdr =
(__GLXdispatchTexSubImage3DHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
hdr->zoffset, hdr->width, hdr->height, hdr->depth,
hdr->format, hdr->type, (GLvoid *)(hdr+1));
}
void __glXDisp_ColorTable(GLbyte *pc)
{
__GLXdispatchColorTableHeader *hdr =
(__GLXdispatchColorTableHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glColorTable(hdr->target, hdr->internalformat,
hdr->width, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_ColorSubTable(GLbyte *pc)
{
__GLXdispatchColorSubTableHeader *hdr =
(__GLXdispatchColorSubTableHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
hdr->type, (GLvoid *)(hdr+1));
}
void __glXDisp_ConvolutionFilter1D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glConvolutionFilter1D(hdr->target, hdr->internalformat,
hdr->width, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_ConvolutionFilter2D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glConvolutionFilter2D(hdr->target, hdr->internalformat,
hdr->width, hdr->height, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_SeparableFilter2D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
GLint hdrlen, image1len;
hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE);
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
/* XXX check this usage - internal code called
** a version without the packing parameters
*/
image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
0, hdr->rowLength, 0, hdr->skipRows,
hdr->alignment);
image1len = __GLX_PAD(image1len);
glSeparableFilter2D(hdr->target, hdr->internalformat,
hdr->width, hdr->height, hdr->format, hdr->type,
((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
}

View File

@@ -0,0 +1,553 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
void __glXDispSwap_PolygonStipple(GLbyte *pc)
{
__GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glPolygonStipple((GLubyte *)(hdr+1));
}
void __glXDispSwap_Bitmap(GLbyte *pc)
{
__GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_FLOAT((GLbyte *)&hdr->xorig);
__GLX_SWAP_FLOAT((GLbyte *)&hdr->yorig);
__GLX_SWAP_FLOAT((GLbyte *)&hdr->xmove);
__GLX_SWAP_FLOAT((GLbyte *)&hdr->ymove);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glBitmap((GLsizei) hdr->width,
(GLsizei) hdr->height,
(GLfloat) hdr->xorig,
(GLfloat) hdr->yorig,
(GLfloat) hdr->xmove,
(GLfloat) hdr->ymove,
(GLubyte *)(hdr+1));
}
void __glXDispSwap_TexImage1D(GLbyte *pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->components);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->border);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexImage1D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->components,
(GLsizei) hdr->width,
(GLint) hdr->border,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexImage2D(GLbyte *pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->components);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->border);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexImage2D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->components,
(GLsizei) hdr->width,
(GLsizei) hdr->height,
(GLint) hdr->border,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexImage3D(GLbyte *pc)
{
__GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
__GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
__GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->depth);
__GLX_SWAP_INT((GLbyte *)&hdr->size4d);
__GLX_SWAP_INT((GLbyte *)&hdr->border);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_DrawPixels(GLbyte *pc)
{
__GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glDrawPixels((GLsizei) hdr->width,
(GLsizei) hdr->height,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexSubImage1D(GLbyte *pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexSubImage1D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->xoffset,
(GLsizei) hdr->width,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexSubImage2D(GLbyte *pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexSubImage2D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->xoffset,
(GLint) hdr->yoffset,
(GLsizei) hdr->width,
(GLsizei) hdr->height,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexSubImage3D(GLbyte *pc)
{
__GLXdispatchTexSubImage3DHeader *hdr =
(__GLXdispatchTexSubImage3DHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
__GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
__GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->zoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->depth);
__GLX_SWAP_INT((GLbyte *)&hdr->size4d);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
hdr->zoffset, hdr->width, hdr->height, hdr->depth,
hdr->format, hdr->type, (GLvoid *)(hdr+1));
}
void __glXDispSwap_ColorTable(GLbyte *pc)
{
__GLXdispatchColorTableHeader *hdr =
(__GLXdispatchColorTableHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glColorTable(hdr->target, hdr->internalformat,
hdr->width, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_ColorSubTable(GLbyte *pc)
{
__GLXdispatchColorSubTableHeader *hdr =
(__GLXdispatchColorSubTableHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->start);
__GLX_SWAP_INT((GLbyte *)&hdr->count);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
hdr->type, (GLvoid *)(hdr+1));
}
void __glXDispSwap_ConvolutionFilter1D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glConvolutionFilter2D(hdr->target, hdr->internalformat,
hdr->width, 1, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_ConvolutionFilter2D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glConvolutionFilter2D(hdr->target, hdr->internalformat,
hdr->width, hdr->height, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_SeparableFilter2D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
GLint hdrlen, image1len;
__GLX_DECLARE_SWAP_VARIABLES;
hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
/* XXX check this usage - internal code called
** a version without the packing parameters
*/
image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
0, hdr->rowLength, 0, hdr->skipRows,
hdr->alignment);
image1len = __GLX_PAD(image1len);
glSeparableFilter2D(hdr->target, hdr->internalformat,
hdr->width, hdr->height, hdr->format, hdr->type,
((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,425 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
#include "unpack.h"
#include "g_disptab.h"
int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
GLsizei size;
GLenum type;
__GLXcontext *cx;
int error;
REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
size = *(GLsizei *)(pc+0);
type = *(GLenum *)(pc+4);
if (cx->feedbackBufSize < size) {
cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
(size_t)size
* __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
cl->client->errorValue = size;
return BadAlloc;
}
cx->feedbackBufSize = size;
}
glFeedbackBuffer(size, type, cx->feedbackBuf);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
__GLXcontext *cx;
GLsizei size;
int error;
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
size = *(GLsizei *)(pc+0);
if (cx->selectBufSize < size) {
cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
(size_t) size
* __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
cl->client->errorValue = size;
return BadAlloc;
}
cx->selectBufSize = size;
}
glSelectBuffer(size, cx->selectBuf);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXRenderModeReply reply;
__GLXcontext *cx;
GLint nitems=0, retBytes=0, retval, newModeCheck;
GLubyte *retBuffer = NULL;
GLenum newMode;
int error;
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
newMode = *(GLenum*) pc;
retval = glRenderMode(newMode);
/* Check that render mode worked */
glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
if (newModeCheck != newMode) {
/* Render mode change failed. Bail */
newMode = newModeCheck;
goto noChangeAllowed;
}
/*
** Render mode might have still failed if we get here. But in this
** case we can't really tell, nor does it matter. If it did fail, it
** will return 0, and thus we won't send any data across the wire.
*/
switch (cx->renderMode) {
case GL_RENDER:
cx->renderMode = newMode;
break;
case GL_FEEDBACK:
if (retval < 0) {
/* Overflow happened. Copy the entire buffer */
nitems = cx->feedbackBufSize;
} else {
nitems = retval;
}
retBytes = nitems * __GLX_SIZE_FLOAT32;
retBuffer = (GLubyte*) cx->feedbackBuf;
cx->renderMode = newMode;
break;
case GL_SELECT:
if (retval < 0) {
/* Overflow happened. Copy the entire buffer */
nitems = cx->selectBufSize;
} else {
GLuint *bp = cx->selectBuf;
GLint i;
/*
** Figure out how many bytes of data need to be sent. Parse
** the selection buffer to determine this fact as the
** return value is the number of hits, not the number of
** items in the buffer.
*/
nitems = 0;
i = retval;
while (--i >= 0) {
GLuint n;
/* Parse select data for this hit */
n = *bp;
bp += 3 + n;
}
nitems = bp - cx->selectBuf;
}
retBytes = nitems * __GLX_SIZE_CARD32;
retBuffer = (GLubyte*) cx->selectBuf;
cx->renderMode = newMode;
break;
}
/*
** First reply is the number of elements returned in the feedback or
** selection array, as per the API for glRenderMode itself.
*/
noChangeAllowed:;
reply.length = nitems;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.retval = retval;
reply.size = nitems;
reply.newMode = newMode;
WriteToClient(client, sz_xGLXRenderModeReply, &reply);
if (retBytes) {
WriteToClient(client, retBytes, retBuffer);
}
return Success;
}
int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
__GLXcontext *cx;
int error;
REQUEST_SIZE_MATCH(xGLXSingleReq);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
glFlush();
__GLX_NOTE_FLUSHED_CMDS(cx);
return Success;
}
int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
__GLXcontext *cx;
int error;
REQUEST_SIZE_MATCH(xGLXSingleReq);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
/* Do a local glFinish */
glFinish();
__GLX_NOTE_FLUSHED_CMDS(cx);
/* Send empty reply packet to indicate finish is finished */
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
return Success;
}
#define SEPARATOR " "
char *__glXcombine_strings(const char *cext_string, const char *sext_string)
{
size_t clen, slen;
char *combo_string, *token, *s1;
const char *s2, *end;
/* safeguard to prevent potentially fatal errors in the string functions */
if (!cext_string)
cext_string = "";
if (!sext_string)
sext_string = "";
/*
** String can't be longer than min(cstring, sstring)
** pull tokens out of shortest string
** include space in combo_string for final separator and null terminator
*/
clen = strlen(cext_string);
slen = strlen(sext_string);
if (clen > slen) {
combo_string = (char *) malloc(slen + 2);
s1 = (char *) malloc(slen + 2);
strcpy(s1, sext_string);
s2 = cext_string;
} else {
combo_string = (char *) malloc(clen + 2);
s1 = (char *) malloc(clen + 2);
strcpy(s1, cext_string);
s2 = sext_string;
}
if (!combo_string || !s1) {
if (combo_string)
free(combo_string);
if (s1)
free(s1);
return NULL;
}
combo_string[0] = '\0';
/* Get first extension token */
token = strtok( s1, SEPARATOR);
while ( token != NULL ) {
/*
** if token in second string then save it
** beware of extension names which are prefixes of other extension names
*/
const char *p = s2;
end = p + strlen(p);
while (p < end) {
size_t n = strcspn(p, SEPARATOR);
if ((strlen(token) == n) && (strncmp(token, p, n) == 0)) {
combo_string = strcat(combo_string, token);
combo_string = strcat(combo_string, SEPARATOR);
}
p += (n + 1);
}
/* Get next extension token */
token = strtok( NULL, SEPARATOR);
}
free(s1);
return combo_string;
}
int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
{
ClientPtr client = cl->client;
__GLXcontext *cx;
GLenum name;
const char *string;
__GLX_DECLARE_SWAP_VARIABLES;
int error;
char *buf = NULL, *buf1 = NULL;
GLint length = 0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
/* If the client has the opposite byte order, swap the contextTag and
* the name.
*/
if ( need_swap ) {
__GLX_SWAP_INT(pc + 4);
__GLX_SWAP_INT(pc + __GLX_SINGLE_HDR_SIZE);
}
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
name = *(GLenum *)(pc + 0);
string = (const char *)glGetString(name);
/*
** Restrict extensions to those that are supported by both the
** implementation and the connection. That is, return the
** intersection of client, server, and core extension strings.
*/
if (name == GL_EXTENSIONS) {
buf1 = __glXcombine_strings(string,
cl->GLClientextensions);
buf = __glXcombine_strings(buf1,
cx->pGlxScreen->GLextensions);
if (buf1 != NULL) {
free(buf1);
}
string = buf;
}
else if ( name == GL_VERSION ) {
if ( atof( string ) > atof( GLServerVersion ) ) {
buf = malloc( strlen( string ) + strlen( GLServerVersion ) + 4 );
if ( buf == NULL ) {
string = GLServerVersion;
}
else {
sprintf( buf, "%s (%s)", GLServerVersion, string );
string = buf;
}
}
}
if (string) {
length = strlen((const char *) string) + 1;
}
__GLX_BEGIN_REPLY(length);
__GLX_PUT_SIZE(length);
if ( need_swap ) {
__GLX_SWAP_REPLY_SIZE();
__GLX_SWAP_REPLY_HEADER();
}
__GLX_SEND_HEADER();
WriteToClient(client, length, string);
if (buf != NULL) {
free(buf);
}
return Success;
}
int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc)
{
return DoGetString(cl, pc, GL_FALSE);
}
int __glXDisp_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
GLdouble answer[4];
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__glXClearErrorOccured();
glGetClipPlane(*(GLenum *)(pc + 0), answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(32);
__GLX_SEND_HEADER();
__GLX_SEND_DOUBLE_ARRAY(4);
}
return Success;
}

View File

@@ -0,0 +1,307 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
#include "unpack.h"
#include "g_disptab.h"
int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
GLsizei size;
GLenum type;
__GLX_DECLARE_SWAP_VARIABLES;
__GLXcontext *cx;
int error;
REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
size = *(GLsizei *)(pc+0);
type = *(GLenum *)(pc+4);
if (cx->feedbackBufSize < size) {
cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
(size_t) size
* __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
cl->client->errorValue = size;
return BadAlloc;
}
cx->feedbackBufSize = size;
}
glFeedbackBuffer(size, type, cx->feedbackBuf);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
__GLXcontext *cx;
GLsizei size;
__GLX_DECLARE_SWAP_VARIABLES;
int error;
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
size = *(GLsizei *)(pc+0);
if (cx->selectBufSize < size) {
cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
(size_t) size
* __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
cl->client->errorValue = size;
return BadAlloc;
}
cx->selectBufSize = size;
}
glSelectBuffer(size, cx->selectBuf);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
__GLXcontext *cx;
xGLXRenderModeReply reply;
GLint nitems=0, retBytes=0, retval, newModeCheck;
GLubyte *retBuffer = NULL;
GLenum newMode;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
int error;
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc);
newMode = *(GLenum*) pc;
retval = glRenderMode(newMode);
/* Check that render mode worked */
glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
if (newModeCheck != newMode) {
/* Render mode change failed. Bail */
newMode = newModeCheck;
goto noChangeAllowed;
}
/*
** Render mode might have still failed if we get here. But in this
** case we can't really tell, nor does it matter. If it did fail, it
** will return 0, and thus we won't send any data across the wire.
*/
switch (cx->renderMode) {
case GL_RENDER:
cx->renderMode = newMode;
break;
case GL_FEEDBACK:
if (retval < 0) {
/* Overflow happened. Copy the entire buffer */
nitems = cx->feedbackBufSize;
} else {
nitems = retval;
}
retBytes = nitems * __GLX_SIZE_FLOAT32;
retBuffer = (GLubyte*) cx->feedbackBuf;
__GLX_SWAP_FLOAT_ARRAY((GLbyte *)retBuffer, nitems);
cx->renderMode = newMode;
break;
case GL_SELECT:
if (retval < 0) {
/* Overflow happened. Copy the entire buffer */
nitems = cx->selectBufSize;
} else {
GLuint *bp = cx->selectBuf;
GLint i;
/*
** Figure out how many bytes of data need to be sent. Parse
** the selection buffer to determine this fact as the
** return value is the number of hits, not the number of
** items in the buffer.
*/
nitems = 0;
i = retval;
while (--i >= 0) {
GLuint n;
/* Parse select data for this hit */
n = *bp;
bp += 3 + n;
}
nitems = bp - cx->selectBuf;
}
retBytes = nitems * __GLX_SIZE_CARD32;
retBuffer = (GLubyte*) cx->selectBuf;
__GLX_SWAP_INT_ARRAY((GLbyte *)retBuffer, nitems);
cx->renderMode = newMode;
break;
}
/*
** First reply is the number of elements returned in the feedback or
** selection array, as per the API for glRenderMode itself.
*/
noChangeAllowed:;
reply.length = nitems;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.retval = retval;
reply.size = nitems;
reply.newMode = newMode;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.retval);
__GLX_SWAP_INT(&reply.size);
__GLX_SWAP_INT(&reply.newMode);
WriteToClient(client, sz_xGLXRenderModeReply, &reply);
if (retBytes) {
WriteToClient(client, retBytes, retBuffer);
}
return Success;
}
int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
__GLXcontext *cx;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXSingleReq);
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
glFlush();
__GLX_NOTE_FLUSHED_CMDS(cx);
return Success;
}
int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
__GLXcontext *cx;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXSingleReq);
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
/* Do a local glFinish */
glFinish();
__GLX_NOTE_FLUSHED_CMDS(cx);
/* Send empty reply packet to indicate finish is finished */
__GLX_BEGIN_REPLY(0);
__GLX_PUT_RETVAL(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
return Success;
}
int __glXDispSwap_GetString(__GLXclientState *cl, GLbyte *pc)
{
return DoGetString(cl, pc, GL_TRUE);
}
int __glXDispSwap_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
GLdouble answer[4];
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc + 0);
__glXClearErrorOccured();
glGetClipPlane(*(GLenum *)(pc + 0), answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
} else {
__GLX_SWAP_DOUBLE_ARRAY((GLbyte *)answer, 4);
__GLX_BEGIN_REPLY(32);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
__GLX_SEND_DOUBLE_ARRAY(4);
}
return Success;
}

View File

@@ -0,0 +1,469 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxext.h"
#include "singlesize.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
{
GLsizei width, height;
GLenum format, type;
GLboolean swapBytes, lsbFirst;
GLint compsize;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
width = *(GLsizei *)(pc + 8);
height = *(GLsizei *)(pc + 12);
format = *(GLenum *)(pc + 16);
type = *(GLenum *)(pc + 20);
swapBytes = *(GLboolean *)(pc + 24);
lsbFirst = *(GLboolean *)(pc + 25);
compsize = __glReadPixels_size(format,type,width,height);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glReadPixels(
*(GLint *)(pc + 0),
*(GLint *)(pc + 4),
*(GLsizei *)(pc + 8),
*(GLsizei *)(pc + 12),
*(GLenum *)(pc + 16),
*(GLenum *)(pc + 20),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetTexImage(__GLXclientState *cl, GLbyte *pc)
{
GLint level, compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0, height=0, depth=1;
REQUEST_FIXED_SIZE(xGLXSingleReq, 20);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
level = *(GLint *)(pc + 4);
format = *(GLenum *)(pc + 8);
type = *(GLenum *)(pc + 12);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 16);
glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
if ( target == GL_TEXTURE_3D) {
glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
}
/*
* The three queries above might fail if we're in a state where queries
* are illegal, but then width, height, and depth would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetTexImage(
*(GLenum *)(pc + 0),
*(GLint *)(pc + 4),
*(GLenum *)(pc + 8),
*(GLenum *)(pc + 12),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
((xGLXGetTexImageReply *)&__glXReply)->width = width;
((xGLXGetTexImageReply *)&__glXReply)->height = height;
((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
{
GLboolean lsbFirst;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
GLubyte answerBuffer[200];
char *answer;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
lsbFirst = *(GLboolean *)(pc + 0);
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
__GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
__glXClearErrorOccured();
glGetPolygonStipple(
(GLubyte *) answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(128);
__GLX_SEND_HEADER();
__GLX_SEND_BYTE_ARRAY(128);
}
return Success;
}
int __glXDisp_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize, compsize2;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0, height=0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
/* target must be SEPARABLE_2D, however I guess we can let the GL
barf on this one.... */
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
/*
* The two queries above might fail if we're in a state where queries
* are illegal, but then width and height would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
if ((compsize = safe_pad(compsize)) < 0) return BadLength;
if ((compsize2 = safe_pad(compsize2)) < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,safe_add(compsize, compsize2),1);
__glXClearErrorOccured();
glGetSeparableFilter(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer,
answer + compsize,
NULL
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize + compsize2);
((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize + compsize2);
}
return Success;
}
int __glXDisp_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0, height=0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
if (target == GL_CONVOLUTION_1D) {
height = 1;
} else {
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
}
/*
* The two queries above might fail if we're in a state where queries
* are illegal, but then width and height would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetConvolutionFilter(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetHistogram(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes, reset;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
reset = *(GLboolean *)(pc + 13);
glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
/*
* The one query above might fail if we're in a state where queries
* are illegal, but then width would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetHistogram( target, reset, format, type, answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
((xGLXGetHistogramReply *)&__glXReply)->width = width;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetMinmax(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes, reset;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
reset = *(GLboolean *)(pc + 13);
compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetMinmax( target, reset, format, type, answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetColorTable(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
target = *(GLenum *)(pc + 0);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
swapBytes = *(GLboolean *)(pc + 12);
glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
/*
* The one query above might fail if we're in a state where queries
* are illegal, but then width would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetColorTable(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
((xGLXGetColorTableReply *)&__glXReply)->width = width;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}

View File

@@ -0,0 +1,523 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxext.h"
#include "singlesize.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc)
{
GLsizei width, height;
GLenum format, type;
GLboolean swapBytes, lsbFirst;
GLint compsize;
__GLX_DECLARE_SWAP_VARIABLES;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
__GLX_SWAP_INT(pc+12);
__GLX_SWAP_INT(pc+16);
__GLX_SWAP_INT(pc+20);
width = *(GLsizei *)(pc + 8);
height = *(GLsizei *)(pc + 12);
format = *(GLenum *)(pc + 16);
type = *(GLenum *)(pc + 20);
swapBytes = *(GLboolean *)(pc + 24);
lsbFirst = *(GLboolean *)(pc + 25);
compsize = __glReadPixels_size(format,type,width,height);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glReadPixels(
*(GLint *)(pc + 0),
*(GLint *)(pc + 4),
*(GLsizei *)(pc + 8),
*(GLsizei *)(pc + 12),
*(GLenum *)(pc + 16),
*(GLenum *)(pc + 20),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc)
{
GLint level, compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLX_DECLARE_SWAP_VARIABLES;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0, height=0, depth=1;
REQUEST_FIXED_SIZE(xGLXSingleReq, 24);
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
__GLX_SWAP_INT(pc+12);
level = *(GLint *)(pc + 4);
format = *(GLenum *)(pc + 8);
type = *(GLenum *)(pc + 12);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 16);
glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
if ( target == GL_TEXTURE_3D) {
glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
}
/*
* The three queries above might fail if we're in a state where queries
* are illegal, but then width, height, and depth would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetTexImage(
*(GLenum *)(pc + 0),
*(GLint *)(pc + 4),
*(GLenum *)(pc + 8),
*(GLenum *)(pc + 12),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
__GLX_SWAP_INT(&height);
__GLX_SWAP_INT(&depth);
((xGLXGetTexImageReply *)&__glXReply)->width = width;
((xGLXGetTexImageReply *)&__glXReply)->height = height;
((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
{
GLboolean lsbFirst;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
GLubyte answerBuffer[200];
char *answer;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
lsbFirst = *(GLboolean *)(pc + 0);
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
__GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
__glXClearErrorOccured();
glGetPolygonStipple(
(GLubyte *) answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(128);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
__GLX_SEND_BYTE_ARRAY(128);
}
return Success;
}
int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize, compsize2;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
GLint width=0, height=0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
/* target must be SEPARABLE_2D, however I guess we can let the GL
barf on this one.... */
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
/*
* The two queries above might fail if we're in a state where queries
* are illegal, but then width and height would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
if ((compsize = safe_pad(compsize)) < 0) return BadLength;
if ((compsize2 = safe_pad(compsize2)) < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,safe_add(compsize, compsize2),1);
__glXClearErrorOccured();
glGetSeparableFilter(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer,
answer + compsize,
NULL
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize + compsize2);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
__GLX_SWAP_INT(&height);
((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
__GLX_SEND_VOID_ARRAY(compsize + compsize2);
}
return Success;
}
int __glXDispSwap_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
GLint width=0, height=0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
if (target == GL_CONVOLUTION_2D) {
height = 1;
} else {
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
}
/*
* The two queries above might fail if we're in a state where queries
* are illegal, but then width and height would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetConvolutionFilter(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
__GLX_SWAP_INT(&height);
((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetHistogram(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes, reset;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
GLint width=0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
reset = *(GLboolean *)(pc + 13);
glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
/*
* The one query above might fail if we're in a state where queries
* are illegal, but then width would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetHistogram( target, reset, format, type, answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
((xGLXGetHistogramReply *)&__glXReply)->width = width;
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetMinmax(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes, reset;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
reset = *(GLboolean *)(pc + 13);
compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetMinmax( target, reset, format, type, answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
GLint width=0;
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
/*
* The one query above might fail if we're in a state where queries
* are illegal, but then width would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
if (compsize < 0) return BadLength;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetColorTable(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
((xGLXGetColorTableReply *)&__glXReply)->width = width;
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,86 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _singlesize_h_
#define _singlesize_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 "indirect_size.h"
extern GLint __glReadPixels_size(GLenum format, GLenum type,
GLint width, GLint height);
extern GLint __glGetTexEnvfv_size(GLenum pname);
extern GLint __glGetTexEnviv_size(GLenum pname);
extern GLint __glGetTexGenfv_size(GLenum pname);
extern GLint __glGetTexGendv_size(GLenum pname);
extern GLint __glGetTexGeniv_size(GLenum pname);
extern GLint __glGetTexParameterfv_size(GLenum pname);
extern GLint __glGetTexParameteriv_size(GLenum pname);
extern GLint __glGetLightfv_size(GLenum pname);
extern GLint __glGetLightiv_size(GLenum pname);
extern GLint __glGetMap_size(GLenum pname, GLenum query);
extern GLint __glGetMapdv_size(GLenum target, GLenum query);
extern GLint __glGetMapfv_size(GLenum target, GLenum query);
extern GLint __glGetMapiv_size(GLenum target, GLenum query);
extern GLint __glGetMaterialfv_size(GLenum pname);
extern GLint __glGetMaterialiv_size(GLenum pname);
extern GLint __glGetPixelMap_size(GLenum map);
extern GLint __glGetPixelMapfv_size(GLenum map);
extern GLint __glGetPixelMapuiv_size(GLenum map);
extern GLint __glGetPixelMapusv_size(GLenum map);
extern GLint __glGet_size(GLenum sq);
extern GLint __glGetDoublev_size(GLenum sq);
extern GLint __glGetFloatv_size(GLenum sq);
extern GLint __glGetIntegerv_size(GLenum sq);
extern GLint __glGetBooleanv_size(GLenum sq);
extern GLint __glGetTexLevelParameterfv_size(GLenum pname);
extern GLint __glGetTexLevelParameteriv_size(GLenum pname);
extern GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
GLenum type, GLint width, GLint height,
GLint depth);
extern GLint __glGetColorTableParameterfv_size(GLenum pname);
extern GLint __glGetColorTableParameteriv_size(GLenum pname);
extern GLint __glGetConvolutionParameterfv_size(GLenum pname);
extern GLint __glGetConvolutionParameteriv_size(GLenum pname);
extern GLint __glGetHistogramParameterfv_size(GLenum pname);
extern GLint __glGetHistogramParameteriv_size(GLenum pname);
extern GLint __glGetMinmaxParameterfv_size(GLenum pname);
extern GLint __glGetMinmaxParameteriv_size(GLenum pname);
#endif /* _singlesize_h_ */

View File

@@ -0,0 +1,240 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef __GLX_unpack_h__
#define __GLX_unpack_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.
**
*/
#define __GLX_PAD(s) (((s)+3) & (GLuint)~3)
/*
** Fetch the context-id out of a SingleReq request pointed to by pc.
*/
#define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag)
#define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag)
/*
** Fetch a double from potentially unaligned memory.
*/
#ifdef __GLX_ALIGN64
#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n)
#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
#else
#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
#endif
extern void __glXMemInit(void);
extern xGLXSingleReply __glXReply;
#define __GLX_BEGIN_REPLY(size) \
__glXReply.length = __GLX_PAD(size) >> 2; \
__glXReply.type = X_Reply; \
__glXReply.sequenceNumber = client->sequence;
#define __GLX_SEND_HEADER() \
WriteToClient( client, sz_xGLXSingleReply, &__glXReply);
#define __GLX_PUT_RETVAL(a) \
__glXReply.retval = (a);
#define __GLX_PUT_SIZE(a) \
__glXReply.size = (a);
#define __GLX_PUT_RENDERMODE(m) \
__glXReply.pad3 = (m)
/*
** Get a buffer to hold returned data, with the given alignment. If we have
** to realloc, allocate size+align, in case the pointer has to be bumped for
** alignment. The answerBuffer should already be aligned.
**
** NOTE: the cast (long)res below assumes a long is large enough to hold a
** pointer.
*/
#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
if (size < 0) return BadLength; \
else if ((size) > sizeof(answerBuffer)) { \
int bump; \
if ((cl)->returnBufSize < (size)+(align)) { \
(cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
(size)+(align)); \
if (!(cl)->returnBuf) { \
return BadAlloc; \
} \
(cl)->returnBufSize = (size)+(align); \
} \
res = (char*)cl->returnBuf; \
bump = (long)(res) % (align); \
if (bump) res += (align) - (bump); \
} else { \
res = (char *)answerBuffer; \
}
#define __GLX_PUT_BYTE() \
*(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
#define __GLX_PUT_SHORT() \
*(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
#define __GLX_PUT_INT() \
*(GLint *)&__glXReply.pad3 = *(GLint *)answer
#define __GLX_PUT_FLOAT() \
*(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
#define __GLX_PUT_DOUBLE() \
*(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
#define __GLX_SEND_BYTE_ARRAY(len) \
WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer)
#define __GLX_SEND_SHORT_ARRAY(len) \
WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer)
#define __GLX_SEND_INT_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_INT32, answer)
#define __GLX_SEND_FLOAT_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer)
#define __GLX_SEND_DOUBLE_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer)
#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len)
#define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len)
/*
** PERFORMANCE NOTE:
** Machine dependent optimizations abound here; these swapping macros can
** conceivably be replaced with routines that do the job faster.
*/
#define __GLX_DECLARE_SWAP_VARIABLES \
GLbyte sw
#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \
GLbyte *swapPC; \
GLbyte *swapEnd
#define __GLX_SWAP_INT(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
((GLbyte *)(pc))[3] = sw; \
sw = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
((GLbyte *)(pc))[2] = sw;
#define __GLX_SWAP_SHORT(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = sw;
#define __GLX_SWAP_DOUBLE(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \
((GLbyte *)(pc))[7] = sw; \
sw = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \
((GLbyte *)(pc))[6] = sw; \
sw = ((GLbyte *)(pc))[2]; \
((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \
((GLbyte *)(pc))[5] = sw; \
sw = ((GLbyte *)(pc))[3]; \
((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \
((GLbyte *)(pc))[4] = sw;
#define __GLX_SWAP_FLOAT(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
((GLbyte *)(pc))[3] = sw; \
sw = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
((GLbyte *)(pc))[2] = sw;
#define __GLX_SWAP_INT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\
while (swapPC < swapEnd) { \
__GLX_SWAP_INT(swapPC); \
swapPC += __GLX_SIZE_INT32; \
}
#define __GLX_SWAP_SHORT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\
while (swapPC < swapEnd) { \
__GLX_SWAP_SHORT(swapPC); \
swapPC += __GLX_SIZE_INT16; \
}
#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\
while (swapPC < swapEnd) { \
__GLX_SWAP_DOUBLE(swapPC); \
swapPC += __GLX_SIZE_FLOAT64; \
}
#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\
while (swapPC < swapEnd) { \
__GLX_SWAP_FLOAT(swapPC); \
swapPC += __GLX_SIZE_FLOAT32; \
}
#define __GLX_SWAP_REPLY_HEADER() \
__GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \
__GLX_SWAP_INT(&__glXReply.length);
#define __GLX_SWAP_REPLY_RETVAL() \
__GLX_SWAP_INT(&__glXReply.retval)
#define __GLX_SWAP_REPLY_SIZE() \
__GLX_SWAP_INT(&__glXReply.size)
#endif /* !__GLX_unpack_h__ */

View File

@@ -0,0 +1,193 @@
/*
** 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.
**
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "glxserver.h"
#include "glxutil.h"
#include "g_disptab.h"
#include <unpack.h>
#include <GL/gl.h>
#include <pixmapstr.h>
#include <windowstr.h>
#include <dixfontstr.h>
extern XID clientErrorValue; /* imported kludge from dix layer */
/*
** Make a single GL bitmap from a single X glyph
*/
static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
{
int i, j;
int widthPadded; /* width of glyph in bytes, as padded by X */
int allocBytes; /* bytes to allocate to store bitmap */
int w; /* width of glyph in bits */
int h; /* height of glyph */
register unsigned char *pglyph;
register unsigned char *p;
unsigned char *allocbuf;
#define __GL_CHAR_BUF_SIZE 2048
unsigned char buf[__GL_CHAR_BUF_SIZE];
w = GLYPHWIDTHPIXELS(pci);
h = GLYPHHEIGHTPIXELS(pci);
widthPadded = GLYPHWIDTHBYTESPADDED(pci);
/*
** Use the local buf if possible, otherwise malloc.
*/
allocBytes = widthPadded * h;
if (allocBytes <= __GL_CHAR_BUF_SIZE) {
p = buf;
allocbuf = 0;
} else {
p = (unsigned char *) malloc(allocBytes);
if (!p)
return BadAlloc;
allocbuf = p;
}
/*
** We have to reverse the picture, top to bottom
*/
pglyph = FONTGLYPHBITS(FONTGLYPHS(font), pci) + (h-1)*widthPadded;
for (j=0; j < h; j++) {
for (i=0; i < widthPadded; i++) {
p[i] = pglyph[i];
}
pglyph -= widthPadded;
p += widthPadded;
}
glBitmap(w, h, -pci->metrics.leftSideBearing, pci->metrics.descent,
pci->metrics.characterWidth, 0, allocbuf ? allocbuf : buf);
if (allocbuf) {
free(allocbuf);
}
return Success;
#undef __GL_CHAR_BUF_SIZE
}
/*
** Create a GL bitmap for each character in the X font. The bitmap is stored
** in a display list.
*/
static int
MakeBitmapsFromFont(FontPtr pFont, int first, int count, int list_base)
{
unsigned long i, nglyphs;
CARD8 chs[2]; /* the font index we are going after */
CharInfoPtr pci;
int rv; /* return value */
int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit;
glPixelStorei(GL_UNPACK_SWAP_BYTES, FALSE);
glPixelStorei(GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
glPixelStorei(GL_UNPACK_ALIGNMENT, GLYPHPADBYTES);
for (i=0; i < count; i++) {
chs[0] = (first + i) >> 8; /* high byte is first byte */
chs[1] = first + i;
(*pFont->get_glyphs)(pFont, 1, chs, (FontEncoding)encoding,
&nglyphs, &pci);
/*
** Define a display list containing just a glBitmap() call.
*/
glNewList(list_base + i, GL_COMPILE);
if (nglyphs ) {
rv = __glXMakeBitmapFromGlyph(pFont, pci);
if (rv) {
return rv;
}
}
glEndList();
}
return Success;
}
/************************************************************************/
int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXUseXFontReq *req;
FontPtr pFont;
GC *pGC;
GLuint currentListIndex;
__GLXcontext *cx;
int error;
req = (xGLXUseXFontReq *) pc;
cx = __glXForceCurrent(cl, req->contextTag, &error);
if (!cx) {
return error;
}
glGetIntegerv(GL_LIST_INDEX, (GLint*) &currentListIndex);
if (currentListIndex != 0) {
/*
** A display list is currently being made. It is an error
** to try to make a font during another lists construction.
*/
client->errorValue = cx->id;
return __glXBadContextState;
}
/*
** Font can actually be either the ID of a font or the ID of a GC
** containing a font.
*/
pFont = (FontPtr)LookupIDByType(req->font, RT_FONT);
if (!pFont) {
pGC = (GC *)LookupIDByType(req->font, RT_GC);
if (!pGC) {
client->errorValue = req->font;
return BadFont;
}
pFont = pGC->font;
}
return MakeBitmapsFromFont(pFont, req->first, req->count,
req->listBase);
}

View File

@@ -0,0 +1,5 @@
/* no-op file to make current Mesa happy */
#ifndef _glx_ansic_h_
#define _glx_ansic_h_
#endif

View File

@@ -0,0 +1 @@
/* no-op file to make current Mesa happy */

View File

@@ -0,0 +1,52 @@
#include <Server.tmpl>
#define NeedAllMesaSrc
#define MesaInXServer
#define MesaBuildDir ../main/
#define MesaACBuildDir ../array_cache/
#define MesaMathBuildDir ../math/
#define MesaSwrastBuildDir ../swrast/
#define MesaSwrastSetupBuildDir ../swrast_setup/
#define MesaTnlBuildDir ../tnl/
#define MesaShaderBuildDir ../shader/
#define MesaGrammarBuildDir ../shader/grammar/
#define MesaSlangBuildDir ../shader/slang/
#define MesaXBuildDir ../X/
#include "../array_cache/Imakefile.inc"
#include "../swrast/Imakefile.inc"
#include "../swrast_setup/Imakefile.inc"
#include "../tnl/Imakefile.inc"
#include "../main/Imakefile.inc"
#include "../math/Imakefile.inc"
#include "../shader/Imakefile.inc"
#include "../shader/grammar/Imakefile.inc"
#include "../shader/slang/Imakefile.inc"
#include "../X/Imakefile.inc"
#include "../Imakefile.inc"
XOBJS = ../X/?*.o
OBJS = $(COREMESAOBJS) $(MOBJS)
DONES = ../main/DONE ../X/DONE ../array_cache/DONE \
../math/DONE ../swrast/DONE ../swrast_setup/DONE \
../tnl/DONE ../shader/DONE ../shader/grammar/DONE \
../shader/slang/DONE
INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \
-I$(MESASRCDIR)/include \
-I$(MESASRCDIR)/src/mesa \
-I$(SERVERSRC)/include
DEFINES = $(GLX_DEFINES)
NormalDepLibraryTarget(GLcore, $(DONES) $(OBJS), $(OBJS) $(XOBJS))
NormalLibraryObjectRule()
InstallDriverSDKLibraryModule(GLcore,$(DRIVERSDKMODULEDIR),extensions)
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,26 @@
#define IHaveSubdirs
SUBDIRS = main math array_cache swrast swrast_setup tnl shader X GLcore $(MODSUBDIR)
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaBuildDir /**/
#include "Imakefile.inc"
INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \
-I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include \
-I$(MESASRCDIR)/src/mesa \
-I$(SERVERSRC)/include
DEFINES = $(GLX_DEFINES)
NormalLibraryObjectRule()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
DependTarget()

View File

@@ -0,0 +1,51 @@
MESABUILDDIR = MesaBuildDir
COREMESASRCS = $(COREMESABASESRCS) \
$(MESA_AC_SRCS) \
$(MESA_MATH_SRCS) \
$(MESA_SWRAST_SRCS) \
$(MESA_SWR_SETUP_SRCS) \
$(MESA_TNL_SRCS) \
$(MESA_SHADER_SRCS) \
$(MESA_GRAMMAR_SRCS) \
$(MESA_SLANG_SRCS)
COREMESAOBJS = $(COREMESABASEOBJS) \
$(MESA_AC_OBJS) \
$(MESA_MATH_OBJS) \
$(MESA_SWRAST_OBJS) \
$(MESA_SWR_SETUP_OBJS) \
$(MESA_TNL_OBJS) \
$(MESA_SHADER_OBJS) \
$(MESA_GRAMMAR_OBJS) \
$(MESA_SLANG_OBJS)
COREMESAUOBJS = $(COREMESABASEUOBJS) \
$(MESA_AC_UOBJS) \
$(MESA_MATH_UOBJS) \
$(MESA_SWRAST_UOBJS) \
$(MESA_SWR_SETUP_UOBJS) \
$(MESA_TNL_UOBJS) \
$(MESA_SHADER_UOBJS) \
$(MESA_GRAMMAR_UOBJS) \
$(MESA_SLANG_UOBJS)
COREMESADOBJS = $(COREMESABASEDOBJS) \
$(MESA_AC_DOBJS) \
$(MESA_MATH_DOBJS) \
$(MESA_SWRAST_DOBJS) \
$(MESA_SWR_SETUP_DOBJS) \
$(MESA_TNL_DOBJS) \
$(MESA_SHADER_DOBJS) \
$(MESA_GRAMMAR_DOBJS) \
$(MESA_SLANG_DOBJS)
COREMESAPOBJS = $(COREMESABASEPOBJS) \
$(MESA_AC_POBJS) \
$(MESA_MATH_POBJS) \
$(MESA_SWRAST_POBJS) \
$(MESA_SWR_SETUP_POBJS) \
$(MESA_TNL_POBJS) \
$(MESA_SHADER_POBJS) \
$(MESA_GRAMMAR_POBJS) \
$(MESA_SLANG_POBJS)

View File

@@ -0,0 +1,63 @@
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaXBuildDir /**/
#define MesaInXServer
#include "Imakefile.inc"
LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11)
DRIVER_SRCS = $(XMESA_SRCS)
DRIVER_OBJS = $(XMESA_OBJS)
COMMON_SRCS = driverfuncs.c
COMMON_OBJS = driverfuncs.o
GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c
GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o
SRCS = $(DRIVER_SRCS) $(GLX_SRCS) $(COMMON_SRCS)
OBJS = $(DRIVER_OBJS) $(GLX_OBJS) $(COMMON_OBJS)
INCLUDES = -I$(SERVERSRC)/GL/mesa/X -I$(XINCLUDESRC) \
-I$(EXTINCSRC) \
-I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src -I$(MESASRCDIR)/src/mesa/drivers/x11 \
-I$(MESASRCDIR)/include \
-I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \
-I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \
-I$(SERVERSRC)/GL/glx \
-I$(XF86OSSRC) \
-I$(DRMSRCDIR)/shared-core \
`pkg-config --cflags-only-I pixman-1`
DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
#ifndef MesaDrvSrcDir
#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri
#endif
MESADRVSRCDIR = MesaDrvSrcDir
LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common)
LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common)

View File

@@ -0,0 +1,98 @@
MESAXBUILDDIR = MesaXBuildDir
#ifndef MesaInXServer
XMESA_GLX_SRCS = $(MESAXBUILDDIR)fakeglx.c \
$(MESAXBUILDDIR)glxapi.c \
$(MESAXBUILDDIR)realglx.c \
$(MESAXBUILDDIR)xfonts.c
#endif
XMESA_SRCS = $(XMESA_GLX_SRCS) \
$(MESAXBUILDDIR)xm_api.c \
$(MESAXBUILDDIR)xm_buffer.c \
$(MESAXBUILDDIR)xm_dd.c \
$(MESAXBUILDDIR)xm_line.c \
$(MESAXBUILDDIR)xm_span.c \
$(MESAXBUILDDIR)xm_tri.c
#ifdef NeedToLinkMesaSrc
#ifndef MesaInXServer
LinkSourceFile(fakeglx.c, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(glxapi.c, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(glxapi.h, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(realglx.c, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(xfonts.c, $(MESASRCDIR)/src/mesa/drivers/x11)
#endif
LinkSourceFile(xm_api.c, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(xm_buffer.c, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(xm_dd.c, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(xm_line.c, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(xm_span.c, $(MESASRCDIR)/src/mesa/drivers/x11)
LinkSourceFile(xm_tri.c, $(MESASRCDIR)/src/mesa/drivers/x11)
#endif
#ifndef MesaInXServer
XMESA_GLX_OBJS = $(MESAXBUILDDIR)fakeglx.o \
$(MESAXBUILDDIR)glxapi.o \
$(MESAXBUILDDIR)realglx.o \
$(MESAXBUILDDIR)xfonts.o
#endif
XMESA_OBJS = $(XMESA_GLX_OBJS) \
$(MESAXBUILDDIR)xm_api.o \
$(MESAXBUILDDIR)xm_buffer.o \
$(MESAXBUILDDIR)xm_dd.o \
$(MESAXBUILDDIR)xm_line.o \
$(MESAXBUILDDIR)xm_span.o \
$(MESAXBUILDDIR)xm_tri.o
#if defined(DoSharedLib) && DoSharedLib
#ifndef MesaInXServer
XMESA_GLX_UOBJS = $(MESAXBUILDDIR)unshared/fakeglx.o \
$(MESAXBUILDDIR)unshared/glxapi.o \
$(MESAXBUILDDIR)unshared/realglx.o \
$(MESAXBUILDDIR)unshared/xfonts.o
#endif
XMESA_UOBJS = $(XMESA_GLX_UOBJS) \
$(MESAXBUILDDIR)unshared/xm_api.o \
$(MESAXBUILDDIR)unshared/xm_buffer.o \
$(MESAXBUILDDIR)unshared/xm_dd.o \
$(MESAXBUILDDIR)unshared/xm_line.o \
$(MESAXBUILDDIR)unshared/xm_span.o \
$(MESAXBUILDDIR)unshared/xm_tri.o
#else
XMESA_GLX_UOBJS = $(XMESA_GLX_OBJS)
XMESA_UOBJS = $(XMESA_OBJS)
#endif
#ifndef MesaInXServer
XMESA_GLX_DOBJS = $(MESAXBUILDDIR)debugger/fakeglx.o \
$(MESAXBUILDDIR)debugger/glxapi.o \
$(MESAXBUILDDIR)debugger/realglx.o \
$(MESAXBUILDDIR)debugger/xfonts.o
#endif
XMESA_DOBJS = $(XMESA_GLX_DOBJS) \
$(MESAXBUILDDIR)debugger/xm_api.o \
$(MESAXBUILDDIR)debugger/xm_buffer.o \
$(MESAXBUILDDIR)debugger/xm_dd.o \
$(MESAXBUILDDIR)debugger/xm_line.o \
$(MESAXBUILDDIR)debugger/xm_span.o \
$(MESAXBUILDDIR)debugger/xm_tri.o
#ifndef MesaInXServer
XMESA_GLX_POBJS = $(MESAXBUILDDIR)profiled/fakeglx.o \
$(MESAXBUILDDIR)profiled/glxapi.o \
$(MESAXBUILDDIR)profiled/realglx.o \
$(MESAXBUILDDIR)profiled/xfonts.o
#endif
XMESA_POBJS = $(XMESA_GLX_POBJS) \
$(MESAXBUILDDIR)profiled/xm_api.o \
$(MESAXBUILDDIR)profiled/xm_buffer.o \
$(MESAXBUILDDIR)profiled/xm_dd.o \
$(MESAXBUILDDIR)profiled/xm_line.o \
$(MESAXBUILDDIR)profiled/xm_span.o \
$(MESAXBUILDDIR)profiled/xm_tri.o

View File

@@ -0,0 +1,950 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian E. Paul <brian@precisioninsight.com>
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <regionstr.h>
#include <resource.h>
#include <GL/gl.h>
#include <GL/glxint.h>
#include <GL/glxtokens.h>
#include <scrnintstr.h>
#include <config.h>
#include <glxserver.h>
#include <glxscreens.h>
#include <glxdrawable.h>
#include <glxcontext.h>
#include <glxext.h>
#include <glxutil.h>
#include "xf86glxint.h"
#include "context.h"
#include "xmesaP.h"
#include "context.h"
/*
* This define is for the glcore.h header file.
* If you add it here, then make sure you also add it in
* ../../../glx/Imakefile.
*/
#if 0
#define DEBUG
#include <GL/internal/glcore.h>
#undef DEBUG
#else
#include <GL/internal/glcore.h>
#endif
#include "glcontextmodes.h"
#ifdef NXAGENT_SERVER
#include "../main/WSDrawBuffer.h"
#endif
/*
* This structure is statically allocated in the __glXScreens[]
* structure. This struct is not used anywhere other than in
* __glXScreenInit to initialize each of the active screens
* (__glXActiveScreens[]). Several of the fields must be initialized by
* the screenProbe routine before they are copied to the active screens
* struct. In particular, the contextCreate, pGlxVisual, numVisuals,
* and numUsableVisuals fields must be initialized.
*/
static __GLXscreenInfo __glDDXScreenInfo = {
__MESA_screenProbe, /* Must be generic and handle all screens */
__MESA_createContext, /* Substitute screen's createContext routine */
__MESA_createBuffer, /* Substitute screen's createBuffer routine */
NULL, /* Set up modes in probe */
NULL, /* Set up pVisualPriv in probe */
0, /* Set up numVisuals in probe */
0, /* Set up numUsableVisuals in probe */
NULL, /* GLextensions is overwritten by __glXScreenInit */
"Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
"Version String", /* GLXversion is overwritten by __glXScreenInit */
"Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
NULL /* WrappedPositionWindow is overwritten */
};
#ifdef NXAGENT_SERVER
WSDrawBufferPtr pWSDrawBuffer = NULL;
void AddWSDrawBuffer(GLframebuffer *mesa_buffer)
{
WSDrawBufferPtr prevWSDB;
WSDrawBufferPtr newWSDB;
WSDrawBufferPtr p;
prevWSDB = NULL;
newWSDB = NULL;
p = pWSDrawBuffer;
while (p != NULL) {
prevWSDB = p;
if (prevWSDB -> DrawBuffer == mesa_buffer) {
return;
}
p = p -> next;
}
newWSDB = malloc(sizeof(WSDrawBufferRec));
newWSDB -> DrawBuffer = mesa_buffer;
newWSDB -> next = NULL;
if (pWSDrawBuffer == NULL)
pWSDrawBuffer = newWSDB;
else
prevWSDB -> next = newWSDB;
}
#endif
void *__glXglDDXScreenInfo(void) {
return &__glDDXScreenInfo;
}
static __GLXextensionInfo __glDDXExtensionInfo = {
GL_CORE_MESA,
__MESA_resetExtension,
__MESA_initVisuals,
__MESA_setVisualConfigs
};
void *__glXglDDXExtensionInfo(void) {
return &__glDDXExtensionInfo;
}
static __MESA_screen MESAScreens[MAXSCREENS];
static __GLcontext *MESA_CC = NULL;
static int numConfigs = 0;
static __GLXvisualConfig *visualConfigs = NULL;
static void **visualPrivates = NULL;
static int count_bits(unsigned int n)
{
int bits = 0;
while (n > 0) {
if (n & 1) bits++;
n >>= 1;
}
return bits;
}
static XMesaVisual find_mesa_visual(int screen, VisualID vid)
{
__MESA_screen * const pMScr = &MESAScreens[screen];
const __GLcontextModes *modes;
unsigned i = 0;
for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) {
if ( modes->visualID == vid ) {
break;
}
i++;
}
return (modes != NULL) ? pMScr->xm_vis[i] : NULL;
}
/*
* In the case the driver defines no GLX visuals we'll use these.
* Note that for TrueColor and DirectColor visuals, bufferSize is the
* sum of redSize, greenSize, blueSize and alphaSize, which may be larger
* than the nplanes/rootDepth of the server's X11 visuals
*/
#define NUM_FALLBACK_CONFIGS 5
static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
/* [0] = RGB, double buffered, Z */
{
-1, /* vid */
-1, /* class */
True, /* rgba */
-1, -1, -1, 0, /* rgba sizes */
-1, -1, -1, 0, /* rgba masks */
0, 0, 0, 0, /* rgba accum sizes */
True, /* doubleBuffer */
False, /* stereo */
-1, /* bufferSize */
16, /* depthSize */
0, /* stencilSize */
0, /* auxBuffers */
0, /* level */
GLX_NONE, /* visualRating */
GLX_NONE, /* transparentPixel */
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
0 /* transparentIndex */
},
/* [1] = RGB, double buffered, Z, stencil, accum */
{
-1, /* vid */
-1, /* class */
True, /* rgba */
-1, -1, -1, 0, /* rgba sizes */
-1, -1, -1, 0, /* rgba masks */
16, 16, 16, 0, /* rgba accum sizes */
True, /* doubleBuffer */
False, /* stereo */
-1, /* bufferSize */
16, /* depthSize */
8, /* stencilSize */
0, /* auxBuffers */
0, /* level */
GLX_NONE, /* visualRating */
GLX_NONE, /* transparentPixel */
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
0 /* transparentIndex */
},
/* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
{
-1, /* vid */
-1, /* class */
True, /* rgba */
-1, -1, -1, 8, /* rgba sizes */
-1, -1, -1, -1, /* rgba masks */
16, 16, 16, 16, /* rgba accum sizes */
True, /* doubleBuffer */
False, /* stereo */
-1, /* bufferSize */
16, /* depthSize */
8, /* stencilSize */
0, /* auxBuffers */
0, /* level */
GLX_NONE, /* visualRating */
GLX_NONE, /* transparentPixel */
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
0 /* transparentIndex */
},
/* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
{
-1, /* vid */
-1, /* class */
True, /* rgba */
-1, -1, -1, 8, /* rgba sizes */
-1, -1, -1, -1, /* rgba masks */
16, 16, 16, 16, /* rgba accum sizes */
False, /* doubleBuffer */
False, /* stereo */
-1, /* bufferSize */
16, /* depthSize */
8, /* stencilSize */
0, /* auxBuffers */
0, /* level */
GLX_NONE, /* visualRating */
GLX_NONE, /* transparentPixel */
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
0 /* transparentIndex */
},
/* [4] = CI, double buffered, Z */
{
-1, /* vid */
-1, /* class */
False, /* rgba? (false = color index) */
-1, -1, -1, 0, /* rgba sizes */
-1, -1, -1, 0, /* rgba masks */
0, 0, 0, 0, /* rgba accum sizes */
True, /* doubleBuffer */
False, /* stereo */
-1, /* bufferSize */
16, /* depthSize */
0, /* stencilSize */
0, /* auxBuffers */
0, /* level */
GLX_NONE, /* visualRating */
GLX_NONE, /* transparentPixel */
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
0 /* transparentIndex */
},
};
static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
VisualID *defaultVisp,
int ndepth, DepthPtr pdepth,
int rootDepth)
{
int numRGBconfigs;
int numCIconfigs;
int numVisuals = *nvisualp;
int numNewVisuals;
int numNewConfigs;
VisualPtr pVisual = *visualp;
VisualPtr pVisualNew = NULL;
VisualID *orig_vid = NULL;
__GLcontextModes *modes;
__GLXvisualConfig *pNewVisualConfigs = NULL;
void **glXVisualPriv;
void **pNewVisualPriv;
int found_default;
int i, j, k;
if (numConfigs > 0)
numNewConfigs = numConfigs;
else
numNewConfigs = NUM_FALLBACK_CONFIGS;
/* Alloc space for the list of new GLX visuals */
pNewVisualConfigs = (__GLXvisualConfig *)
malloc(numNewConfigs * sizeof(__GLXvisualConfig));
if (!pNewVisualConfigs) {
return FALSE;
}
/* Alloc space for the list of new GLX visual privates */
pNewVisualPriv = (void **) malloc(numNewConfigs * sizeof(void *));
if (!pNewVisualPriv) {
free(pNewVisualConfigs);
return FALSE;
}
/*
** If SetVisualConfigs was not called, then use default GLX
** visual configs.
*/
if (numConfigs == 0) {
memcpy(pNewVisualConfigs, FallbackConfigs,
NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
}
else {
/* copy driver's visual config info */
for (i = 0; i < numConfigs; i++) {
pNewVisualConfigs[i] = visualConfigs[i];
pNewVisualPriv[i] = visualPrivates[i];
}
}
/* Count the number of RGB and CI visual configs */
numRGBconfigs = 0;
numCIconfigs = 0;
for (i = 0; i < numNewConfigs; i++) {
if (pNewVisualConfigs[i].rgba)
numRGBconfigs++;
else
numCIconfigs++;
}
/* Count the total number of visuals to compute */
numNewVisuals = 0;
for (i = 0; i < numVisuals; i++) {
numNewVisuals +=
(pVisual[i].class == TrueColor || pVisual[i].class == DirectColor)
? numRGBconfigs : numCIconfigs;
}
/* Reset variables for use with the next screen/driver's visual configs */
visualConfigs = NULL;
numConfigs = 0;
/* Alloc temp space for the list of orig VisualIDs for each new visual */
orig_vid = (VisualID *)malloc(numNewVisuals * sizeof(VisualID));
if (!orig_vid) {
free(pNewVisualPriv);
free(pNewVisualConfigs);
return FALSE;
}
/* Alloc space for the list of glXVisuals */
modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
if (modes == NULL) {
free(orig_vid);
free(pNewVisualPriv);
free(pNewVisualConfigs);
return FALSE;
}
/* Alloc space for the list of glXVisualPrivates */
glXVisualPriv = (void **)malloc(numNewVisuals * sizeof(void *));
if (!glXVisualPriv) {
_gl_context_modes_destroy( modes );
free(orig_vid);
free(pNewVisualPriv);
free(pNewVisualConfigs);
return FALSE;
}
/* Alloc space for the new list of the X server's visuals */
pVisualNew = (VisualPtr)malloc(numNewVisuals * sizeof(VisualRec));
if (!pVisualNew) {
free(glXVisualPriv);
_gl_context_modes_destroy( modes );
free(orig_vid);
free(pNewVisualPriv);
free(pNewVisualConfigs);
return FALSE;
}
/* Initialize the new visuals */
found_default = FALSE;
MESAScreens[screenInfo.numScreens-1].modes = modes;
for (i = j = 0; i < numVisuals; i++) {
int is_rgb = (pVisual[i].class == TrueColor ||
pVisual[i].class == DirectColor);
for (k = 0; k < numNewConfigs; k++) {
if (pNewVisualConfigs[k].rgba != is_rgb)
continue;
assert( modes != NULL );
/* Initialize the new visual */
pVisualNew[j] = pVisual[i];
pVisualNew[j].vid = FakeClientID(0);
/* Check for the default visual */
if (!found_default && pVisual[i].vid == *defaultVisp) {
*defaultVisp = pVisualNew[j].vid;
found_default = TRUE;
}
/* Save the old VisualID */
orig_vid[j] = pVisual[i].vid;
/* Initialize the glXVisual */
_gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
modes->visualID = pVisualNew[j].vid;
/*
* If the class is -1, then assume the X visual information
* is identical to what GLX needs, and take them from the X
* visual. NOTE: if class != -1, then all other fields MUST
* be initialized.
*/
if (modes->visualType == GLX_NONE) {
modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
modes->redBits = count_bits(pVisual[i].redMask);
modes->greenBits = count_bits(pVisual[i].greenMask);
modes->blueBits = count_bits(pVisual[i].blueMask);
modes->alphaBits = modes->alphaBits;
modes->redMask = pVisual[i].redMask;
modes->greenMask = pVisual[i].greenMask;
modes->blueMask = pVisual[i].blueMask;
modes->alphaMask = modes->alphaMask;
modes->rgbBits = (is_rgb)
? (modes->redBits + modes->greenBits +
modes->blueBits + modes->alphaBits)
: rootDepth;
}
/* Save the device-dependent private for this visual */
glXVisualPriv[j] = pNewVisualPriv[k];
j++;
modes = modes->next;
}
}
assert(j <= numNewVisuals);
/* Save the GLX visuals in the screen structure */
MESAScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
MESAScreens[screenInfo.numScreens-1].private = glXVisualPriv;
/* Set up depth's VisualIDs */
for (i = 0; i < ndepth; i++) {
int numVids = 0;
VisualID *pVids = NULL;
int k, n = 0;
/* Count the new number of VisualIDs at this depth */
for (j = 0; j < pdepth[i].numVids; j++)
for (k = 0; k < numNewVisuals; k++)
if (pdepth[i].vids[j] == orig_vid[k])
numVids++;
/* Allocate a new list of VisualIDs for this depth */
pVids = (VisualID *)malloc(numVids * sizeof(VisualID));
/* Initialize the new list of VisualIDs for this depth */
for (j = 0; j < pdepth[i].numVids; j++)
for (k = 0; k < numNewVisuals; k++)
if (pdepth[i].vids[j] == orig_vid[k])
pVids[n++] = pVisualNew[k].vid;
/* Update this depth's list of VisualIDs */
free(pdepth[i].vids);
pdepth[i].vids = pVids;
pdepth[i].numVids = numVids;
}
/* Update the X server's visuals */
*nvisualp = numNewVisuals;
*visualp = pVisualNew;
/* Free the old list of the X server's visuals */
free(pVisual);
/* Clean up temporary allocations */
free(orig_vid);
free(pNewVisualPriv);
free(pNewVisualConfigs);
/* Free the private list created by DDX HW driver */
if (visualPrivates)
free(visualPrivates);
visualPrivates = NULL;
return TRUE;
}
void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
void **privates)
{
numConfigs = nconfigs;
visualConfigs = configs;
visualPrivates = privates;
}
Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp,
int *nvisualp, int *ndepthp, int *rootDepthp,
VisualID *defaultVisp, unsigned long sizes,
int bitsPerRGB)
{
/*
* Setup the visuals supported by this particular screen.
*/
return init_visuals(nvisualp, visualp, defaultVisp,
*ndepthp, *depthp, *rootDepthp);
}
static void fixup_visuals(int screen)
{
ScreenPtr pScreen = screenInfo.screens[screen];
__MESA_screen *pMScr = &MESAScreens[screen];
int j;
__GLcontextModes *modes;
for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) {
const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
const int nplanes = (modes->rgbBits - modes->alphaBits);
const VisualPtr pVis = pScreen->visuals;
/* Find a visual that matches the GLX visual's class and size */
for (j = 0; j < pScreen->numVisuals; j++) {
if (pVis[j].class == vis_class &&
pVis[j].nplanes == nplanes) {
/* Fixup the masks */
modes->redMask = pVis[j].redMask;
modes->greenMask = pVis[j].greenMask;
modes->blueMask = pVis[j].blueMask;
/* Recalc the sizes */
modes->redBits = count_bits(modes->redMask);
modes->greenBits = count_bits(modes->greenMask);
modes->blueBits = count_bits(modes->blueMask);
}
}
}
}
static void init_screen_visuals(int screen)
{
ScreenPtr pScreen = screenInfo.screens[screen];
__GLcontextModes *modes;
XMesaVisual *pXMesaVisual;
int *used;
int i, j;
/* Alloc space for the list of XMesa visuals */
pXMesaVisual = (XMesaVisual *)malloc(MESAScreens[screen].num_vis *
sizeof(XMesaVisual));
memset(pXMesaVisual, 0,
MESAScreens[screen].num_vis * sizeof(XMesaVisual));
/* FIXME: Change 'used' to be a array of bits (rather than of ints),
* FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less
* FIXME: than 64 or 128 the stack array can be used instead of calling
* FIXME: malloc / free. If nothing else, convert 'used' to
* FIXME: array of bytes instead of ints!
*/
used = (int *)malloc(pScreen->numVisuals * sizeof(int));
memset(used, 0, pScreen->numVisuals * sizeof(int));
i = 0;
for ( modes = MESAScreens[screen].modes
; modes != NULL
; modes = modes->next ) {
const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
const int nplanes = (modes->rgbBits - modes->alphaBits);
const VisualPtr pVis = pScreen->visuals;
for (j = 0; j < pScreen->numVisuals; j++) {
if (pVis[j].class == vis_class &&
pVis[j].nplanes == nplanes &&
pVis[j].redMask == modes->redMask &&
pVis[j].greenMask == modes->greenMask &&
pVis[j].blueMask == modes->blueMask &&
!used[j]) {
/* Create the XMesa visual */
pXMesaVisual[i] =
XMesaCreateVisual(pScreen,
pVis,
modes->rgbMode,
(modes->alphaBits > 0),
modes->doubleBufferMode,
modes->stereoMode,
GL_TRUE, /* ximage_flag */
modes->depthBits,
modes->stencilBits,
modes->accumRedBits,
modes->accumGreenBits,
modes->accumBlueBits,
modes->accumAlphaBits,
modes->samples,
modes->level,
modes->visualRating);
/* Set the VisualID */
modes->visualID = pVis[j].vid;
/* Mark this visual used */
used[j] = 1;
break;
}
}
if ( j == pScreen->numVisuals ) {
ErrorF("No matching visual for __GLcontextMode with "
"visual class = %d (%d), nplanes = %u\n",
vis_class,
modes->visualType,
(modes->rgbBits - modes->alphaBits) );
}
else if ( modes->visualID == -1 ) {
FatalError( "Matching visual found, but visualID still -1!\n" );
}
i++;
}
free(used);
MESAScreens[screen].xm_vis = pXMesaVisual;
}
Bool __MESA_screenProbe(int screen)
{
/*
* Set up the current screen's visuals.
*/
__glDDXScreenInfo.modes = MESAScreens[screen].modes;
__glDDXScreenInfo.pVisualPriv = MESAScreens[screen].private;
__glDDXScreenInfo.numVisuals =
__glDDXScreenInfo.numUsableVisuals = MESAScreens[screen].num_vis;
/*
* Set the current screen's createContext routine. This could be
* wrapped by a DDX GLX context creation routine.
*/
__glDDXScreenInfo.createContext = __MESA_createContext;
/*
* The ordering of the rgb compenents might have been changed by the
* driver after mi initialized them.
*/
fixup_visuals(screen);
/*
* Find the GLX visuals that are supported by this screen and create
* XMesa's visuals.
*/
init_screen_visuals(screen);
return TRUE;
}
extern void __MESA_resetExtension(void)
{
int i, j;
XMesaReset();
for (i = 0; i < screenInfo.numScreens; i++) {
for (j = 0; j < MESAScreens[i].num_vis; j++) {
if (MESAScreens[i].xm_vis[j]) {
XMesaDestroyVisual(MESAScreens[i].xm_vis[j]);
MESAScreens[i].xm_vis[j] = NULL;
}
}
_gl_context_modes_destroy( MESAScreens[i].modes );
MESAScreens[i].modes = NULL;
free(MESAScreens[i].private);
MESAScreens[i].private = NULL;
free(MESAScreens[i].xm_vis);
MESAScreens[i].xm_vis = NULL;
MESAScreens[i].num_vis = 0;
}
__glDDXScreenInfo.modes = NULL;
MESA_CC = NULL;
}
void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv)
{
DrawablePtr pDraw = glxPriv->pDraw;
XMesaVisual xm_vis = find_mesa_visual(pDraw->pScreen->myNum,
glxPriv->modes->visualID);
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
__MESA_buffer buf;
if (xm_vis == NULL) {
ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
glxPriv->modes->visualID);
}
buf = (__MESA_buffer)malloc(sizeof(struct __MESA_bufferRec));
/* Create Mesa's buffers */
if (glxPriv->type == DRAWABLE_WINDOW) {
buf->xm_buf = (void *)XMesaCreateWindowBuffer(xm_vis,
(WindowPtr)pDraw);
} else {
buf->xm_buf = (void *)XMesaCreatePixmapBuffer(xm_vis,
(PixmapPtr)pDraw, 0);
}
/* Wrap the front buffer's resize routine */
buf->fbresize = glPriv->frontBuffer.resize;
glPriv->frontBuffer.resize = __MESA_resizeBuffers;
/* Wrap the swap buffers routine */
buf->fbswap = glxPriv->swapBuffers;
glxPriv->swapBuffers = __MESA_swapBuffers;
/* Save Mesa's private buffer structure */
glPriv->private = (void *)buf;
glPriv->freePrivate = __MESA_destroyBuffer;
}
GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer,
GLint x, GLint y,
GLuint width, GLuint height,
__GLdrawablePrivate *glPriv,
GLuint bufferMask)
{
__MESA_buffer buf = (__MESA_buffer)glPriv->private;
if (buf->xm_buf)
XMesaResizeBuffers(buf->xm_buf);
return (*buf->fbresize)(buffer, x, y, width, height, glPriv, bufferMask);
}
GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv)
{
__MESA_buffer buf = (__MESA_buffer)glxPriv->glPriv.private;
/*
** Do not call the wrapped swap buffers routine since Mesa has
** already done the swap.
*/
XMesaSwapBuffers(buf->xm_buf);
return GL_TRUE;
}
void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv)
{
__MESA_buffer buf = (__MESA_buffer)glPriv->private;
__GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
#ifdef NXAGENT_SERVER
AddWSDrawBuffer(& (buf -> xm_buf -> mesa_buffer) );
#endif
/* Destroy Mesa's buffers */
if (buf->xm_buf)
XMesaDestroyBuffer(buf->xm_buf);
/* Unwrap these routines */
glxPriv->swapBuffers = buf->fbswap;
glPriv->frontBuffer.resize = buf->fbresize;
free(glPriv->private);
glPriv->private = NULL;
}
__GLinterface *__MESA_createContext(__GLimports *imports,
__GLcontextModes *modes,
__GLinterface *shareGC)
{
__GLcontext *gl_ctx = NULL;
__GLcontext *m_share = NULL;
__GLXcontext *glxc = (__GLXcontext *)imports->other;
XMesaVisual xm_vis;
if (shareGC)
m_share = (__GLcontext *)shareGC;
xm_vis = find_mesa_visual(glxc->pScreen->myNum, glxc->modes->visualID);
if (xm_vis) {
XMesaContext xmshare = m_share ? m_share->DriverCtx : 0;
XMesaContext xmctx = XMesaCreateContext(xm_vis, xmshare);
gl_ctx = xmctx ? &xmctx->mesa : 0;
}
else {
ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
glxc->modes->visualID);
}
if (!gl_ctx)
return NULL;
gl_ctx->imports = *imports;
gl_ctx->exports.destroyContext = __MESA_destroyContext;
gl_ctx->exports.loseCurrent = __MESA_loseCurrent;
gl_ctx->exports.makeCurrent = __MESA_makeCurrent;
gl_ctx->exports.shareContext = __MESA_shareContext;
gl_ctx->exports.copyContext = __MESA_copyContext;
gl_ctx->exports.forceCurrent = __MESA_forceCurrent;
gl_ctx->exports.notifyResize = __MESA_notifyResize;
gl_ctx->exports.notifyDestroy = __MESA_notifyDestroy;
gl_ctx->exports.notifySwapBuffers = __MESA_notifySwapBuffers;
gl_ctx->exports.dispatchExec = __MESA_dispatchExec;
gl_ctx->exports.beginDispatchOverride = __MESA_beginDispatchOverride;
gl_ctx->exports.endDispatchOverride = __MESA_endDispatchOverride;
return (__GLinterface *)gl_ctx;
}
GLboolean __MESA_destroyContext(__GLcontext *gc)
{
XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
XMesaDestroyContext( xmesa );
return GL_TRUE;
}
GLboolean __MESA_loseCurrent(__GLcontext *gc)
{
XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
MESA_CC = NULL;
__glXLastContext = NULL;
return XMesaLoseCurrent(xmesa);
}
GLboolean __MESA_makeCurrent(__GLcontext *gc)
{
__GLdrawablePrivate *drawPriv = gc->imports.getDrawablePrivate( gc );
__MESA_buffer drawBuf = (__MESA_buffer)drawPriv->private;
__GLdrawablePrivate *readPriv = gc->imports.getReadablePrivate( gc );
__MESA_buffer readBuf = (__MESA_buffer)readPriv->private;
XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
MESA_CC = gc;
return XMesaMakeCurrent2(xmesa, drawBuf->xm_buf, readBuf->xm_buf);
}
GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare)
{
/* NOT_DONE */
/* XXX I don't see where/how this could ever be called */
ErrorF("__MESA_shareContext\n");
return GL_FALSE;
}
GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src,
GLuint mask)
{
XMesaContext xm_dst = (XMesaContext) dst->DriverCtx;
const XMesaContext xm_src = (const XMesaContext) src->DriverCtx;
_mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask);
return GL_TRUE;
}
GLboolean __MESA_forceCurrent(__GLcontext *gc)
{
XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
MESA_CC = gc;
return XMesaForceCurrent(xmesa);
}
GLboolean __MESA_notifyResize(__GLcontext *gc)
{
/* NOT_DONE */
ErrorF("__MESA_notifyResize\n");
return GL_FALSE;
}
void __MESA_notifyDestroy(__GLcontext *gc)
{
/* NOT_DONE */
ErrorF("__MESA_notifyDestroy\n");
return;
}
void __MESA_notifySwapBuffers(__GLcontext *gc)
{
_mesa_notifySwapBuffers(gc);
}
struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc)
{
/* NOT_DONE */
ErrorF("__MESA_dispatchExec\n");
return NULL;
}
void __MESA_beginDispatchOverride(__GLcontext *gc)
{
/* NOT_DONE */
ErrorF("__MESA_beginDispatchOverride\n");
return;
}
void __MESA_endDispatchOverride(__GLcontext *gc)
{
/* NOT_DONE */
ErrorF("__MESA_endDispatchOverride\n");
return;
}
/*
* Server-side GLX uses these functions which are normally defined
* in the OpenGL SI.
*/
GLuint __glFloorLog2(GLuint val)
{
int c = 0;
while (val > 1) {
c++;
val >>= 1;
}
return c;
}

View File

@@ -0,0 +1,151 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian Paul <brian@precisioninsight.com>
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <gcstruct.h>
#include "pixmapstr.h"
#include "xf86glx_util.h"
#include <nx-X11/Xmd.h>
#ifdef ROUNDUP
#undef ROUNDUP
#endif
#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3))
XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data)
{
XMesaImage *image;
image = (XMesaImage *)malloc(sizeof(XMesaImage));
if (image) {
image->width = width;
image->height = height;
image->data = data;
/* Always pad to 32 bits */
image->bytes_per_line = ROUNDUP((bitsPerPixel * width), 32);
image->bits_per_pixel = bitsPerPixel;
}
return image;
}
void XMesaDestroyImage(XMesaImage *image)
{
if (image->data)
free(image->data);
free(image);
}
unsigned long XMesaGetPixel(XMesaImage *image, int x, int y)
{
CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line);
CARD8 *i8;
CARD16 *i16;
CARD32 *i32;
switch (image->bits_per_pixel) {
case 8:
i8 = (CARD8 *)row;
return i8[x];
break;
case 15:
case 16:
i16 = (CARD16 *)row;
return i16[x];
break;
case 24: /* WARNING: architecture specific code */
i8 = (CARD8 *)row;
return (((CARD32)i8[x*3]) |
(((CARD32)i8[x*3+1])<<8) |
(((CARD32)i8[x*3+2])<<16));
break;
case 32:
i32 = (CARD32 *)row;
return i32[x];
break;
}
return 0;
}
#ifndef XMESA_USE_PUTPIXEL_MACRO
void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel)
{
CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line);
CARD8 *i8;
CARD16 *i16;
CARD32 *i32;
switch (image->bits_per_pixel) {
case 8:
i8 = (CARD8 *)row;
i8[x] = (CARD8)pixel;
break;
case 15:
case 16:
i16 = (CARD16 *)row;
i16[x] = (CARD16)pixel;
break;
case 24: /* WARNING: architecture specific code */
i8 = (CARD8 *)__row;
i8[x*3] = (CARD8)(p);
i8[x*3+1] = (CARD8)(p>>8);
i8[x*3+2] = (CARD8)(p>>16);
case 32:
i32 = (CARD32 *)row;
i32[x] = (CARD32)pixel;
break;
}
}
#endif
void XMesaPutImageHelper(ScreenPtr display,
DrawablePtr d, GCPtr gc,
XMesaImage *image,
int src_x, int src_y,
int dest_x, int dest_y,
unsigned int width, unsigned int height)
{
/* NOT_DONE: Verify that the following works for all depths */
char *src = (image->data +
src_y * image->bytes_per_line +
((src_x * image->bits_per_pixel) >> 3));
ValidateGC(d, gc);
(*gc->ops->PutImage)(d, gc, d->depth, dest_x, dest_y, width, height,
0, ZPixmap, src);
}

View File

@@ -0,0 +1,105 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian Paul <brian@precisioninsight.com>
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _XF86GLX_UTIL_H_
#define _XF86GLX_UTIL_H_
#ifdef __CYGWIN__
#undef WIN32
#undef _WIN32
#endif
#include <screenint.h>
#include <pixmap.h>
#include <gc.h>
#include "GL/xmesa.h"
#define XMESA_USE_PUTPIXEL_MACRO
struct _XMesaImageRec {
int width, height;
char *data;
int bytes_per_line; /* Padded to 32 bits */
int bits_per_pixel;
};
extern XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height,
char *data);
extern void XMesaDestroyImage(XMesaImage *image);
extern unsigned long XMesaGetPixel(XMesaImage *image, int x, int y);
#ifdef XMESA_USE_PUTPIXEL_MACRO
#define XMesaPutPixel(__i,__x,__y,__p) \
{ \
CARD8 *__row = (CARD8 *)(__i->data + __y*__i->bytes_per_line); \
CARD8 *__i8; \
CARD16 *__i16; \
CARD32 *__i32; \
switch (__i->bits_per_pixel) { \
case 8: \
__i8 = (CARD8 *)__row; \
__i8[__x] = (CARD8)__p; \
break; \
case 15: \
case 16: \
__i16 = (CARD16 *)__row; \
__i16[__x] = (CARD16)__p; \
break; \
case 24: /* WARNING: architecture specific code */ \
__i8 = (CARD8 *)__row; \
__i8[__x*3] = (CARD8)(__p); \
__i8[__x*3+1] = (CARD8)(__p>>8); \
__i8[__x*3+2] = (CARD8)(__p>>16); \
break; \
case 32: \
__i32 = (CARD32 *)__row; \
__i32[__x] = (CARD32)__p; \
break; \
} \
}
#else
extern void XMesaPutPixel(XMesaImage *image, int x, int y,
unsigned long pixel);
#endif
extern void XMesaPutImageHelper(ScreenPtr display,
DrawablePtr d, GCPtr gc,
XMesaImage *image,
int src_x, int src_y,
int dest_x, int dest_y,
unsigned int width, unsigned int height);
#endif /* _XF86GLX_UTIL_H_ */

View File

@@ -0,0 +1,101 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _XF86GLXINT_H_
#define _XF86GLXINT_H_
#include <miscstruct.h>
#include <GL/gl.h>
#include <GL/xmesa.h>
typedef struct __MESA_screenRec __MESA_screen;
struct __MESA_screenRec {
int num_vis;
__GLcontextModes *modes;
XMesaVisual *xm_vis;
void **private;
};
typedef struct __MESA_bufferRec *__MESA_buffer;
struct __MESA_bufferRec {
XMesaBuffer xm_buf;
GLboolean (*fbresize)(__GLdrawableBuffer *buf,
GLint x, GLint y, GLuint width, GLuint height,
__GLdrawablePrivate *glPriv, GLuint bufferMask);
GLboolean (*fbswap)(__GLXdrawablePrivate *glxPriv);
};
extern void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
void **privates);
extern Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp,
int *nvisualp, int *ndepthp, int *rootDepthp,
VisualID *defaultVisp, unsigned long sizes,
int bitsPerRGB);
extern Bool __MESA_screenProbe(int screen);
extern void __MESA_resetExtension(void);
extern void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv);
extern GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buf,
GLint x, GLint y,
GLuint width, GLuint height,
__GLdrawablePrivate *glPriv,
GLuint bufferMask);
extern GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv);
extern void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv);
extern __GLinterface *__MESA_createContext(__GLimports *imports,
__GLcontextModes *modes,
__GLinterface *shareGC);
extern GLboolean __MESA_destroyContext(__GLcontext *gc);
extern GLboolean __MESA_loseCurrent(__GLcontext *gc);
extern GLboolean __MESA_makeCurrent(__GLcontext *gc);
extern GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare);
extern GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src,
GLuint mask);
extern GLboolean __MESA_forceCurrent(__GLcontext *gc);
extern GLboolean __MESA_notifyResize(__GLcontext *gc);
extern void __MESA_notifyDestroy(__GLcontext *gc);
extern void __MESA_notifySwapBuffers(__GLcontext *gc);
extern struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc);
extern void __MESA_beginDispatchOverride(__GLcontext *gc);
extern void __MESA_endDispatchOverride(__GLcontext *gc);
extern GLuint __glFloorLog2(GLuint val);
#endif /* _XF86GLXINT_H_ */

View File

@@ -0,0 +1,36 @@
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaACBuildDir /**/
#include "Imakefile.inc"
SRCS = $(MESA_AC_SRCS)
OBJS = $(MESA_AC_OBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/array_cache \
-I$(MESASRCDIR)/src/mesa/math \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,28 @@
MESAACBUILDDIR = MesaACBuildDir
MESA_AC_SRCS = $(MESAACBUILDDIR)ac_context.c \
$(MESAACBUILDDIR)ac_import.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(acache.h, $(MESASRCDIR)/src/mesa/array_cache)
LinkSourceFile(ac_context.c, $(MESASRCDIR)/src/mesa/array_cache)
LinkSourceFile(ac_context.h, $(MESASRCDIR)/src/mesa/array_cache)
LinkSourceFile(ac_import.c, $(MESASRCDIR)/src/mesa/array_cache)
#endif
MESA_AC_OBJS = $(MESAACBUILDDIR)ac_context.o \
$(MESAACBUILDDIR)ac_import.o
#if defined(DoSharedLib) && DoSharedLib
MESA_AC_UOBJS = $(MESAACBUILDDIR)unshared/ac_context.o \
$(MESAACBUILDDIR)unshared/ac_import.o
#else
MESA_AC_UOBJS = $(MESA_AC_OBJS)
#endif
MESA_AC_DOBJS = $(MESAACBUILDDIR)debugger/ac_context.o \
$(MESAACBUILDDIR)debugger/ac_import.o
MESA_AC_POBJS = $(MESAACBUILDDIR)profiled/ac_context.o \
$(MESAACBUILDDIR)profiled/ac_import.o

View File

@@ -0,0 +1,40 @@
/* Large PIC tables needed for Solaris/SPARC builds */
#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
PICFLAGS = LargePositionIndependentCFlags
#endif
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaBuildDir /**/
#include "Imakefile.inc"
SRCS = $(COREMESABASESRCS)
OBJS = $(COREMESABASEOBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,481 @@
/* gcc on ppc64 defines this, causes macro recursion with pixel below */
#undef pixel
MESABUILDDIR = MesaBuildDir
#ifdef NeedAllMesaSrc
DISPATCHSRCS = $(MESABUILDDIR)dispatch.c
GLAPISRCS = $(MESABUILDDIR)glapi.c
GLTHREADSRCS = $(MESABUILDDIR)glthread.c
#endif
MESA_CORE_INCLUDES = -I$(MESASRCDIR)/src/array_cache \
-I$(MESASRCDIR)/src/math -I$(MESASRCDIR)/src/shader \
-I$(MESASRCDIR)/src/swrast -I$(MESASRCDIR)/src/swrast_setup \
-I$(MESASRCDIR)/src/tnl -I$(MESASRCDIR)/src/tnl_dd
COREMESABASESRCS = \
$(MESABUILDDIR)api_arrayelt.c \
$(MESABUILDDIR)api_loopback.c \
$(MESABUILDDIR)api_noop.c \
$(MESABUILDDIR)api_validate.c \
$(MESABUILDDIR)accum.c \
$(MESABUILDDIR)attrib.c \
$(MESABUILDDIR)blend.c \
$(MESABUILDDIR)bufferobj.c \
$(MESABUILDDIR)buffers.c \
$(MESABUILDDIR)clip.c \
$(MESABUILDDIR)colortab.c \
$(MESABUILDDIR)context.c \
$(MESABUILDDIR)convolve.c \
$(MESABUILDDIR)debug.c \
$(MESABUILDDIR)depth.c \
$(MESABUILDDIR)dlist.c \
$(MESABUILDDIR)drawpix.c \
$(MESABUILDDIR)enable.c \
$(MESABUILDDIR)enums.c \
$(MESABUILDDIR)eval.c \
$(MESABUILDDIR)execmem.c \
$(MESABUILDDIR)extensions.c \
$(MESABUILDDIR)feedback.c \
$(MESABUILDDIR)fbobject.c \
$(MESABUILDDIR)fog.c \
$(MESABUILDDIR)framebuffer.c \
$(MESABUILDDIR)get.c \
$(MESABUILDDIR)getstring.c \
$(MESABUILDDIR)hash.c \
$(MESABUILDDIR)hint.c \
$(MESABUILDDIR)histogram.c \
$(MESABUILDDIR)image.c \
$(MESABUILDDIR)imports.c \
$(MESABUILDDIR)light.c \
$(MESABUILDDIR)lines.c \
$(MESABUILDDIR)matrix.c \
$(MESABUILDDIR)mm.c \
$(MESABUILDDIR)occlude.c \
$(MESABUILDDIR)pixel.c \
$(MESABUILDDIR)points.c \
$(MESABUILDDIR)polygon.c \
$(MESABUILDDIR)rastpos.c \
$(MESABUILDDIR)renderbuffer.c \
$(MESABUILDDIR)state.c \
$(MESABUILDDIR)stencil.c \
$(MESABUILDDIR)texcompress.c \
$(MESABUILDDIR)texcompress_fxt1.c \
$(MESABUILDDIR)texcompress_s3tc.c \
$(MESABUILDDIR)texenvprogram.c \
$(MESABUILDDIR)texformat.c \
$(MESABUILDDIR)teximage.c \
$(MESABUILDDIR)texobj.c \
$(MESABUILDDIR)texrender.c \
$(MESABUILDDIR)texstate.c \
$(MESABUILDDIR)texstore.c \
$(MESABUILDDIR)varray.c \
$(MESABUILDDIR)vtxfmt.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(api_arrayelt.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(api_arrayelt.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(api_eval.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(api_loopback.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(api_loopback.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(api_noop.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(api_noop.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(api_validate.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(api_validate.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(accum.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(accum.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(attrib.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(attrib.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(blend.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(blend.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(bufferobj.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(bufferobj.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(buffers.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(buffers.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(clip.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(clip.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(colormac.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(colortab.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(colortab.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(config.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(context.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(context.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(convolve.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(convolve.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(dd.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(debug.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(debug.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(depth.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(depth.h, $(MESASRCDIR)/src/mesa/main)
#ifdef NeedAllMesaSrc
LinkSourceFile(dispatch.c, $(MESASRCDIR)/src/mesa/main)
#endif
LinkSourceFile(dlist.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(dlist.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(drawpix.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(drawpix.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(enable.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(enable.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(enums.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(enums.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(eval.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(eval.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(execmem.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(extensions.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(extensions.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(fbobject.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(fbobject.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(feedback.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(feedback.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(fog.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(fog.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(framebuffer.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(framebuffer.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(get.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(get.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(getstring.c, $(MESASRCDIR)/src/mesa/main)
#ifdef NeedAllMesaSrc
LinkSourceFile(glapi.c, $(MESASRCDIR)/src/mesa/glapi)
LinkSourceFile(glthread.c, $(MESASRCDIR)/src/mesa/glapi)
#endif
LinkSourceFile(glheader.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(hash.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(hash.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(hint.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(hint.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(histogram.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(histogram.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(image.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(image.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(imports.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(imports.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(light.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(light.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(lines.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(lines.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(macros.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(matrix.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(matrix.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(mm.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(mm.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(mtypes.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(occlude.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(occlude.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(pixel.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(pixel.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(points.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(points.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(polygon.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(polygon.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(rastpos.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(rastpos.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(renderbuffer.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(renderbuffer.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(simple_list.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(state.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(state.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(stencil.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(stencil.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texcompress.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texcompress_fxt1.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texcompress_s3tc.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texcompress.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texenvprogram.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texenvprogram.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texformat.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texformat.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texformat_tmp.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(teximage.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(teximage.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texobj.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texobj.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texrender.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texrender.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texstate.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texstate.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texstore.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(texstore.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(varray.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(varray.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(version.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(vtxfmt.c, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(vtxfmt.h, $(MESASRCDIR)/src/mesa/main)
LinkSourceFile(vtxfmt_tmp.h, $(MESASRCDIR)/src/mesa/main)
#endif
#ifdef NeedAllMesaSrc
DISPATCHOBJS = $(MESABUILDDIR)dispatch.o
GLAPIOBJS = $(MESABUILDDIR)glapi.o
GLTHREADOBJS = $(MESABUILDDIR)glthread.o
#endif
COREMESABASEOBJS = \
$(DISPATCHOBJS) \
$(GLAPIOBJS) \
$(GLTHREADOBJS) \
$(MESABUILDDIR)api_arrayelt.o \
$(MESABUILDDIR)api_loopback.o \
$(MESABUILDDIR)api_noop.o \
$(MESABUILDDIR)api_validate.o \
$(MESABUILDDIR)accum.o \
$(MESABUILDDIR)attrib.o \
$(MESABUILDDIR)blend.o \
$(MESABUILDDIR)bufferobj.o \
$(MESABUILDDIR)buffers.o \
$(MESABUILDDIR)clip.o \
$(MESABUILDDIR)colortab.o \
$(MESABUILDDIR)context.o \
$(MESABUILDDIR)convolve.o \
$(MESABUILDDIR)debug.o \
$(MESABUILDDIR)depth.o \
$(MESABUILDDIR)dlist.o \
$(MESABUILDDIR)drawpix.o \
$(MESABUILDDIR)enable.o \
$(MESABUILDDIR)enums.o \
$(MESABUILDDIR)eval.o \
$(MESABUILDDIR)execmem.o \
$(MESABUILDDIR)extensions.o \
$(MESABUILDDIR)fbobject.o \
$(MESABUILDDIR)feedback.o \
$(MESABUILDDIR)fog.o \
$(MESABUILDDIR)framebuffer.o \
$(MESABUILDDIR)get.o \
$(MESABUILDDIR)getstring.o \
$(MESABUILDDIR)hash.o \
$(MESABUILDDIR)hint.o \
$(MESABUILDDIR)histogram.o \
$(MESABUILDDIR)image.o \
$(MESABUILDDIR)imports.o \
$(MESABUILDDIR)light.o \
$(MESABUILDDIR)lines.o \
$(MESABUILDDIR)matrix.o \
$(MESABUILDDIR)mm.o \
$(MESABUILDDIR)occlude.o \
$(MESABUILDDIR)pixel.o \
$(MESABUILDDIR)points.o \
$(MESABUILDDIR)polygon.o \
$(MESABUILDDIR)rastpos.o \
$(MESABUILDDIR)renderbuffer.o \
$(MESABUILDDIR)state.o \
$(MESABUILDDIR)stencil.o \
$(MESABUILDDIR)texcompress.o \
$(MESABUILDDIR)texcompress_fxt1.o \
$(MESABUILDDIR)texcompress_s3tc.o \
$(MESABUILDDIR)texenvprogram.o \
$(MESABUILDDIR)texformat.o \
$(MESABUILDDIR)teximage.o \
$(MESABUILDDIR)texrender.o \
$(MESABUILDDIR)texobj.o \
$(MESABUILDDIR)texstate.o \
$(MESABUILDDIR)texstore.o \
$(MESABUILDDIR)varray.o \
$(MESABUILDDIR)vtxfmt.o
#ifdef NeedAllMesaSrc
DISPATCHUOBJS = $(MESABUILDDIR)unshared/dispatch.o
GLAPIUOBJS = $(MESABUILDDIR)unshared/glapi.o
GLTHREADUOBJS = $(MESABUILDDIR)unshared/glthread.o
#endif
#if defined(DoSharedLib) && DoSharedLib
COREMESABASEUOBJS = \
$(DISPATCHUOBJS) \
$(GLAPIUOBJS) \
$(GLTHREADUOBJS) \
$(MESABUILDDIR)unshared/api_arrayelt.o \
$(MESABUILDDIR)unshared/api_loopback.o \
$(MESABUILDDIR)unshared/api_noop.o \
$(MESABUILDDIR)unshared/api_validate.o \
$(MESABUILDDIR)unshared/accum.o \
$(MESABUILDDIR)unshared/attrib.o \
$(MESABUILDDIR)unshared/blend.o \
$(MESABUILDDIR)unshared/bufferobj.o \
$(MESABUILDDIR)unshared/buffers.o \
$(MESABUILDDIR)unshared/clip.o \
$(MESABUILDDIR)unshared/colortab.o \
$(MESABUILDDIR)unshared/context.o \
$(MESABUILDDIR)unshared/convolve.o \
$(MESABUILDDIR)unshared/debug.o \
$(MESABUILDDIR)unshared/depth.o \
$(MESABUILDDIR)unshared/dlist.o \
$(MESABUILDDIR)unshared/drawpix.o \
$(MESABUILDDIR)unshared/enable.o \
$(MESABUILDDIR)unshared/enums.o \
$(MESABUILDDIR)unshared/eval.o \
$(MESABUILDDIR)unshared/execmem.o \
$(MESABUILDDIR)unshared/extensions.o \
$(MESABUILDDIR)unshared/fbobject.o \
$(MESABUILDDIR)unshared/feedback.o \
$(MESABUILDDIR)unshared/fog.o \
$(MESABUILDDIR)unshared/framebuffer.o \
$(MESABUILDDIR)unshared/get.o \
$(MESABUILDDIR)unshared/getstring.o \
$(MESABUILDDIR)unshared/hash.o \
$(MESABUILDDIR)unshared/hint.o \
$(MESABUILDDIR)unshared/histogram.o \
$(MESABUILDDIR)unshared/image.o \
$(MESABUILDDIR)unshared/imports.o \
$(MESABUILDDIR)unshared/light.o \
$(MESABUILDDIR)unshared/lines.o \
$(MESABUILDDIR)unshared/matrix.o \
$(MESABUILDDIR)unshared/mm.o \
$(MESABUILDDIR)unshared/occlude.o \
$(MESABUILDDIR)unshared/pixel.o \
$(MESABUILDDIR)unshared/points.o \
$(MESABUILDDIR)unshared/polygon.o \
$(MESABUILDDIR)unshared/rastpos.o \
$(MESABUILDDIR)unshared/renderbuffer.o \
$(MESABUILDDIR)unshared/state.o \
$(MESABUILDDIR)unshared/stencil.o \
$(MESABUILDDIR)unshared/texcompress.o \
$(MESABUILDDIR)unshared/texcompress_fxt1.o \
$(MESABUILDDIR)unshared/texcompress_s3tc.o \
$(MESABUILDDIR)unshared/texenvprogram.o \
$(MESABUILDDIR)unshared/texformat.o \
$(MESABUILDDIR)unshared/teximage.o \
$(MESABUILDDIR)unshared/texobj.o \
$(MESABUILDDIR)unshared/texrender.o \
$(MESABUILDDIR)unshared/texstate.o \
$(MESABUILDDIR)unshared/texstore.o \
$(MESABUILDDIR)unshared/varray.o \
$(MESABUILDDIR)unshared/vtxfmt.o
#else
COREMESABASEUOBJS = $(COREMESABASEOBJS)
#endif
#ifdef NeedAllMesaSrc
DISPATCHDOBJS = $(MESABUILDDIR)debugger/dispatch.o
GLAPIDOBJS = $(MESABUILDDIR)debugger/glapi.o
GLTHREADDOBJS = $(MESABUILDDIR)debugger/glthread.o
#endif
COREMESABASEDOBJS = \
$(DISPATCHDOBJS) \
$(GLAPIDOBJS) \
$(GLTHREADDOBJS) \
$(MESABUILDDIR)debugger/api_arrayelt.o \
$(MESABUILDDIR)debugger/api_loopback.o \
$(MESABUILDDIR)debugger/api_noop.o \
$(MESABUILDDIR)debugger/api_validate.o \
$(MESABUILDDIR)debugger/accum.o \
$(MESABUILDDIR)debugger/attrib.o \
$(MESABUILDDIR)debugger/blend.o \
$(MESABUILDDIR)debugger/bufferobj.o \
$(MESABUILDDIR)debugger/buffers.o \
$(MESABUILDDIR)debugger/clip.o \
$(MESABUILDDIR)debugger/colortab.o \
$(MESABUILDDIR)debugger/context.o \
$(MESABUILDDIR)debugger/convolve.o \
$(MESABUILDDIR)debugger/debug.o \
$(MESABUILDDIR)debugger/depth.o \
$(MESABUILDDIR)debugger/dlist.o \
$(MESABUILDDIR)debugger/drawpix.o \
$(MESABUILDDIR)debugger/enable.o \
$(MESABUILDDIR)debugger/enums.o \
$(MESABUILDDIR)debugger/eval.o \
$(MESABUILDDIR)debugger/execmem.o \
$(MESABUILDDIR)debugger/extensions.o \
$(MESABUILDDIR)debugger/fbobject.o \
$(MESABUILDDIR)debugger/feedback.o \
$(MESABUILDDIR)debugger/fog.o \
$(MESABUILDDIR)debugger/framebuffer.o \
$(MESABUILDDIR)debugger/get.o \
$(MESABUILDDIR)debugger/getstring.o \
$(MESABUILDDIR)debugger/hash.o \
$(MESABUILDDIR)debugger/hint.o \
$(MESABUILDDIR)debugger/histogram.o \
$(MESABUILDDIR)debugger/image.o \
$(MESABUILDDIR)debugger/imports.o \
$(MESABUILDDIR)debugger/light.o \
$(MESABUILDDIR)debugger/lines.o \
$(MESABUILDDIR)debugger/matrix.o \
$(MESABUILDDIR)debugger/mm.o \
$(MESABUILDDIR)debugger/occlude.o \
$(MESABUILDDIR)debugger/pixel.o \
$(MESABUILDDIR)debugger/points.o \
$(MESABUILDDIR)debugger/polygon.o \
$(MESABUILDDIR)debugger/rastpos.o \
$(MESABUILDDIR)debugger/renderbuffer.o \
$(MESABUILDDIR)debugger/state.o \
$(MESABUILDDIR)debugger/stencil.o \
$(MESABUILDDIR)debugger/texcompress.o \
$(MESABUILDDIR)debugger/texcompress_fxt1.o \
$(MESABUILDDIR)debugger/texcompress_s3tc.o \
$(MESABUILDDIR)debugger/texenvprogram.o \
$(MESABUILDDIR)debugger/texformat.o \
$(MESABUILDDIR)debugger/teximage.o \
$(MESABUILDDIR)debugger/texobj.o \
$(MESABUILDDIR)debugger/texrender.o \
$(MESABUILDDIR)debugger/texstate.o \
$(MESABUILDDIR)debugger/texstore.o \
$(MESABUILDDIR)debugger/varray.o \
$(MESABUILDDIR)debugger/vtxfmt.o
#ifdef NeedAllMesaSrc
DISPATCHPOBJS = $(MESABUILDDIR)profiled/dispatch.o
GLAPIPOBJS = $(MESABUILDDIR)profiled/glapi.o
GLTHREADPOBJS = $(MESABUILDDIR)profiled/glthread.o
#endif
COREMESABASEPOBJS = \
$(DISPATCHPOBJS) \
$(GLAPIPOBJS) \
$(GLTHREADPOBJS) \
$(MESABUILDDIR)profiled/api_arrayelt.o \
$(MESABUILDDIR)profiled/api_loopback.o \
$(MESABUILDDIR)profiled/api_noop.o \
$(MESABUILDDIR)profiled/api_validate.o \
$(MESABUILDDIR)profiled/accum.o \
$(MESABUILDDIR)profiled/attrib.o \
$(MESABUILDDIR)profiled/blend.o \
$(MESABUILDDIR)profiled/bufferobj.o \
$(MESABUILDDIR)profiled/buffers.o \
$(MESABUILDDIR)profiled/clip.o \
$(MESABUILDDIR)profiled/colortab.o \
$(MESABUILDDIR)profiled/context.o \
$(MESABUILDDIR)profiled/convolve.o \
$(MESABUILDDIR)profiled/debug.o \
$(MESABUILDDIR)profiled/depth.o \
$(MESABUILDDIR)profiled/dlist.o \
$(MESABUILDDIR)profiled/drawpix.o \
$(MESABUILDDIR)profiled/enable.o \
$(MESABUILDDIR)profiled/enums.o \
$(MESABUILDDIR)profiled/eval.o \
$(MESABUILDDIR)profiled/execmem.o \
$(MESABUILDDIR)profiled/extensions.o \
$(MESABUILDDIR)profiled/fbobject.o \
$(MESABUILDDIR)profiled/feedback.o \
$(MESABUILDDIR)profiled/fog.o \
$(MESABUILDDIR)profiled/framebuffer.o \
$(MESABUILDDIR)profiled/get.o \
$(MESABUILDDIR)profiled/getstring.o \
$(MESABUILDDIR)profiled/hash.o \
$(MESABUILDDIR)profiled/hint.o \
$(MESABUILDDIR)profiled/histogram.o \
$(MESABUILDDIR)profiled/image.o \
$(MESABUILDDIR)profiled/imports.o \
$(MESABUILDDIR)profiled/light.o \
$(MESABUILDDIR)profiled/lines.o \
$(MESABUILDDIR)profiled/matrix.o \
$(MESABUILDDIR)profiled/mm.o \
$(MESABUILDDIR)profiled/occlude.o \
$(MESABUILDDIR)profiled/pixel.o \
$(MESABUILDDIR)profiled/points.o \
$(MESABUILDDIR)profiled/polygon.o \
$(MESABUILDDIR)profiled/rastpos.o \
$(MESABUILDDIR)profiled/renderbuffer.o \
$(MESABUILDDIR)profiled/state.o \
$(MESABUILDDIR)profiled/stencil.o \
$(MESABUILDDIR)profiled/texcompress.o \
$(MESABUILDDIR)profiled/texcompress_fxt1.o \
$(MESABUILDDIR)profiled/texcompress_s3tc.o \
$(MESABUILDDIR)profiled/texenvprogram.o \
$(MESABUILDDIR)profiled/texformat.o \
$(MESABUILDDIR)profiled/teximage.o \
$(MESABUILDDIR)profiled/texobj.o \
$(MESABUILDDIR)profiled/texrender.o \
$(MESABUILDDIR)profiled/texstate.o \
$(MESABUILDDIR)profiled/texstore.o \
$(MESABUILDDIR)profiled/varray.o \
$(MESABUILDDIR)profiled/vtxfmt.o

View File

@@ -0,0 +1,27 @@
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */
/* Copyright (c) 2008-2017 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */
/* Copyright (c) 2011-2022 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/
/* Copyright (c) 2014-2019 Mihai Moldovan <ionic@ionic.de> */
/* Copyright (c) 2014-2022 Ulrich Sibiller <uli42@gmx.de> */
/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */
/* */
/* NXAGENT, NX protocol compression and NX extensions to this software */
/* are copyright of the aforementioned persons and companies. */
/* */
/* Redistribution and use of the present software is allowed according */
/* to terms specified in the file LICENSE which comes in the source */
/* distribution. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
typedef struct _WSDrawBufferRec {
GLframebuffer *DrawBuffer;
struct _WSDrawBufferRec *next;
} WSDrawBufferRec, *WSDrawBufferPtr;
WSDrawBufferPtr pWSDrawBuffer;

View File

@@ -0,0 +1,35 @@
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaMathBuildDir /**/
#include "Imakefile.inc"
SRCS = $(MESA_MATH_SRCS)
OBJS = $(MESA_MATH_OBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/math \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,76 @@
MESAMATHBUILDDIR = MesaMathBuildDir
MESA_MATH_SRCS = $(MESAMATHBUILDDIR)m_debug_clip.c \
$(MESAMATHBUILDDIR)m_debug_norm.c \
$(MESAMATHBUILDDIR)m_debug_xform.c \
$(MESAMATHBUILDDIR)m_eval.c \
$(MESAMATHBUILDDIR)m_matrix.c \
$(MESAMATHBUILDDIR)m_translate.c \
$(MESAMATHBUILDDIR)m_vector.c \
$(MESAMATHBUILDDIR)m_xform.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(mathmod.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_clip_tmp.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_copy_tmp.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_debug_clip.c, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_debug.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_debug_util.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_debug_norm.c, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_debug_xform.c, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_dotprod_tmp.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_eval.c, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_eval.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_matrix.c, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_matrix.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_norm_tmp.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_translate.c, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_translate.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_trans_tmp.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_vector.c, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_vector.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_xform.c, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_xform.h, $(MESASRCDIR)/src/mesa/math)
LinkSourceFile(m_xform_tmp.h, $(MESASRCDIR)/src/mesa/math)
#endif
MESA_MATH_OBJS = $(MESAMATHBUILDDIR)m_debug_clip.o \
$(MESAMATHBUILDDIR)m_debug_norm.o \
$(MESAMATHBUILDDIR)m_debug_xform.o \
$(MESAMATHBUILDDIR)m_eval.o \
$(MESAMATHBUILDDIR)m_matrix.o \
$(MESAMATHBUILDDIR)m_translate.o \
$(MESAMATHBUILDDIR)m_vector.o \
$(MESAMATHBUILDDIR)m_xform.o
#if defined(DoSharedLib) && DoSharedLib
MESA_MATH_UOBJS = $(MESAMATHBUILDDIR)unshared/m_debug_clip.o \
$(MESAMATHBUILDDIR)unshared/m_debug_norm.o \
$(MESAMATHBUILDDIR)unshared/m_debug_xform.o \
$(MESAMATHBUILDDIR)unshared/m_eval.o \
$(MESAMATHBUILDDIR)unshared/m_matrix.o \
$(MESAMATHBUILDDIR)unshared/m_translate.o \
$(MESAMATHBUILDDIR)unshared/m_vector.o \
$(MESAMATHBUILDDIR)unshared/m_xform.o
#else
MATH_MESA_UOBJS = $(MESA_MATH_OBJS)
#endif
MESA_MATH_DOBJS = $(MESAMATHBUILDDIR)debugger/m_debug_clip.o \
$(MESAMATHBUILDDIR)debugger/m_debug_norm.o \
$(MESAMATHBUILDDIR)debugger/m_debug_xform.o \
$(MESAMATHBUILDDIR)debugger/m_eval.o \
$(MESAMATHBUILDDIR)debugger/m_matrix.o \
$(MESAMATHBUILDDIR)debugger/m_translate.o \
$(MESAMATHBUILDDIR)debugger/m_vector.o \
$(MESAMATHBUILDDIR)debugger/m_xform.o
MESA_MATH_POBJS = $(MESAMATHBUILDDIR)profiled/m_debug_clip.o \
$(MESAMATHBUILDDIR)profiled/m_debug_norm.o \
$(MESAMATHBUILDDIR)profiled/m_debug_xform.o \
$(MESAMATHBUILDDIR)profiled/m_eval.o \
$(MESAMATHBUILDDIR)profiled/m_matrix.o \
$(MESAMATHBUILDDIR)profiled/m_translate.o \
$(MESAMATHBUILDDIR)profiled/m_vector.o \
$(MESAMATHBUILDDIR)profiled/m_xform.o

View File

@@ -0,0 +1,40 @@
#define IHaveSubdirs
SUBDIRS = grammar slang
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaShaderBuildDir /**/
#include "Imakefile.inc"
SRCS = $(MESA_SHADER_SRCS)
OBJS = $(MESA_SHADER_OBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src/mesa/shader/grammar \
-I$(MESASRCDIR)/src/mesa/shader/slang \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,100 @@
MESASHADERBUILDDIR = MesaShaderBuildDir
MESA_SHADER_SRCS = $(MESASHADERBUILDDIR)arbprogparse.c \
$(MESASHADERBUILDDIR)arbprogram.c \
$(MESASHADERBUILDDIR)arbfragparse.c \
$(MESASHADERBUILDDIR)arbvertparse.c \
$(MESASHADERBUILDDIR)atifragshader.c \
$(MESASHADERBUILDDIR)nvprogram.c \
$(MESASHADERBUILDDIR)nvfragparse.c \
$(MESASHADERBUILDDIR)nvvertexec.c \
$(MESASHADERBUILDDIR)nvvertparse.c \
$(MESASHADERBUILDDIR)program.c \
$(MESASHADERBUILDDIR)shaderobjects.c \
$(MESASHADERBUILDDIR)shaderobjects_3dlabs.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(arbprogparse.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(arbprogram.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(arbfragparse.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(arbvertparse.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(arbfragparse.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(arbprogparse.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(arbprogram.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(arbprogram_syn.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(arbvertparse.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(atifragshader.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(atifragshader.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvfragparse.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvfragprog.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvprogram.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvprogram.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvfragparse.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvvertexec.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvvertexec.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvvertparse.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvvertparse.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(nvvertprog.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(program.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(program.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(shaderobjects.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(shaderobjects.h, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(shaderobjects_3dlabs.c, $(MESASRCDIR)/src/mesa/shader)
LinkSourceFile(shaderobjects_3dlabs.h, $(MESASRCDIR)/src/mesa/shader)
#endif
MESA_SHADER_OBJS = $(MESASHADERBUILDDIR)arbprogparse.o \
$(MESASHADERBUILDDIR)arbprogram.o \
$(MESASHADERBUILDDIR)arbfragparse.o \
$(MESASHADERBUILDDIR)arbvertparse.o \
$(MESASHADERBUILDDIR)atifragshader.o \
$(MESASHADERBUILDDIR)nvprogram.o \
$(MESASHADERBUILDDIR)nvfragparse.o \
$(MESASHADERBUILDDIR)nvvertexec.o \
$(MESASHADERBUILDDIR)nvvertparse.o \
$(MESASHADERBUILDDIR)program.o \
$(MESASHADERBUILDDIR)shaderobjects.o \
$(MESASHADERBUILDDIR)shaderobjects_3dlabs.o
#if defined(DoSharedLib) && DoSharedLib
MESA_SHADER_UOBJS = $(MESASHADERBUILDDIR)unshared/arbprogparse.o \
$(MESASHADERBUILDDIR)unshared/arbprogram.o \
$(MESASHADERBUILDDIR)unshared/arbfragparse.o \
$(MESASHADERBUILDDIR)unshared/arbvertparse.o \
$(MESASHADERBUILDDIR)unshared/atifragshader.o \
$(MESASHADERBUILDDIR)unshared/nvprogram.o \
$(MESASHADERBUILDDIR)unshared/nvfragparse.o \
$(MESASHADERBUILDDIR)unshared/nvvertexec.o \
$(MESASHADERBUILDDIR)unshared/nvvertparse.o \
$(MESASHADERBUILDDIR)unshared/program.o \
$(MESASHADERBUILDDIR)unshared/shaderobjects.o \
$(MESASHADERBUILDDIR)unshared/shaderobjects_3dlabs.o
#else
MESA_SHADER_UOBJS = $(MESA_SHADER_OBJS)
#endif
MESA_SHADER_DOBJS = $(MESASHADERBUILDDIR)debugger/arbprogparse.o \
$(MESASHADERBUILDDIR)debugger/arbprogram.o \
$(MESASHADERBUILDDIR)debugger/arbfragparse.o \
$(MESASHADERBUILDDIR)debugger/arbvertparse.o \
$(MESASHADERBUILDDIR)debugger/atifragshader.o \
$(MESASHADERBUILDDIR)debugger/nvprogram.o \
$(MESASHADERBUILDDIR)debugger/nvfragparse.o \
$(MESASHADERBUILDDIR)debugger/nvvertexec.o \
$(MESASHADERBUILDDIR)debugger/nvvertparse.o \
$(MESASHADERBUILDDIR)debugger/program.o \
$(MESASHADERBUILDDIR)debugger/shaderobjects.o \
$(MESASHADERBUILDDIR)debugger/shaderobjects_3dlabs.o
MESA_SHADER_POBJS = $(MESASHADERBUILDDIR)profiled/arbprogparse.o \
$(MESASHADERBUILDDIR)profiled/arbprogram.o \
$(MESASHADERBUILDDIR)profiled/arbfragparse.o \
$(MESASHADERBUILDDIR)profiled/arbvertparse.o \
$(MESASHADERBUILDDIR)profiled/atifragshader.o \
$(MESASHADERBUILDDIR)profiled/nvprogram.o \
$(MESASHADERBUILDDIR)profiled/nvfragparse.o \
$(MESASHADERBUILDDIR)profiled/nvvertexec.o \
$(MESASHADERBUILDDIR)profiled/nvvertparse.o \
$(MESASHADERBUILDDIR)profiled/program.o \
$(MESASHADERBUILDDIR)profiled/shaderobjects.o \
$(MESASHADERBUILDDIR)profiled/shaderobjects_3dlabs.o

View File

@@ -0,0 +1,37 @@
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaGrammarBuildDir /**/
#include "Imakefile.inc"
SRCS = $(MESA_GRAMMAR_SRCS)
OBJS = $(MESA_GRAMMAR_OBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src/mesa/shader/grammar \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,23 @@
MESAGRAMMARBUILDDIR=MesaGrammarBuildDir
MESA_GRAMMAR_SRCS = $(MESAGRAMMARBUILDDIR)grammar_mesa.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(grammar.c, $(MESASRCDIR)/src/mesa/shader/grammar)
LinkSourceFile(grammar.h, $(MESASRCDIR)/src/mesa/shader/grammar)
LinkSourceFile(grammar_syn.h, $(MESASRCDIR)/src/mesa/shader/grammar)
LinkSourceFile(grammar_mesa.c, $(MESASRCDIR)/src/mesa/shader/grammar)
LinkSourceFile(grammar_mesa.h, $(MESASRCDIR)/src/mesa/shader/grammar)
#endif
MESA_GRAMMAR_OBJS = $(MESAGRAMMARBUILDDIR)grammar_mesa.o
#if defined(DoSharedLib) && DoSharedLib
MESA_GRAMMAR_UOBJS = $(MESAGRAMMARBUILDDIR)unshared/grammar_mesa.o
#else
MESA_GRAMMAR_UOBJS = $(MESA_GRAMMAR_OBJS)
#endif
MESA_GRAMMAR_DOBJS = $(MESAGRAMMARBUILDDIR)debugger/grammar_mesa.o
MESA_GRAMMAR_POBJS = $(MESAGRAMMARBUILDDIR)profiled/grammar_mesa.o

View File

@@ -0,0 +1,40 @@
#define IHaveSubdirs
SUBDIRS = library
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaSlangBuildDir /**/
#include "Imakefile.inc"
SRCS = $(MESA_SLANG_SRCS)
OBJS = $(MESA_SLANG_OBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src/mesa/shader/grammar \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,84 @@
MESASLANGBUILDDIR=MesaSlangBuildDir
MESA_SLANG_SRCS = $(MESASLANGBUILDDIR)slang_assemble_assignment.c \
$(MESASLANGBUILDDIR)slang_assemble.c \
$(MESASLANGBUILDDIR)slang_assemble_conditional.c \
$(MESASLANGBUILDDIR)slang_assemble_constructor.c \
$(MESASLANGBUILDDIR)slang_assemble_typeinfo.c \
$(MESASLANGBUILDDIR)slang_compile.c \
$(MESASLANGBUILDDIR)slang_execute.c \
$(MESASLANGBUILDDIR)slang_preprocess.c \
$(MESASLANGBUILDDIR)slang_storage.c \
$(MESASLANGBUILDDIR)slang_utility.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(slang_assemble_assignment.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble_assignment.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble_conditional.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble_conditional.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble_constructor.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble_constructor.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble_typeinfo.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_assemble_typeinfo.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_compile.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_compile.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_execute.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_execute.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_preprocess.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_preprocess.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_storage.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_storage.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_utility.c, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(slang_utility.h, $(MESASRCDIR)/src/mesa/shader/slang)
LinkSourceFile(traverse_wrap.h, $(MESASRCDIR)/src/mesa/shader/slang)
#endif
MESA_SLANG_OBJS = $(MESASLANGBUILDDIR)slang_assemble_assignment.o \
$(MESASLANGBUILDDIR)slang_assemble.o \
$(MESASLANGBUILDDIR)slang_assemble_conditional.o \
$(MESASLANGBUILDDIR)slang_assemble_constructor.o \
$(MESASLANGBUILDDIR)slang_assemble_typeinfo.o \
$(MESASLANGBUILDDIR)slang_compile.o \
$(MESASLANGBUILDDIR)slang_execute.o \
$(MESASLANGBUILDDIR)slang_preprocess.o \
$(MESASLANGBUILDDIR)slang_storage.o \
$(MESASLANGBUILDDIR)slang_utility.o
#if defined(DoSharedLib) && DoSharedLib
MESA_SLANG_UOBJS = $(MESASLANGBUILDDIR)unshared/slang_assemble_assignment.o \
$(MESASLANGBUILDDIR)unshared/slang_assemble.o \
$(MESASLANGBUILDDIR)unshared/slang_assemble_conditional.o \
$(MESASLANGBUILDDIR)unshared/slang_assemble_constructor.o \
$(MESASLANGBUILDDIR)unshared/slang_assemble_typeinfo.o \
$(MESASLANGBUILDDIR)unshared/slang_compile.o \
$(MESASLANGBUILDDIR)unshared/slang_execute.o \
$(MESASLANGBUILDDIR)unshared/slang_preprocess.o \
$(MESASLANGBUILDDIR)unshared/slang_storage.o \
$(MESASLANGBUILDDIR)unshared/slang_utility.o
#else
MESA_SLANG_UOBJS = $(MESA_SLANG_OBJS)
#endif
MESA_SLANG_DOBJS = $(MESASLANGBUILDDIR)debugger/slang_assemble_assignment.o \
$(MESASLANGBUILDDIR)debugger/slang_assemble.o \
$(MESASLANGBUILDDIR)debugger/slang_assemble_conditional.o \
$(MESASLANGBUILDDIR)debugger/slang_assemble_constructor.o \
$(MESASLANGBUILDDIR)debugger/slang_assemble_typeinfo.o \
$(MESASLANGBUILDDIR)debugger/slang_compile.o \
$(MESASLANGBUILDDIR)debugger/slang_execute.o \
$(MESASLANGBUILDDIR)debugger/slang_preprocess.o \
$(MESASLANGBUILDDIR)debugger/slang_storage.o \
$(MESASLANGBUILDDIR)debugger/slang_utility.o
MESA_SLANG_POBJS = $(MESASLANGBUILDDIR)profiled/slang_assemble_assignment.o \
$(MESASLANGBUILDDIR)profiled/slang_assemble.o \
$(MESASLANGBUILDDIR)profiled/slang_assemble_conditional.o \
$(MESASLANGBUILDDIR)profiled/slang_assemble_constructor.o \
$(MESASLANGBUILDDIR)profiled/slang_assemble_typeinfo.o \
$(MESASLANGBUILDDIR)profiled/slang_compile.o \
$(MESASLANGBUILDDIR)profiled/slang_execute.o \
$(MESASLANGBUILDDIR)profiled/slang_preprocess.o \
$(MESASLANGBUILDDIR)profiled/slang_storage.o \
$(MESASLANGBUILDDIR)profiled/slang_utility.o

View File

@@ -0,0 +1,30 @@
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaLibraryBuildDir /**/
#include "Imakefile.inc"
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src/mesa/shader/grammar \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,12 @@
#ifdef NeedToLinkMesaSrc
LinkSourceFile(slang_common_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_common_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_core_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_core_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_fragment_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_fragment_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_shader_syn.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_version_syn.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_vertex_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
LinkSourceFile(slang_vertex_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library)
#endif

View File

@@ -0,0 +1,42 @@
/* Large PIC tables needed for Solaris/SPARC builds */
#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
PICFLAGS = LargePositionIndependentCFlags
#endif
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaSwrastBuildDir /**/
#include "Imakefile.inc"
SRCS = $(MESA_SWRAST_SRCS)
OBJS = $(MESA_SWRAST_OBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/src/mesa/swrast \
-I$(MESASRCDIR)/src/mesa/swrast_setup \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,212 @@
MESASWRASTBUILDDIR = MesaSwrastBuildDir
MESA_SWRAST_SRCS = $(MESASWRASTBUILDDIR)s_aaline.c \
$(MESASWRASTBUILDDIR)s_aatriangle.c \
$(MESASWRASTBUILDDIR)s_accum.c \
$(MESASWRASTBUILDDIR)s_alpha.c \
$(MESASWRASTBUILDDIR)s_atifragshader.c \
$(MESASWRASTBUILDDIR)s_bitmap.c \
$(MESASWRASTBUILDDIR)s_blend.c \
$(MESASWRASTBUILDDIR)s_buffers.c \
$(MESASWRASTBUILDDIR)s_context.c \
$(MESASWRASTBUILDDIR)s_copypix.c \
$(MESASWRASTBUILDDIR)s_depth.c \
$(MESASWRASTBUILDDIR)s_drawpix.c \
$(MESASWRASTBUILDDIR)s_feedback.c \
$(MESASWRASTBUILDDIR)s_fog.c \
$(MESASWRASTBUILDDIR)s_imaging.c \
$(MESASWRASTBUILDDIR)s_lines.c \
$(MESASWRASTBUILDDIR)s_logic.c \
$(MESASWRASTBUILDDIR)s_masking.c \
$(MESASWRASTBUILDDIR)s_nvfragprog.c \
$(MESASWRASTBUILDDIR)s_pixeltex.c \
$(MESASWRASTBUILDDIR)s_points.c \
$(MESASWRASTBUILDDIR)s_readpix.c \
$(MESASWRASTBUILDDIR)s_span.c \
$(MESASWRASTBUILDDIR)s_stencil.c \
$(MESASWRASTBUILDDIR)s_texstore.c \
$(MESASWRASTBUILDDIR)s_texture.c \
$(MESASWRASTBUILDDIR)s_triangle.c \
$(MESASWRASTBUILDDIR)s_zoom.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(s_aaline.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_aaline.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_aalinetemp.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_aatriangle.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_aatriangle.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_aatritemp.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_accum.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_accum.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_alpha.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_alpha.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_atifragshader.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_atifragshader.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_bitmap.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_blend.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_blend.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_buffers.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_context.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_context.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_copypix.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_depth.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_depth.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_drawpix.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_drawpix.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_feedback.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_feedback.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_fog.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_fog.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_imaging.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_lines.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_lines.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_linetemp.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_logic.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_logic.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_masking.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_masking.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_nvfragprog.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_nvfragprog.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_pixeltex.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_pixeltex.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_points.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_points.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_pointtemp.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_readpix.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_span.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_span.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_spantemp.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_stencil.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_stencil.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_texstore.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_texture.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_texture.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_triangle.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_triangle.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_trispan.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_tritemp.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_zoom.c, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(s_zoom.h, $(MESASRCDIR)/src/mesa/swrast)
LinkSourceFile(swrast.h, $(MESASRCDIR)/src/mesa/swrast)
#endif
MESA_SWRAST_OBJS = $(MESASWRASTBUILDDIR)s_aaline.o \
$(MESASWRASTBUILDDIR)s_aatriangle.o \
$(MESASWRASTBUILDDIR)s_accum.o \
$(MESASWRASTBUILDDIR)s_alpha.o \
$(MESASWRASTBUILDDIR)s_atifragshader.o \
$(MESASWRASTBUILDDIR)s_bitmap.o \
$(MESASWRASTBUILDDIR)s_blend.o \
$(MESASWRASTBUILDDIR)s_buffers.o \
$(MESASWRASTBUILDDIR)s_context.o \
$(MESASWRASTBUILDDIR)s_copypix.o \
$(MESASWRASTBUILDDIR)s_depth.o \
$(MESASWRASTBUILDDIR)s_drawpix.o \
$(MESASWRASTBUILDDIR)s_feedback.o \
$(MESASWRASTBUILDDIR)s_fog.o \
$(MESASWRASTBUILDDIR)s_imaging.o \
$(MESASWRASTBUILDDIR)s_lines.o \
$(MESASWRASTBUILDDIR)s_logic.o \
$(MESASWRASTBUILDDIR)s_masking.o \
$(MESASWRASTBUILDDIR)s_nvfragprog.o \
$(MESASWRASTBUILDDIR)s_pixeltex.o \
$(MESASWRASTBUILDDIR)s_points.o \
$(MESASWRASTBUILDDIR)s_readpix.o \
$(MESASWRASTBUILDDIR)s_span.o \
$(MESASWRASTBUILDDIR)s_stencil.o \
$(MESASWRASTBUILDDIR)s_texstore.o \
$(MESASWRASTBUILDDIR)s_texture.o \
$(MESASWRASTBUILDDIR)s_triangle.o \
$(MESASWRASTBUILDDIR)s_zoom.o
#if defined(DoSharedLib) && DoSharedLib
MESA_SWRAST_UOBJS = $(MESASWRASTBUILDDIR)unshared/s_aaline.o \
$(MESASWRASTBUILDDIR)unshared/s_aatriangle.o \
$(MESASWRASTBUILDDIR)unshared/s_accum.o \
$(MESASWRASTBUILDDIR)unshared/s_alpha.o \
$(MESASWRASTBUILDDIR)unshared/s_atifragshader.o \
$(MESASWRASTBUILDDIR)unshared/s_bitmap.o \
$(MESASWRASTBUILDDIR)unshared/s_blend.o \
$(MESASWRASTBUILDDIR)unshared/s_buffers.o \
$(MESASWRASTBUILDDIR)unshared/s_context.o \
$(MESASWRASTBUILDDIR)unshared/s_copypix.o \
$(MESASWRASTBUILDDIR)unshared/s_depth.o \
$(MESASWRASTBUILDDIR)unshared/s_drawpix.o \
$(MESASWRASTBUILDDIR)unshared/s_feedback.o \
$(MESASWRASTBUILDDIR)unshared/s_fog.o \
$(MESASWRASTBUILDDIR)unshared/s_imaging.o \
$(MESASWRASTBUILDDIR)unshared/s_lines.o \
$(MESASWRASTBUILDDIR)unshared/s_logic.o \
$(MESASWRASTBUILDDIR)unshared/s_masking.o \
$(MESASWRASTBUILDDIR)unshared/s_nvfragprog.o \
$(MESASWRASTBUILDDIR)unshared/s_pixeltex.o \
$(MESASWRASTBUILDDIR)unshared/s_points.o \
$(MESASWRASTBUILDDIR)unshared/s_readpix.o \
$(MESASWRASTBUILDDIR)unshared/s_span.o \
$(MESASWRASTBUILDDIR)unshared/s_stencil.o \
$(MESASWRASTBUILDDIR)unshared/s_texstore.o \
$(MESASWRASTBUILDDIR)unshared/s_texture.o \
$(MESASWRASTBUILDDIR)unshared/s_triangle.o \
$(MESASWRASTBUILDDIR)unshared/s_zoom.o
#else
MESA_SWRAST_UOBJS = $(MESA_SWRAST_OBJS)
#endif
MESA_SWRAST_DOBJS = $(MESASWRASTBUILDDIR)debugger/s_aaline.o \
$(MESASWRASTBUILDDIR)debugger/s_aatriangle.o \
$(MESASWRASTBUILDDIR)debugger/s_accum.o \
$(MESASWRASTBUILDDIR)debugger/s_alpha.o \
$(MESASWRASTBUILDDIR)debugger/s_atifragshader.o \
$(MESASWRASTBUILDDIR)debugger/s_bitmap.o \
$(MESASWRASTBUILDDIR)debugger/s_blend.o \
$(MESASWRASTBUILDDIR)debugger/s_buffers.o \
$(MESASWRASTBUILDDIR)debugger/s_context.o \
$(MESASWRASTBUILDDIR)debugger/s_copypix.o \
$(MESASWRASTBUILDDIR)debugger/s_depth.o \
$(MESASWRASTBUILDDIR)debugger/s_drawpix.o \
$(MESASWRASTBUILDDIR)debugger/s_feedback.o \
$(MESASWRASTBUILDDIR)debugger/s_fog.o \
$(MESASWRASTBUILDDIR)debugger/s_imaging.o \
$(MESASWRASTBUILDDIR)debugger/s_lines.o \
$(MESASWRASTBUILDDIR)debugger/s_logic.o \
$(MESASWRASTBUILDDIR)debugger/s_masking.o \
$(MESASWRASTBUILDDIR)debugger/s_nvfragprog.o \
$(MESASWRASTBUILDDIR)debugger/s_pixeltex.o \
$(MESASWRASTBUILDDIR)debugger/s_points.o \
$(MESASWRASTBUILDDIR)debugger/s_readpix.o \
$(MESASWRASTBUILDDIR)debugger/s_span.o \
$(MESASWRASTBUILDDIR)debugger/s_stencil.o \
$(MESASWRASTBUILDDIR)debugger/s_texstore.o \
$(MESASWRASTBUILDDIR)debugger/s_texture.o \
$(MESASWRASTBUILDDIR)debugger/s_triangle.o \
$(MESASWRASTBUILDDIR)debugger/s_zoom.o
MESA_SWRAST_POBJS = $(MESASWRASTBUILDDIR)profiled/s_aaline.o \
$(MESASWRASTBUILDDIR)profiled/s_aatriangle.o \
$(MESASWRASTBUILDDIR)profiled/s_accum.o \
$(MESASWRASTBUILDDIR)profiled/s_alpha.o \
$(MESASWRASTBUILDDIR)profiled/s_atifragshader.o \
$(MESASWRASTBUILDDIR)profiled/s_bitmap.o \
$(MESASWRASTBUILDDIR)profiled/s_blend.o \
$(MESASWRASTBUILDDIR)profiled/s_buffers.o \
$(MESASWRASTBUILDDIR)profiled/s_context.o \
$(MESASWRASTBUILDDIR)profiled/s_copypix.o \
$(MESASWRASTBUILDDIR)profiled/s_depth.o \
$(MESASWRASTBUILDDIR)profiled/s_drawpix.o \
$(MESASWRASTBUILDDIR)profiled/s_feedback.o \
$(MESASWRASTBUILDDIR)profiled/s_fog.o \
$(MESASWRASTBUILDDIR)profiled/s_imaging.o \
$(MESASWRASTBUILDDIR)profiled/s_lines.o \
$(MESASWRASTBUILDDIR)profiled/s_logic.o \
$(MESASWRASTBUILDDIR)profiled/s_masking.o \
$(MESASWRASTBUILDDIR)profiled/s_nvfragprog.o \
$(MESASWRASTBUILDDIR)profiled/s_pixeltex.o \
$(MESASWRASTBUILDDIR)profiled/s_points.o \
$(MESASWRASTBUILDDIR)profiled/s_readpix.o \
$(MESASWRASTBUILDDIR)profiled/s_span.o \
$(MESASWRASTBUILDDIR)profiled/s_stencil.o \
$(MESASWRASTBUILDDIR)profiled/s_texstore.o \
$(MESASWRASTBUILDDIR)profiled/s_texture.o \
$(MESASWRASTBUILDDIR)profiled/s_triangle.o \
$(MESASWRASTBUILDDIR)profiled/s_zoom.o

View File

@@ -0,0 +1,34 @@
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaSwrastSetupBuildDir /**/
#include "Imakefile.inc"
SRCS = $(MESA_SWR_SETUP_SRCS)
OBJS = $(MESA_SWR_SETUP_OBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/src/mesa/swrast_setup \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,30 @@
MESASWRSETUPDIR = MesaSwrastSetupBuildDir
MESA_SWR_SETUP_SRCS = $(MESASWRSETUPDIR)ss_context.c \
$(MESASWRSETUPDIR)ss_triangle.c
#ifdef NeedToLinkMesaSrc
LinkSourceFile(ss_context.c, $(MESASRCDIR)/src/mesa/swrast_setup)
LinkSourceFile(ss_context.h, $(MESASRCDIR)/src/mesa/swrast_setup)
LinkSourceFile(ss_triangle.c, $(MESASRCDIR)/src/mesa/swrast_setup)
LinkSourceFile(ss_triangle.h, $(MESASRCDIR)/src/mesa/swrast_setup)
LinkSourceFile(ss_tritmp.h, $(MESASRCDIR)/src/mesa/swrast_setup)
LinkSourceFile(swrast_setup.h, $(MESASRCDIR)/src/mesa/swrast_setup)
#endif
MESA_SWR_SETUP_OBJS = $(MESASWRSETUPDIR)ss_context.o \
$(MESASWRSETUPDIR)ss_triangle.o
#if defined(DoSharedLib) && DoSharedLib
MESA_SWR_SETUP_UOBJS = $(MESASWRSETUPDIR)unshared/ss_context.o \
$(MESASWRSETUPDIR)unshared/ss_triangle.o
#else
MESA_SWR_SETUP_UOBJS = $(MESA_SWR_SETUP_OBJS)
#endif
MESA_SWR_SETUP_DOBJS = $(MESASWRSETUPDIR)debugger/ss_context.o \
$(MESASWRSETUPDIR)debugger/ss_triangle.o
MESA_SWR_SETUP_POBJS = $(MESASWRSETUPDIR)profiled/ss_context.o \
$(MESASWRSETUPDIR)profiled/ss_triangle.o

View File

@@ -0,0 +1,45 @@
/* Large PIC tables needed for Solaris/SPARC builds */
#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
PICFLAGS = LargePositionIndependentCFlags
#endif
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaTnlBuildDir /**/
#include "Imakefile.inc"
SRCS = $(MESA_TNL_SRCS)
OBJS = $(MESA_TNL_OBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/array_cache \
-I$(MESASRCDIR)/src/mesa/math \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src/mesa/tnl \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
NormalLibraryObjectRule()
SubdirLibraryRule($(OBJS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

View File

@@ -0,0 +1,219 @@
MESATNLBUILDDIR = MesaTnlBuildDir
MESA_TNL_SRCS = $(MESATNLBUILDDIR)t_array_api.c \
$(MESATNLBUILDDIR)t_array_import.c \
$(MESATNLBUILDDIR)t_context.c \
$(MESATNLBUILDDIR)t_pipeline.c \
$(MESATNLBUILDDIR)t_save_api.c \
$(MESATNLBUILDDIR)t_save_loopback.c \
$(MESATNLBUILDDIR)t_save_playback.c \
$(MESATNLBUILDDIR)t_vb_arbprogram.c \
$(MESATNLBUILDDIR)t_vb_arbprogram_sse.c \
$(MESATNLBUILDDIR)t_vb_fog.c \
$(MESATNLBUILDDIR)t_vb_cull.c \
$(MESATNLBUILDDIR)t_vb_light.c \
$(MESATNLBUILDDIR)t_vb_normals.c \
$(MESATNLBUILDDIR)t_vb_points.c \
$(MESATNLBUILDDIR)t_vb_program.c \
$(MESATNLBUILDDIR)t_vb_render.c \
$(MESATNLBUILDDIR)t_vb_texgen.c \
$(MESATNLBUILDDIR)t_vb_texmat.c \
$(MESATNLBUILDDIR)t_vb_vertex.c \
$(MESATNLBUILDDIR)t_vertex.c \
$(MESATNLBUILDDIR)t_vertex_generic.c \
$(MESATNLBUILDDIR)t_vertex_sse.c \
$(MESATNLBUILDDIR)t_vp_build.c \
$(MESATNLBUILDDIR)t_vtx_api.c \
$(MESATNLBUILDDIR)t_vtx_eval.c \
$(MESATNLBUILDDIR)t_vtx_exec.c \
$(MESATNLBUILDDIR)t_vtx_generic.c
#if defined(i386Architecture) && MesaUseX86Asm
MESA_TNL_SRCS += MesaTnlAsmSrcs $(MESATNLBUILDDIR)t_vtx_x86.c \
$(MESATNLBUILDDIR)t_vtx_x86_gcc.S
#endif
#ifdef NeedToLinkMesaSrc
LinkSourceFile(t_array_api.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_array_api.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_array_import.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_array_import.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_context.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_context.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(tnl.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_pipeline.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_pipeline.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_save_api.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_save_api.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_save_loopback.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_save_playback.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_arbprogram.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_arbprogram.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_arbprogram_sse.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_cliptmp.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_fog.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_cull.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_light.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_lighttmp.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_normals.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_points.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_program.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_render.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_rendertmp.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_texgen.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_texmat.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vb_vertex.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vertex.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vertex.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vertex_generic.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vertex_sse.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vp_build.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vp_build.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vtx_api.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vtx_api.h, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vtx_eval.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vtx_exec.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vtx_generic.c, $(MESASRCDIR)/src/mesa/tnl)
#if defined(i386Architecture) && MesaUseX86Asm
LinkSourceFile(t_vtx_x86.c, $(MESASRCDIR)/src/mesa/tnl)
LinkSourceFile(t_vtx_x86_gcc.S, $(MESASRCDIR)/src/mesa/tnl)
#endif
#endif
MESA_TNL_OBJS = $(MESATNLBUILDDIR)t_array_api.o \
$(MESATNLBUILDDIR)t_array_import.o \
$(MESATNLBUILDDIR)t_context.o \
$(MESATNLBUILDDIR)t_pipeline.o \
$(MESATNLBUILDDIR)t_save_api.o \
$(MESATNLBUILDDIR)t_save_loopback.o \
$(MESATNLBUILDDIR)t_save_playback.o \
$(MESATNLBUILDDIR)t_vb_arbprogram.o \
$(MESATNLBUILDDIR)t_vb_arbprogram_sse.o \
$(MESATNLBUILDDIR)t_vb_fog.o \
$(MESATNLBUILDDIR)t_vb_cull.o \
$(MESATNLBUILDDIR)t_vb_light.o \
$(MESATNLBUILDDIR)t_vb_normals.o \
$(MESATNLBUILDDIR)t_vb_points.o \
$(MESATNLBUILDDIR)t_vb_program.o \
$(MESATNLBUILDDIR)t_vb_render.o \
$(MESATNLBUILDDIR)t_vb_texgen.o \
$(MESATNLBUILDDIR)t_vb_texmat.o \
$(MESATNLBUILDDIR)t_vb_vertex.o \
$(MESATNLBUILDDIR)t_vertex.o \
$(MESATNLBUILDDIR)t_vertex_generic.o \
$(MESATNLBUILDDIR)t_vertex_sse.o \
$(MESATNLBUILDDIR)t_vp_build.o \
$(MESATNLBUILDDIR)t_vtx_api.o \
$(MESATNLBUILDDIR)t_vtx_eval.o \
$(MESATNLBUILDDIR)t_vtx_exec.o \
$(MESATNLBUILDDIR)t_vtx_generic.o
#if defined(i386Architecture) && MesaUseX86Asm
MESA_TNL_OBJS += $(MESATNLBUILDDIR)t_vtx_x86.o \
$(MESATNLBUILDDIR)t_vtx_x86_gcc.o
#endif
#if defined(DoSharedLib) && DoSharedLib
MESA_TNL_UOBJS = $(MESATNLBUILDDIR)unshared/t_array_api.o \
$(MESATNLBUILDDIR)unshared/t_array_import.o \
$(MESATNLBUILDDIR)unshared/t_context.o \
$(MESATNLBUILDDIR)unshared/t_pipeline.o \
$(MESATNLBUILDDIR)unshared/t_save_api.o \
$(MESATNLBUILDDIR)unshared/t_save_loopback.o \
$(MESATNLBUILDDIR)unshared/t_save_playback.o \
$(MESATNLBUILDDIR)unshared/t_vb_arbprogram.o \
$(MESATNLBUILDDIR)unshared/t_vb_arbprogram_sse.o \
$(MESATNLBUILDDIR)unshared/t_vb_fog.o \
$(MESATNLBUILDDIR)unshared/t_vb_cull.o \
$(MESATNLBUILDDIR)unshared/t_vb_light.o \
$(MESATNLBUILDDIR)unshared/t_vb_normals.o \
$(MESATNLBUILDDIR)unshared/t_vb_points.o \
$(MESATNLBUILDDIR)unshared/t_vb_program.o \
$(MESATNLBUILDDIR)unshared/t_vb_render.o \
$(MESATNLBUILDDIR)unshared/t_vb_texgen.o \
$(MESATNLBUILDDIR)unshared/t_vb_texmat.o \
$(MESATNLBUILDDIR)unshared/t_vb_vertex.o \
$(MESATNLBUILDDIR)unshared/t_vertex.o \
$(MESATNLBUILDDIR)unshared/t_vertex_generic.o \
$(MESATNLBUILDDIR)unshared/t_vertex_sse.o \
$(MESATNLBUILDDIR)unshared/t_vp_build.o \
$(MESATNLBUILDDIR)unshared/t_vtx_api.o \
$(MESATNLBUILDDIR)unshared/t_vtx_eval.o \
$(MESATNLBUILDDIR)unshared/t_vtx_exec.o \
$(MESATNLBUILDDIR)unshared/t_vtx_generic.o
#if defined(i386Architecture) && MesaUseX86Asm
MESA_TNL_UOBJS += $(MESATNLBUILDDIR)unshared/t_vtx_x86.o \
$(MESATNLBUILDDIR)t_vtx_x86_gcc.o
#endif
#else
MESA_TNL_UOBJS = $(MESA_TNL_OBJS)
#endif
MESA_TNL_DOBJS = $(MESATNLBUILDDIR)debugger/t_array_api.o \
$(MESATNLBUILDDIR)debugger/t_array_import.o \
$(MESATNLBUILDDIR)debugger/t_context.o \
$(MESATNLBUILDDIR)debugger/t_pipeline.o \
$(MESATNLBUILDDIR)debugger/t_save_api.o \
$(MESATNLBUILDDIR)debugger/t_save_loopback.o \
$(MESATNLBUILDDIR)debugger/t_save_playback.o \
$(MESATNLBUILDDIR)debugger/t_vb_arbprogram.o \
$(MESATNLBUILDDIR)debugger/t_vb_arbprogram_sse.o \
$(MESATNLBUILDDIR)debugger/t_vb_fog.o \
$(MESATNLBUILDDIR)debugger/t_vb_cull.o \
$(MESATNLBUILDDIR)debugger/t_vb_light.o \
$(MESATNLBUILDDIR)debugger/t_vb_normals.o \
$(MESATNLBUILDDIR)debugger/t_vb_points.o \
$(MESATNLBUILDDIR)debugger/t_vb_program.o \
$(MESATNLBUILDDIR)debugger/t_vb_render.o \
$(MESATNLBUILDDIR)debugger/t_vb_texgen.o \
$(MESATNLBUILDDIR)debugger/t_vb_texmat.o \
$(MESATNLBUILDDIR)debugger/t_vb_vertex.o \
$(MESATNLBUILDDIR)debugger/t_vertex.o \
$(MESATNLBUILDDIR)debugger/t_vertex_generic.o \
$(MESATNLBUILDDIR)debugger/t_vertex_sse.o \
$(MESATNLBUILDDIR)debugger/t_vp_build.o \
$(MESATNLBUILDDIR)debugger/t_vtx_api.o \
$(MESATNLBUILDDIR)debugger/t_vtx_eval.o \
$(MESATNLBUILDDIR)debugger/t_vtx_exec.o \
$(MESATNLBUILDDIR)debugger/t_vtx_generic.o
#if defined(i386Architecture) && MesaUseX86Asm
MESA_TNL_DOBJS += $(MESATNLBUILDDIR)debugger/t_vtx_x86.o \
$(MESATNLBUILDDIR)debugger/t_vtx_x86_gcc.o
#endif
MESA_TNL_POBJS = $(MESATNLBUILDDIR)profiled/t_array_api.o \
$(MESATNLBUILDDIR)profiled/t_array_import.o \
$(MESATNLBUILDDIR)profiled/t_context.o \
$(MESATNLBUILDDIR)profiled/t_pipeline.o \
$(MESATNLBUILDDIR)profiled/t_save_api.o \
$(MESATNLBUILDDIR)profiled/t_save_loopback.o \
$(MESATNLBUILDDIR)profiled/t_save_playback.o \
$(MESATNLBUILDDIR)profiled/t_vb_arbprogram.o \
$(MESATNLBUILDDIR)profiled/t_vb_arbprogram_sse.o \
$(MESATNLBUILDDIR)profiled/t_vb_fog.o \
$(MESATNLBUILDDIR)profiled/t_vb_cull.o \
$(MESATNLBUILDDIR)profiled/t_vb_light.o \
$(MESATNLBUILDDIR)profiled/t_vb_normals.o \
$(MESATNLBUILDDIR)profiled/t_vb_points.o \
$(MESATNLBUILDDIR)profiled/t_vb_program.o \
$(MESATNLBUILDDIR)profiled/t_vb_render.o \
$(MESATNLBUILDDIR)profiled/t_vb_texgen.o \
$(MESATNLBUILDDIR)profiled/t_vb_texmat.o \
$(MESATNLBUILDDIR)profiled/t_vb_vertex.o \
$(MESATNLBUILDDIR)profiled/t_vertex.o \
$(MESATNLBUILDDIR)profiled/t_vertex_generic.o \
$(MESATNLBUILDDIR)profiled/t_vertex_sse.o \
$(MESATNLBUILDDIR)profiled/t_vp_build.o \
$(MESATNLBUILDDIR)profiled/t_vtx_api.o \
$(MESATNLBUILDDIR)profiled/t_vtx_eval.o \
$(MESATNLBUILDDIR)profiled/t_vtx_exec.o \
$(MESATNLBUILDDIR)profiled/t_vtx_generic.o
#if defined(i386Architecture) && MesaUseX86Asm
MESA_TNL_POBJS += $(MESATNLBUILDDIR)profiled/t_vtx_x86.o \
$(MESATNLBUILDDIR)profiled/t_vtx_x86_gcc.o
#endif