Compare commits

..

123 Commits

Author SHA1 Message Date
Tom Fogal
3af43c0b4c Revert "Prefer intrinsics to handrolled atomic ops."
This reverts commit 5f66b340aa, quickly
fixing 30514.
2010-09-30 14:43:20 -06:00
Tom Fogal
337dace22d Prefer intrinsics to handrolled atomic ops. 2010-09-26 22:32:15 -06:00
Tom Fogal
cc32ff741c Implement x86_64 atomics for compilers w/o intrinsics.
Really old gcc's (3.3, at least) don't have support for the
intrinsics we need.  This implements a fallback for that case.
2010-09-26 19:00:01 -06:00
Chia-I Wu
340e063525 progs/egl: Link xeglthreads to -lpthread. 2010-09-16 12:50:08 +08:00
Brian Paul
9c0eb872a2 mesa: set VERSION to 7.8.3-rc1 2010-09-14 18:20:22 -06:00
Brian Paul
b7cea230b3 docs: add link to 7.8.3 release notes 2010-08-24 08:31:46 -06:00
Brian Paul
5aade70660 docs: added news update for 7.8.3 (date TBD) 2010-08-24 08:31:30 -06:00
Brian Paul
793a121433 mesa: bump version to 7.8.3 2010-08-24 08:16:37 -06:00
Brian Paul
d2c4a8813e osmesa: remove unused var 2010-08-24 08:15:18 -06:00
Tom Fogal
75181e974c Add release notes for recent bug fixes. 2010-08-23 10:01:39 -06:00
Brian Paul
6628188a87 st/mesa: fix ReadPixels crashes when reading depth/stencil from a FBO
This is based on a patch from Marek Olšák.

NOTE: This is a candidate for the Mesa 7.8 branch.
2010-08-23 09:58:08 -06:00
M.Froehlich@science-computing.de
435474e116 swrast: fix span color array pointer assignment for 32-bit/channel rendering
See fd.o bug 29487.

NOTE: This is a candidate for the 7.8 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-23 09:57:58 -06:00
Tom Fogal
4adff471fe Regenerate mangling header. 2010-08-19 16:47:31 -06:00
Marek Olšák
016a79b732 Update release notes for 7.8.3 2010-08-08 00:41:20 +02:00
Marek Olšák
84e84cf4e7 r300c: do not advertise half float vertex on RV3xx, RS4xx, RC4xx
Fixes a hardlock.

(cherry picked from commit 1e46de3a83)
2010-08-08 00:32:58 +02:00
Tom Fogal
800473566c Add release notes for 7.8.3. 2010-08-06 12:40:02 -06:00
Tom Fogal
9af135c7cd Revert "radeon: allow driconf vblank settings with dri2"
As requested by Alex Deucher; dri2ConfigQueryExtension is not
available in 7.8.

This reverts commit 66ad60399a.
2010-08-05 14:45:29 -06:00
Marek Olšák
d06b34f563 st/mesa: fix FRAMEBUFFER_UNSUPPORTED with the D24S8 format
Fixes FDO bug #29116.

(cherry picked from commit 4fd39a8d69)
2010-08-05 13:39:40 -06:00
Brian Paul
f8363b25bb swrast: fix 16-bit/channel rendering
NOTE: This is a candidate for the 7.8 stable branch
(cherry picked from commit e3d8d25ebf)
2010-08-04 16:08:23 -06:00
Jos Fonseca
b69946870e mesa/st+tgsi: Provide a free callback to match with ureg_get_tokens().
This fixes crashes with the memory debugging routines on Windows.

NOTE: This is a candidate for the 7.8 stable branch
(cherry picked from commit edbc302ad6)
2010-08-04 16:08:23 -06:00
Brian Paul
3daa728fe7 mesa: fix texenv generation when num color bufs == 0
Before, if there were no color buffers enabled (with glDrawBuffers(GL_NONE))
when the texenv program was generated, we'd emit writes to OUTPUT[1] but
the OutputsWritten mask was 0.  This inconsistency caused an assertion to
fail later in the Mesa->TGSI translation.

Fixes fd.o bug 28169

NOTE: this is a candidate for the 7.8 branch (and depends on commit
b6b9b17d27).
(cherry picked from commit 6e83420ee0)
2010-08-04 16:08:23 -06:00
Brian Paul
596e1d3e44 mesa: make the number of draw buffers part of the texenv program key state
All the state that effects the program should be in the key.
This didn't help with bug 28169 but is a good fix anyway.

NOTE: this is a low-priority candidate for the 7.8 branch.  In practice,
this issue might never be hit.
(cherry picked from commit b6b9b17d27)
2010-08-04 16:08:23 -06:00
Maciej Cencora
7b6a68df92 radeon: fix glCopyTex(Sub)Image
Fallback to swrast for software renderbuffers
(cherry picked from commit 1a8a230a61)
2010-08-04 16:08:23 -06:00
Maciej Cencora
4a915f34e1 radeon: fix glCopyTex(Sub)Image if user FBO is bound
Fixes piglit/fbo-blit and wine d3d9 unit test.
(cherry picked from commit a68e8a4eaa)
2010-08-04 16:08:23 -06:00
Tom Fogal
be86a63d9a glsl: fix indirect addressing of gl_TextureMatrix[] arrays
The code to emit an array of OpenGL state vars lacked the code
to handle the gl_TextureMatrix[] array.

Fixes fd.o bug 28967

(manual cherry pick of 41f66915ab)

Acked-by: Brian Paul <brianp@vmware.com>
2010-08-04 16:08:22 -06:00
Tom Fogal
cb37c3a1c6 glsl: fix 'if ((x=foo()) > 1.0)' bug
Fixes fd.o bug 27216.  May also be the root cause of fd.o bug 28950.

We weren't propogating the storage info for the x=foo() expression up
through the IR tree to the inequality expression.

(manual cherry-pick 3751e6e1fc)

Acked-by: Brian Paul <brianp@vmware.com>
2010-08-04 16:08:22 -06:00
Brian Paul
218b9be37a st/mesa: fix bug in emit_adjusted_wpos()
If we bias x,y we still need to pass through z,w in case the shader
reads gl_FragCoord.z or .w.

Fixes fd.o bug 29183 (piglit glsl-bug-22603).

NOTE: This is a candidate for the 7.8 branch.
2010-08-04 16:08:22 -06:00
Tom Fogal
fb9a133071 radeon: fix some wine d3d9 tests
Need to flush command stream before mapping texture image
that is referenced by current cs.

This is a manual application of
ba03a0b5ba, which could not be
cherry-picked directly due to refactoring.

Acked-by: Maciej Cencora <m.cencora@gmail.com>
2010-08-04 16:08:10 -06:00
Andre Maasikas
886019125e r600: fix sin,cos functions on r600
r600 doesnt need the same normalization as r700 - instead it requires
range to be truncated to -pi..pi

I left the range trunc also effective on r700 althouch according the docs
it has sufficent range (-512*PI, +512*PI). The instructions seem
to be used not too often to cause perf loss because of this

Based on patches and testing by Conn Clark and Alain Perrot
(cherry picked from commit d6a5f94ea4)
2010-08-03 12:04:00 -06:00
Andre Maasikas
aac05a8580 r600: since 8744c36e added asserts - use another random register for shader with no output
(cherry picked from commit 9b3bf392e1)
2010-08-03 12:03:59 -06:00
Henri Verbeet
8186c7d106 r600: Flip point sprite coordinates when rendering to an FBO.
This supersedes http://lists.freedesktop.org/archives/mesa-dev/2010-July/001442.html.
(cherry picked from commit 2fdff50999)
2010-08-03 12:03:59 -06:00
Andre Maasikas
7e07c8f40e r600: workaround 3 comp GL_SHORT vertex attribute format on r700
guess it's a hw errata?
(cherry picked from commit 51c438feb7)
2010-08-03 12:03:59 -06:00
Henri Verbeet
c81ba220d7 r600: GL_COORD_REPLACE state is only relevant when point sprites are enabled.
(cherry picked from commit 71646528da)
2010-08-03 12:03:59 -06:00
Marc
8f2100b48e r600: fix warnings
(cherry picked from commit 5552dffa39)
2010-08-03 12:03:58 -06:00
Henri Verbeet
27bbb68dfb r600: Make next_inst() static.
(cherry picked from commit 8744c36ea4)
2010-08-03 12:03:58 -06:00
Henri Verbeet
c3cc7d4033 r600: Assert output registers have a valid export index.
(cherry picked from commit 1bf75a921b)
2010-08-03 12:03:58 -06:00
Henri Verbeet
47a2046a08 r600: Process exports for all written fragment outputs.
(cherry picked from commit 1ec492a366)
2010-08-03 12:03:58 -06:00
Henri Verbeet
f3724c830c r600: Fill uiFP_OutputMap for all written fragment outputs.
(cherry picked from commit 1f7bc87391)
2010-08-03 12:03:58 -06:00
Andre Maasikas
bedecdff1f r600: enable VERT_RESULT_PSIZ - makes point size & attenuation work
doc additions: shader export ARRAY_BASE for EXPORT_POS: 60 is position,
61 is misc vec(VS_OUT_MISC_VEC - used here),
62, 63 are clip distance vectors(VS_OUT_CCDIST#)

sorry for formating - there seem to be so many different styles in r600
(cherry picked from commit 12172071b5)
2010-08-03 12:03:57 -06:00
Andre Maasikas
43f332e6fc r600: adjust point sprites after 911fa4a4a1
there's no more vp results for point coords so we cannot iterate
over vp outputs. Use only Point.CoordReplace[i]
(cherry picked from commit 04a148629f)
2010-08-03 12:03:57 -06:00
Brian Paul
12df872f8c mesa: return retval in _mesa_RenderObjectUnpurgeable()
Found by Vinson with static analysis.

NOTE: This is a candidate for the 7.8 branch.
(cherry picked from commit 41bcd8cb1e)
2010-08-03 12:03:56 -06:00
Alex Deucher
0d3ac51bf2 r600: fix typo in r700 assembler
Noticed by Henri Verbeet on IRC.

NOTE: This is a candidate for the 7.8 branch.
(cherry picked from commit 2bd69080a2)
2010-08-03 12:03:55 -06:00
Henri Verbeet
9cad102121 radeon: Also flush if it's not the current context that's being destroyed.
This avoids calling radeonFlush() during context destruction, when
ctx->DrawBuffer would be NULL.

NOTE: This is a candidate for the 7.8 branch.
(cherry picked from commit fef9b532cd)
2010-08-03 12:03:55 -06:00
Alex Deucher
66ad60399a radeon: allow driconf vblank settings with dri2
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28771

NOTE: This is a candidate for the 7.8 branch.
(cherry picked from commit 0a7803cbac)
2010-08-03 12:03:55 -06:00
Brian Paul
7f31029471 mesa: fix _mesa_Texture/Render/BufferObjectUnpurgeable() return values
Fixes piglit object_purgeable-api-pbo, object_purgeable-api-vbo
and object_purgeable-api-texture failures with swrast.

NOTE: This is a candidate for the 7.8 branch.
(cherry picked from commit 2f4ce25645)
2010-08-03 12:03:55 -06:00
Maciej Cencora
7b706cc69b radeon: lower texture memory consumption is some cases
When searching for valid miptree check images in range
of [BaseLeve, MaxLevel] not [MinLod, MaxLoad].
Prevents unnecessary miptree allocations in cases when during
every rendering operation different texture image level
was selected using MIN_LOD = MAX_LOD = level (for every level
new miptree for whole texture was allocated).

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
(cherry picked from commit 72e6a1e72f)
2010-08-03 12:03:54 -06:00
Maciej Cencora
69088d5484 radeon: fix teximage migration failure in rare case
Always store selected miptree in texObj->mt so get_base_teximage_offset returns correct data.
Found with piglit/mipmap-setup.

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
(cherry picked from commit ad24ea37bb)
2010-08-03 12:03:54 -06:00
Maciej Cencora
8cb6b198d2 r300c: Fix vertex data setup for named buffer objects with unaligned offset
Candidate for 7.8 branch

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
(cherry picked from commit 452a7d5a9d)
2010-08-03 12:03:54 -06:00
Brian Paul
ac82d16021 osmesa: remove old renderbuffer before adding new
Fixes fd.o bug 10966 when OSMesaMakeCurrent() was called twice.

NOTE: This is a candidate for the 7.8 branch.
(cherry picked from commit 91c37599f6)
2010-08-03 12:03:53 -06:00
Brian Paul
f02cd9030c mesa: initialize extension string when context is first bound
...instead of waiting until glGetString(GL_EXTENSIONS) is called.
This fixes a problem where the MESA_EXTENSION_OVERRIDE env var is
ignored if the app never calls glGetString(GL_EXTENSIONS).

NOTE: this is a candidate patch for the 7.8 branch.
(cherry picked from commit a879d14ecf)
2010-08-03 12:03:53 -06:00
Tim Evans
74959ed201 swrast: fix incorrect specular highlights on backfaces
See bug 28577 for details.
NOTE: this is a candidate for the 7.8 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 64e32ffb6e)
2010-08-03 12:03:53 -06:00
Chia-I Wu
d06e0117e3 st/egl: Fix build on FreeBSD.
There is no libdl on FreeBSD.  Based on patch from Thinker
<thinker@branda.to>, which is against 7.8.

This fixes fdo bug #29093.
(cherry picked from commit 08f4bc07e4)
2010-07-16 20:24:35 +08:00
Tom Stellard
b69d5414aa r300/compiler: Fix scheduling of TEX instructions.
The following instruction sequence will no longer be emitted in separate
TEX blocks:

0: TEX temp[0].xyz, temp[1].xy__, 2D[0];
1: TEX temp[1].xyz, temp[2].xy__, 2D[0];

This fixes fdo bug #25109
(cherry picked from commit 3724a2e65f)
2010-07-08 22:46:56 -07:00
Chia-I Wu
f6bba7b996 st/egl: Add support for !GLX_DIRECT_RENDERING.
st/egl uses GLX code for DRI2 support.  It should honor
GLX_DIRECT_RENDERING.

Also updates configure.ac to define GLX_DIRECT_RENDERING for st/egl.
(cherry picked from commit cf588ab3f1)
2010-07-06 15:45:27 +08:00
Brian Paul
6afe2936f7 mesa: put progs/util into the MesaDemos package 2010-07-05 16:50:24 -06:00
Dan Nicholson
fd95ea52e5 Use GLW_CFLAGS when building libGLw
We check for libX11 and libXt, so we might as well use the CFLAGS
pkg-config tells us about.
(cherry picked from commit 442c37e2ef)

Conflicts:

	configs/autoconf.in
2010-07-01 13:02:47 -07:00
Dan Nicholson
31799da47f Use GLUT_CFLAGS when building glut
Fix this build error (in MesaGLUT-7.6.1)...
glut_cmap.c:23:66: error: X11/Xmu/StdCmap.h: No such file or directory

...by not preventing the cflags that pkg-config finds for glut dependencies
(including 'xmu') from being used.

Defining GLUT_CFLAGS before running the pkg-config prevents the
cflags found by pkg-config from being used.

This patch lets GLUT_CFLAGS that configure & pkg-config work
so hard to set actually get used.

Also make sure the generated configs/autoconf defines GLUT_CFLAGS
used in (at least) src/glut/glx/Makefile.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit 9617254a1e)

Conflicts:

	configs/autoconf.in
2010-07-01 13:02:09 -07:00
Brian Paul
078d04ed81 docs: remove redundant changes section 2010-06-21 16:21:19 -06:00
Ian Romanick
a2782af384 docs: Add 7.8.2 release MD5 sums 2010-06-16 14:39:34 -07:00
Ian Romanick
b12692404c docs: added news item for 7.8.2 release 2010-06-16 14:30:14 -07:00
Ian Romanick
43becf60f8 mesa: set version string to 7.8.2 2010-06-16 14:29:46 -07:00
Ian Romanick
c19bc5de96 docs: Update mailing lines from sf.net to freedesktop.org 2010-06-16 14:28:08 -07:00
Ian Romanick
41e371e351 docs: download.html does not need to be updated for each release 2010-06-16 14:24:46 -07:00
Ian Romanick
7b86b24808 docs: Many updates to 7.8.2 release notes 2010-06-16 14:16:39 -07:00
Dan Nicholson
6e0c3a1ba0 docs: Note OSMesa build fix 2010-06-16 12:12:39 -07:00
Dan Nicholson
843a02eb9b osmesa: always build standalone for internal symbols
When building OSMesa and xlib GL, the resulting OSMesa would be linked
against libGL instead of the internal mesa libraries. However, when
building with -fvisibility=hidden, some of the internal functions used
in OSMesa could not be resolved through libGL.

Instead, always build OSMesa standalone without linking against libGL.
This has the advantage that OSMesa is always built the same way, but it
means that disk space is wasted when libGL is installed since both
libraries will contain the internal objects.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Tom Fogal <tfogal@alumni.unh.edu>
(cherry picked from commit cbf30fce32)
2010-06-16 09:29:44 -07:00
Eric Anholt
8825d5ca54 docs: Update to note 830/845 hang fix. 2010-06-15 15:54:31 -07:00
Eric Anholt
226e612631 i915: Clamp minimum lod to maximum texture level too.
Otherwise, we'd run into minlod > maxlod, and the sampler would give
us the undefined we asked for.

Bug #24846.  Fixes OGLC texlod.c.
(cherry picked from commit b80a728f8a)
2010-06-15 15:53:02 -07:00
Eric Anholt
3e9f4d19f6 i965: Fix bit allocation for number of color regions for ARB_draw_buffers.
If you used all 4 color targets we currently support, we would see 0
and end up just writing the first output.  Give enough bits that we
can do the maximum of 16.

Fixes piglit fbo-drawbuffers-maxtargets.
(cherry picked from commit 08b42bc97d)
2010-06-15 15:53:02 -07:00
Eric Anholt
37a8fa74c3 i965: Set the correct provoking vertex for clipped first-mode trifans.
Bug #24470: glean clipFlat test.
(cherry picked from commit 4e84dc8729)
2010-06-15 15:53:02 -07:00
Eric Anholt
eb99b66737 i965: Use R16G16B16A16_FLOAT for 3-component half-float.
The RGBX version isn't supported as a vertex input type, but since we
force the last channel's value anyway, this should be fine.  The only
potential risk I see is in the limiter on VBO reads past the end of
the buffer forcing the whole vertex to 0 when the A channel lands past
the end.

Fixes piglit draw-vertices-half-float.
(cherry picked from commit f5bd48cf67)
2010-06-15 15:53:01 -07:00
Eric Anholt
fc0b912f1e i915: Don't use XRGB8888 on 830 and 845.
The support for XRGB8888 appeared in the 855 and 865, and this format
is reserved on 830/845.  This should fix a regression from
b4a6169412 that caused hangs in etracer
on 845s.

Bug #26557.
(cherry picked from commit f0ff214bee)
2010-06-15 15:53:01 -07:00
Chris Wilson
a48edfad8a i915: Fix off-by-one for drawing rectangle.
The drawing rectangle is given in *inclusive* pixel values, so the range
is only [0,2047]. Hence when rendering to a 2048 wide target, such as an
extended desktop, we would issue an illegal instruction zeroing the draw
area.

Fixes:

  Bug 27408: Primary and Secondary display blanks in extended
             desktop mode with Compiz enabled
  https://bugs.freedesktop.org/show_bug.cgi?id=27408

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit add3260157)
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-06-13 21:05:27 +01:00
Brian Paul
1f756d916a docs: added a few more bug fixes to the 7.8.2 relnotes file 2010-06-08 08:45:08 -06:00
Brian Paul
7dbfc2565e glsl: change uniform location/offset encoding
This lets Mesa work like other OpenGL implementations with regard
to indexing uniform arrays.  See comments for details.

This is a combination of commits 5d0e136eff
and 1bbf803e3b from master which didn't
apply cleanly with git cherry-pick.
2010-06-08 08:43:37 -06:00
Brian Paul
d2f2d0a1b7 glx: fix regression with GLX_USE_GL
update for fbconfig_style_tags

Based on commit 26a9b7e4c7 from master.
But fix the formatting and don't dereference the pointer to avoid a
compiler warning.
2010-06-02 16:01:17 -06:00
Marek Olšák
fadc3c5c06 st/mesa: fix per-vertex point size
Cherry-picked from master, commit 0ad541a684.
2010-05-27 21:25:13 +02:00
Brian Paul
011e7b2c96 mesa: fix incorrect GL_DEPTH_STENCIL_ATTACHMENT format check
We want to check the incoming renderbuffer format, not the (potentially
non-existant) current attachment.

Fixes segfault w/ fbotexture -ds2.

NOTE: this will be applied to the 7.8 branch too.

(cherry picked from commit a504f2387e)
2010-05-27 13:14:40 -06:00
Brian Paul
2eb5bc5add meta: Convert Z value from normalized to object-space in meta code
Convert Z from a normalized value in the range [0, 1] to an
object-space Z coordinate in [-1, +1] so that drawing at the new Z
position with the default/identity ortho projection results in the
original Z value.  Used by the meta-Clear, Draw/CopyPixels and Bitmap
functions where the Z value comes from the clear value or raster
position.

Fixes piglit tests fdo23670-depth_test, quad-invariance and
glsl-orangebook-ch06-bump as well as oglc zbfunc.c.

https://bugs.freedesktop.org/show_bug.cgi?id=23670
2010-05-24 17:24:38 -04:00
Brian Paul
7d313d3506 docs: update 7.8.2 relnotes with Cell driver fixes
(cherry picked from commit b7f8f176f1)
2010-05-21 09:52:05 -06:00
Brian Paul
5c54b54e00 cell: fix breakage from earlier draw module changes
(cherry picked from commit 6e0efad38b)
2010-05-21 09:49:08 -06:00
Brian Paul
433626e5c0 cell: remove unused var 2010-05-21 09:27:39 -06:00
Brian Paul
b4777f82d5 gallium/draw: fix function parameter warning 2010-05-21 09:27:24 -06:00
Brian Paul
f94e259d8e gallium/rtasm: add function prototype to silence warning 2010-05-21 09:27:03 -06:00
Eric Anholt
533b766383 i965: Fix scissoring when width or height is 0.
We would run into trouble due to the hardware using inclusive numbers
and the subtraction to handle that producing negative (meaning large
positive) coordinates.

Bug #27643.
(cherry picked from commit 64516430be)
2010-05-13 13:43:06 -07:00
Eric Anholt
71f028bf93 i965: Fix assertion for surface tile offset usage on Ironlake.
Fixes assertion failure in fbo-generatemipmap-npot.
(cherry picked from commit b2e52e7278)
2010-05-13 13:43:06 -07:00
Eric Anholt
f007d0f89d i965: Fix cube map layouts on Ironlake.
We were doubling up the offsets for the mipmap levels for CPU access.
Instead of reimplementing i945_miptree_layout_2d with 6 cube images
separated by qpitch, share that function and provide the level offsets
later.

Fixes piglit cubemap and fbo-cubemap.
(cherry picked from commit 7d8f0fc282
Conflict due to mt->pitch still being here resolved -- i945 layout
should set it.)
2010-05-13 13:42:36 -07:00
Zhenyu Wang
728df9aaca intel: Clean up chipset name and gen num for Ironlake
Rename old IGDNG to Ironlake, and set 'gen' number for
Ironlake as 5, so tracking the features with generation num
instead of special is_ironlake flag.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
(cherry picked from commit cdcef6cbf4)
2010-05-13 13:41:33 -07:00
Eric Anholt
d2ade4b802 i965: When an RB gets a new region, clear the old from the state cache.
This prevents memory usage explosion in blender due to the state cache
hanging on to old fake frontbuffer regions.  Sigh at blender still
using frontbuffer rendering.

Bug #24119.
(cherry picked from commit ce914fff08)
2010-05-13 11:41:14 -07:00
Eric Anholt
e48964a561 intel: Don't tile textures so small that size is blown up by over 2x.
Noted on the mailing list for an app that puts each glyph for its text
into a separate texture.
(cherry picked from commit 453f0b1f24)
2010-05-13 11:41:10 -07:00
Eric Anholt
53557f1f34 i965: Reject shaders with uninlined function calls instead of hanging.
Most of the failure from using uninlined function calls ends up being
just bad rendering, but nested function calls in the VS currently hang
the GPU, so reject them and explain why.
(cherry picked from commit ee29b86129)
2010-05-13 11:40:21 -07:00
Eric Anholt
3bf7ea2a1c mesa: Don't overwrite a driver's shader infolog with generic failure message.
(cherry picked from commit 07a248a366)
2010-05-13 11:40:17 -07:00
Kristian Høgsberg
f3b55494f3 egl_dri2: Zero out driver struct
Otherwise testing ->Probe for non-NULL and calling it goes boom.
2010-05-12 14:51:25 -04:00
Kristian Høgsberg
8b68c0aa24 glx: Get GLX_SCREEN first in __glXQueryContextInfo()
And lookup the GLX screen for the context.  Otherwise we'll end up
jumping through a NULL-pointer once we try to look up the visual
or config for the shared context.

https://bugs.freedesktop.org/show_bug.cgi?id=14245
2010-05-12 14:50:04 -04:00
Brian Paul
3c407b52ff osmesa: fix OSMesa for CHAN_BITS=32
CHAN_BITS=16 still broken.

NOTE: this is a candidate for back-porting to the 7.8 stable branch.
(cherry picked from commit 36b3a8bd5a)
2010-05-07 09:00:05 -06:00
Brian Paul
210b74c613 glsl: change variable declared assertion into conditional
The slang_variable::declared field originated as a debug field but
can be promoted for use during sematic error checking.

Fixes fd.o bug 27921.

NOTE: this is a candidate for back-porting to the 7.8 stable branch.
(cherry picked from commit a12614362a)
2010-05-07 08:59:08 -06:00
Xavier Chantry
f7638f004d gallium: untrack u_indices_gen.c and u_indices_gen.c
These files are built with make and removed with make clean, so it does not
seem necessary to track them.

Looking at the Makefile, it seems that the two u_indices_* files are handled
similarly to u_format_srgb.c u_format_table.c and u_half.c, and these 3
files are already untracked and in .gitignore

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-05-06 12:40:36 +01:00
José Fonseca
30e9ffcd3b mesa/st: Fill in native program limits.
In the lack of more fine grained capabilities in Gallium, assume that if
the pipe driver supports GLSL then native limits match Mesa software
limits.
(cherry picked from commit 40a90cd11234a09c2477f5c9984dd6d9fac3f52c)
2010-05-04 15:37:25 +01:00
Jeremy Huddleston
4d63be67f3 darwin: Fix build
This is a regression from e42d84eaba

https://bugs.freedesktop.org/show_bug.cgi?id=27929

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-01 13:59:30 -07:00
Brian Paul
7b640f9f70 st/mesa: fix incorrect RowStride computation
Fixes incorrect stride when getting a compressed tex image.
2010-04-28 10:06:08 -06:00
Brian Paul
56f99ee640 st/mesa: fill in stImage->level in st_generate_mipmap()
Before, this field was always zero for all the new mipmap levels.
Fixes problems with glGetTexImage() from a generated mipmap.
2010-04-28 10:05:06 -06:00
Jakob Bornecrantz
ef9a8fcb1b glx: Fix build 2010-04-28 16:25:28 +01:00
Micah Fedke
9cfaaa291f egl: dri2 driver error output
This patch amends the error output string for the case where the
dri2 egl driver could not open the dri dev node.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-28 07:26:01 -06:00
Brian Paul
eecd2a59c1 osmesa: update SRC_DIRS to fix build 2010-04-27 17:06:17 -06:00
Brian Paul
29fc97606b osdemos: replace assertion with error handler 2010-04-27 17:05:56 -06:00
Brian Paul
c5bf13c537 osmesa: don't need to link with -lGL
The gl entrypoints are in libOSMesa.so
2010-04-27 16:57:43 -06:00
Pierre Willenbrock
c0b41116f1 mesa: Disable scissor when begining meta operations
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:58:58 -06:00
Pierre Willenbrock
717e86738f mesa: Don't set srcLevel on GL_TEXTURE_RECTANGLE_ARB targets
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:54:24 -06:00
Pierre Willenbrok
cc806f70b2 glx: Initialize have_back.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:53:28 -06:00
Jeremy Huddleston
a1cb3babbe Buildfixes to work around issues in OpenGL.framework
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 12:37:16 -07:00
Jeremy Huddleston
f64773010d Update OpenGL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
f5aa5377a5 apple: Use mesa gl.h rather than generating one.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
de96d063b1 apple: Integrate our libGL into the existing build system better
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
163901bc7f darwin: Use clientattrib
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
80b280db88 apple: Change ifdefs for DRI to be DRI && !APPLE
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00
Jeremy Huddleston
77dc40b289 apple: Remove duplicate headers that already exist in mesa.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-04-27 11:26:50 -07:00
Jeremy Huddleston
ad503c4155 apple: Initial import of libGL for OSX from AppleSGLX svn repository.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:50 -07:00
Chia-I Wu
f1381880a8 glapi: Fix loading of old DRI drivers.
The removal of _glapi_noop_enable_warnings and _glapi_set_warning_func
in e4f168a6f4 prevents DRI drivers built
before the commit from loading.  Add stub versions of the functions to
make them load again.
2010-04-27 23:19:27 +08:00
Pedro Maia
ea373df069 nv30/40g: fix calls to draw_create(), draw_set_rasterizer_state()
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 08:22:11 -06:00
Brian Paul
b0e2c5f8aa docs: document updated glext.h and glxext.h files 2010-04-26 20:32:24 -06:00
Brian Paul
4eb803975d glxext.h: upgraded to 2010/02/10 version 2010-04-26 20:32:02 -06:00
Brian Paul
273058b677 glext: upgraded to version 61 2010-04-26 20:31:19 -06:00
Brian Paul
b695cbd57c docs: add links to old mailing list archives 2010-04-23 15:36:40 -06:00
186 changed files with 57260 additions and 8407 deletions

View File

@@ -180,7 +180,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.8.1
VERSION=7.8.3-rc1
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
@@ -285,9 +285,6 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile \
$(DIRECTORY)/progs/Makefile \
$(DIRECTORY)/progs/util/README \
$(DIRECTORY)/progs/util/*.[ch] \
$(DIRECTORY)/progs/util/sampleMakefile \
$(DIRECTORY)/windows/VC8/
ES_FILES = \
@@ -438,7 +435,10 @@ DEMO_FILES = \
$(DIRECTORY)/progs/glsl/*.c \
$(DIRECTORY)/progs/glsl/*.frag \
$(DIRECTORY)/progs/glsl/*.vert \
$(DIRECTORY)/progs/glsl/*.shtest
$(DIRECTORY)/progs/glsl/*.shtest \
$(DIRECTORY)/progs/util/README \
$(DIRECTORY)/progs/util/*.[ch] \
$(DIRECTORY)/progs/util/sampleMakefile
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \

View File

@@ -26,6 +26,11 @@ INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Assembler
MESA_ASM_SOURCES = @MESA_ASM_SOURCES@

View File

@@ -13,7 +13,10 @@ CC = gcc
CXX = g++
PIC_FLAGS = -fPIC
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
-DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
-DGLX_ALIAS_UNSUPPORTED \
-DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL
# -DGLX_INDIRECT_RENDERING \
# -D_GNU_SOURCE - for src/mesa/main ...
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx
@@ -49,7 +52,7 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glsl glx mesa gallium glu glut/glx glew
SRC_DIRS = glsl glx/apple mesa gallium glu glut/glx glew
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri

View File

@@ -10,7 +10,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=8
MESA_TINY=1
MESA_TINY=2
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.
@@ -121,6 +121,8 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LI
APP_LIB_DEPS = -lm
X11_LIBS = -lX11
DLOPEN_LIBS = -ldl
# Installation directories (for make install)
INSTALL_DIR = /usr/local
INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR)

View File

@@ -9,7 +9,7 @@ CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS
CFLAGS = -g -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
@@ -17,12 +17,12 @@ CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
OSMESA_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -20,7 +20,7 @@ OSMESA_LIB_NAME = libOSMesa16.so
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =

View File

@@ -20,7 +20,7 @@ OSMESA_LIB_NAME = libOSMesa32.so
# Directories
SRC_DIRS = gallium mesa glu
SRC_DIRS = glsl mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =

View File

@@ -398,6 +398,7 @@ dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [],
[AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
AC_SUBST([DLOPEN_LIBS])
dnl See if posix_memalign is available
AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
@@ -699,7 +700,7 @@ AC_SUBST([DRI_DRIVER_SEARCH_DIR])
dnl Direct rendering or just indirect rendering
AC_ARG_ENABLE([driglx-direct],
[AS_HELP_STRING([--disable-driglx-direct],
[enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
[enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])],
[driglx_direct="$enableval"],
[driglx_direct="yes"])
dnl Which drivers to build - default is chosen by platform
@@ -865,7 +866,7 @@ else
fi
AC_ARG_ENABLE([gl-osmesa],
[AS_HELP_STRING([--enable-gl-osmesa],
[enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
[enable OSMesa with libGL @<:@default=enabled for xlib driver@:>@])],
[gl_osmesa="$enableval"],
[gl_osmesa="$default_gl_osmesa"])
if test "x$gl_osmesa" = xyes; then
@@ -900,8 +901,8 @@ x16|x32)
esac
AC_SUBST([OSMESA_LIB])
case "$mesa_driver" in
osmesa)
case "$DRIVER_DIRS" in
*osmesa*)
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
@@ -911,19 +912,7 @@ osmesa)
OSMESA_MESA_DEPS=""
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
;;
*)
# Link OSMesa to libGL otherwise
OSMESA_LIB_DEPS=""
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_MESA_DEPS='-l$(GL_LIB)'
else
OSMESA_MESA_DEPS=""
fi
OSMESA_PC_REQ="gl"
;;
esac
OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
AC_SUBST([OSMESA_LIB_DEPS])
AC_SUBST([OSMESA_MESA_DEPS])
AC_SUBST([OSMESA_PC_REQ])
@@ -1114,10 +1103,6 @@ fi
if test "x$enable_glut" = xyes; then
SRC_DIRS="$SRC_DIRS glut/glx"
GLUT_CFLAGS=""
if test "x$GCC" = xyes; then
GLUT_CFLAGS="-fexceptions"
fi
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
GLUT_PC_REQ_PRIV="x11 xmu xi"
@@ -1128,6 +1113,9 @@ if test "x$enable_glut" = xyes; then
GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
GLUT_PC_CFLAGS="$X11_INCLUDES"
fi
if test "x$GCC" = xyes; then
GLUT_CFLAGS="$GLUT_CFLAGS -fexceptions"
fi
GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
@@ -1229,6 +1217,10 @@ yes)
if test "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
# define GLX_DIRECT_RENDERING even when the driver is not dri
if test "x$mesa_driver" != xdri -a "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
;;
xorg)
PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])

View File

@@ -145,7 +145,7 @@ Make sure the values in src/mesa/main/version.h are correct.
</p>
<p>
Update the docs/news.html file and docs/download.html files.
Update docs/news.html.
</p>
<p>
@@ -208,10 +208,11 @@ sftp USERNAME,mesa3d@web.sourceforge.net
<p>
Make an announcement on the mailing lists:
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
and
<em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
</p>

View File

@@ -40,6 +40,15 @@ versions are sent to this list. Very low traffic.
Follow the links above for list archives.
</p>
<p>
The old Mesa lists hosted at SourceForge are no longer in use.
The archives are still available, however:
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-announce" target="_parent">mesa3d-announce</a>,
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-users" target="_parent">mesa3d-users</a>,
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-dev" target="_parent">mesa3d-dev</a>.
</p>
<p>For mailing lists about Direct Rendering Modules (drm) in Linux/BSD
kernels, see the
<a href="http://dri.freedesktop.org/wiki/MailingLists" target="_parent">

View File

@@ -11,6 +11,22 @@
<H1>News</H1>
<h2>TBD, 2010</h2>
<p>
<a href="relnotes-7.8.3.html">Mesa 7.8.3</a> is released. This is a bug-fix
release collecting fixes since the 7.8.2 release.
</p>
<h2>June 16, 2010</h2>
<p>
<a href="relnotes-7.8.2.html">Mesa 7.8.2</a> is released. This is a bug-fix
release collecting fixes since the 7.8.1 release.
</p>
<h2>April 5, 2010</h2>
<p>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.8.2 Release Notes / April, 5, 2010</H1>
<H1>Mesa 7.8.2 Release Notes / (date tbd)</H1>
<p>
Mesa 7.8.2 is a bug fix release which fixes bugs found since the 7.8.1 release.
@@ -26,7 +26,15 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
c89b63d253605ed40e8ac370d25a833c MesaLib-7.8.2.tar.gz
6be2d343a0089bfd395ce02aaf8adb57 MesaLib-7.8.2.tar.bz2
a04ad3b06ac5ff3969a003fa7bbf7d5b MesaLib-7.8.2.zip
7c213f92efeb471f0331670d5079d4c0 MesaDemos-7.8.2.tar.gz
757d9e2e06f48b1a52848be9b0307ced MesaDemos-7.8.2.tar.bz2
8d0e5cfe68b8ebf90265d350ae2c48b1 MesaDemos-7.8.2.zip
b74482e3f44f35ed395c4aada4fd8240 MesaGLUT-7.8.2.tar.gz
a471807b65e49c325808ba4551be93ed MesaGLUT-7.8.2.tar.bz2
9f190268c42be582ef66e47365ee61e3 MesaGLUT-7.8.2.zip
</pre>
@@ -34,13 +42,105 @@ tbd
<p>None.</p>
<h2>Bug fixes</h2>
<h2>Changes</h2>
<ul>
<li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
<li>Upgraded glext.h to version 61, and upgraded glxext.h
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
<li>Fixed Gallium Cell driver to buildable, runable state
<li>Fixed bad error checking for glFramebufferRenderbuffer(attachment=GL_DEPTH_STENCIL_ATTACHMENT).
<li>Fixed incorrect Z coordinate handling in "meta" glDraw/CopyPixels.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">Bug
#23670</a>.</li>
<li>Assorted i965 driver fixes.
Including but not limited to:
<ul>
<li>Fix scissoring when width or height is
0. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27643">Bug
#27643</a>.
<li>Fix bit allocation for number of color regions for
ARB_draw_buffers.</li>
<li>Set the correct provoking vertex for clipped first-mode
trifans. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24470">Bug
#24470</a>.</li>
<li>Use <code>R16G16B16A16_FLOAT</code> for 3-component half-float.</li>
<li>Fix assertion for surface tile offset usage on Ironlake.</li>
<li>Fix cube map layouts on Ironlake.</li>
<li>When an RB gets a new region, clear the old from the state
cache. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=24119">Bug
#24119</a>.</li>
<li>Reject shaders with uninlined function calls instead of hanging.</li>
</ul>
</li>
<li>Assorted i915 driver fixes. Including but not limited to:
<ul>
<li>Fixed texture LOD clamping in i915 driver.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=24846">Bug
#24846</a>.</li>
<li>Fix off-by-one for drawing rectangle.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27408">Bug
#27408</a>.</li>
</ul>
</li>
<li>Fixed hangs in etracer on 830 and 845
chipsets. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=26557">Bug
#26557</a>.</li>
<li>Fixed tiling of small textures on all Intel drivers.</li>
<li>Fixed crash in Savage driver when using <code>_mesa_CopyTexImage2D</code>.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27652">Bug
#27652</a>.</li>
<li>Assorted GLX fixes. Including but not limited to:
<ul>
<li>Fixed <code>__glXInitializeVisualConfigFromTags</code>'s handling of
unrecognized fbconfig tags.</li>
<li>Fixed regression with <code>GLX_USE_GL</code>.
<li>Fixed config chooser logic for 'mask' matching.</li>
<li>Report swap events correctly in direct rendered case (DRI2)</li>
<li>Fixed build with dri2proto which doesn't define
<code>X_DRI2SwapInterval</code>.</li>
<li>Get <code>GLX_SCREEN</code> first in <code>__glXQueryContextInfo</code>.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=14245">Bug
#14245</a>.</li>
</ul>
</li>
<li>Assorted GLSL fixes. Including but not limited to:
<ul>
<li>Change variable declared assertion into conditional in GLSL
compiler. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27921">Bug
#27921</a>.</li>
<li>Fix instruction indexing
bugs. <a href="https://bugs.freedesktop.org/show_bug.cgi?id=27566">Bug
#27566</a>.</li>
<li>Updated uniform location / offset encoding to be more like
other implementations.</li>
<li>Don't overwrite a driver's shader infolog with generic failure
message.</li>
</ul>
</li>
<li>Fixed OSMesa build for 16 and 32-bit color channel depth.
<li>Fixed OSMesa build with hidden symbol visibility. libOSMesa no longer links to libGL.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28305">Bug
#28305</a>.
<li>Fixed handling of multiple render targets in fixed-function
texture envrionmnent programs.</li>
<li>Fixed conversion errors in <code>signed_rgba8888[rev]</code> texel
fetch.</li>
<li>Don't set srcLevel on <code>GL_TEXTURE_RECTANGLE_ARB</code> targets.</li>
<li>Various build fixes for OpenBSD.</li>
<li>Various build fixes for OS X.</li>
<li>Various build fixes for GCC 3.3.</li>
</ul>
<h2>Changes</h2>
<p>None.</p>
</body>
</html>

89
docs/relnotes-7.8.3.html Normal file
View File

@@ -0,0 +1,89 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.8.3 Release Notes / (date tbd)</H1>
<p>
Mesa 7.8.3 is a bug fix release which fixes bugs found since the 7.8.2 release.
</p>
<p>
Mesa 7.8.3 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
x MesaLib-7.8.3.tar.gz
x MesaLib-7.8.3.tar.bz2
x MesaLib-7.8.3.zip
x MesaDemos-7.8.3.tar.gz
x MesaDemos-7.8.3.tar.bz2
x MesaDemos-7.8.3.zip
x MesaGLUT-7.8.3.tar.gz
x MesaGLUT-7.8.3.tar.bz2
x MesaGLUT-7.8.3.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Changes</h2>
<ul>
<li>The radeon driver should use less memory when searching for a valid mip
image.</li>
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fix unsupported FB with D24S8 (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=23670">29116</a>)</li>
<li>Fix ReadPixels crash when reading depth/stencil from an FBO</li>
<li>Fixed a bug rendering to 16-bit buffers using swrast.</li>
<li>Fixed a state tracker/TGSI bug that caused crashes when using Windows'
memory debugging features.</li>
<li>Fixed an issue rendering to 32-bit channels with swrast (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29487">29487</a>)</li>
<li>GLSL: fix indirect <TT>gl_TextureMatrix</TT> addressing (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28967">28967</a>)</li>
<li>GLSL: fix for bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=27216">27216</a></li>
<li>GLSL: fix zw fragcoord entries in some cases (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=29183">29183</a>)</li>
<li>Fix texture env generation in some cases (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=28169">28169</a>)</li>
<li>osmesa: a fix for calling <TT>OSMesaMakeCurrent</TT> twice was applied (bug
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=10966">10966</a></li>
<li>A bug was fixed which could cause Mesa to ignore the
<TT>MESA_EXTENSION_OVERRIDE</TT> environment variable.</li>
<li>A bug related to specular highlights on backfaces was fixed.</li>
<li>A radeon-specific issue with <TT>glCopyTex(Sub)Image</TT> was
corrected.</li>
<li>radeon/wine: flush command stream in more cases, fixing wine d3d9
tests.</li>
<li>r600: fix sin+cos normalization.</li>
<li>r600: (properly) ignore <TT>GL_COORD_REPLACE</TT> when point sprites are
disabled.</li>
<li>radeon: avoid flushing when the context is not current.</li>
<li>r300c: a bug affecting unaligned BOs was fixed.</li>
<li>r300c: a hardlock caused by ARB_half_float_vertex incorrectly advertised on some chipsets.</li>
</ul>
</body>
</html>

View File

@@ -13,6 +13,7 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>

View File

@@ -56,6 +56,7 @@
#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
#define glBeginPerfMonitorAMD MANGLE(BeginPerfMonitorAMD)
#define glBeginQueryARB MANGLE(BeginQueryARB)
#define glBeginQueryIndexed MANGLE(BeginQueryIndexed)
#define glBeginQuery MANGLE(BeginQuery)
#define glBeginTransformFeedbackEXT MANGLE(BeginTransformFeedbackEXT)
#define glBeginTransformFeedback MANGLE(BeginTransformFeedback)
@@ -75,6 +76,7 @@
#define glBindBufferRange MANGLE(BindBufferRange)
#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
#define glBindFragDataLocationIndexed MANGLE(BindFragDataLocationIndexed)
#define glBindFragDataLocation MANGLE(BindFragDataLocation)
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
@@ -87,10 +89,12 @@
#define glBindProgramNV MANGLE(BindProgramNV)
#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
#define glBindRenderbuffer MANGLE(BindRenderbuffer)
#define glBindSampler MANGLE(BindSampler)
#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
#define glBindTextureEXT MANGLE(BindTextureEXT)
#define glBindTexture MANGLE(BindTexture)
#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
#define glBindTransformFeedback MANGLE(BindTransformFeedback)
#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV)
#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
#define glBindVertexArray MANGLE(BindVertexArray)
@@ -215,6 +219,10 @@
#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
#define glColorMask MANGLE(ColorMask)
#define glColorMaterial MANGLE(ColorMaterial)
#define glColorP3ui MANGLE(ColorP3ui)
#define glColorP3uiv MANGLE(ColorP3uiv)
#define glColorP4ui MANGLE(ColorP4ui)
#define glColorP4uiv MANGLE(ColorP4uiv)
#define glColorPointerEXT MANGLE(ColorPointerEXT)
#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
#define glColorPointer MANGLE(ColorPointer)
@@ -236,6 +244,7 @@
#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
#define glCompileShaderARB MANGLE(CompileShaderARB)
#define glCompileShaderIncludeARB MANGLE(CompileShaderIncludeARB)
#define glCompileShader MANGLE(CompileShader)
#define glCompressedMultiTexImage1DEXT MANGLE(CompressedMultiTexImage1DEXT)
#define glCompressedMultiTexImage2DEXT MANGLE(CompressedMultiTexImage2DEXT)
@@ -326,6 +335,7 @@
#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
#define glDeleteFramebuffers MANGLE(DeleteFramebuffers)
#define glDeleteLists MANGLE(DeleteLists)
#define glDeleteNamedStringARB MANGLE(DeleteNamedStringARB)
#define glDeleteObjectARB MANGLE(DeleteObjectARB)
#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
#define glDeletePerfMonitorsAMD MANGLE(DeletePerfMonitorsAMD)
@@ -336,10 +346,12 @@
#define glDeleteQueries MANGLE(DeleteQueries)
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
#define glDeleteSamplers MANGLE(DeleteSamplers)
#define glDeleteShader MANGLE(DeleteShader)
#define glDeleteSync MANGLE(DeleteSync)
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
#define glDeleteTextures MANGLE(DeleteTextures)
#define glDeleteTransformFeedbacks MANGLE(DeleteTransformFeedbacks)
#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
#define glDeleteVertexArrays MANGLE(DeleteVertexArrays)
@@ -363,6 +375,7 @@
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
#define glDrawArraysIndirect MANGLE(DrawArraysIndirect)
#define glDrawArraysInstancedARB MANGLE(DrawArraysInstancedARB)
#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
#define glDrawArraysInstanced MANGLE(DrawArraysInstanced)
@@ -374,6 +387,7 @@
#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
#define glDrawElementsBaseVertex MANGLE(DrawElementsBaseVertex)
#define glDrawElementsIndirect MANGLE(DrawElementsIndirect)
#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
#define glDrawElementsInstancedBaseVertex MANGLE(DrawElementsInstancedBaseVertex)
#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
@@ -386,7 +400,9 @@
#define glDrawRangeElementsBaseVertex MANGLE(DrawRangeElementsBaseVertex)
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glDrawRangeElements MANGLE(DrawRangeElements)
#define glDrawTransformFeedback MANGLE(DrawTransformFeedback)
#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
#define glDrawTransformFeedbackStream MANGLE(DrawTransformFeedbackStream)
#define glEdgeFlagFormatNV MANGLE(EdgeFlagFormatNV)
#define glEdgeFlag MANGLE(EdgeFlag)
#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
@@ -414,6 +430,7 @@
#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
#define glEndPerfMonitorAMD MANGLE(EndPerfMonitorAMD)
#define glEndQueryARB MANGLE(EndQueryARB)
#define glEndQueryIndexed MANGLE(EndQueryIndexed)
#define glEndQuery MANGLE(EndQuery)
#define glEndTransformFeedbackEXT MANGLE(EndTransformFeedbackEXT)
#define glEndTransformFeedback MANGLE(EndTransformFeedback)
@@ -498,7 +515,6 @@
#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
#define glFramebufferTextureFace MANGLE(FramebufferTextureFace)
#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
@@ -529,15 +545,20 @@
#define glGenQueries MANGLE(GenQueries)
#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
#define glGenRenderbuffers MANGLE(GenRenderbuffers)
#define glGenSamplers MANGLE(GenSamplers)
#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
#define glGenTexturesEXT MANGLE(GenTexturesEXT)
#define glGenTextures MANGLE(GenTextures)
#define glGenTransformFeedbacks MANGLE(GenTransformFeedbacks)
#define glGenTransformFeedbacksNV MANGLE(GenTransformFeedbacksNV)
#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
#define glGenVertexArrays MANGLE(GenVertexArrays)
#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
#define glGetActiveAttrib MANGLE(GetActiveAttrib)
#define glGetActiveSubroutineName MANGLE(GetActiveSubroutineName)
#define glGetActiveSubroutineUniformiv MANGLE(GetActiveSubroutineUniformiv)
#define glGetActiveSubroutineUniformName MANGLE(GetActiveSubroutineUniformName)
#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
#define glGetActiveUniformBlockiv MANGLE(GetActiveUniformBlockiv)
#define glGetActiveUniformBlockName MANGLE(GetActiveUniformBlockName)
@@ -599,6 +620,7 @@
#define glGetFloatIndexedvEXT MANGLE(GetFloatIndexedvEXT)
#define glGetFloatv MANGLE(GetFloatv)
#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
#define glGetFragDataIndex MANGLE(GetFragDataIndex)
#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
#define glGetFragDataLocation MANGLE(GetFragDataLocation)
#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
@@ -678,6 +700,8 @@
#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT)
#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT)
#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT)
#define glGetNamedStringARB MANGLE(GetNamedStringARB)
#define glGetNamedStringivARB MANGLE(GetNamedStringivARB)
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
@@ -717,18 +741,26 @@
#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
#define glGetProgramStageiv MANGLE(GetProgramStageiv)
#define glGetProgramStringARB MANGLE(GetProgramStringARB)
#define glGetProgramStringNV MANGLE(GetProgramStringNV)
#define glGetQueryIndexediv MANGLE(GetQueryIndexediv)
#define glGetQueryivARB MANGLE(GetQueryivARB)
#define glGetQueryiv MANGLE(GetQueryiv)
#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
#define glGetQueryObjecti64v MANGLE(GetQueryObjecti64v)
#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
#define glGetQueryObjectui64v MANGLE(GetQueryObjectui64v)
#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
#define glGetRenderbufferParameteriv MANGLE(GetRenderbufferParameteriv)
#define glGetSamplerParameterfv MANGLE(GetSamplerParameterfv)
#define glGetSamplerParameterIfv MANGLE(GetSamplerParameterIfv)
#define glGetSamplerParameterIiv MANGLE(GetSamplerParameterIiv)
#define glGetSamplerParameteriv MANGLE(GetSamplerParameteriv)
#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
#define glGetSeparableFilter MANGLE(GetSeparableFilter)
#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
@@ -738,6 +770,8 @@
#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
#define glGetStringi MANGLE(GetStringi)
#define glGetString MANGLE(GetString)
#define glGetSubroutineIndex MANGLE(GetSubroutineIndex)
#define glGetSubroutineUniformLocation MANGLE(GetSubroutineUniformLocation)
#define glGetSynciv MANGLE(GetSynciv)
#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
@@ -770,6 +804,7 @@
#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
#define glGetUniformBlockIndex MANGLE(GetUniformBlockIndex)
#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
#define glGetUniformdv MANGLE(GetUniformdv)
#define glGetUniformfvARB MANGLE(GetUniformfvARB)
#define glGetUniformfv MANGLE(GetUniformfv)
#define glGetUniformIndices MANGLE(GetUniformIndices)
@@ -778,6 +813,7 @@
#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
#define glGetUniformLocation MANGLE(GetUniformLocation)
#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
#define glGetUniformSubroutineuiv MANGLE(GetUniformSubroutineuiv)
#define glGetUniformui64vNV MANGLE(GetUniformui64vNV)
#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
#define glGetUniformuiv MANGLE(GetUniformuiv)
@@ -865,6 +901,7 @@
#define glIsFramebuffer MANGLE(IsFramebuffer)
#define glIsList MANGLE(IsList)
#define glIsNamedBufferResidentNV MANGLE(IsNamedBufferResidentNV)
#define glIsNamedStringARB MANGLE(IsNamedStringARB)
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
#define glIsProgramARB MANGLE(IsProgramARB)
@@ -874,10 +911,12 @@
#define glIsQuery MANGLE(IsQuery)
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
#define glIsRenderbuffer MANGLE(IsRenderbuffer)
#define glIsSampler MANGLE(IsSampler)
#define glIsShader MANGLE(IsShader)
#define glIsSync MANGLE(IsSync)
#define glIsTextureEXT MANGLE(IsTextureEXT)
#define glIsTexture MANGLE(IsTexture)
#define glIsTransformFeedback MANGLE(IsTransformFeedback)
#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
@@ -915,6 +954,8 @@
#define glLogicOp MANGLE(LogicOp)
#define glMakeBufferNonResidentNV MANGLE(MakeBufferNonResidentNV)
#define glMakeBufferResidentNV MANGLE(MakeBufferResidentNV)
#define glMakeNamedBufferNonResidentNV MANGLE(MakeNamedBufferNonResidentNV)
#define glMakeNamedBufferResidentNV MANGLE(MakeNamedBufferResidentNV)
#define glMap1d MANGLE(Map1d)
#define glMap1f MANGLE(Map1f)
#define glMap2d MANGLE(Map2d)
@@ -1048,6 +1089,14 @@
#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
#define glMultiTexCoordP1ui MANGLE(MultiTexCoordP1ui)
#define glMultiTexCoordP1uiv MANGLE(MultiTexCoordP1uiv)
#define glMultiTexCoordP2ui MANGLE(MultiTexCoordP2ui)
#define glMultiTexCoordP2uiv MANGLE(MultiTexCoordP2uiv)
#define glMultiTexCoordP3ui MANGLE(MultiTexCoordP3ui)
#define glMultiTexCoordP3uiv MANGLE(MultiTexCoordP3uiv)
#define glMultiTexCoordP4ui MANGLE(MultiTexCoordP4ui)
#define glMultiTexCoordP4uiv MANGLE(MultiTexCoordP4uiv)
#define glMultiTexCoordPointerEXT MANGLE(MultiTexCoordPointerEXT)
#define glMultiTexEnvfEXT MANGLE(MultiTexEnvfEXT)
#define glMultiTexEnvfvEXT MANGLE(MultiTexEnvfvEXT)
@@ -1087,8 +1136,6 @@
#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
#define glNamedMakeBufferNonResidentNV MANGLE(NamedMakeBufferNonResidentNV)
#define glNamedMakeBufferResidentNV MANGLE(NamedMakeBufferResidentNV)
#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
@@ -1104,6 +1151,7 @@
#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT)
#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT)
#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT)
#define glNamedStringARB MANGLE(NamedStringARB)
#define glNewList MANGLE(NewList)
#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
#define glNormal3b MANGLE(Normal3b)
@@ -1121,6 +1169,8 @@
#define glNormal3s MANGLE(Normal3s)
#define glNormal3sv MANGLE(Normal3sv)
#define glNormalFormatNV MANGLE(NormalFormatNV)
#define glNormalP3ui MANGLE(NormalP3ui)
#define glNormalP3uiv MANGLE(NormalP3uiv)
#define glNormalPointerEXT MANGLE(NormalPointerEXT)
#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
#define glNormalPointer MANGLE(NormalPointer)
@@ -1140,6 +1190,9 @@
#define glOrtho MANGLE(Ortho)
#define glPassTexCoordATI MANGLE(PassTexCoordATI)
#define glPassThrough MANGLE(PassThrough)
#define glPatchParameterfv MANGLE(PatchParameterfv)
#define glPatchParameteri MANGLE(PatchParameteri)
#define glPauseTransformFeedback MANGLE(PauseTransformFeedback)
#define glPauseTransformFeedbackNV MANGLE(PauseTransformFeedbackNV)
#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
#define glPixelMapfv MANGLE(PixelMapfv)
@@ -1231,38 +1284,55 @@
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
#define glProgramUniform1dEXT MANGLE(ProgramUniform1dEXT)
#define glProgramUniform1dvEXT MANGLE(ProgramUniform1dvEXT)
#define glProgramUniform1fEXT MANGLE(ProgramUniform1fEXT)
#define glProgramUniform1fvEXT MANGLE(ProgramUniform1fvEXT)
#define glProgramUniform1iEXT MANGLE(ProgramUniform1iEXT)
#define glProgramUniform1ivEXT MANGLE(ProgramUniform1ivEXT)
#define glProgramUniform1uiEXT MANGLE(ProgramUniform1uiEXT)
#define glProgramUniform1uivEXT MANGLE(ProgramUniform1uivEXT)
#define glProgramUniform2dEXT MANGLE(ProgramUniform2dEXT)
#define glProgramUniform2dvEXT MANGLE(ProgramUniform2dvEXT)
#define glProgramUniform2fEXT MANGLE(ProgramUniform2fEXT)
#define glProgramUniform2fvEXT MANGLE(ProgramUniform2fvEXT)
#define glProgramUniform2iEXT MANGLE(ProgramUniform2iEXT)
#define glProgramUniform2ivEXT MANGLE(ProgramUniform2ivEXT)
#define glProgramUniform2uiEXT MANGLE(ProgramUniform2uiEXT)
#define glProgramUniform2uivEXT MANGLE(ProgramUniform2uivEXT)
#define glProgramUniform3dEXT MANGLE(ProgramUniform3dEXT)
#define glProgramUniform3dvEXT MANGLE(ProgramUniform3dvEXT)
#define glProgramUniform3fEXT MANGLE(ProgramUniform3fEXT)
#define glProgramUniform3fvEXT MANGLE(ProgramUniform3fvEXT)
#define glProgramUniform3iEXT MANGLE(ProgramUniform3iEXT)
#define glProgramUniform3ivEXT MANGLE(ProgramUniform3ivEXT)
#define glProgramUniform3uiEXT MANGLE(ProgramUniform3uiEXT)
#define glProgramUniform3uivEXT MANGLE(ProgramUniform3uivEXT)
#define glProgramUniform4dEXT MANGLE(ProgramUniform4dEXT)
#define glProgramUniform4dvEXT MANGLE(ProgramUniform4dvEXT)
#define glProgramUniform4fEXT MANGLE(ProgramUniform4fEXT)
#define glProgramUniform4fvEXT MANGLE(ProgramUniform4fvEXT)
#define glProgramUniform4iEXT MANGLE(ProgramUniform4iEXT)
#define glProgramUniform4ivEXT MANGLE(ProgramUniform4ivEXT)
#define glProgramUniform4uiEXT MANGLE(ProgramUniform4uiEXT)
#define glProgramUniform4uivEXT MANGLE(ProgramUniform4uivEXT)
#define glProgramUniformMatrix2dvEXT MANGLE(ProgramUniformMatrix2dvEXT)
#define glProgramUniformMatrix2fvEXT MANGLE(ProgramUniformMatrix2fvEXT)
#define glProgramUniformMatrix2x3dvEXT MANGLE(ProgramUniformMatrix2x3dvEXT)
#define glProgramUniformMatrix2x3fvEXT MANGLE(ProgramUniformMatrix2x3fvEXT)
#define glProgramUniformMatrix2x4dvEXT MANGLE(ProgramUniformMatrix2x4dvEXT)
#define glProgramUniformMatrix2x4fvEXT MANGLE(ProgramUniformMatrix2x4fvEXT)
#define glProgramUniformMatrix3dvEXT MANGLE(ProgramUniformMatrix3dvEXT)
#define glProgramUniformMatrix3fvEXT MANGLE(ProgramUniformMatrix3fvEXT)
#define glProgramUniformMatrix3x2dvEXT MANGLE(ProgramUniformMatrix3x2dvEXT)
#define glProgramUniformMatrix3x2fvEXT MANGLE(ProgramUniformMatrix3x2fvEXT)
#define glProgramUniformMatrix3x4dvEXT MANGLE(ProgramUniformMatrix3x4dvEXT)
#define glProgramUniformMatrix3x4fvEXT MANGLE(ProgramUniformMatrix3x4fvEXT)
#define glProgramUniformMatrix4dvEXT MANGLE(ProgramUniformMatrix4dvEXT)
#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT)
#define glProgramUniformMatrix4x2dvEXT MANGLE(ProgramUniformMatrix4x2dvEXT)
#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT)
#define glProgramUniformMatrix4x3dvEXT MANGLE(ProgramUniformMatrix4x3dvEXT)
#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
#define glProgramUniformui64NV MANGLE(ProgramUniformui64NV)
#define glProgramUniformui64vNV MANGLE(ProgramUniformui64vNV)
@@ -1274,6 +1344,7 @@
#define glPushClientAttrib MANGLE(PushClientAttrib)
#define glPushMatrix MANGLE(PushMatrix)
#define glPushName MANGLE(PushName)
#define glQueryCounter MANGLE(QueryCounter)
#define glRasterPos2d MANGLE(RasterPos2d)
#define glRasterPos2dv MANGLE(RasterPos2dv)
#define glRasterPos2f MANGLE(RasterPos2f)
@@ -1345,6 +1416,7 @@
#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
#define glResetMinmax MANGLE(ResetMinmax)
#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
#define glResumeTransformFeedback MANGLE(ResumeTransformFeedback)
#define glResumeTransformFeedbackNV MANGLE(ResumeTransformFeedbackNV)
#define glRotated MANGLE(Rotated)
#define glRotatef MANGLE(Rotatef)
@@ -1357,6 +1429,12 @@
#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
#define glSamplePatternEXT MANGLE(SamplePatternEXT)
#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
#define glSamplerParameterf MANGLE(SamplerParameterf)
#define glSamplerParameterfv MANGLE(SamplerParameterfv)
#define glSamplerParameterIiv MANGLE(SamplerParameterIiv)
#define glSamplerParameteri MANGLE(SamplerParameteri)
#define glSamplerParameterIuiv MANGLE(SamplerParameterIuiv)
#define glSamplerParameteriv MANGLE(SamplerParameteriv)
#define glScaled MANGLE(Scaled)
#define glScalef MANGLE(Scalef)
#define glScissor MANGLE(Scissor)
@@ -1395,6 +1473,8 @@
#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
#define glSecondaryColorFormatNV MANGLE(SecondaryColorFormatNV)
#define glSecondaryColorP3ui MANGLE(SecondaryColorP3ui)
#define glSecondaryColorP3uiv MANGLE(SecondaryColorP3uiv)
#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
@@ -1509,6 +1589,14 @@
#define glTexCoord4s MANGLE(TexCoord4s)
#define glTexCoord4sv MANGLE(TexCoord4sv)
#define glTexCoordFormatNV MANGLE(TexCoordFormatNV)
#define glTexCoordP1ui MANGLE(TexCoordP1ui)
#define glTexCoordP1uiv MANGLE(TexCoordP1uiv)
#define glTexCoordP2ui MANGLE(TexCoordP2ui)
#define glTexCoordP2uiv MANGLE(TexCoordP2uiv)
#define glTexCoordP3ui MANGLE(TexCoordP3ui)
#define glTexCoordP3uiv MANGLE(TexCoordP3uiv)
#define glTexCoordP4ui MANGLE(TexCoordP4ui)
#define glTexCoordP4uiv MANGLE(TexCoordP4uiv)
#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
#define glTexCoordPointer MANGLE(TexCoordPointer)
@@ -1574,6 +1662,8 @@
#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
#define glTranslated MANGLE(Translated)
#define glTranslatef MANGLE(Translatef)
#define glUniform1d MANGLE(Uniform1d)
#define glUniform1dv MANGLE(Uniform1dv)
#define glUniform1fARB MANGLE(Uniform1fARB)
#define glUniform1f MANGLE(Uniform1f)
#define glUniform1fvARB MANGLE(Uniform1fvARB)
@@ -1586,6 +1676,8 @@
#define glUniform1ui MANGLE(Uniform1ui)
#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
#define glUniform1uiv MANGLE(Uniform1uiv)
#define glUniform2d MANGLE(Uniform2d)
#define glUniform2dv MANGLE(Uniform2dv)
#define glUniform2fARB MANGLE(Uniform2fARB)
#define glUniform2f MANGLE(Uniform2f)
#define glUniform2fvARB MANGLE(Uniform2fvARB)
@@ -1598,6 +1690,8 @@
#define glUniform2ui MANGLE(Uniform2ui)
#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
#define glUniform2uiv MANGLE(Uniform2uiv)
#define glUniform3d MANGLE(Uniform3d)
#define glUniform3dv MANGLE(Uniform3dv)
#define glUniform3fARB MANGLE(Uniform3fARB)
#define glUniform3f MANGLE(Uniform3f)
#define glUniform3fvARB MANGLE(Uniform3fvARB)
@@ -1610,6 +1704,8 @@
#define glUniform3ui MANGLE(Uniform3ui)
#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
#define glUniform3uiv MANGLE(Uniform3uiv)
#define glUniform4d MANGLE(Uniform4d)
#define glUniform4dv MANGLE(Uniform4dv)
#define glUniform4fARB MANGLE(Uniform4fARB)
#define glUniform4f MANGLE(Uniform4f)
#define glUniform4fvARB MANGLE(Uniform4fvARB)
@@ -1624,18 +1720,28 @@
#define glUniform4uiv MANGLE(Uniform4uiv)
#define glUniformBlockBinding MANGLE(UniformBlockBinding)
#define glUniformBufferEXT MANGLE(UniformBufferEXT)
#define glUniformMatrix2dv MANGLE(UniformMatrix2dv)
#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
#define glUniformMatrix2x3dv MANGLE(UniformMatrix2x3dv)
#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
#define glUniformMatrix2x4dv MANGLE(UniformMatrix2x4dv)
#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
#define glUniformMatrix3dv MANGLE(UniformMatrix3dv)
#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
#define glUniformMatrix3x2dv MANGLE(UniformMatrix3x2dv)
#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
#define glUniformMatrix3x4dv MANGLE(UniformMatrix3x4dv)
#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
#define glUniformMatrix4dv MANGLE(UniformMatrix4dv)
#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
#define glUniformMatrix4x2dv MANGLE(UniformMatrix4x2dv)
#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
#define glUniformMatrix4x3dv MANGLE(UniformMatrix4x3dv)
#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
#define glUniformSubroutinesuiv MANGLE(UniformSubroutinesuiv)
#define glUniformui64NV MANGLE(Uniformui64NV)
#define glUniformui64vNV MANGLE(Uniformui64vNV)
#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
@@ -1844,6 +1950,14 @@
#define glVertexAttribIFormatNV MANGLE(VertexAttribIFormatNV)
#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
#define glVertexAttribIPointer MANGLE(VertexAttribIPointer)
#define glVertexAttribP1ui MANGLE(VertexAttribP1ui)
#define glVertexAttribP1uiv MANGLE(VertexAttribP1uiv)
#define glVertexAttribP2ui MANGLE(VertexAttribP2ui)
#define glVertexAttribP2uiv MANGLE(VertexAttribP2uiv)
#define glVertexAttribP3ui MANGLE(VertexAttribP3ui)
#define glVertexAttribP3uiv MANGLE(VertexAttribP3uiv)
#define glVertexAttribP4ui MANGLE(VertexAttribP4ui)
#define glVertexAttribP4uiv MANGLE(VertexAttribP4uiv)
#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
#define glVertexAttribPointer MANGLE(VertexAttribPointer)
#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
@@ -1868,6 +1982,12 @@
#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
#define glVertexFormatNV MANGLE(VertexFormatNV)
#define glVertexP2ui MANGLE(VertexP2ui)
#define glVertexP2uiv MANGLE(VertexP2uiv)
#define glVertexP3ui MANGLE(VertexP3ui)
#define glVertexP3uiv MANGLE(VertexP3uiv)
#define glVertexP4ui MANGLE(VertexP4ui)
#define glVertexP4uiv MANGLE(VertexP4uiv)
#define glVertexPointerEXT MANGLE(VertexPointerEXT)
#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
#define glVertexPointer MANGLE(VertexPointer)

File diff suppressed because it is too large Load Diff

View File

@@ -124,6 +124,10 @@ extern "C" {
#define GLX_SAMPLES_ARB 100001
#endif
#ifndef GLX_ARB_vertex_buffer_object
#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
#endif
#ifndef GLX_ARB_fbconfig_float
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004

View File

@@ -60,7 +60,7 @@ xeglgears: xeglgears.o $(HEADERS) $(LIB_DEP)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)
xeglthreads: xeglthreads.o $(HEADERS) $(LIB_DEP)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -lpthread $(X11_LIBS)
xegl_tri: xegl_tri.o $(HEADERS) $(LIB_DEP)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)

View File

@@ -5,7 +5,7 @@ include $(TOP)/configs/current
INCDIR = $(TOP)/include
OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -l$(OSMESA_LIB) $(APP_LIB_DEPS)
OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(OSMESA_LIB) $(APP_LIB_DEPS)
OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -lOSMesa16 -l$(GLU_LIB) \
-l$(GL_LIB) $(APP_LIB_DEPS)

View File

@@ -399,7 +399,11 @@ test(GLenum type, GLint bits, const char *filename)
/* sanity checks */
glGetIntegerv(GL_RED_BITS, &cBits);
assert(cBits == bits);
if (cBits != bits) {
fprintf(stderr, "Unable to create %d-bit/channel renderbuffer.\n", bits);
fprintf(stderr, "May need to recompile Mesa with CHAN_BITS=16 or 32.\n");
return 0;
}
glGetIntegerv(GL_GREEN_BITS, &cBits);
assert(cBits == bits);
glGetIntegerv(GL_BLUE_BITS, &cBits);

View File

@@ -706,7 +706,8 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp,
dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
if (dri2_dpy->fd == -1) {
_eglLog(_EGL_FATAL,
"DRI2: could not open %s (%s)", path, strerror(errno));
"DRI2: could not open %s (%s)", dri2_dpy->device_name,
strerror(errno));
goto cleanup_driver;
}
@@ -1330,6 +1331,7 @@ _eglMain(const char *args)
if (!dri2_drv)
return NULL;
memset(dri2_drv, 0, sizeof *dri2_drv);
_eglInitDriverFallbacks(&dri2_drv->base);
dri2_drv->base.API.Initialize = dri2_initialize;
dri2_drv->base.API.Terminate = dri2_terminate;

View File

@@ -125,7 +125,7 @@ vs_ppc_run_linear( struct draw_vertex_shader *base,
*/
shader->func(inputs_soa, outputs_soa, temps_soa,
(float (*)[4]) shader->base.immediates,
(const float (*)[4])constants[0],
(float (*)[4]) constants[0],
ppc_builtin_constants);
/* convert (up to) four output verts from SoA back to AoS format */

View File

@@ -0,0 +1,2 @@
u_indices_gen.c
u_unfilled_gen.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,992 +0,0 @@
/* File automatically generated by u_unfilled_gen.py */
/*
* Copyright 2009 VMware, Inc.
* 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
* on 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
* VMWARE AND/OR THEIR 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.
*/
/**
* @file
* Functions to translate and generate index lists
*/
#include "indices/u_indices.h"
#include "indices/u_indices_priv.h"
#include "pipe/p_compiler.h"
#include "util/u_debug.h"
#include "pipe/p_defines.h"
#include "util/u_memory.h"
static unsigned out_size_idx( unsigned index_size )
{
switch (index_size) {
case 4: return OUT_UINT;
case 2: return OUT_USHORT;
default: assert(0); return OUT_USHORT;
}
}
static unsigned in_size_idx( unsigned index_size )
{
switch (index_size) {
case 4: return IN_UINT;
case 2: return IN_USHORT;
case 1: return IN_UBYTE;
default: assert(0); return IN_UBYTE;
}
}
static u_generate_func generate_line[OUT_COUNT][PRIM_COUNT];
static u_translate_func translate_line[IN_COUNT][OUT_COUNT][PRIM_COUNT];
static void generate_tris_ushort(
unsigned nr,
void *_out )
{
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i+=3) {
(out+j)[0] = (ushort)(i);
(out+j)[1] = (ushort)(i+1);
(out+j+2)[0] = (ushort)(i+1);
(out+j+2)[1] = (ushort)(i+2);
(out+j+4)[0] = (ushort)(i+2);
(out+j+4)[1] = (ushort)(i);
}
}
static void generate_tristrip_ushort(
unsigned nr,
void *_out )
{
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)(i);
(out+j)[1] = (ushort)(i+1/*+(i&1)*/);
(out+j+2)[0] = (ushort)(i+1/*+(i&1)*/);
(out+j+2)[1] = (ushort)(i+2/*-(i&1)*/);
(out+j+4)[0] = (ushort)(i+2/*-(i&1)*/);
(out+j+4)[1] = (ushort)(i);
}
}
static void generate_trifan_ushort(
unsigned nr,
void *_out )
{
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)(0);
(out+j)[1] = (ushort)(i+1);
(out+j+2)[0] = (ushort)(i+1);
(out+j+2)[1] = (ushort)(i+2);
(out+j+4)[0] = (ushort)(i+2);
(out+j+4)[1] = (ushort)(0);
}
}
static void generate_quads_ushort(
unsigned nr,
void *_out )
{
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=4) {
(out+j)[0] = (ushort)(i+0);
(out+j)[1] = (ushort)(i+1);
(out+j+2)[0] = (ushort)(i+1);
(out+j+2)[1] = (ushort)(i+2);
(out+j+4)[0] = (ushort)(i+2);
(out+j+4)[1] = (ushort)(i+3);
(out+j+6)[0] = (ushort)(i+3);
(out+j+6)[1] = (ushort)(i+0);
}
}
static void generate_quadstrip_ushort(
unsigned nr,
void *_out )
{
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=2) {
(out+j)[0] = (ushort)(i+2);
(out+j)[1] = (ushort)(i+0);
(out+j+2)[0] = (ushort)(i+0);
(out+j+2)[1] = (ushort)(i+1);
(out+j+4)[0] = (ushort)(i+1);
(out+j+4)[1] = (ushort)(i+3);
(out+j+6)[0] = (ushort)(i+3);
(out+j+6)[1] = (ushort)(i+2);
}
}
static void generate_polygon_ushort(
unsigned nr,
void *_out )
{
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)(0);
(out+j)[1] = (ushort)(i+1);
(out+j+2)[0] = (ushort)(i+1);
(out+j+2)[1] = (ushort)(i+2);
(out+j+4)[0] = (ushort)(i+2);
(out+j+4)[1] = (ushort)(0);
}
}
static void generate_tris_uint(
unsigned nr,
void *_out )
{
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i+=3) {
(out+j)[0] = (uint)(i);
(out+j)[1] = (uint)(i+1);
(out+j+2)[0] = (uint)(i+1);
(out+j+2)[1] = (uint)(i+2);
(out+j+4)[0] = (uint)(i+2);
(out+j+4)[1] = (uint)(i);
}
}
static void generate_tristrip_uint(
unsigned nr,
void *_out )
{
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)(i);
(out+j)[1] = (uint)(i+1/*+(i&1)*/);
(out+j+2)[0] = (uint)(i+1/*+(i&1)*/);
(out+j+2)[1] = (uint)(i+2/*-(i&1)*/);
(out+j+4)[0] = (uint)(i+2/*-(i&1)*/);
(out+j+4)[1] = (uint)(i);
}
}
static void generate_trifan_uint(
unsigned nr,
void *_out )
{
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)(0);
(out+j)[1] = (uint)(i+1);
(out+j+2)[0] = (uint)(i+1);
(out+j+2)[1] = (uint)(i+2);
(out+j+4)[0] = (uint)(i+2);
(out+j+4)[1] = (uint)(0);
}
}
static void generate_quads_uint(
unsigned nr,
void *_out )
{
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=4) {
(out+j)[0] = (uint)(i+0);
(out+j)[1] = (uint)(i+1);
(out+j+2)[0] = (uint)(i+1);
(out+j+2)[1] = (uint)(i+2);
(out+j+4)[0] = (uint)(i+2);
(out+j+4)[1] = (uint)(i+3);
(out+j+6)[0] = (uint)(i+3);
(out+j+6)[1] = (uint)(i+0);
}
}
static void generate_quadstrip_uint(
unsigned nr,
void *_out )
{
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=2) {
(out+j)[0] = (uint)(i+2);
(out+j)[1] = (uint)(i+0);
(out+j+2)[0] = (uint)(i+0);
(out+j+2)[1] = (uint)(i+1);
(out+j+4)[0] = (uint)(i+1);
(out+j+4)[1] = (uint)(i+3);
(out+j+6)[0] = (uint)(i+3);
(out+j+6)[1] = (uint)(i+2);
}
}
static void generate_polygon_uint(
unsigned nr,
void *_out )
{
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)(0);
(out+j)[1] = (uint)(i+1);
(out+j+2)[0] = (uint)(i+1);
(out+j+2)[1] = (uint)(i+2);
(out+j+4)[0] = (uint)(i+2);
(out+j+4)[1] = (uint)(0);
}
}
static void translate_tris_ubyte2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i+=3) {
(out+j)[0] = (ushort)in[i];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[i];
}
}
static void translate_tristrip_ubyte2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[i];
(out+j)[1] = (ushort)in[i+1/*+(i&1)*/];
(out+j+2)[0] = (ushort)in[i+1/*+(i&1)*/];
(out+j+2)[1] = (ushort)in[i+2/*-(i&1)*/];
(out+j+4)[0] = (ushort)in[i+2/*-(i&1)*/];
(out+j+4)[1] = (ushort)in[i];
}
}
static void translate_trifan_ubyte2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[0];
}
}
static void translate_quads_ubyte2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=4) {
(out+j)[0] = (ushort)in[i+0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[i+3];
(out+j+6)[0] = (ushort)in[i+3];
(out+j+6)[1] = (ushort)in[i+0];
}
}
static void translate_quadstrip_ubyte2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=2) {
(out+j)[0] = (ushort)in[i+2];
(out+j)[1] = (ushort)in[i+0];
(out+j+2)[0] = (ushort)in[i+0];
(out+j+2)[1] = (ushort)in[i+1];
(out+j+4)[0] = (ushort)in[i+1];
(out+j+4)[1] = (ushort)in[i+3];
(out+j+6)[0] = (ushort)in[i+3];
(out+j+6)[1] = (ushort)in[i+2];
}
}
static void translate_polygon_ubyte2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[0];
}
}
static void translate_tris_ubyte2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i+=3) {
(out+j)[0] = (uint)in[i];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[i];
}
}
static void translate_tristrip_ubyte2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[i];
(out+j)[1] = (uint)in[i+1/*+(i&1)*/];
(out+j+2)[0] = (uint)in[i+1/*+(i&1)*/];
(out+j+2)[1] = (uint)in[i+2/*-(i&1)*/];
(out+j+4)[0] = (uint)in[i+2/*-(i&1)*/];
(out+j+4)[1] = (uint)in[i];
}
}
static void translate_trifan_ubyte2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[0];
}
}
static void translate_quads_ubyte2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=4) {
(out+j)[0] = (uint)in[i+0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[i+3];
(out+j+6)[0] = (uint)in[i+3];
(out+j+6)[1] = (uint)in[i+0];
}
}
static void translate_quadstrip_ubyte2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=2) {
(out+j)[0] = (uint)in[i+2];
(out+j)[1] = (uint)in[i+0];
(out+j+2)[0] = (uint)in[i+0];
(out+j+2)[1] = (uint)in[i+1];
(out+j+4)[0] = (uint)in[i+1];
(out+j+4)[1] = (uint)in[i+3];
(out+j+6)[0] = (uint)in[i+3];
(out+j+6)[1] = (uint)in[i+2];
}
}
static void translate_polygon_ubyte2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ubyte*in = (const ubyte*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[0];
}
}
static void translate_tris_ushort2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i+=3) {
(out+j)[0] = (ushort)in[i];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[i];
}
}
static void translate_tristrip_ushort2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[i];
(out+j)[1] = (ushort)in[i+1/*+(i&1)*/];
(out+j+2)[0] = (ushort)in[i+1/*+(i&1)*/];
(out+j+2)[1] = (ushort)in[i+2/*-(i&1)*/];
(out+j+4)[0] = (ushort)in[i+2/*-(i&1)*/];
(out+j+4)[1] = (ushort)in[i];
}
}
static void translate_trifan_ushort2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[0];
}
}
static void translate_quads_ushort2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=4) {
(out+j)[0] = (ushort)in[i+0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[i+3];
(out+j+6)[0] = (ushort)in[i+3];
(out+j+6)[1] = (ushort)in[i+0];
}
}
static void translate_quadstrip_ushort2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=2) {
(out+j)[0] = (ushort)in[i+2];
(out+j)[1] = (ushort)in[i+0];
(out+j+2)[0] = (ushort)in[i+0];
(out+j+2)[1] = (ushort)in[i+1];
(out+j+4)[0] = (ushort)in[i+1];
(out+j+4)[1] = (ushort)in[i+3];
(out+j+6)[0] = (ushort)in[i+3];
(out+j+6)[1] = (ushort)in[i+2];
}
}
static void translate_polygon_ushort2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[0];
}
}
static void translate_tris_ushort2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i+=3) {
(out+j)[0] = (uint)in[i];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[i];
}
}
static void translate_tristrip_ushort2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[i];
(out+j)[1] = (uint)in[i+1/*+(i&1)*/];
(out+j+2)[0] = (uint)in[i+1/*+(i&1)*/];
(out+j+2)[1] = (uint)in[i+2/*-(i&1)*/];
(out+j+4)[0] = (uint)in[i+2/*-(i&1)*/];
(out+j+4)[1] = (uint)in[i];
}
}
static void translate_trifan_ushort2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[0];
}
}
static void translate_quads_ushort2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=4) {
(out+j)[0] = (uint)in[i+0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[i+3];
(out+j+6)[0] = (uint)in[i+3];
(out+j+6)[1] = (uint)in[i+0];
}
}
static void translate_quadstrip_ushort2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=2) {
(out+j)[0] = (uint)in[i+2];
(out+j)[1] = (uint)in[i+0];
(out+j+2)[0] = (uint)in[i+0];
(out+j+2)[1] = (uint)in[i+1];
(out+j+4)[0] = (uint)in[i+1];
(out+j+4)[1] = (uint)in[i+3];
(out+j+6)[0] = (uint)in[i+3];
(out+j+6)[1] = (uint)in[i+2];
}
}
static void translate_polygon_ushort2uint(
const void * _in,
unsigned nr,
void *_out )
{
const ushort*in = (const ushort*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[0];
}
}
static void translate_tris_uint2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i+=3) {
(out+j)[0] = (ushort)in[i];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[i];
}
}
static void translate_tristrip_uint2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[i];
(out+j)[1] = (ushort)in[i+1/*+(i&1)*/];
(out+j+2)[0] = (ushort)in[i+1/*+(i&1)*/];
(out+j+2)[1] = (ushort)in[i+2/*-(i&1)*/];
(out+j+4)[0] = (ushort)in[i+2/*-(i&1)*/];
(out+j+4)[1] = (ushort)in[i];
}
}
static void translate_trifan_uint2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[0];
}
}
static void translate_quads_uint2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=4) {
(out+j)[0] = (ushort)in[i+0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[i+3];
(out+j+6)[0] = (ushort)in[i+3];
(out+j+6)[1] = (ushort)in[i+0];
}
}
static void translate_quadstrip_uint2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=2) {
(out+j)[0] = (ushort)in[i+2];
(out+j)[1] = (ushort)in[i+0];
(out+j+2)[0] = (ushort)in[i+0];
(out+j+2)[1] = (ushort)in[i+1];
(out+j+4)[0] = (ushort)in[i+1];
(out+j+4)[1] = (ushort)in[i+3];
(out+j+6)[0] = (ushort)in[i+3];
(out+j+6)[1] = (ushort)in[i+2];
}
}
static void translate_polygon_uint2ushort(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
ushort *out = (ushort*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (ushort)in[0];
(out+j)[1] = (ushort)in[i+1];
(out+j+2)[0] = (ushort)in[i+1];
(out+j+2)[1] = (ushort)in[i+2];
(out+j+4)[0] = (ushort)in[i+2];
(out+j+4)[1] = (ushort)in[0];
}
}
static void translate_tris_uint2uint(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i+=3) {
(out+j)[0] = (uint)in[i];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[i];
}
}
static void translate_tristrip_uint2uint(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[i];
(out+j)[1] = (uint)in[i+1/*+(i&1)*/];
(out+j+2)[0] = (uint)in[i+1/*+(i&1)*/];
(out+j+2)[1] = (uint)in[i+2/*-(i&1)*/];
(out+j+4)[0] = (uint)in[i+2/*-(i&1)*/];
(out+j+4)[1] = (uint)in[i];
}
}
static void translate_trifan_uint2uint(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[0];
}
}
static void translate_quads_uint2uint(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=4) {
(out+j)[0] = (uint)in[i+0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[i+3];
(out+j+6)[0] = (uint)in[i+3];
(out+j+6)[1] = (uint)in[i+0];
}
}
static void translate_quadstrip_uint2uint(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=8, i+=2) {
(out+j)[0] = (uint)in[i+2];
(out+j)[1] = (uint)in[i+0];
(out+j+2)[0] = (uint)in[i+0];
(out+j+2)[1] = (uint)in[i+1];
(out+j+4)[0] = (uint)in[i+1];
(out+j+4)[1] = (uint)in[i+3];
(out+j+6)[0] = (uint)in[i+3];
(out+j+6)[1] = (uint)in[i+2];
}
}
static void translate_polygon_uint2uint(
const void * _in,
unsigned nr,
void *_out )
{
const uint*in = (const uint*)_in;
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (j = i = 0; j < nr; j+=6, i++) {
(out+j)[0] = (uint)in[0];
(out+j)[1] = (uint)in[i+1];
(out+j+2)[0] = (uint)in[i+1];
(out+j+2)[1] = (uint)in[i+2];
(out+j+4)[0] = (uint)in[i+2];
(out+j+4)[1] = (uint)in[0];
}
}
void u_unfilled_init( void )
{
static int firsttime = 1;
if (!firsttime) return;
firsttime = 0;
generate_line[OUT_USHORT][PIPE_PRIM_TRIANGLES] = generate_tris_ushort;
generate_line[OUT_USHORT][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_ushort;
generate_line[OUT_USHORT][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_ushort;
generate_line[OUT_USHORT][PIPE_PRIM_QUADS] = generate_quads_ushort;
generate_line[OUT_USHORT][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_ushort;
generate_line[OUT_USHORT][PIPE_PRIM_POLYGON] = generate_polygon_ushort;
generate_line[OUT_UINT][PIPE_PRIM_TRIANGLES] = generate_tris_uint;
generate_line[OUT_UINT][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_uint;
generate_line[OUT_UINT][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_uint;
generate_line[OUT_UINT][PIPE_PRIM_QUADS] = generate_quads_uint;
generate_line[OUT_UINT][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_uint;
generate_line[OUT_UINT][PIPE_PRIM_POLYGON] = generate_polygon_uint;
translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2ushort;
translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2ushort;
translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2ushort;
translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_QUADS] = translate_quads_ubyte2ushort;
translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2ushort;
translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2ushort;
translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2uint;
translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2uint;
translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2uint;
translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_QUADS] = translate_quads_ubyte2uint;
translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2uint;
translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2uint;
translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2ushort;
translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2ushort;
translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2ushort;
translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_QUADS] = translate_quads_ushort2ushort;
translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2ushort;
translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_POLYGON] = translate_polygon_ushort2ushort;
translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2uint;
translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2uint;
translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2uint;
translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_QUADS] = translate_quads_ushort2uint;
translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2uint;
translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_POLYGON] = translate_polygon_ushort2uint;
translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_TRIANGLES] = translate_tris_uint2ushort;
translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2ushort;
translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2ushort;
translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_QUADS] = translate_quads_uint2ushort;
translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2ushort;
translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_POLYGON] = translate_polygon_uint2ushort;
translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_TRIANGLES] = translate_tris_uint2uint;
translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2uint;
translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2uint;
translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_QUADS] = translate_quads_uint2uint;
translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2uint;
translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_POLYGON] = translate_polygon_uint2uint;
}
#include "indices/u_unfilled_indices.c"

View File

@@ -1757,6 +1757,8 @@ void (*x86_get_func( struct x86_function *p ))(void)
#else
void x86sse_dummy( void );
void x86sse_dummy( void )
{
}

View File

@@ -1489,6 +1489,12 @@ const struct tgsi_token *ureg_get_tokens( struct ureg_program *ureg,
}
void ureg_free_tokens( const struct tgsi_token *tokens )
{
FREE((struct tgsi_token *)tokens);
}
struct ureg_program *ureg_create( unsigned processor )
{
struct ureg_program *ureg = CALLOC_STRUCT( ureg_program );

View File

@@ -104,6 +104,10 @@ ureg_get_tokens( struct ureg_program *ureg,
unsigned *nr_tokens );
/* Free the tokens created by ureg_get_tokens() */
void ureg_free_tokens( const struct tgsi_token *tokens );
void
ureg_destroy( struct ureg_program * );

View File

@@ -29,6 +29,8 @@
#define PIPE_ATOMIC_ASM_MSVC_X86
#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86))
#define PIPE_ATOMIC_ASM_GCC_X86
#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64))
#define PIPE_ATOMIC_ASM_GCC_X86_64
#elif defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 401)
#define PIPE_ATOMIC_GCC_INTRINSIC
#else
@@ -36,6 +38,51 @@
#endif
#if defined(PIPE_ATOMIC_ASM_GCC_X86_64)
#define PIPE_ATOMIC "GCC x86_64 assembly"
#ifdef __cplusplus
extern "C" {
#endif
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
static INLINE boolean
p_atomic_dec_zero(int32_t *v)
{
unsigned char c;
__asm__ __volatile__("lock; decl %0; sete %1":"+m"(*v), "=qm"(c)
::"memory");
return c != 0;
}
static INLINE void
p_atomic_inc(int32_t *v)
{
__asm__ __volatile__("lock; incl %0":"+m"(*v));
}
static INLINE void
p_atomic_dec(int32_t *v)
{
__asm__ __volatile__("lock; decl %0":"+m"(*v));
}
static INLINE int32_t
p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
{
return __sync_val_compare_and_swap(v, old, _new);
}
#ifdef __cplusplus
}
#endif
#endif /* PIPE_ATOMIC_ASM_GCC_X86_64 */
#if defined(PIPE_ATOMIC_ASM_GCC_X86)

View File

@@ -74,7 +74,7 @@ cell_destroy_context( struct pipe_context *pipe )
static struct draw_context *
cell_draw_create(struct cell_context *cell)
{
struct draw_context *draw = draw_create();
struct draw_context *draw = draw_create(&cell->pipe);
#if 0 /* broken */
if (getenv("GALLIUM_CELL_VS")) {

View File

@@ -92,7 +92,6 @@ cell_add_buffer_to_list(struct cell_context *cell,
struct cell_buffer_list *list,
struct pipe_buffer *buffer)
{
struct pipe_screen *ps = cell->pipe.screen;
struct cell_buffer_node *node = CALLOC_STRUCT(cell_buffer_node);
/* create new list node which references the buffer, insert at head */
if (node) {

View File

@@ -197,7 +197,7 @@ cell_bind_rasterizer_state(struct pipe_context *pipe, void *rast)
struct cell_context *cell = cell_context(pipe);
/* pass-through to draw module */
draw_set_rasterizer_state(cell->draw, rasterizer);
draw_set_rasterizer_state(cell->draw, rasterizer, rast);
cell->rasterizer = rasterizer;

View File

@@ -76,7 +76,7 @@ nv30_create(struct pipe_screen *pscreen, void *priv)
nv30_init_state_functions(nv30);
/* Create, configure, and install fallback swtnl path */
nv30->draw = draw_create();
nv30->draw = draw_create(&nv30->pipe);
draw_wide_point_threshold(nv30->draw, 9999999.0);
draw_wide_line_threshold(nv30->draw, 9999999.0);
draw_enable_line_stipple(nv30->draw, FALSE);

View File

@@ -76,7 +76,7 @@ nv40_create(struct pipe_screen *pscreen, void *priv)
nv40_init_state_functions(nv40);
/* Create, configure, and install fallback swtnl path */
nv40->draw = draw_create();
nv40->draw = draw_create(&nv40->pipe);
draw_wide_point_threshold(nv40->draw, 9999999.0);
draw_wide_line_threshold(nv40->draw, 9999999.0);
draw_enable_line_stipple(nv40->draw, FALSE);

View File

@@ -164,7 +164,7 @@ nv40_state_validate_swtnl(struct nv40_context *nv40)
draw_bind_vertex_shader(draw, nv40->vertprog->draw);
if (nv40->draw_dirty & NV40_NEW_RAST)
draw_set_rasterizer_state(draw, &nv40->rasterizer->pipe);
draw_set_rasterizer_state(draw, &nv40->rasterizer->pipe, nv40->rasterizer);
if (nv40->draw_dirty & NV40_NEW_UCP)
draw_set_clip_state(draw, &nv40->clip);

View File

@@ -16,6 +16,8 @@
#include "glxinit.h"
#ifdef GLX_DIRECT_RENDERING
typedef struct GLXGenericGetString
{
CARD8 reqType;
@@ -680,3 +682,5 @@ __glXInitialize(Display * dpy)
return dpyPriv;
}
#endif /* GLX_DIRECT_RENDERING */

View File

@@ -37,6 +37,8 @@
#include "native_x11.h"
#include "x11_screen.h"
#ifdef GLX_DIRECT_RENDERING
enum dri2_surface_type {
DRI2_SURFACE_TYPE_WINDOW,
DRI2_SURFACE_TYPE_PIXMAP,
@@ -878,3 +880,15 @@ x11_create_dri2_display(EGLNativeDisplayType dpy,
return &dri2dpy->base;
}
#else /* GLX_DIRECT_RENDERING */
struct native_display *
x11_create_dri2_display(EGLNativeDisplayType dpy,
struct native_event_handler *event_handler,
struct drm_api *api)
{
return NULL;
}
#endif /* GLX_DIRECT_RENDERING */

View File

@@ -70,7 +70,9 @@ native_create_probe(EGLNativeDisplayType dpy)
xscr = x11_screen_create(xdpy, scr);
if (xscr) {
if (x11_screen_support(xscr, X11_SCREEN_EXTENSION_DRI2)) {
#ifdef GLX_DIRECT_RENDERING
driver_name = x11_screen_probe_dri2(xscr, NULL, NULL);
#endif
if (driver_name)
nprobe->data = strdup(driver_name);
}

View File

@@ -39,8 +39,10 @@
#include "glxinit.h"
struct x11_screen {
#ifdef GLX_DIRECT_RENDERING
/* dummy base class */
struct __GLXDRIdisplayRec base;
#endif
Display *dpy;
int number;
@@ -103,15 +105,19 @@ x11_screen_destroy(struct x11_screen *xscr)
if (xscr->dri_device)
Xfree(xscr->dri_device);
#ifdef GLX_DIRECT_RENDERING
/* xscr->glx_dpy will be destroyed with the X display */
if (xscr->glx_dpy)
xscr->glx_dpy->dri2Display = NULL;
#endif
if (xscr->visuals)
XFree(xscr->visuals);
free(xscr);
}
#ifdef GLX_DIRECT_RENDERING
static boolean
x11_screen_init_dri2(struct x11_screen *xscr)
{
@@ -133,6 +139,8 @@ x11_screen_init_glx(struct x11_screen *xscr)
return (xscr->glx_dpy != NULL);
}
#endif /* GLX_DIRECT_RENDERING */
/**
* Return true if the screen supports the extension.
*/
@@ -145,12 +153,14 @@ x11_screen_support(struct x11_screen *xscr, enum x11_screen_extension ext)
case X11_SCREEN_EXTENSION_XSHM:
supported = XShmQueryExtension(xscr->dpy);
break;
#ifdef GLX_DIRECT_RENDERING
case X11_SCREEN_EXTENSION_GLX:
supported = x11_screen_init_glx(xscr);
break;
case X11_SCREEN_EXTENSION_DRI2:
supported = x11_screen_init_dri2(xscr);
break;
#endif
default:
break;
}
@@ -233,6 +243,39 @@ x11_screen_convert_visual(struct x11_screen *xscr, const XVisualInfo *visual,
mode->xRenderable = TRUE;
}
/**
* Return the depth of a drawable.
*
* Unlike other drawable functions, the drawable needs not be a DRI2 drawable.
*/
uint
x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable)
{
unsigned int depth;
if (drawable != xscr->last_drawable) {
Window root;
int x, y;
unsigned int w, h, border;
Status ok;
ok = XGetGeometry(xscr->dpy, drawable, &root,
&x, &y, &w, &h, &border, &depth);
if (!ok)
depth = 0;
xscr->last_drawable = drawable;
xscr->last_depth = depth;
}
else {
depth = xscr->last_depth;
}
return depth;
}
#ifdef GLX_DIRECT_RENDERING
/**
* Return the GLX fbconfigs.
*/
@@ -391,37 +434,6 @@ x11_drawable_get_buffers(struct x11_screen *xscr, Drawable drawable,
return (struct x11_drawable_buffer *) dri2bufs;
}
/**
* Return the depth of a drawable.
*
* Unlike other drawable functions, the drawable needs not be a DRI2 drawable.
*/
uint
x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable)
{
unsigned int depth;
if (drawable != xscr->last_drawable) {
Window root;
int x, y;
unsigned int w, h, border;
Status ok;
ok = XGetGeometry(xscr->dpy, drawable, &root,
&x, &y, &w, &h, &border, &depth);
if (!ok)
depth = 0;
xscr->last_drawable = drawable;
xscr->last_depth = depth;
}
else {
depth = xscr->last_depth;
}
return depth;
}
/**
* Create a mode list of the given size.
*/
@@ -489,3 +501,5 @@ dri2InvalidateBuffers(Display *dpy, XID drawable)
xscr->dri_invalidate_buffers(xscr, drawable, xscr->dri_user_data);
}
#endif /* GLX_DIRECT_RENDERING */

View File

@@ -68,20 +68,18 @@ void
x11_screen_convert_visual(struct x11_screen *xscr, const XVisualInfo *visual,
__GLcontextModes *mode);
uint
x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable);
#ifdef GLX_DIRECT_RENDERING
/* GLX */
const __GLcontextModes *
x11_screen_get_glx_configs(struct x11_screen *xscr);
const __GLcontextModes *
x11_screen_get_glx_visuals(struct x11_screen *xscr);
const char *
x11_screen_probe_dri2(struct x11_screen *xscr, int *major, int *minor);
int
x11_screen_enable_dri2(struct x11_screen *xscr,
x11_drawable_invalidate_buffers invalidate_buffers,
void *user_data);
__GLcontextModes *
x11_context_modes_create(unsigned count);
@@ -91,6 +89,15 @@ x11_context_modes_destroy(__GLcontextModes *modes);
unsigned
x11_context_modes_count(const __GLcontextModes *modes);
/* DRI2 */
const char *
x11_screen_probe_dri2(struct x11_screen *xscr, int *major, int *minor);
int
x11_screen_enable_dri2(struct x11_screen *xscr,
x11_drawable_invalidate_buffers invalidate_buffers,
void *user_data);
void
x11_drawable_enable_dri2(struct x11_screen *xscr,
Drawable drawable, boolean on);
@@ -105,7 +112,6 @@ x11_drawable_get_buffers(struct x11_screen *xscr, Drawable drawable,
int *width, int *height, unsigned int *attachments,
boolean with_format, int num_ins, int *num_outs);
uint
x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable);
#endif /* GLX_DIRECT_RENDERING */
#endif /* _X11_SCREEN_H_ */

View File

@@ -11,7 +11,7 @@
EGL_DRIVER_OBJECTS = $(EGL_DRIVER_SOURCES:.c=.o)
common_LIBS = -ldrm -lm -ldl
common_LIBS = -ldrm -lm $(DLOPEN_LIBS)
x11_ST = $(TOP)/src/gallium/state_trackers/egl/libeglx11.a
x11_LIBS = $(common_LIBS) -lX11 -lXext -lXfixes

View File

@@ -17,7 +17,7 @@ OBJECTS = $(GLW_SOURCES:.c=.o)
##### RULES #####
.c.o:
$(CC) -c $(INCDIRS) $(CFLAGS) $<
$(CC) -c $(INCDIRS) $(CFLAGS) $(GLW_CFLAGS) $<

View File

@@ -90,7 +90,7 @@ install: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
# Remove .o and backup files
clean:
-rm -f $(TOP)/$(LIB_DIR)/libGL.so*
-rm -f $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB)
-rm -f *.o *~
-rm -f depend depend.bak

View File

@@ -36,7 +36,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* THIS IS NOT AN X CONSORTIUM STANDARD */
#ifdef GLX_DIRECT_RENDERING
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
#define NEED_REPLIES
#include <X11/Xlibint.h>

4
src/glx/apple/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
apple_xgl_api.[hc]
exports.list
stage.[1234]

10
src/glx/apple/GL_aliases Normal file
View File

@@ -0,0 +1,10 @@
#GL_EXT_texture_object
alias AreTexturesResidentEXT AreTexturesResident
alias BindTextureEXT BindTexture
alias DeleteTexturesEXT DeleteTextures
alias GenTexturesEXT GenTextures
alias IsTextureEXT IsTexture
alias PrioritizeTexturesEXT PrioritizeTextures
# Due to type conflicts, we handle this differently
#alias TexImage3DEXT TexImage3D

106
src/glx/apple/GL_extensions Normal file
View File

@@ -0,0 +1,106 @@
extension ARB_transpose_matrix
extension ARB_vertex_program
extension ARB_vertex_blend
extension ARB_window_pos
extension ARB_shader_objects
extension ARB_vertex_shader
extension ARB_shading_language_100
extension ARB_imaging
extension ARB_point_parameters
extension ARB_texture_env_crossbar
extension ARB_texture_border_clamp
extension ARB_multitexture
extension ARB_texture_env_add
extension ARB_texture_cube_map
extension ARB_texture_env_dot3
extension ARB_multisample
extension ARB_texture_env_combine
extension ARB_texture_compression
extension ARB_texture_mirrored_repeat
extension ARB_shadow
extension ARB_depth_texture
extension ARB_shadow_ambient
extension ARB_fragment_program
extension ARB_fragment_program_shadow
extension ARB_fragment_shader
extension ARB_occlusion_query
extension ARB_point_sprite
extension ARB_texture_non_power_of_two
extension ARB_vertex_buffer_object
extension ARB_pixel_buffer_object
extension ARB_draw_buffers
extension ARB_shader_texture_lod
extension ARB_texture_rectangle
extension ARB_texture_float
extension ARB_half_float_pixel
extension EXT_multi_draw_arrays
extension EXT_clip_volume_hint
extension EXT_rescale_normal
extension EXT_draw_range_elements
extension EXT_fog_coord
extension EXT_gpu_program_parameters
extension EXT_geometry_shader4
#The gl.spec has the wrong arguments for GetTransformFeedbackVaryingEXT
#extension EXT_transform_feedback
extension EXT_compiled_vertex_array
extension EXT_framebuffer_object
extension EXT_framebuffer_blit
extension EXT_framebuffer_multisample
extension EXT_texture_rectangle
extension EXT_texture_env_add
extension EXT_blend_color
extension EXT_blend_minmax
extension EXT_blend_subtract
extension EXT_texture_lod_bias
extension EXT_abgr
extension EXT_bgra
extension EXT_stencil_wrap
extension EXT_texture_filter_anisotropic
extension EXT_separate_specular_color
extension EXT_secondary_color
extension EXT_blend_func_separate
extension EXT_shadow_funcs
extension EXT_stencil_two_side
extension EXT_texture_compression_s3tc
extension EXT_texture_compression_dxt1
extension EXT_texture_sRGB
extension EXT_blend_equation_separate
extension EXT_texture_mirror_clamp
extension EXT_packed_depth_stencil
extension APPLE_client_storage
extension APPLE_specular_vector
extension APPLE_transform_hint
extension APPLE_packed_pixels
#The gl.spec has different argument types for this:
#extension APPLE_fence
extension APPLE_vertex_array_object
extension APPLE_vertex_program_evaluators
extension APPLE_element_array
extension APPLE_flush_render
extension APPLE_aux_depth_stencil
extension APPLE_flush_buffer_range
extension APPLE_ycbcr_422
#The gl.spec has different argument types for this:
#extension APPLE_vertex_array_range
extension APPLE_texture_range
extension APPLE_float_pixels
extension APPLE_pixel_buffer
extension APPLE_object_purgeable
#The OpenGL framework has moved this to the core OpenGL, and eliminated EXT_convolution listing.
#extension EXT_convolution
#Leopard supports these according to nm.
#Applications should use the GL_EXTENSIONS list to determine capabilities.
extension EXT_paletted_texture
extension APPLE_fence
extension NV_vertex_program4
extension EXT_draw_buffers2
extension EXT_gpu_shader4
extension ATI_pn_triangles
extension NV_register_combiners
extension EXT_depth_bounds_test

15
src/glx/apple/GL_noop Normal file
View File

@@ -0,0 +1,15 @@
#These are for compatibility with the old libGL.
noop SGI_color_table
noop EXT_convolution
noop EXT_cull_vertex
noop NV_fence
noop SGIS_detail_texture
noop SGIX_fragment_lighting
noop SGIX_flush_raster
noop EXT_vertex_array
noop SGIX_instruments
noop EXT_histogram
noop NV_vertex_program
noop PGI_misc_hints
noop SGIS_multisample
noop EXT_multisample

View File

@@ -0,0 +1,4 @@
promoted MESA_window_pos
promoted ARB_window_pos
promoted EXT_copy_texture
promoted ARB_vertex_program

129
src/glx/apple/Makefile Normal file
View File

@@ -0,0 +1,129 @@
TOP = ../../..
include $(TOP)/configs/current
#CC=gcc
#GL_CFLAGS=-Wall -ggdb3 -Os -DPTHREADS -D_REENTRANT $(RC_CFLAGS) $(CFLAGS)
#GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module
TCLSH=tclsh8.5
MKDIR=mkdir
INSTALL=install
LN=ln
RM=rm
#INCLUDE=-I. -Iinclude -I.. -DGLX_ALIAS_UNSUPPORTED -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
#COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c
#The directory with the final binaries.
BUILD_DIR=builds
all: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
SOURCES = \
apple_cgl.c \
apple_glx.c \
apple_glx_context.c \
apple_glx_drawable.c \
apple_glx_pbuffer.c \
apple_glx_pixmap.c \
apple_glx_surface.c \
apple_visual.c \
apple_xgl_api.c \
apple_xgl_api_additional.c \
apple_xgl_api_read.c \
apple_xgl_api_stereo.c \
apple_xgl_api_viewport.c \
appledri.c \
../clientattrib.c \
../compsize.c \
../glcontextmodes.c \
glx_empty.c \
glx_error.c \
../glx_pbuffer.c \
../glx_query.c \
../glxcmds.c \
../glxcurrent.c \
../glxext.c \
../glxextensions.c \
glxreply.c \
../pixel.c \
../xfont.c
include $(TOP)/src/mesa/sources.mak
LDFLAGS += -lXplugin -framework ApplicationServices -framework CoreFoundation
MESA_GLAPI_ASM_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_ASM_SOURCES))
MESA_GLAPI_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_SOURCES))
MESA_GLAPI_OBJECTS = $(addprefix $(TOP)/src/mesa/, $(GLAPI_OBJECTS))
OBJECTS = $(SOURCES:.c=.o) # $(MESA_GLAPI_OBJECTS)
INCLUDES = -I. -Iinclude -I..\
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/glapi \
$(LIBDRM_CFLAGS) \
$(DRI2PROTO_CFLAGS) \
$(X11_INCLUDES)
##### RULES #####
$(OBJECTS) : apple_xgl_api.h
apple_xgl_api.c : apple_xgl_api.h
apple_xgl_api.h : gen_api_header.tcl gen_api_library.tcl gen_code.tcl gen_defs.tcl gen_exports.tcl gen_funcs.tcl gen_types.tcl
$(TCLSH) gen_code.tcl
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
.S.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
##### TARGETS #####
default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
# Make libGL
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
$(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major 1 -minor 2 $(MKLIB_OPTIONS) \
-install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
$(GL_LIB_DEPS) $(OBJECTS)
depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) Makefile
rm -f depend
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \
$(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES)
# Emacs tags
tags:
etags `find . -name \*.[ch]` `find $(TOP)/include`
install_headers: include/GL/gl.h
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) -m 644 include/GL/gl.h $(DESTDIR)$(INSTALL_DIR)/include/GL
install_libraries: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
$(MAKE) -C $(TOP)/src/mesa install-libgl
install: install_libraries
# Remove .o and backup files
clean:
-rm -f *.o *.a *~
-rm -f *.c~ *.h~
-rm -f apple_xgl_api.h apple_xgl_api.c
-rm -f *.dylib
-rm -f include/GL/gl.h
-rm -f $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB)
-rm -f *.o *~
-rm -f depend depend.bak
-include depend

View File

@@ -0,0 +1,18 @@
A lot of the code is automatically generated.
The following are generated based on specs/gl.spec and specs/enum.spec (from OpenGL.org):
apple_xgl_api.h
apple_xgl_api.c
exports.list
include/GL/gl.h
include/GL/glext.h (includes the OpenGL framework glext.h)
The gen_code.tcl script is what executes the various gen_*.tcl scripts to produce those.
You will need Tcl 8.5 for the gen_code.tcl script.
The tests/ directory contains some tests that are built in testbuilds.
The tests built in testbuilds don't require installation of the library.

View File

@@ -0,0 +1,8 @@
The design of most of this code is such that we extend the GLX structures
with a void * named apple.
The GLX functions that need to do Apple-specific things are passed
&s->apple in order to initialize the private structures.
Thus when updating, just run a diff against glxext.c or glxcmds.c, and
manually merge from there as needed.

View File

@@ -0,0 +1,71 @@
AppleSGLX Release Notes
o OpenGL Support
AppleSGLX supports the same version of OpenGL as Leopard (OpenGL 2.1).
Many extensions from the OpenGL framework are now builtin.
This adds support for GLSL, and a variety of other features.
o Thread Support
Thread support has been improved since the libGL in XQuartz 2.3.2.1.
o GLX 1.4 Support
The GLX 1.3 and 1.4 functions should all work with a few exceptions
as outlined in this document.
o glXMakeContextCurrent (a GLX 1.3 feature)
glXMakeContextCurrent should work with the readable drawable. The
OpenGL functions: glReadPixels, glCopyPixels, and glCopyColorTable,
should use the readable drawable if it's different than the rendering
drawable.
o glXGetProcAddress (a GLX 1.4 feature and ARB extension)
glXGetProcAddress should work and allow getting the address of any
extension functions you may need from the X11 libGL, or OpenGL framework
libGL. Previous versions of the X11 libGL didn't allow getting the newer
OpenGL framework addresses.
o GLXPixmaps
New support for GLXPixmaps works well with mixed X11 and OpenGL drawing
operations. You can create them using glXCreateGLXPixmap or
glXCreatePixmap.
o GLXPbuffers
Support for GLXPbuffers has been added. These are drawables that are
not possible to render to with X11, which is allowed by the spec.
A GLXPbuffer will never generate a clobber event, however
glXSelectEvent and glXGetSelectedEvent should operate normally.
Clobber events are not generated due to low-level architectural
differences. The contents of your pbuffers will not be clobbered.
o Shared Contexts
Due to basic low-level architectural differences the usage of shared
contexts requires a similar visual or GLXFBConfig be used in the
creation of a shared context. It's best if you specify the same
visual. This is due to a CGL design difference, and not something
that is easily worked around. UPDATE: some changes made seem to
help resolve this issue in many cases, so you may be able to use a
shared context without this restriction.
o Indirect
The X server supports indirect fairly well, so OpenGL applications
can be run remotely and displayed by XQuartz. This means you can run
applications from a remote host on an XQuartz X server.
AppleSGLX does not support indirect rendering. Any indirect context
created will appear to glXIsDirect as an indirect context, but it
does not actually support indirect rendering to a remote X server.
AppleSGLX supports GLXPixmaps and GLXPbuffers with direct and indirect
contexts, though they are all direct contexts by definition (see above).

26
src/glx/apple/TODO Normal file
View File

@@ -0,0 +1,26 @@
Test shared contexts!
Go over every glxcmd in glxcmds.c and make sure we have them working.
Verify the XError behavior of GLXPixmap support functions.
Test GLXPixmap support with various pixmap depths.
Test GLXPixmap support with invalid pixmaps (to stress the protocol code).
-- Feb 10, 2009
Test glXCopyContext.
-- Dec 12 2008
TEST glXCopyContext needs some work and additional code in apple_glx.c.
----
Make sure we report the proper list of GLX extensions available. Apple direct may not support some
that Mesa does, and vice-versa.
Modify create_destroy_context and create a new test called create_destroy_context_thread_race.
Where 2 threads are doing the same sort of path of create and destroy. The locking should protect
us there, but we need to verify nothing goes wrong.

128
src/glx/apple/apple_cgl.c Normal file
View File

@@ -0,0 +1,128 @@
/*
Copyright (c) 2008 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
#include "apple_cgl.h"
#include "apple_glx.h"
#ifndef OPENGL_FRAMEWORK_PATH
#define OPENGL_FRAMEWORK_PATH "/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL"
#endif
static void *dl_handle = NULL;
struct apple_cgl_api apple_cgl;
static bool initialized = false;
static void *
sym(void *h, const char *name)
{
void *s;
s = dlsym(h, name);
if (NULL == s) {
fprintf(stderr, "error: %s\n", dlerror());
abort();
}
return s;
}
void
apple_cgl_init(void)
{
void *h;
GLint major = 0, minor = 0;
const char *opengl_framework_path;
if (initialized)
return;
opengl_framework_path = getenv("OPENGL_FRAMEWORK_PATH");
if (!opengl_framework_path) {
opengl_framework_path = OPENGL_FRAMEWORK_PATH;
}
(void) dlerror(); /*drain dlerror */
h = dlopen(opengl_framework_path, RTLD_NOW);
if (NULL == h) {
fprintf(stderr, "error: unable to dlopen %s : %s\n",
opengl_framework_path, dlerror());
abort();
}
dl_handle = h;
apple_cgl.get_version = sym(h, "CGLGetVersion");
apple_cgl.get_version(&major, &minor);
apple_glx_diagnostic("CGL major %d minor %d\n", major, minor);
if (1 != major) {
fprintf(stderr, "WARNING: the CGL major version has changed!\n"
"libGL may be incompatible!\n");
}
apple_cgl.choose_pixel_format = sym(h, "CGLChoosePixelFormat");
apple_cgl.destroy_pixel_format = sym(h, "CGLDestroyPixelFormat");
apple_cgl.clear_drawable = sym(h, "CGLClearDrawable");
apple_cgl.flush_drawable = sym(h, "CGLFlushDrawable");
apple_cgl.create_context = sym(h, "CGLCreateContext");
apple_cgl.destroy_context = sym(h, "CGLDestroyContext");
apple_cgl.set_current_context = sym(h, "CGLSetCurrentContext");
apple_cgl.get_current_context = sym(h, "CGLGetCurrentContext");
apple_cgl.error_string = sym(h, "CGLErrorString");
apple_cgl.set_off_screen = sym(h, "CGLSetOffScreen");
apple_cgl.copy_context = sym(h, "CGLCopyContext");
apple_cgl.create_pbuffer = sym(h, "CGLCreatePBuffer");
apple_cgl.destroy_pbuffer = sym(h, "CGLDestroyPBuffer");
apple_cgl.set_pbuffer = sym(h, "CGLSetPBuffer");
initialized = true;
}
void *
apple_cgl_get_dl_handle(void)
{
return dl_handle;
}

86
src/glx/apple/apple_cgl.h Normal file
View File

@@ -0,0 +1,86 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#ifndef APPLE_CGL_H
#define APPLE_CGL_H
#include <stdio.h>
#include <OpenGL/CGLCurrent.h>
#include <OpenGL/CGLTypes.h>
#include <OpenGL/OpenGL.h>
/* For GLint and GLsizei on Tiger */
#include <OpenGL/gl.h>
struct apple_cgl_api
{
void (*get_version) (GLint * majorvers, GLint * minorvers);
CGLError(*choose_pixel_format) (const CGLPixelFormatAttribute * attribs,
CGLPixelFormatObj * pix, GLint * npix);
CGLError(*destroy_pixel_format) (CGLPixelFormatObj pix);
CGLError(*clear_drawable) (CGLContextObj ctx);
CGLError(*flush_drawable) (CGLContextObj ctx);
CGLError(*create_context) (CGLPixelFormatObj pix, CGLContextObj share,
CGLContextObj * ctx);
CGLError(*destroy_context) (CGLContextObj pix);
CGLError(*set_current_context) (CGLContextObj ctx);
CGLContextObj(*get_current_context) (void);
const char *(*error_string) (CGLError error);
CGLError(*set_off_screen) (CGLContextObj ctx,
GLsizei width, GLsizei height, GLint rowbytes,
void *baseaddr);
CGLError(*copy_context) (CGLContextObj src, CGLContextObj dst,
GLbitfield mask);
CGLError(*create_pbuffer) (GLsizei width,
GLsizei height,
GLenum target,
GLenum internalFormat,
GLint max_level, CGLPBufferObj * pbuffer);
CGLError(*destroy_pbuffer) (CGLPBufferObj pbuffer);
CGLError(*set_pbuffer) (CGLContextObj ctx,
CGLPBufferObj pbuffer,
GLenum face, GLint level, GLint screen);
};
extern struct apple_cgl_api apple_cgl;
extern void apple_cgl_init(void);
extern void *apple_cgl_get_dl_handle(void);
#endif

View File

@@ -0,0 +1,623 @@
_glAccum
_glAlphaFunc
_glAreTexturesResident
_glArrayElement
_glBegin
_glBindTexture
_glBitmap
_glBlendColor
_glBlendEquation
_glBlendEquationSeparate
_glBlendFunc
_glCallList
_glCallLists
_glClear
_glClearAccum
_glClearColor
_glClearDepth
_glClearIndex
_glClearStencil
_glClipPlane
_glColor3b
_glColor3bv
_glColor3d
_glColor3dv
_glColor3f
_glColor3fv
_glColor3i
_glColor3iv
_glColor3s
_glColor3sv
_glColor3ub
_glColor3ubv
_glColor3ui
_glColor3uiv
_glColor3us
_glColor3usv
_glColor4b
_glColor4bv
_glColor4d
_glColor4dv
_glColor4f
_glColor4fv
_glColor4i
_glColor4iv
_glColor4s
_glColor4sv
_glColor4ub
_glColor4ubv
_glColor4ui
_glColor4uiv
_glColor4us
_glColor4usv
_glColorMask
_glColorMaterial
_glColorPointer
_glColorSubTable
_glColorTable
_glColorTableParameterfv
_glColorTableParameteriv
_glConvolutionFilter1D
_glConvolutionFilter2D
_glConvolutionParameterf
_glConvolutionParameterfv
_glConvolutionParameteri
_glConvolutionParameteriv
_glCopyColorSubTable
_glCopyColorTable
_glCopyConvolutionFilter1D
_glCopyConvolutionFilter2D
_glCopyPixels
_glCopyTexImage1D
_glCopyTexImage2D
_glCopyTexSubImage1D
_glCopyTexSubImage2D
_glCopyTexSubImage3D
_glCullFace
_glDeleteLists
_glDeleteTextures
_glDepthFunc
_glDepthMask
_glDepthRange
_glDisable
_glDisableClientState
_glDrawArrays
_glDrawBuffer
_glDrawElements
_glDrawPixels
_glDrawRangeElements
_glEdgeFlag
_glEdgeFlagPointer
_glEdgeFlagv
_glEnable
_glEnableClientState
_glEnd
_glEndList
_glEvalCoord1d
_glEvalCoord1dv
_glEvalCoord1f
_glEvalCoord1fv
_glEvalCoord2d
_glEvalCoord2dv
_glEvalCoord2f
_glEvalCoord2fv
_glEvalMesh1
_glEvalMesh2
_glEvalPoint1
_glEvalPoint2
_glFeedbackBuffer
_glFinish
_glFlush
_glFogf
_glFogfv
_glFogi
_glFogiv
_glFrontFace
_glFrustum
_glGenLists
_glGenTextures
_glGetBooleanv
_glGetClipPlane
_glGetColorTable
_glGetColorTableParameterfv
_glGetColorTableParameteriv
_glGetConvolutionFilter
_glGetConvolutionParameterfv
_glGetConvolutionParameteriv
_glGetDoublev
_glGetError
_glGetFloatv
_glGetHistogram
_glGetHistogramParameterfv
_glGetHistogramParameteriv
_glGetIntegerv
_glGetLightfv
_glGetLightiv
_glGetMapdv
_glGetMapfv
_glGetMapiv
_glGetMaterialfv
_glGetMaterialiv
_glGetMinmax
_glGetMinmaxParameterfv
_glGetMinmaxParameteriv
_glGetPixelMapfv
_glGetPixelMapuiv
_glGetPixelMapusv
_glGetPointerv
_glGetPolygonStipple
_glGetSeparableFilter
_glGetString
_glGetTexEnvfv
_glGetTexEnviv
_glGetTexGendv
_glGetTexGenfv
_glGetTexGeniv
_glGetTexImage
_glGetTexLevelParameterfv
_glGetTexLevelParameteriv
_glGetTexParameterfv
_glGetTexParameteriv
_glHint
_glHistogram
_glIndexMask
_glIndexPointer
_glIndexd
_glIndexdv
_glIndexf
_glIndexfv
_glIndexi
_glIndexiv
_glIndexs
_glIndexsv
_glIndexub
_glIndexubv
_glInitNames
_glInterleavedArrays
_glIsEnabled
_glIsList
_glIsTexture
_glLightModelf
_glLightModelfv
_glLightModeli
_glLightModeliv
_glLightf
_glLightfv
_glLighti
_glLightiv
_glLineStipple
_glLineWidth
_glListBase
_glLoadIdentity
_glLoadMatrixd
_glLoadMatrixf
_glLoadName
_glLogicOp
_glMap1d
_glMap1f
_glMap2d
_glMap2f
_glMapGrid1d
_glMapGrid1f
_glMapGrid2d
_glMapGrid2f
_glMaterialf
_glMaterialfv
_glMateriali
_glMaterialiv
_glMatrixMode
_glMinmax
_glMultMatrixd
_glMultMatrixf
_glNewList
_glNormal3b
_glNormal3bv
_glNormal3d
_glNormal3dv
_glNormal3f
_glNormal3fv
_glNormal3i
_glNormal3iv
_glNormal3s
_glNormal3sv
_glNormalPointer
_glOrtho
_glPassThrough
_glPixelMapfv
_glPixelMapuiv
_glPixelMapusv
_glPixelStoref
_glPixelStorei
_glPixelTransferf
_glPixelTransferi
_glPixelZoom
_glPointSize
_glPolygonMode
_glPolygonOffset
_glPolygonStipple
_glPopAttrib
_glPopClientAttrib
_glPopMatrix
_glPopName
_glPrioritizeTextures
_glPushAttrib
_glPushClientAttrib
_glPushMatrix
_glPushName
_glRasterPos2d
_glRasterPos2dv
_glRasterPos2f
_glRasterPos2fv
_glRasterPos2i
_glRasterPos2iv
_glRasterPos2s
_glRasterPos2sv
_glRasterPos3d
_glRasterPos3dv
_glRasterPos3f
_glRasterPos3fv
_glRasterPos3i
_glRasterPos3iv
_glRasterPos3s
_glRasterPos3sv
_glRasterPos4d
_glRasterPos4dv
_glRasterPos4f
_glRasterPos4fv
_glRasterPos4i
_glRasterPos4iv
_glRasterPos4s
_glRasterPos4sv
_glReadBuffer
_glReadPixels
_glRectd
_glRectdv
_glRectf
_glRectfv
_glRecti
_glRectiv
_glRects
_glRectsv
_glRenderMode
_glResetHistogram
_glResetMinmax
_glRotated
_glRotatef
_glScaled
_glScalef
_glScissor
_glSelectBuffer
_glSeparableFilter2D
_glShadeModel
_glStencilFunc
_glStencilMask
_glStencilOp
_glTexCoord1d
_glTexCoord1dv
_glTexCoord1f
_glTexCoord1fv
_glTexCoord1i
_glTexCoord1iv
_glTexCoord1s
_glTexCoord1sv
_glTexCoord2d
_glTexCoord2dv
_glTexCoord2f
_glTexCoord2fv
_glTexCoord2i
_glTexCoord2iv
_glTexCoord2s
_glTexCoord2sv
_glTexCoord3d
_glTexCoord3dv
_glTexCoord3f
_glTexCoord3fv
_glTexCoord3i
_glTexCoord3iv
_glTexCoord3s
_glTexCoord3sv
_glTexCoord4d
_glTexCoord4dv
_glTexCoord4f
_glTexCoord4fv
_glTexCoord4i
_glTexCoord4iv
_glTexCoord4s
_glTexCoord4sv
_glTexCoordPointer
_glTexEnvf
_glTexEnvfv
_glTexEnvi
_glTexEnviv
_glTexGend
_glTexGendv
_glTexGenf
_glTexGenfv
_glTexGeni
_glTexGeniv
_glTexImage1D
_glTexImage2D
_glTexImage3D
_glTexParameterf
_glTexParameterfv
_glTexParameteri
_glTexParameteriv
_glTexSubImage1D
_glTexSubImage2D
_glTexSubImage3D
_glTranslated
_glTranslatef
_glVertex2d
_glVertex2dv
_glVertex2f
_glVertex2fv
_glVertex2i
_glVertex2iv
_glVertex2s
_glVertex2sv
_glVertex3d
_glVertex3dv
_glVertex3f
_glVertex3fv
_glVertex3i
_glVertex3iv
_glVertex3s
_glVertex3sv
_glVertex4d
_glVertex4dv
_glVertex4f
_glVertex4fv
_glVertex4i
_glVertex4iv
_glVertex4s
_glVertex4sv
_glVertexPointer
_glViewport
_glSampleCoverage
_glSamplePass
_glLoadTransposeMatrixf
_glLoadTransposeMatrixd
_glMultTransposeMatrixf
_glMultTransposeMatrixd
_glCompressedTexImage3D
_glCompressedTexImage2D
_glCompressedTexImage1D
_glCompressedTexSubImage3D
_glCompressedTexSubImage2D
_glCompressedTexSubImage1D
_glGetCompressedTexImage
_glActiveTexture
_glClientActiveTexture
_glMultiTexCoord1d
_glMultiTexCoord1dv
_glMultiTexCoord1f
_glMultiTexCoord1fv
_glMultiTexCoord1i
_glMultiTexCoord1iv
_glMultiTexCoord1s
_glMultiTexCoord1sv
_glMultiTexCoord2d
_glMultiTexCoord2dv
_glMultiTexCoord2f
_glMultiTexCoord2fv
_glMultiTexCoord2i
_glMultiTexCoord2iv
_glMultiTexCoord2s
_glMultiTexCoord2sv
_glMultiTexCoord3d
_glMultiTexCoord3dv
_glMultiTexCoord3f
_glMultiTexCoord3fv
_glMultiTexCoord3i
_glMultiTexCoord3iv
_glMultiTexCoord3s
_glMultiTexCoord3sv
_glMultiTexCoord4d
_glMultiTexCoord4dv
_glMultiTexCoord4f
_glMultiTexCoord4fv
_glMultiTexCoord4i
_glMultiTexCoord4iv
_glMultiTexCoord4s
_glMultiTexCoord4sv
_glFogCoordf
_glFogCoordfv
_glFogCoordd
_glFogCoorddv
_glFogCoordPointer
_glSecondaryColor3b
_glSecondaryColor3bv
_glSecondaryColor3d
_glSecondaryColor3dv
_glSecondaryColor3f
_glSecondaryColor3fv
_glSecondaryColor3i
_glSecondaryColor3iv
_glSecondaryColor3s
_glSecondaryColor3sv
_glSecondaryColor3ub
_glSecondaryColor3ubv
_glSecondaryColor3ui
_glSecondaryColor3uiv
_glSecondaryColor3us
_glSecondaryColor3usv
_glSecondaryColorPointer
_glPointParameterf
_glPointParameterfv
_glPointParameteri
_glPointParameteriv
_glBlendFuncSeparate
_glMultiDrawArrays
_glMultiDrawElements
_glWindowPos2d
_glWindowPos2dv
_glWindowPos2f
_glWindowPos2fv
_glWindowPos2i
_glWindowPos2iv
_glWindowPos2s
_glWindowPos2sv
_glWindowPos3d
_glWindowPos3dv
_glWindowPos3f
_glWindowPos3fv
_glWindowPos3i
_glWindowPos3iv
_glWindowPos3s
_glWindowPos3sv
_glGenQueries
_glDeleteQueries
_glIsQuery
_glBeginQuery
_glEndQuery
_glGetQueryiv
_glGetQueryObjectiv
_glGetQueryObjectuiv
_glBindBuffer
_glDeleteBuffers
_glGenBuffers
_glIsBuffer
_glBufferData
_glBufferSubData
_glGetBufferSubData
_glMapBuffer
_glUnmapBuffer
_glGetBufferParameteriv
_glGetBufferPointerv
_glDrawBuffers
_glVertexAttrib1d
_glVertexAttrib1dv
_glVertexAttrib1f
_glVertexAttrib1fv
_glVertexAttrib1s
_glVertexAttrib1sv
_glVertexAttrib2d
_glVertexAttrib2dv
_glVertexAttrib2f
_glVertexAttrib2fv
_glVertexAttrib2s
_glVertexAttrib2sv
_glVertexAttrib3d
_glVertexAttrib3dv
_glVertexAttrib3f
_glVertexAttrib3fv
_glVertexAttrib3s
_glVertexAttrib3sv
_glVertexAttrib4Nbv
_glVertexAttrib4Niv
_glVertexAttrib4Nsv
_glVertexAttrib4Nub
_glVertexAttrib4Nubv
_glVertexAttrib4Nuiv
_glVertexAttrib4Nusv
_glVertexAttrib4bv
_glVertexAttrib4d
_glVertexAttrib4dv
_glVertexAttrib4f
_glVertexAttrib4fv
_glVertexAttrib4iv
_glVertexAttrib4s
_glVertexAttrib4sv
_glVertexAttrib4ubv
_glVertexAttrib4uiv
_glVertexAttrib4usv
_glVertexAttribPointer
_glEnableVertexAttribArray
_glDisableVertexAttribArray
_glGetVertexAttribdv
_glGetVertexAttribfv
_glGetVertexAttribiv
_glGetVertexAttribPointerv
_glDeleteShader
_glDetachShader
_glCreateShader
_glShaderSource
_glCompileShader
_glCreateProgram
_glAttachShader
_glLinkProgram
_glUseProgram
_glDeleteProgram
_glValidateProgram
_glUniform1f
_glUniform2f
_glUniform3f
_glUniform4f
_glUniform1i
_glUniform2i
_glUniform3i
_glUniform4i
_glUniform1fv
_glUniform2fv
_glUniform3fv
_glUniform4fv
_glUniform1iv
_glUniform2iv
_glUniform3iv
_glUniform4iv
_glUniformMatrix2fv
_glUniformMatrix3fv
_glUniformMatrix4fv
_glIsShader
_glIsProgram
_glGetShaderiv
_glGetProgramiv
_glGetAttachedShaders
_glGetShaderInfoLog
_glGetProgramInfoLog
_glGetUniformLocation
_glGetActiveUniform
_glGetUniformfv
_glGetUniformiv
_glGetShaderSource
_glBindAttribLocation
_glGetActiveAttrib
_glGetAttribLocation
_glStencilFuncSeparate
_glStencilOpSeparate
_glStencilMaskSeparate
_glUniformMatrix2x3fv
_glUniformMatrix3x2fv
_glUniformMatrix2x4fv
_glUniformMatrix4x2fv
_glUniformMatrix3x4fv
_glUniformMatrix4x3fv
_glXChooseVisual
_glXCreateContext
_glXDestroyContext
_glXMakeCurrent
_glXCopyContext
_glXSwapBuffers
_glXCreateGLXPixmap
_glXDestroyGLXPixmap
_glXQueryExtension
_glXQueryVersion
_glXIsDirect
_glXGetConfig
_glXGetCurrentContext
_glXGetCurrentDrawable
_glXWaitGL
_glXWaitX
_glXUseXFont
_glXQueryExtensionsString
_glXQueryServerString
_glXGetClientString
_glXGetCurrentDisplay
_glXChooseFBConfig
_glXGetFBConfigAttrib
_glXGetFBConfigs
_glXGetVisualFromFBConfig
_glXCreateWindow
_glXDestroyWindow
_glXCreatePixmap
_glXDestroyPixmap
_glXCreatePbuffer
_glXDestroyPbuffer
_glXQueryDrawable
_glXCreateNewContext
_glXMakeContextCurrent
_glXGetCurrentReadDrawable
_glXQueryContext
_glXSelectEvent
_glXGetSelectedEvent
_glXGetProcAddress

214
src/glx/apple/apple_glx.c Normal file
View File

@@ -0,0 +1,214 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdarg.h>
#include <dlfcn.h>
#include "appledri.h"
#include "apple_glx.h"
#include "apple_glx_context.h"
#include "apple_cgl.h"
#include "apple_xgl_api.h"
static bool initialized = false;
static int dri_event_base = 0;
const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
#ifndef OPENGL_LIB_PATH
#define OPENGL_LIB_PATH "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
#endif
static void *libgl_handle = NULL;
static bool diagnostic = false;
void
apple_glx_diagnostic(const char *fmt, ...)
{
va_list vl;
if (diagnostic) {
fprintf(stderr, "DIAG: ");
va_start(vl, fmt);
vfprintf(stderr, fmt, vl);
va_end(vl);
}
}
int
apple_get_dri_event_base(void)
{
if (!initialized) {
fprintf(stderr,
"error: dri_event_base called before apple_init_glx!\n");
abort();
}
return dri_event_base;
}
static void
surface_notify_handler(Display * dpy, unsigned int uid, int kind)
{
switch (kind) {
case AppleDRISurfaceNotifyDestroyed:
apple_glx_diagnostic("%s: surface destroyed %u\n", __func__, uid);
apple_glx_surface_destroy(uid);
break;
case AppleDRISurfaceNotifyChanged:{
int updated;
updated = apple_glx_context_surface_changed(uid, pthread_self());
apple_glx_diagnostic("surface notify updated %d\n", updated);
}
break;
default:
fprintf(stderr, "unhandled kind of event: %d in %s\n", kind, __func__);
}
}
xp_client_id
apple_glx_get_client_id(void)
{
static xp_client_id id;
if (0 == id) {
if ((XP_Success != xp_init(XP_IN_BACKGROUND)) ||
(Success != xp_get_client_id(&id))) {
return 0;
}
}
return id;
}
/* Return true if an error occured. */
bool
apple_init_glx(Display * dpy)
{
int eventBase, errorBase;
int major, minor, patch;
if (!XAppleDRIQueryExtension(dpy, &eventBase, &errorBase))
return true;
if (!XAppleDRIQueryVersion(dpy, &major, &minor, &patch))
return true;
if (initialized)
return false;
if (getenv("LIBGL_DIAGNOSTIC")) {
printf("initializing libGL in %s\n", __func__);
diagnostic = true;
}
apple_cgl_init();
apple_xgl_init_direct();
libgl_handle = dlopen(OPENGL_LIB_PATH, RTLD_LAZY);
(void) apple_glx_get_client_id();
XAppleDRISetSurfaceNotifyHandler(surface_notify_handler);
/* This should really be per display. */
dri_event_base = eventBase;
initialized = true;
return false;
}
void
apple_glx_swap_buffers(void *ptr)
{
struct apple_glx_context *ac = ptr;
/* This may not be needed with CGLFlushDrawable: */
glFlush();
apple_cgl.flush_drawable(ac->context_obj);
}
void *
apple_glx_get_proc_address(const GLubyte * procname)
{
size_t len;
void *h, *s;
char *pname = (char *) procname;
assert(NULL != procname);
len = strlen(pname);
if (len < 3) {
return NULL;
}
if ((pname != strstr(pname, "glX")) && (pname != strstr(pname, "gl"))) {
fprintf(stderr,
"warning: get proc address request is not for a gl or glX function");
return NULL;
}
/* Search using the default symbols first. */
(void) dlerror(); /*drain dlerror */
h = dlopen(NULL, RTLD_NOW);
if (NULL == h) {
fprintf(stderr, "warning: get proc address: %s\n", dlerror());
return NULL;
}
s = dlsym(h, pname);
if (NULL == s) {
/* Try the libGL.dylib from the OpenGL.framework. */
s = dlsym(libgl_handle, pname);
}
dlclose(h);
return s;
}
void
apple_glx_waitx(Display * dpy, void *ptr)
{
struct apple_private_context *ac = ptr;
(void) ac;
glFlush();
glFinish();
XSync(dpy, False);
}

49
src/glx/apple/apple_glx.h Normal file
View File

@@ -0,0 +1,49 @@
/*
Copyright (c) 2008 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#ifndef APPLE_GLX_H
#define APPLE_GLX_H
#include <stdbool.h>
#include <GL/gl.h>
#include <GL/glxint.h>
#include <X11/Xlib.h>
#define XP_NO_X_HEADERS
#include <Xplugin.h>
void apple_glx_diagnostic(const char *fmt, ...);
xp_client_id apple_glx_get_client_id(void);
bool apple_init_glx(Display * dpy);
void apple_glx_swap_buffers(void *ptr);
void *apple_glx_get_proc_address(const GLubyte * procname);
void apple_glx_waitx(Display * dpy, void *ptr);
int apple_get_dri_event_base(void);
#endif

View File

@@ -0,0 +1,616 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <assert.h>
#include <pthread.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
// Get the newer glext.h first
#include <GL/gl.h>
#include <GL/glext.h>
#include <OpenGL/CGLTypes.h>
#include <OpenGL/CGLCurrent.h>
#include <OpenGL/OpenGL.h>
#include "glxclient.h"
#include "apple_glx.h"
#include "apple_glx_context.h"
#include "appledri.h"
#include "apple_visual.h"
#include "apple_cgl.h"
#include "apple_glx_drawable.h"
static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER;
/*
* This should be locked on creation and destruction of the
* apple_glx_contexts.
*
* It's also locked when the surface_notify_handler is searching
* for a uid associated with a surface.
*/
static struct apple_glx_context *context_list = NULL;
/* This guards the context_list above. */
static void
lock_context_list(void)
{
int err;
err = pthread_mutex_lock(&context_lock);
if (err) {
fprintf(stderr, "pthread_mutex_lock failure in %s: %d\n",
__func__, err);
abort();
}
}
static void
unlock_context_list(void)
{
int err;
err = pthread_mutex_unlock(&context_lock);
if (err) {
fprintf(stderr, "pthread_mutex_unlock failure in %s: %d\n",
__func__, err);
abort();
}
}
static bool
is_context_valid(struct apple_glx_context *ac)
{
struct apple_glx_context *i;
lock_context_list();
for (i = context_list; i; i = i->next) {
if (ac == i) {
unlock_context_list();
return true;
}
}
unlock_context_list();
return false;
}
/* This creates an apple_private_context struct.
*
* It's typically called to save the struct in a GLXContext.
*
* This is also where the CGLContextObj is created, and the CGLPixelFormatObj.
*/
bool
apple_glx_create_context(void **ptr, Display * dpy, int screen,
const void *mode, void *sharedContext,
int *errorptr, bool * x11errorptr)
{
struct apple_glx_context *ac;
struct apple_glx_context *sharedac = sharedContext;
CGLError error;
*ptr = NULL;
ac = malloc(sizeof *ac);
if (NULL == ac) {
*errorptr = BadAlloc;
*x11errorptr = true;
return true;
}
if (sharedac && !is_context_valid(sharedac)) {
*errorptr = GLXBadContext;
*x11errorptr = false;
return true;
}
ac->context_obj = NULL;
ac->pixel_format_obj = NULL;
ac->drawable = NULL;
ac->thread_id = pthread_self();
ac->screen = screen;
ac->double_buffered = false;
ac->uses_stereo = false;
ac->need_update = false;
ac->is_current = false;
ac->made_current = false;
ac->last_surface_window = None;
apple_visual_create_pfobj(&ac->pixel_format_obj, mode,
&ac->double_buffered, &ac->uses_stereo,
/*offscreen */ false);
error = apple_cgl.create_context(ac->pixel_format_obj,
sharedac ? sharedac->context_obj : NULL,
&ac->context_obj);
if (error) {
(void) apple_cgl.destroy_pixel_format(ac->pixel_format_obj);
free(ac);
if (kCGLBadMatch == error) {
*errorptr = BadMatch;
*x11errorptr = true;
}
else {
*errorptr = GLXBadContext;
*x11errorptr = false;
}
if (getenv("LIBGL_DIAGNOSTIC"))
fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
return true;
}
/* The context creation succeeded, so we can link in the new context. */
lock_context_list();
if (context_list)
context_list->previous = ac;
ac->previous = NULL;
ac->next = context_list;
context_list = ac;
*ptr = ac;
apple_glx_diagnostic("%s: ac %p ac->context_obj %p\n",
__func__, (void *) ac, (void *) ac->context_obj);
unlock_context_list();
return false;
}
void
apple_glx_destroy_context(void **ptr, Display * dpy)
{
struct apple_glx_context *ac = *ptr;
if (NULL == ac)
return;
apple_glx_diagnostic("%s: ac %p ac->context_obj %p\n",
__func__, (void *) ac, (void *) ac->context_obj);
if (apple_cgl.get_current_context() == ac->context_obj) {
apple_glx_diagnostic("%s: context ac->context_obj %p "
"is still current!\n", __func__,
(void *) ac->context_obj);
if (apple_cgl.set_current_context(NULL)) {
abort();
}
}
/* Remove ac from the context_list as soon as possible. */
lock_context_list();
if (ac->previous) {
ac->previous->next = ac->next;
}
else {
context_list = ac->next;
}
if (ac->next) {
ac->next->previous = ac->previous;
}
unlock_context_list();
if (apple_cgl.clear_drawable(ac->context_obj)) {
fprintf(stderr, "error: while clearing drawable!\n");
abort();
}
/*
* This potentially causes surface_notify_handler to be called in
* apple_glx.c...
* We can NOT have a lock held at this point. It would result in
* an abort due to an attempted deadlock. This is why we earlier
* removed the ac pointer from the double-linked list.
*/
if (ac->drawable) {
ac->drawable->destroy(ac->drawable);
}
if (apple_cgl.destroy_pixel_format(ac->pixel_format_obj)) {
fprintf(stderr, "error: destroying pixel format in %s\n", __func__);
abort();
}
if (apple_cgl.destroy_context(ac->context_obj)) {
fprintf(stderr, "error: destroying context_obj in %s\n", __func__);
abort();
}
free(ac);
*ptr = NULL;
apple_glx_garbage_collect_drawables(dpy);
}
/* Return true if an error occured. */
bool
apple_glx_make_current_context(Display * dpy, void *oldptr, void *ptr,
GLXDrawable drawable)
{
struct apple_glx_context *oldac = oldptr;
struct apple_glx_context *ac = ptr;
struct apple_glx_drawable *newagd = NULL;
CGLError cglerr;
bool same_drawable = false;
#if 0
apple_glx_diagnostic("%s: oldac %p ac %p drawable 0x%lx\n",
__func__, (void *) oldac, (void *) ac, drawable);
apple_glx_diagnostic("%s: oldac->context_obj %p ac->context_obj %p\n",
__func__,
(void *) (oldac ? oldac->context_obj : NULL),
(void *) (ac ? ac->context_obj : NULL));
#endif
/* This a common path for GLUT and other apps, so special case it. */
if (ac && ac->drawable && ac->drawable->drawable == drawable) {
same_drawable = true;
if (ac->is_current)
return false;
}
/* Reset the is_current state of the old context, if non-NULL. */
if (oldac && (ac != oldac))
oldac->is_current = false;
if (NULL == ac) {
/*Clear the current context for this thread. */
apple_cgl.set_current_context(NULL);
if (oldac) {
oldac->is_current = false;
if (oldac->drawable) {
oldac->drawable->destroy(oldac->drawable);
oldac->drawable = NULL;
}
/* Invalidate this to prevent surface recreation. */
oldac->last_surface_window = None;
}
return false;
}
if (None == drawable) {
bool error = false;
/* Clear the current drawable for this context_obj. */
if (apple_cgl.set_current_context(ac->context_obj))
error = true;
if (apple_cgl.clear_drawable(ac->context_obj))
error = true;
if (ac->drawable) {
ac->drawable->destroy(ac->drawable);
ac->drawable = NULL;
}
/* Invalidate this to prevent surface recreation. */
ac->last_surface_window = None;
apple_glx_diagnostic("%s: drawable is None, error is: %d\n",
__func__, error);
return error;
}
/* This is an optimisation to avoid searching for the current drawable. */
if (ac->drawable && ac->drawable->drawable == drawable) {
newagd = ac->drawable;
}
else {
/* Find the drawable if possible, and retain a reference to it. */
newagd =
apple_glx_drawable_find(drawable, APPLE_GLX_DRAWABLE_REFERENCE);
}
/*
* Try to destroy the old drawable, so long as the new one
* isn't the old.
*/
if (ac->drawable && !same_drawable) {
ac->drawable->destroy(ac->drawable);
ac->drawable = NULL;
}
if (NULL == newagd) {
if (apple_glx_surface_create(dpy, ac->screen, drawable, &newagd))
return true;
/* The drawable is referenced once by apple_glx_surface_create. */
/*
* FIXME: We actually need 2 references to prevent premature surface
* destruction. The problem is that the surface gets destroyed in
* the case of the context being reused for another window, and
* we then lose the surface contents. Wait for destruction of a
* window to destroy a surface.
*
* Note: this may leave around surfaces we don't want around, if
* say we are using X for raster drawing after OpenGL rendering,
* but it will be compatible with the old libGL's behavior.
*
* Someday the X11 and OpenGL rendering must be unified at some
* layer. I suspect we can do that via shared memory and
* multiple threads in the X server (1 for each context created
* by a client). This would also allow users to render from
* multiple clients to the same OpenGL surface. In fact it could
* all be OpenGL.
*
*/
newagd->reference(newagd);
/* Save the new drawable with the context structure. */
ac->drawable = newagd;
}
else {
/* We are reusing an existing drawable structure. */
if (same_drawable) {
assert(ac->drawable == newagd);
/* The drawable_find above retained a reference for us. */
}
else {
ac->drawable = newagd;
}
}
/*
* Avoid this costly path if this is the same drawable and the
* context is already current.
*/
if (same_drawable && ac->is_current) {
apple_glx_diagnostic("%s: same_drawable and ac->is_current\n");
return false;
}
cglerr = apple_cgl.set_current_context(ac->context_obj);
if (kCGLNoError != cglerr) {
fprintf(stderr, "set current error: %s\n",
apple_cgl.error_string(cglerr));
return true;
}
ac->is_current = true;
assert(NULL != ac->context_obj);
assert(NULL != ac->drawable);
ac->thread_id = pthread_self();
/* This will be set if the pending_destroy code indicates it should be: */
ac->last_surface_window = None;
switch (ac->drawable->type) {
case APPLE_GLX_DRAWABLE_PBUFFER:
case APPLE_GLX_DRAWABLE_SURFACE:
case APPLE_GLX_DRAWABLE_PIXMAP:
if (ac->drawable->callbacks.make_current) {
if (ac->drawable->callbacks.make_current(ac, ac->drawable))
return true;
}
break;
default:
fprintf(stderr, "internal error: invalid drawable type: %d\n",
ac->drawable->type);
abort();
}
return false;
}
bool
apple_glx_is_current_drawable(Display * dpy, void *ptr, GLXDrawable drawable)
{
struct apple_glx_context *ac = ptr;
if (ac->drawable && ac->drawable->drawable == drawable) {
return true;
}
else if (NULL == ac->drawable && None != ac->last_surface_window) {
apple_glx_context_update(dpy, ac);
return (ac->drawable && ac->drawable->drawable == drawable);
}
return false;
}
bool
apple_glx_copy_context(void *currentptr, void *srcptr, void *destptr,
unsigned long mask, int *errorptr, bool * x11errorptr)
{
struct apple_glx_context *src, *dest;
CGLError err;
src = srcptr;
dest = destptr;
if (src->screen != dest->screen) {
*errorptr = BadMatch;
*x11errorptr = true;
return true;
}
if (dest == currentptr || dest->is_current) {
*errorptr = BadAccess;
*x11errorptr = true;
return true;
}
/*
* If srcptr is the current context then we should do an implicit glFlush.
*/
if (currentptr == srcptr)
glFlush();
err = apple_cgl.copy_context(src->context_obj, dest->context_obj,
(GLbitfield) mask);
if (kCGLNoError != err) {
*errorptr = GLXBadContext;
*x11errorptr = false;
return true;
}
return false;
}
/*
* The value returned is the total number of contexts set to update.
* It's meant for debugging/introspection.
*/
int
apple_glx_context_surface_changed(unsigned int uid, pthread_t caller)
{
struct apple_glx_context *ac;
int updated = 0;
lock_context_list();
for (ac = context_list; ac; ac = ac->next) {
if (ac->drawable && APPLE_GLX_DRAWABLE_SURFACE == ac->drawable->type
&& ac->drawable->types.surface.uid == uid) {
if (caller == ac->thread_id) {
apple_glx_diagnostic("caller is the same thread for uid %u\n",
uid);
xp_update_gl_context(ac->context_obj);
}
else {
ac->need_update = true;
++updated;
}
}
}
unlock_context_list();
return updated;
}
void
apple_glx_context_update(Display * dpy, void *ptr)
{
struct apple_glx_context *ac = ptr;
if (NULL == ac->drawable && None != ac->last_surface_window) {
bool failed;
/* Attempt to recreate the surface for a destroyed drawable. */
failed =
apple_glx_make_current_context(dpy, ac, ac, ac->last_surface_window);
apple_glx_diagnostic("%s: surface recreation failed? %s\n", __func__,
failed ? "YES" : "NO");
}
if (ac->need_update) {
xp_update_gl_context(ac->context_obj);
ac->need_update = false;
apple_glx_diagnostic("%s: updating context %p\n", __func__, ptr);
}
if (ac->drawable && APPLE_GLX_DRAWABLE_SURFACE == ac->drawable->type
&& ac->drawable->types.surface.pending_destroy) {
apple_glx_diagnostic("%s: clearing drawable %p\n", __func__, ptr);
apple_cgl.clear_drawable(ac->context_obj);
if (ac->drawable) {
struct apple_glx_drawable *d;
apple_glx_diagnostic("%s: attempting to destroy drawable %p\n",
__func__, ptr);
apple_glx_diagnostic("%s: ac->drawable->drawable is 0x%lx\n",
__func__, ac->drawable->drawable);
d = ac->drawable;
ac->last_surface_window = d->drawable;
ac->drawable = NULL;
/*
* This will destroy the surface drawable if there are
* no references to it.
* It also subtracts 1 from the reference_count.
* If there are references to it, then it's probably made
* current in another context.
*/
d->destroy(d);
}
}
}
bool
apple_glx_context_uses_stereo(void *ptr)
{
struct apple_glx_context *ac = ptr;
return ac->uses_stereo;
}

View File

@@ -0,0 +1,93 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#ifndef APPLE_GLX_CONTEXT_H
#define APPLE_GLX_CONTEXT_H
/* <rdar://problem/6953344> */
#define glTexImage1D glTexImage1D_OSX
#define glTexImage2D glTexImage2D_OSX
#define glTexImage3D glTexImage3D_OSX
#include <OpenGL/CGLTypes.h>
#include <OpenGL/CGLContext.h>
#undef glTexImage1D
#undef glTexImage2D
#undef glTexImage3D
#include <stdbool.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
#define XP_NO_X_HEADERS
#include <Xplugin.h>
#undef XP_NO_X_HEADERS
#include "apple_glx_drawable.h"
struct apple_glx_context
{
CGLContextObj context_obj;
CGLPixelFormatObj pixel_format_obj;
struct apple_glx_drawable *drawable;
pthread_t thread_id;
int screen;
bool double_buffered;
bool uses_stereo;
bool need_update;
bool is_current; /* True if the context is current in some thread. */
bool made_current; /* True if the context has ever been made current. */
/*
* last_surface is set by the pending_destroy code handler for a drawable.
* Due to a CG difference, we have to recreate a surface if the window
* is unmapped and mapped again.
*/
Window last_surface_window;
struct apple_glx_context *previous, *next;
};
bool apple_glx_create_context(void **ptr, Display * dpy, int screen,
const void *mode, void *sharedContext,
int *errorptr, bool * x11errorptr);
void apple_glx_destroy_context(void **ptr, Display * dpy);
bool apple_glx_make_current_context(Display * dpy, void *oldptr, void *ptr,
GLXDrawable drawable);
bool apple_glx_is_current_drawable(Display * dpy, void *ptr,
GLXDrawable drawable);
bool apple_glx_copy_context(void *currentptr, void *srcptr, void *destptr,
unsigned long mask, int *errorptr,
bool * x11errorptr);
int apple_glx_context_surface_changed(unsigned int uid, pthread_t caller);
void apple_glx_context_update(Display * dpy, void *ptr);
bool apple_glx_context_uses_stereo(void *ptr);
#endif /*APPLE_GLX_CONTEXT_H */

View File

@@ -0,0 +1,542 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <pthread.h>
#include "apple_glx.h"
#include "apple_glx_context.h"
#include "apple_glx_drawable.h"
#include "appledri.h"
static pthread_mutex_t drawables_lock = PTHREAD_MUTEX_INITIALIZER;
static struct apple_glx_drawable *drawables_list = NULL;
static void
lock_drawables_list(void)
{
int err;
err = pthread_mutex_lock(&drawables_lock);
if (err) {
fprintf(stderr, "pthread_mutex_lock failure in %s: %d\n",
__func__, err);
abort();
}
}
static void
unlock_drawables_list(void)
{
int err;
err = pthread_mutex_unlock(&drawables_lock);
if (err) {
fprintf(stderr, "pthread_mutex_unlock failure in %s: %d\n",
__func__, err);
abort();
}
}
struct apple_glx_drawable *
apple_glx_find_drawable(Display * dpy, GLXDrawable drawable)
{
struct apple_glx_drawable *i, *agd = NULL;
lock_drawables_list();
for (i = drawables_list; i; i = i->next) {
if (i->drawable == drawable) {
agd = i;
break;
}
}
unlock_drawables_list();
return agd;
}
static void
drawable_lock(struct apple_glx_drawable *agd)
{
int err;
err = pthread_mutex_lock(&agd->mutex);
if (err) {
fprintf(stderr, "pthread_mutex_lock error: %d\n", err);
abort();
}
}
static void
drawable_unlock(struct apple_glx_drawable *d)
{
int err;
err = pthread_mutex_unlock(&d->mutex);
if (err) {
fprintf(stderr, "pthread_mutex_unlock error: %d\n", err);
abort();
}
}
static void
reference_drawable(struct apple_glx_drawable *d)
{
d->lock(d);
d->reference_count++;
d->unlock(d);
}
static void
release_drawable(struct apple_glx_drawable *d)
{
d->lock(d);
d->reference_count--;
d->unlock(d);
}
/* The drawables list must be locked prior to calling this. */
/* Return true if the drawable was destroyed. */
static bool
destroy_drawable(struct apple_glx_drawable *d)
{
d->lock(d);
if (d->reference_count > 0) {
d->unlock(d);
return false;
}
d->unlock(d);
if (d->previous) {
d->previous->next = d->next;
}
else {
/*
* The item must be at the head of the list, if it
* has no previous pointer.
*/
drawables_list = d->next;
}
if (d->next)
d->next->previous = d->previous;
unlock_drawables_list();
if (d->callbacks.destroy) {
/*
* Warning: this causes other routines to be called (potentially)
* from surface_notify_handler. It's probably best to not have
* any locks at this point locked.
*/
d->callbacks.destroy(d->display, d);
}
apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d);
free(d);
/* So that the locks are balanced and the caller correctly unlocks. */
lock_drawables_list();
return true;
}
/*
* This is typically called when a context is destroyed or the current
* drawable is made None.
*/
static bool
destroy_drawable_callback(struct apple_glx_drawable *d)
{
bool result;
d->lock(d);
apple_glx_diagnostic("%s: %p ->reference_count before -- %d\n", __func__,
(void *) d, d->reference_count);
d->reference_count--;
if (d->reference_count > 0) {
d->unlock(d);
return false;
}
d->unlock(d);
lock_drawables_list();
result = destroy_drawable(d);
unlock_drawables_list();
return result;
}
static bool
is_pbuffer(struct apple_glx_drawable *d)
{
return APPLE_GLX_DRAWABLE_PBUFFER == d->type;
}
static bool
is_pixmap(struct apple_glx_drawable *d)
{
return APPLE_GLX_DRAWABLE_PIXMAP == d->type;
}
static void
common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d)
{
int err;
pthread_mutexattr_t attr;
d->display = dpy;
d->reference_count = 0;
d->drawable = drawable;
d->type = -1;
err = pthread_mutexattr_init(&attr);
if (err) {
fprintf(stderr, "pthread_mutexattr_init error: %d\n", err);
abort();
}
/*
* There are some patterns that require a recursive mutex,
* when working with locks that protect the apple_glx_drawable,
* and reference functions like ->reference, and ->release.
*/
err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
if (err) {
fprintf(stderr, "error: setting pthread mutex type: %d\n", err);
abort();
}
err = pthread_mutex_init(&d->mutex, &attr);
if (err) {
fprintf(stderr, "pthread_mutex_init error: %d\n", err);
abort();
}
(void) pthread_mutexattr_destroy(&attr);
d->lock = drawable_lock;
d->unlock = drawable_unlock;
d->reference = reference_drawable;
d->release = release_drawable;
d->destroy = destroy_drawable_callback;
d->is_pbuffer = is_pbuffer;
d->is_pixmap = is_pixmap;
d->width = -1;
d->height = -1;
d->row_bytes = 0;
d->path[0] = '\0';
d->fd = -1;
d->buffer = NULL;
d->buffer_length = 0;
d->previous = NULL;
d->next = NULL;
}
static void
link_tail(struct apple_glx_drawable *agd)
{
lock_drawables_list();
/* Link the new drawable into the global list. */
agd->next = drawables_list;
if (drawables_list)
drawables_list->previous = agd;
drawables_list = agd;
unlock_drawables_list();
}
/*WARNING: this returns a locked and referenced object. */
bool
apple_glx_drawable_create(Display * dpy,
int screen,
GLXDrawable drawable,
struct apple_glx_drawable **agdResult,
struct apple_glx_drawable_callbacks *callbacks)
{
struct apple_glx_drawable *d;
d = calloc(1, sizeof *d);
if (NULL == d) {
perror("malloc");
return true;
}
common_init(dpy, drawable, d);
d->type = callbacks->type;
d->callbacks = *callbacks;
d->reference(d);
d->lock(d);
link_tail(d);
apple_glx_diagnostic("%s: new drawable %p\n", __func__, (void *) d);
*agdResult = d;
return false;
}
static int error_count = 0;
static int
error_handler(Display * dpy, XErrorEvent * err)
{
if (err->error_code == BadWindow) {
++error_count;
}
return 0;
}
void
apple_glx_garbage_collect_drawables(Display * dpy)
{
struct apple_glx_drawable *d, *dnext;
Window root;
int x, y;
unsigned int width, height, bd, depth;
int (*old_handler) (Display *, XErrorEvent *);
if (NULL == drawables_list)
return;
old_handler = XSetErrorHandler(error_handler);
XSync(dpy, False);
lock_drawables_list();
for (d = drawables_list; d;) {
dnext = d->next;
d->lock(d);
if (d->reference_count > 0) {
/*
* Skip this, because some context still retains a reference
* to the drawable.
*/
d->unlock(d);
d = dnext;
continue;
}
d->unlock(d);
error_count = 0;
/*
* Mesa uses XGetWindowAttributes, but some of these things are
* most definitely not Windows, and that's against the rules.
* XGetGeometry on the other hand is legal with a Pixmap and Window.
*/
XGetGeometry(dpy, d->drawable, &root, &x, &y, &width, &height, &bd,
&depth);
if (error_count > 0) {
/*
* Note: this may not actually destroy the drawable.
* If another context retains a reference to the drawable
* after the reference count test above.
*/
(void) destroy_drawable(d);
error_count = 0;
}
d = dnext;
}
XSetErrorHandler(old_handler);
unlock_drawables_list();
}
unsigned int
apple_glx_get_drawable_count(void)
{
unsigned int result = 0;
struct apple_glx_drawable *d;
lock_drawables_list();
for (d = drawables_list; d; d = d->next)
++result;
unlock_drawables_list();
return result;
}
struct apple_glx_drawable *
apple_glx_drawable_find_by_type(GLXDrawable drawable, int type, int flags)
{
struct apple_glx_drawable *d;
lock_drawables_list();
for (d = drawables_list; d; d = d->next) {
if (d->type == type && d->drawable == drawable) {
if (flags & APPLE_GLX_DRAWABLE_REFERENCE)
d->reference(d);
if (flags & APPLE_GLX_DRAWABLE_LOCK)
d->lock(d);
unlock_drawables_list();
return d;
}
}
unlock_drawables_list();
return NULL;
}
struct apple_glx_drawable *
apple_glx_drawable_find(GLXDrawable drawable, int flags)
{
struct apple_glx_drawable *d;
lock_drawables_list();
for (d = drawables_list; d; d = d->next) {
if (d->drawable == drawable) {
if (flags & APPLE_GLX_DRAWABLE_REFERENCE)
d->reference(d);
if (flags & APPLE_GLX_DRAWABLE_LOCK)
d->lock(d);
unlock_drawables_list();
return d;
}
}
unlock_drawables_list();
return NULL;
}
/* Return true if the type is valid for the drawable. */
bool
apple_glx_drawable_destroy_by_type(Display * dpy,
GLXDrawable drawable, int type)
{
struct apple_glx_drawable *d;
lock_drawables_list();
for (d = drawables_list; d; d = d->next) {
if (drawable == d->drawable && type == d->type) {
/*
* The user has requested that we destroy this resource.
* However, there may be references in the contexts to it, so
* release it, and call destroy_drawable which doesn't destroy
* if the reference_count is > 0.
*/
d->release(d);
apple_glx_diagnostic("%s d->reference_count %d\n",
__func__, d->reference_count);
destroy_drawable(d);
unlock_drawables_list();
return true;
}
}
unlock_drawables_list();
return false;
}
struct apple_glx_drawable *
apple_glx_drawable_find_by_uid(unsigned int uid, int flags)
{
struct apple_glx_drawable *d;
lock_drawables_list();
for (d = drawables_list; d; d = d->next) {
/* Only surfaces have a uid. */
if (APPLE_GLX_DRAWABLE_SURFACE == d->type) {
if (d->types.surface.uid == uid) {
if (flags & APPLE_GLX_DRAWABLE_REFERENCE)
d->reference(d);
if (flags & APPLE_GLX_DRAWABLE_LOCK)
d->lock(d);
unlock_drawables_list();
return d;
}
}
}
unlock_drawables_list();
return NULL;
}

View File

@@ -0,0 +1,227 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#ifndef APPLE_GLX_DRAWABLE_H
#define APPLE_GLX_DRAWABLE_H
/* Must be first for:
* <rdar://problem/6953344>
*/
#include "apple_glx_context.h"
#include <pthread.h>
#include <stdbool.h>
#include <limits.h>
#include <GL/glx.h>
#define XP_NO_X_HEADERS
#include <Xplugin.h>
#undef XP_NO_X_HEADERS
enum
{
APPLE_GLX_DRAWABLE_SURFACE = 1,
APPLE_GLX_DRAWABLE_PBUFFER,
APPLE_GLX_DRAWABLE_PIXMAP
};
/* The flag for the find routine. */
enum
{
APPLE_GLX_DRAWABLE_LOCK = 2,
APPLE_GLX_DRAWABLE_REFERENCE = 4
};
struct apple_glx_context;
struct apple_glx_drawable;
struct apple_glx_surface
{
xp_surface_id surface_id;
unsigned int uid;
bool pending_destroy;
};
struct apple_glx_pbuffer
{
GLXPbuffer xid; /* our pixmap */
int width, height;
GLint fbconfigID;
CGLPBufferObj buffer_obj;
unsigned long event_mask;
};
struct apple_glx_pixmap
{
GLXPixmap xpixmap;
void *buffer;
int width, height, pitch, /*bytes per pixel */ bpp;
size_t size;
char path[PATH_MAX];
int fd;
CGLPixelFormatObj pixel_format_obj;
CGLContextObj context_obj;
GLint fbconfigID;
};
struct apple_glx_drawable_callbacks
{
int type;
bool(*make_current) (struct apple_glx_context * ac,
struct apple_glx_drawable * d);
void (*destroy) (Display * dpy, struct apple_glx_drawable * d);
};
struct apple_glx_drawable
{
Display *display;
int reference_count;
GLXDrawable drawable;
int type; /* APPLE_GLX_DRAWABLE_* */
union
{
struct apple_glx_pixmap pixmap;
struct apple_glx_pbuffer pbuffer;
struct apple_glx_surface surface;
} types;
struct apple_glx_drawable_callbacks callbacks;
/*
* This mutex protects the reference count and any other drawable data.
* It's used to prevent an early release of a drawable.
*/
pthread_mutex_t mutex;
void (*lock) (struct apple_glx_drawable * agd);
void (*unlock) (struct apple_glx_drawable * agd);
void (*reference) (struct apple_glx_drawable * agd);
void (*release) (struct apple_glx_drawable * agd);
bool(*destroy) (struct apple_glx_drawable * agd);
bool(*is_pbuffer) (struct apple_glx_drawable * agd);
bool(*is_pixmap) (struct apple_glx_drawable * agd);
/*BEGIN These are used for the mixed mode drawing... */
int width, height;
int row_bytes;
char path[PATH_MAX];
int fd; /* The file descriptor for this drawable's shared memory. */
void *buffer; /* The memory for the drawable. Typically shared memory. */
size_t buffer_length;
/*END*/ struct apple_glx_drawable *previous, *next;
};
struct apple_glx_context;
/* May return NULL if not found */
struct apple_glx_drawable *apple_glx_find_drawable(Display * dpy,
GLXDrawable drawable);
/* Returns true on error and locks the agd result with a reference. */
bool apple_glx_drawable_create(Display * dpy,
int screen,
GLXDrawable drawable,
struct apple_glx_drawable **agd,
struct apple_glx_drawable_callbacks
*callbacks);
/* Returns true on error */
bool apple_glx_create_drawable(Display * dpy,
struct apple_glx_context *ac,
GLXDrawable drawable,
struct apple_glx_drawable **agd);
void apple_glx_garbage_collect_drawables(Display * dpy);
/*
* This returns the total number of drawables.
* It's mostly intended for debugging and introspection.
*/
unsigned int apple_glx_get_drawable_count(void);
struct apple_glx_drawable *apple_glx_drawable_find_by_type(GLXDrawable
drawable, int type,
int flags);
struct apple_glx_drawable *apple_glx_drawable_find(GLXDrawable drawable,
int flags);
bool apple_glx_drawable_destroy_by_type(Display * dpy, GLXDrawable drawable,
int type);
struct apple_glx_drawable *apple_glx_drawable_find_by_uid(unsigned int uid,
int flags);
/* Surfaces */
bool apple_glx_surface_create(Display * dpy, int screen, GLXDrawable drawable,
struct apple_glx_drawable **resultptr);
void apple_glx_surface_destroy(unsigned int uid);
/* Pbuffers */
/* Returns true if an error occurred. */
bool apple_glx_pbuffer_create(Display * dpy, GLXFBConfig config,
int width, int height, int *errorcode,
GLXPbuffer * pbuf);
/* Returns true if the pbuffer was invalid. */
bool apple_glx_pbuffer_destroy(Display * dpy, GLXPbuffer pbuf);
/* Returns true if the pbuffer was valid and the attribute. */
bool apple_glx_pbuffer_query(GLXDrawable d, int attribute,
unsigned int *value);
/* Returns true if the GLXDrawable is a valid GLXPbuffer, and the mask is set. */
bool apple_glx_pbuffer_set_event_mask(GLXDrawable d, unsigned long mask);
/* Returns true if the GLXDrawable is a valid GLXPbuffer, and the *mask is set. */
bool apple_glx_pbuffer_get_event_mask(GLXDrawable d, unsigned long *mask);
/* Pixmaps */
/* mode is a __GLcontextModes * */
/* Returns true if an error occurred. */
bool apple_glx_pixmap_create(Display * dpy, int screen, Pixmap pixmap,
const void *mode);
/* Returns true if an error occurred. */
bool apple_glx_pixmap_destroy(Display * dpy, Pixmap pixmap);
bool apple_glx_pixmap_query(GLXPixmap pixmap, int attribute,
unsigned int *value);
#endif

View File

@@ -0,0 +1,348 @@
/*
Copyright (c) 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
/* Must be before OpenGL.framework is included. Remove once fixed:
* <rdar://problem/7872773>
*/
#include <GL/gl.h>
#include <GL/glext.h>
#define __gltypes_h_ 1
/* Must be first for:
* <rdar://problem/6953344>
*/
#include "apple_glx_context.h"
#include "apple_glx_drawable.h"
#include <stdlib.h>
#include <pthread.h>
#include <assert.h>
#include "apple_glx.h"
#include "glcontextmodes.h"
#include "apple_cgl.h"
/* mesa defines in glew.h, Apple in glext.h.
* Due to namespace nightmares, just do it here.
*/
#ifndef GL_TEXTURE_RECTANGLE_EXT
#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
#endif
static bool pbuffer_make_current(struct apple_glx_context *ac,
struct apple_glx_drawable *d);
static void pbuffer_destroy(Display * dpy, struct apple_glx_drawable *d);
static struct apple_glx_drawable_callbacks callbacks = {
.type = APPLE_GLX_DRAWABLE_PBUFFER,
.make_current = pbuffer_make_current,
.destroy = pbuffer_destroy
};
/* Return true if an error occurred. */
bool
pbuffer_make_current(struct apple_glx_context *ac,
struct apple_glx_drawable *d)
{
struct apple_glx_pbuffer *pbuf = &d->types.pbuffer;
CGLError cglerr;
assert(APPLE_GLX_DRAWABLE_PBUFFER == d->type);
cglerr = apple_cgl.set_pbuffer(ac->context_obj, pbuf->buffer_obj, 0, 0, 0);
if (kCGLNoError != cglerr) {
fprintf(stderr, "set_pbuffer: %s\n", apple_cgl.error_string(cglerr));
return true;
}
if (!ac->made_current) {
glViewport(0, 0, pbuf->width, pbuf->height);
glScissor(0, 0, pbuf->width, pbuf->height);
ac->made_current = true;
}
apple_glx_diagnostic("made pbuffer drawable 0x%lx current\n", d->drawable);
return false;
}
void
pbuffer_destroy(Display * dpy, struct apple_glx_drawable *d)
{
struct apple_glx_pbuffer *pbuf = &d->types.pbuffer;
assert(APPLE_GLX_DRAWABLE_PBUFFER == d->type);
apple_glx_diagnostic("destroying pbuffer for drawable 0x%lx\n",
d->drawable);
apple_cgl.destroy_pbuffer(pbuf->buffer_obj);
XFreePixmap(dpy, pbuf->xid);
}
/* Return true if an error occurred. */
bool
apple_glx_pbuffer_destroy(Display * dpy, GLXPbuffer pbuf)
{
return !apple_glx_drawable_destroy_by_type(dpy, pbuf,
APPLE_GLX_DRAWABLE_PBUFFER);
}
/* Return true if an error occurred. */
bool
apple_glx_pbuffer_create(Display * dpy, GLXFBConfig config,
int width, int height, int *errorcode,
GLXPbuffer * result)
{
struct apple_glx_drawable *d;
struct apple_glx_pbuffer *pbuf = NULL;
CGLError err;
Window root;
int screen;
Pixmap xid;
__GLcontextModes *modes = (__GLcontextModes *) config;
root = DefaultRootWindow(dpy);
screen = DefaultScreen(dpy);
/*
* This pixmap is only used for a persistent XID.
* The XC-MISC extension cleans up XIDs and reuses them transparently,
* so we need to retain a server-side reference.
*/
xid = XCreatePixmap(dpy, root, (unsigned int) 1,
(unsigned int) 1, DefaultDepth(dpy, screen));
if (None == xid) {
*errorcode = BadAlloc;
return true;
}
if (apple_glx_drawable_create(dpy, screen, xid, &d, &callbacks)) {
*errorcode = BadAlloc;
return true;
}
/* The lock is held in d from create onward. */
pbuf = &d->types.pbuffer;
pbuf->xid = xid;
pbuf->width = width;
pbuf->height = height;
err = apple_cgl.create_pbuffer(width, height, GL_TEXTURE_RECTANGLE_EXT,
(modes->alphaBits > 0) ? GL_RGBA : GL_RGB,
0, &pbuf->buffer_obj);
if (kCGLNoError != err) {
d->unlock(d);
d->destroy(d);
*errorcode = BadMatch;
return true;
}
pbuf->fbconfigID = modes->fbconfigID;
pbuf->event_mask = 0;
*result = pbuf->xid;
d->unlock(d);
return false;
}
/* Return true if an error occurred. */
static bool
get_max_size(int *widthresult, int *heightresult)
{
CGLContextObj oldcontext;
GLint ar[2];
oldcontext = apple_cgl.get_current_context();
if (!oldcontext) {
/*
* There is no current context, so we need to make one in order
* to call glGetInteger.
*/
CGLPixelFormatObj pfobj;
CGLError err;
CGLPixelFormatAttribute attr[10];
int c = 0;
GLint vsref = 0;
CGLContextObj newcontext;
attr[c++] = kCGLPFAColorSize;
attr[c++] = 32;
attr[c++] = 0;
err = apple_cgl.choose_pixel_format(attr, &pfobj, &vsref);
if (kCGLNoError != err) {
if (getenv("LIBGL_DIAGNOSTIC")) {
printf("choose_pixel_format error in %s: %s\n", __func__,
apple_cgl.error_string(err));
}
return true;
}
err = apple_cgl.create_context(pfobj, NULL, &newcontext);
if (kCGLNoError != err) {
if (getenv("LIBGL_DIAGNOSTIC")) {
printf("create_context error in %s: %s\n", __func__,
apple_cgl.error_string(err));
}
apple_cgl.destroy_pixel_format(pfobj);
return true;
}
err = apple_cgl.set_current_context(newcontext);
if (kCGLNoError != err) {
printf("set_current_context error in %s: %s\n", __func__,
apple_cgl.error_string(err));
return true;
}
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, ar);
apple_cgl.set_current_context(oldcontext);
apple_cgl.destroy_context(newcontext);
apple_cgl.destroy_pixel_format(pfobj);
}
else {
/* We have a valid context. */
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, ar);
}
*widthresult = ar[0];
*heightresult = ar[1];
return false;
}
bool
apple_glx_pbuffer_query(GLXPbuffer p, int attr, unsigned int *value)
{
bool result = false;
struct apple_glx_drawable *d;
struct apple_glx_pbuffer *pbuf;
d = apple_glx_drawable_find_by_type(p, APPLE_GLX_DRAWABLE_PBUFFER,
APPLE_GLX_DRAWABLE_LOCK);
if (d) {
pbuf = &d->types.pbuffer;
switch (attr) {
case GLX_WIDTH:
*value = pbuf->width;
result = true;
break;
case GLX_HEIGHT:
*value = pbuf->height;
result = true;
break;
case GLX_PRESERVED_CONTENTS:
*value = true;
result = true;
break;
case GLX_LARGEST_PBUFFER:{
int width, height;
if (get_max_size(&width, &height)) {
fprintf(stderr, "internal error: "
"unable to find the largest pbuffer!\n");
}
else {
*value = width;
result = true;
}
}
break;
case GLX_FBCONFIG_ID:
*value = pbuf->fbconfigID;
result = true;
break;
}
d->unlock(d);
}
return result;
}
bool
apple_glx_pbuffer_set_event_mask(GLXDrawable drawable, unsigned long mask)
{
struct apple_glx_drawable *d;
bool result = false;
d = apple_glx_drawable_find_by_type(drawable, APPLE_GLX_DRAWABLE_PBUFFER,
APPLE_GLX_DRAWABLE_LOCK);
if (d) {
d->types.pbuffer.event_mask = mask;
result = true;
d->unlock(d);
}
return result;
}
bool
apple_glx_pbuffer_get_event_mask(GLXDrawable drawable, unsigned long *mask)
{
struct apple_glx_drawable *d;
bool result = false;
d = apple_glx_drawable_find_by_type(drawable, APPLE_GLX_DRAWABLE_PBUFFER,
APPLE_GLX_DRAWABLE_LOCK);
if (d) {
*mask = d->types.pbuffer.event_mask;
result = true;
d->unlock(d);
}
return result;
}

View File

@@ -0,0 +1,230 @@
/*
Copyright (c) 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <assert.h>
#include "apple_glx.h"
#include "apple_cgl.h"
#include "apple_visual.h"
#include "apple_glx_drawable.h"
#include "appledri.h"
#include "glcontextmodes.h"
static bool pixmap_make_current(struct apple_glx_context *ac,
struct apple_glx_drawable *d);
static void pixmap_destroy(Display * dpy, struct apple_glx_drawable *d);
static struct apple_glx_drawable_callbacks callbacks = {
.type = APPLE_GLX_DRAWABLE_PIXMAP,
.make_current = pixmap_make_current,
.destroy = pixmap_destroy
};
static bool
pixmap_make_current(struct apple_glx_context *ac,
struct apple_glx_drawable *d)
{
CGLError cglerr;
struct apple_glx_pixmap *p = &d->types.pixmap;
assert(APPLE_GLX_DRAWABLE_PIXMAP == d->type);
cglerr = apple_cgl.set_current_context(p->context_obj);
if (kCGLNoError != cglerr) {
fprintf(stderr, "set current context: %s\n",
apple_cgl.error_string(cglerr));
return true;
}
cglerr = apple_cgl.set_off_screen(p->context_obj, p->width, p->height,
p->pitch, p->buffer);
if (kCGLNoError != cglerr) {
fprintf(stderr, "set off screen: %s\n", apple_cgl.error_string(cglerr));
return true;
}
if (!ac->made_current) {
glViewport(0, 0, p->width, p->height);
glScissor(0, 0, p->width, p->height);
ac->made_current = true;
}
return false;
}
static void
pixmap_destroy(Display * dpy, struct apple_glx_drawable *d)
{
struct apple_glx_pixmap *p = &d->types.pixmap;
if (p->pixel_format_obj)
(void) apple_cgl.destroy_pixel_format(p->pixel_format_obj);
if (p->context_obj)
(void) apple_cgl.destroy_context(p->context_obj);
XAppleDRIDestroyPixmap(dpy, p->xpixmap);
if (p->buffer) {
if (munmap(p->buffer, p->size))
perror("munmap");
if (-1 == close(p->fd))
perror("close");
if (shm_unlink(p->path))
perror("shm_unlink");
}
apple_glx_diagnostic("destroyed pixmap buffer for: 0x%lx\n", d->drawable);
}
/* Return true if an error occurred. */
bool
apple_glx_pixmap_create(Display * dpy, int screen, Pixmap pixmap,
const void *mode)
{
struct apple_glx_drawable *d;
struct apple_glx_pixmap *p;
bool double_buffered;
bool uses_stereo;
CGLError error;
const __GLcontextModes *cmodes = mode;
if (apple_glx_drawable_create(dpy, screen, pixmap, &d, &callbacks))
return true;
/* d is locked and referenced at this point. */
p = &d->types.pixmap;
p->xpixmap = pixmap;
p->buffer = NULL;
if (!XAppleDRICreatePixmap(dpy, screen, pixmap,
&p->width, &p->height, &p->pitch, &p->bpp,
&p->size, p->path, PATH_MAX)) {
d->unlock(d);
d->destroy(d);
return true;
}
p->fd = shm_open(p->path, O_RDWR, 0);
if (p->fd < 0) {
perror("shm_open");
d->unlock(d);
d->destroy(d);
return true;
}
p->buffer = mmap(NULL, p->size, PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED, p->fd, 0);
if (MAP_FAILED == p->buffer) {
perror("mmap");
d->unlock(d);
d->destroy(d);
return true;
}
apple_visual_create_pfobj(&p->pixel_format_obj, mode, &double_buffered,
&uses_stereo, /*offscreen */ true);
error = apple_cgl.create_context(p->pixel_format_obj, NULL,
&p->context_obj);
if (kCGLNoError != error) {
d->unlock(d);
d->destroy(d);
return true;
}
p->fbconfigID = cmodes->fbconfigID;
d->unlock(d);
apple_glx_diagnostic("created: pixmap buffer for 0x%lx\n", d->drawable);
return false;
}
bool
apple_glx_pixmap_query(GLXPixmap pixmap, int attr, unsigned int *value)
{
struct apple_glx_drawable *d;
struct apple_glx_pixmap *p;
bool result = false;
d = apple_glx_drawable_find_by_type(pixmap, APPLE_GLX_DRAWABLE_PIXMAP,
APPLE_GLX_DRAWABLE_LOCK);
if (d) {
p = &d->types.pixmap;
switch (attr) {
case GLX_WIDTH:
*value = p->width;
result = true;
break;
case GLX_HEIGHT:
*value = p->height;
result = true;
break;
case GLX_FBCONFIG_ID:
*value = p->fbconfigID;
result = true;
break;
}
d->unlock(d);
}
return result;
}
/* Return true if the type is valid for pixmap. */
bool
apple_glx_pixmap_destroy(Display * dpy, GLXPixmap pixmap)
{
return !apple_glx_drawable_destroy_by_type(dpy, pixmap,
APPLE_GLX_DRAWABLE_PIXMAP);
}

View File

@@ -0,0 +1,224 @@
/*
Copyright (c) 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <assert.h>
#include "glxclient.h"
#include "apple_glx.h"
#include "appledri.h"
#include "apple_glx_drawable.h"
static bool surface_make_current(struct apple_glx_context *ac,
struct apple_glx_drawable *d);
static void surface_destroy(Display * dpy, struct apple_glx_drawable *d);
static struct apple_glx_drawable_callbacks callbacks = {
.type = APPLE_GLX_DRAWABLE_SURFACE,
.make_current = surface_make_current,
.destroy = surface_destroy
};
static void
update_viewport_and_scissor(Display * dpy, GLXDrawable drawable)
{
Window root;
int x, y;
unsigned int width = 0, height = 0, bd, depth;
XGetGeometry(dpy, drawable, &root, &x, &y, &width, &height, &bd, &depth);
glViewport(0, 0, width, height);
glScissor(0, 0, width, height);
}
static bool
surface_make_current(struct apple_glx_context *ac,
struct apple_glx_drawable *d)
{
struct apple_glx_surface *s = &d->types.surface;
xp_error error;
assert(APPLE_GLX_DRAWABLE_SURFACE == d->type);
apple_glx_diagnostic("%s: ac->context_obj %p s->surface_id %u\n",
__func__, (void *) ac->context_obj, s->surface_id);
error = xp_attach_gl_context(ac->context_obj, s->surface_id);
if (error) {
fprintf(stderr, "error: xp_attach_gl_context returned: %d\n", error);
return true;
}
if (!ac->made_current) {
/*
* The first time a new context is made current the glViewport
* and glScissor should be updated.
*/
update_viewport_and_scissor(ac->drawable->display,
ac->drawable->drawable);
ac->made_current = true;
}
apple_glx_diagnostic("%s: drawable 0x%lx\n", __func__, d->drawable);
return false;
}
static void
surface_destroy(Display * dpy, struct apple_glx_drawable *d)
{
struct apple_glx_surface *s = &d->types.surface;
apple_glx_diagnostic("%s: s->surface_id %u\n", __func__, s->surface_id);
xp_error error = xp_destroy_surface(s->surface_id);
if (error) {
fprintf(stderr, "xp_destroy_surface error: %d\n", (int) error);
}
/*
* Check if this surface destroy came from the surface being destroyed
* on the server. If s->pending_destroy is true, then it did, and
* we don't want to try to destroy the surface on the server.
*/
if (!s->pending_destroy) {
/*
* Warning: this causes other routines to be called (potentially)
* from surface_notify_handler. It's probably best to not have
* any locks at this point locked.
*/
XAppleDRIDestroySurface(d->display, DefaultScreen(d->display),
d->drawable);
apple_glx_diagnostic
("%s: destroyed a surface for drawable 0x%lx uid %u\n", __func__,
d->drawable, s->uid);
}
}
/* Return true if an error occured. */
static bool
create_surface(Display * dpy, int screen, struct apple_glx_drawable *d)
{
struct apple_glx_surface *s = &d->types.surface;
unsigned int key[2];
xp_client_id id;
id = apple_glx_get_client_id();
if (0 == id)
return true;
assert(None != d->drawable);
s->pending_destroy = false;
if (XAppleDRICreateSurface(dpy, screen, d->drawable, id, key, &s->uid)) {
xp_error error;
error = xp_import_surface(key, &s->surface_id);
if (error) {
fprintf(stderr, "error: xp_import_surface returned: %d\n", error);
return true;
}
apple_glx_diagnostic("%s: created a surface for drawable 0x%lx"
" with uid %u\n", __func__, d->drawable, s->uid);
return false; /*success */
}
return true; /* unable to create a surface. */
}
/* Return true if an error occured. */
/* This returns a referenced object via resultptr. */
bool
apple_glx_surface_create(Display * dpy, int screen,
GLXDrawable drawable,
struct apple_glx_drawable ** resultptr)
{
struct apple_glx_drawable *d;
if (apple_glx_drawable_create(dpy, screen, drawable, &d, &callbacks))
return true;
/* apple_glx_drawable_create creates a locked and referenced object. */
if (create_surface(dpy, screen, d)) {
d->unlock(d);
d->destroy(d);
return true;
}
*resultptr = d;
d->unlock(d);
return false;
}
/*
* All surfaces are reference counted, and surfaces are only created
* when the window is made current. When all contexts no longer reference
* a surface drawable the apple_glx_drawable gets destroyed, and thus
* its surface is destroyed.
*
* However we can make the destruction occur a bit sooner by setting
* pending_destroy, which is then checked for in glViewport by
* apple_glx_context_update.
*/
void
apple_glx_surface_destroy(unsigned int uid)
{
struct apple_glx_drawable *d;
d = apple_glx_drawable_find_by_uid(uid, APPLE_GLX_DRAWABLE_REFERENCE
| APPLE_GLX_DRAWABLE_LOCK);
if (d) {
d->types.surface.pending_destroy = true;
d->release(d);
/*
* We release 2 references to the surface. One was acquired by
* the find, and the other was leftover from a context, or
* the surface being displayed, so the destroy() will decrease it
* once more.
*
* If the surface is in a context, it will take one d->destroy(d);
* to actually destroy it when the pending_destroy is processed
* by a glViewport callback (see apple_glx_context_update()).
*/
d->destroy(d);
d->unlock(d);
}
}

View File

@@ -0,0 +1,153 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <GL/gl.h>
/* <rdar://problem/6953344> */
#define glTexImage1D glTexImage1D_OSX
#define glTexImage2D glTexImage2D_OSX
#define glTexImage3D glTexImage3D_OSX
#include <OpenGL/OpenGL.h>
#include <OpenGL/CGLContext.h>
#include <OpenGL/CGLRenderers.h>
#undef glTexImage1D
#undef glTexImage2D
#undef glTexImage3D
#include "apple_cgl.h"
#include "apple_visual.h"
#include "apple_glx.h"
#include "glcontextmodes.h"
enum
{
MAX_ATTR = 60
};
/*mode is a __GlcontextModes*/
void
apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode,
bool * double_buffered, bool * uses_stereo,
bool offscreen)
{
CGLPixelFormatAttribute attr[MAX_ATTR];
const __GLcontextModes *c = mode;
int numattr = 0;
GLint vsref = 0;
CGLError error = 0;
if (offscreen) {
apple_glx_diagnostic
("offscreen rendering enabled. Using kCGLPFAOffScreen\n");
attr[numattr++] = kCGLPFAOffScreen;
attr[numattr++] = kCGLPFAColorSize;
attr[numattr++] = 32;
}
else if (getenv("LIBGL_ALWAYS_SOFTWARE") != NULL) {
apple_glx_diagnostic
("Software rendering requested. Using kCGLRendererGenericFloatID.\n");
attr[numattr++] = kCGLPFARendererID;
attr[numattr++] = kCGLRendererGenericFloatID;
}
else if (getenv("LIBGL_ALLOW_SOFTWARE") != NULL) {
apple_glx_diagnostic
("Software rendering is not being excluded. Not using kCGLPFAAccelerated.\n");
}
else {
attr[numattr++] = kCGLPFAAccelerated;
}
/*
* The program chose a config based on the fbconfigs or visuals.
* Those are based on the attributes from CGL, so we probably
* do want the closest match for the color, depth, and accum.
*/
attr[numattr++] = kCGLPFAClosestPolicy;
if (c->stereoMode) {
attr[numattr++] = kCGLPFAStereo;
*uses_stereo = true;
}
else {
*uses_stereo = false;
}
if (c->doubleBufferMode) {
attr[numattr++] = kCGLPFADoubleBuffer;
*double_buffered = true;
}
else {
*double_buffered = false;
}
attr[numattr++] = kCGLPFAColorSize;
attr[numattr++] = c->redBits + c->greenBits + c->blueBits;
attr[numattr++] = kCGLPFAAlphaSize;
attr[numattr++] = c->alphaBits;
if ((c->accumRedBits + c->accumGreenBits + c->accumBlueBits) > 0) {
attr[numattr++] = kCGLPFAAccumSize;
attr[numattr++] = c->accumRedBits + c->accumGreenBits +
c->accumBlueBits + c->accumAlphaBits;
}
if (c->depthBits > 0) {
attr[numattr++] = kCGLPFADepthSize;
attr[numattr++] = c->depthBits;
}
if (c->stencilBits > 0) {
attr[numattr++] = kCGLPFAStencilSize;
attr[numattr++] = c->stencilBits;
}
if (c->sampleBuffers > 0) {
attr[numattr++] = kCGLPFAMultisample;
attr[numattr++] = kCGLPFASampleBuffers;
attr[numattr++] = c->sampleBuffers;
attr[numattr++] = kCGLPFASamples;
attr[numattr++] = c->samples;
}
attr[numattr++] = 0;
assert(numattr < MAX_ATTR);
error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref);
if (error) {
fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
abort();
}
}

View File

@@ -0,0 +1,41 @@
/*
Copyright (c) 2008 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#ifndef APPLE_VISUAL_H
#define APPLE_VISUAL_H
#include <stdbool.h>
#include <OpenGL/CGLTypes.h>
/* mode is expected to be of type __GLcontextModes. */
void apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode,
bool * double_buffered, bool * uses_stereo,
bool offscreen);
#endif

View File

@@ -0,0 +1,37 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
GLAPI void APIENTRY glTexImage3DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei
depth, GLint border, GLenum format, GLenum type, const void * pixels) {
glTexImage3D(target, level, (GLint)internalformat, width, height, depth, border, format, type, pixels);
}

View File

@@ -0,0 +1,133 @@
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
/*
* This file works with the glXMakeContextCurrent readable drawable.
*
* The way it works is by swapping the currentDrawable for the currentReadable
* drawable if they are different.
*/
#include <stdbool.h>
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
extern struct apple_xgl_api __gl_api;
struct apple_xgl_saved_state
{
bool swapped;
};
static void
SetRead(struct apple_xgl_saved_state *saved)
{
GLXContext gc = __glXGetCurrentContext();
/*
* By default indicate that the state was not swapped, so that UnsetRead
* functions correctly.
*/
saved->swapped = false;
/*
* If the readable drawable isn't the same as the drawable then
* the user has requested a readable drawable with glXMakeContextCurrent().
* We emulate this behavior by switching the current drawable.
*/
if (None != gc->currentReadable
&& gc->currentReadable != gc->currentDrawable) {
Display *dpy = glXGetCurrentDisplay();
saved->swapped = true;
if (apple_glx_make_current_context(dpy, gc->driContext, gc->driContext,
gc->currentReadable)) {
/* An error occurred, so try to restore the old context state. */
(void) apple_glx_make_current_context(dpy, gc->driContext, gc->driContext,
gc->currentDrawable);
saved->swapped = false;
}
}
}
static void
UnsetRead(struct apple_xgl_saved_state *saved)
{
if (saved->swapped) {
GLXContext gc = __glXGetCurrentContext();
Display *dpy = glXGetCurrentDisplay();
if (apple_glx_make_current_context(dpy, gc->driContext, gc->driContext,
gc->currentDrawable)) {
/*
* An error occurred restoring the drawable.
* It's unclear what to do about that.
*/
}
}
}
void
glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type, void *pixels)
{
struct apple_xgl_saved_state saved;
SetRead(&saved);
__gl_api.ReadPixels(x, y, width, height, format, type, pixels);
UnsetRead(&saved);
}
void
glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
{
struct apple_xgl_saved_state saved;
SetRead(&saved);
__gl_api.CopyPixels(x, y, width, height, type);
UnsetRead(&saved);
}
void
glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y,
GLsizei width)
{
struct apple_xgl_saved_state saved;
SetRead(&saved);
__gl_api.CopyColorTable(target, internalformat, x, y, width);
UnsetRead(&saved);
}

View File

@@ -0,0 +1,128 @@
/*
Copyright (c) 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
/* This should be removed once stereo hardware bugs are fixed
* <rdar://problem/6729006>
*/
#include <stdbool.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
extern struct apple_xgl_api __gl_api;
/*
* These are special functions for stereoscopic support
* differences in MacOS X.
*/
void
glDrawBuffer(GLenum mode)
{
GLXContext gc = glXGetCurrentContext();
if (gc && apple_glx_context_uses_stereo(gc->driContext)) {
GLenum buf[2];
GLsizei n = 0;
switch (mode) {
case GL_BACK:
buf[0] = GL_BACK_LEFT;
buf[1] = GL_BACK_RIGHT;
n = 2;
break;
case GL_FRONT:
buf[0] = GL_FRONT_LEFT;
buf[1] = GL_FRONT_RIGHT;
n = 2;
break;
default:
buf[0] = mode;
n = 1;
break;
}
__gl_api.DrawBuffers(n, buf);
}
else {
__gl_api.DrawBuffer(mode);
}
}
void
glDrawBuffers(GLsizei n, const GLenum * bufs)
{
GLXContext gc = glXGetCurrentContext();
if (gc && apple_glx_context_uses_stereo(gc->driContext)) {
GLenum newbuf[n + 2];
GLsizei i, outi = 0;
bool have_back = false;
bool have_front = false;
for (i = 0; i < n; ++i) {
if (GL_BACK == bufs[i]) {
have_back = true;
}
else if (GL_FRONT == bufs[i]) {
have_back = true;
}
else {
newbuf[outi++] = bufs[i];
}
}
if (have_back) {
newbuf[outi++] = GL_BACK_LEFT;
newbuf[outi++] = GL_BACK_RIGHT;
}
if (have_front) {
newbuf[outi++] = GL_FRONT_LEFT;
newbuf[outi++] = GL_FRONT_RIGHT;
}
__gl_api.DrawBuffers(outi, newbuf);
}
else {
__gl_api.DrawBuffers(n, bufs);
}
}
void
glDrawBuffersARB(GLsizei n, const GLenum * bufs)
{
glDrawBuffers(n, bufs);
}

View File

@@ -0,0 +1,46 @@
/*
Copyright (c) 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
extern struct apple_xgl_api __gl_api;
void
glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
GLXContext gc = __glXGetCurrentContext();
Display *dpy = glXGetCurrentDisplay();
if (gc && gc->driContext)
apple_glx_context_update(dpy, gc->driContext);
__gl_api.Viewport(x, y, width, height);
}

452
src/glx/apple/appledri.c Normal file
View File

@@ -0,0 +1,452 @@
/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.12 2001/08/27 17:40:57 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
Copyright 2000 VA Linux Systems, Inc.
Copyright (c) 2002, 2008 Apple Computer, Inc.
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 <martin@valinux.com>
* Jens Owen <jens@valinux.com>
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
/* THIS IS NOT AN X CONSORTIUM STANDARD */
#define NEED_EVENTS
#define NEED_REPLIES
#include <X11/Xlibint.h>
#include "appledristr.h"
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
#include <stdio.h>
static XExtensionInfo _appledri_info_data;
static XExtensionInfo *appledri_info = &_appledri_info_data;
static char *appledri_extension_name = APPLEDRINAME;
#define AppleDRICheckExtension(dpy,i,val) \
XextCheckExtension (dpy, i, appledri_extension_name, val)
/*****************************************************************************
* *
* private utility routines *
* *
*****************************************************************************/
static int close_display(Display * dpy, XExtCodes * extCodes);
static Bool wire_to_event(Display * dpy, XEvent * re, xEvent * event);
static /* const */ XExtensionHooks appledri_extension_hooks = {
NULL, /* create_gc */
NULL, /* copy_gc */
NULL, /* flush_gc */
NULL, /* free_gc */
NULL, /* create_font */
NULL, /* free_font */
close_display, /* close_display */
wire_to_event, /* wire_to_event */
NULL, /* event_to_wire */
NULL, /* error */
NULL, /* error_string */
};
static
XEXT_GENERATE_FIND_DISPLAY(find_display, appledri_info,
appledri_extension_name,
&appledri_extension_hooks,
AppleDRINumberEvents, NULL)
static XEXT_GENERATE_CLOSE_DISPLAY(close_display, appledri_info)
static void (*surface_notify_handler) ();
void *XAppleDRISetSurfaceNotifyHandler(void (*fun) ())
{
void *old = surface_notify_handler;
surface_notify_handler = fun;
return old;
}
static Bool
wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRINotifyEvent *sevent;
AppleDRICheckExtension(dpy, info, False);
switch ((event->u.u.type & 0x7f) - info->codes->first_event) {
case AppleDRISurfaceNotify:
sevent = (xAppleDRINotifyEvent *) event;
if (surface_notify_handler != NULL) {
(*surface_notify_handler) (dpy, (unsigned int) sevent->arg,
(int) sevent->kind);
}
return False;
}
return False;
}
/*****************************************************************************
* *
* public Apple-DRI Extension routines *
* *
*****************************************************************************/
#if 0
#include <stdio.h>
#define TRACE(msg) fprintf(stderr, "AppleDRI%s\n", msg);
#else
#define TRACE(msg)
#endif
Bool
XAppleDRIQueryExtension(dpy, event_basep, error_basep)
Display *dpy;
int *event_basep, *error_basep;
{
XExtDisplayInfo *info = find_display(dpy);
TRACE("QueryExtension...");
if (XextHasExtension(info)) {
*event_basep = info->codes->first_event;
*error_basep = info->codes->first_error;
TRACE("QueryExtension... return True");
return True;
}
else {
TRACE("QueryExtension... return False");
return False;
}
}
Bool
XAppleDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
Display *dpy;
int *majorVersion;
int *minorVersion;
int *patchVersion;
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRIQueryVersionReply rep;
xAppleDRIQueryVersionReq *req;
TRACE("QueryVersion...");
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRIQueryVersion, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRIQueryVersion;
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("QueryVersion... return False");
return False;
}
*majorVersion = rep.majorVersion;
*minorVersion = rep.minorVersion;
*patchVersion = rep.patchVersion;
UnlockDisplay(dpy);
SyncHandle();
TRACE("QueryVersion... return True");
return True;
}
Bool
XAppleDRIQueryDirectRenderingCapable(dpy, screen, isCapable)
Display *dpy;
int screen;
Bool *isCapable;
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRIQueryDirectRenderingCapableReply rep;
xAppleDRIQueryDirectRenderingCapableReq *req;
TRACE("QueryDirectRenderingCapable...");
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRIQueryDirectRenderingCapable, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRIQueryDirectRenderingCapable;
req->screen = screen;
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("QueryDirectRenderingCapable... return False");
return False;
}
*isCapable = rep.isCapable;
UnlockDisplay(dpy);
SyncHandle();
TRACE("QueryDirectRenderingCapable... return True");
return True;
}
Bool
XAppleDRIAuthConnection(dpy, screen, magic)
Display *dpy;
int screen;
unsigned int magic;
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRIAuthConnectionReq *req;
xAppleDRIAuthConnectionReply rep;
TRACE("AuthConnection...");
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRIAuthConnection, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRIAuthConnection;
req->screen = screen;
req->magic = magic;
rep.authenticated = 0;
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.authenticated) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("AuthConnection... return False");
return False;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("AuthConnection... return True");
return True;
}
Bool
XAppleDRICreateSurface(dpy, screen, drawable, client_id, key, uid)
Display *dpy;
int screen;
Drawable drawable;
unsigned int client_id;
unsigned int *key;
unsigned int *uid;
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRICreateSurfaceReply rep;
xAppleDRICreateSurfaceReq *req;
TRACE("CreateSurface...");
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRICreateSurface, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRICreateSurface;
req->screen = screen;
req->drawable = drawable;
req->client_id = client_id;
rep.key_0 = rep.key_1 = rep.uid = 0;
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.key_0) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateSurface... return False");
return False;
}
key[0] = rep.key_0;
key[1] = rep.key_1;
*uid = rep.uid;
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateSurface... return True");
return True;
}
Bool
XAppleDRIDestroySurface(dpy, screen, drawable)
Display *dpy;
int screen;
Drawable drawable;
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRIDestroySurfaceReq *req;
TRACE("DestroySurface...");
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRIDestroySurface, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRIDestroySurface;
req->screen = screen;
req->drawable = drawable;
UnlockDisplay(dpy);
SyncHandle();
TRACE("DestroySurface... return True");
return True;
}
Bool
XAppleDRICreateSharedBuffer(Display * dpy, int screen, Drawable drawable,
Bool doubleSwap, char *path, size_t pathlen,
int *width, int *height)
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRICreateSharedBufferReq *req;
xAppleDRICreateSharedBufferReply rep;
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRICreateSharedBuffer, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRICreateSharedBuffer;
req->screen = screen;
req->drawable = drawable;
req->doubleSwap = doubleSwap;
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
puts("REPLY ERROR");
UnlockDisplay(dpy);
SyncHandle();
return False;
}
printf("rep.stringLength %d\n", (int) rep.stringLength);
if (rep.stringLength > 0 && rep.stringLength <= pathlen) {
_XReadPad(dpy, path, rep.stringLength);
printf("path: %s\n", path);
*width = rep.width;
*height = rep.height;
UnlockDisplay(dpy);
SyncHandle();
return True;
}
UnlockDisplay(dpy);
SyncHandle();
return False;
}
Bool
XAppleDRISwapBuffers(Display * dpy, int screen, Drawable drawable)
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRISwapBuffersReq *req;
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRISwapBuffers, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRISwapBuffers;
req->screen = screen;
req->drawable = drawable;
UnlockDisplay(dpy);
SyncHandle();
return True;
}
Bool
XAppleDRICreatePixmap(Display * dpy, int screen, Drawable drawable,
int *width, int *height, int *pitch, int *bpp,
size_t * size, char *bufname, size_t bufnamesize)
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRICreatePixmapReq *req;
xAppleDRICreatePixmapReply rep;
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRICreatePixmap, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRICreatePixmap;
req->screen = screen;
req->drawable = drawable;
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
return False;
}
/*
printf("rep.stringLength %d\n", (int) rep.stringLength);
*/
if (rep.stringLength > 0 && rep.stringLength <= bufnamesize) {
_XReadPad(dpy, bufname, rep.stringLength);
printf("path: %s\n", bufname);
*width = rep.width;
*height = rep.height;
*pitch = rep.pitch;
*bpp = rep.bpp;
*size = rep.size;
UnlockDisplay(dpy);
SyncHandle();
return True;
}
else if (rep.stringLength > 0) {
_XEatData(dpy, rep.stringLength);
}
UnlockDisplay(dpy);
SyncHandle();
return True;
}
/*
* Call it a drawable, because we really don't know what it is
* until it reaches the server, and we should keep that in mind.
*/
Bool
XAppleDRIDestroyPixmap(Display * dpy, Pixmap drawable)
{
XExtDisplayInfo *info = find_display(dpy);
xAppleDRIDestroyPixmapReq *req;
AppleDRICheckExtension(dpy, info, False);
LockDisplay(dpy);
GetReq(AppleDRIDestroyPixmap, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_AppleDRIDestroyPixmap;
req->drawable = drawable;
UnlockDisplay(dpy);
SyncHandle();
return True;
}

124
src/glx/apple/appledri.h Normal file
View File

@@ -0,0 +1,124 @@
/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.7 2000/12/07 20:26:02 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
Copyright 2000 VA Linux Systems, Inc.
Copyright (c) 2002, 2008, 2009 Apple Computer, Inc.
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 <martin@valinux.com>
* Jens Owen <jens@valinux.com>
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
#ifndef _APPLEDRI_H_
#define _APPLEDRI_H_
#include <X11/Xlib.h>
#include <X11/Xfuncproto.h>
#define X_AppleDRIQueryVersion 0
#define X_AppleDRIQueryDirectRenderingCapable 1
#define X_AppleDRICreateSurface 2
#define X_AppleDRIDestroySurface 3
#define X_AppleDRIAuthConnection 4
#define X_AppleDRICreateSharedBuffer 5
#define X_AppleDRISwapBuffers 6
#define X_AppleDRICreatePixmap 7
#define X_AppleDRIDestroyPixmap 8
/* Requests up to and including 18 were used in a previous version */
/* Events */
#define AppleDRIObsoleteEvent1 0
#define AppleDRIObsoleteEvent2 1
#define AppleDRIObsoleteEvent3 2
#define AppleDRISurfaceNotify 3
#define AppleDRINumberEvents 4
/* Errors */
#define AppleDRIClientNotLocal 0
#define AppleDRIOperationNotSupported 1
#define AppleDRINumberErrors (AppleDRIOperationNotSupported + 1)
/* Kinds of SurfaceNotify events: */
#define AppleDRISurfaceNotifyChanged 0
#define AppleDRISurfaceNotifyDestroyed 1
#ifndef _APPLEDRI_SERVER_
typedef struct
{
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came frome a SendEvent request */
Display *display; /* Display the event was read from */
Window window; /* window of event */
Time time; /* server timestamp when event happened */
int kind; /* subtype of event */
int arg;
} XAppleDRINotifyEvent;
_XFUNCPROTOBEGIN
Bool XAppleDRIQueryExtension(Display * dpy, int *event_base,
int *error_base);
Bool XAppleDRIQueryVersion(Display * dpy, int *majorVersion,
int *minorVersion, int *patchVersion);
Bool XAppleDRIQueryDirectRenderingCapable(Display * dpy, int screen,
Bool * isCapable);
void *XAppleDRISetSurfaceNotifyHandler(void (*fun) (Display * dpy,
unsigned uid, int kind));
Bool XAppleDRIAuthConnection(Display * dpy, int screen, unsigned int magic);
Bool XAppleDRICreateSurface(Display * dpy, int screen, Drawable drawable,
unsigned int client_id, unsigned int key[2],
unsigned int *uid);
Bool XAppleDRIDestroySurface(Display * dpy, int screen, Drawable drawable);
Bool XAppleDRISynchronizeSurfaces(Display * dpy);
Bool XAppleDRICreateSharedBuffer(Display * dpy, int screen, Drawable drawable,
Bool doubleSwap, char *path, size_t pathlen,
int *width, int *height);
Bool XAppleDRISwapBuffers(Display * dpy, int screen, Drawable drawable);
Bool XAppleDRICreatePixmap(Display * dpy, int screen, Drawable drawable,
int *width, int *height, int *pitch, int *bpp,
size_t * size, char *bufname, size_t bufnamesize);
Bool XAppleDRIDestroyPixmap(Display * dpy, Pixmap pixmap);
_XFUNCPROTOEND
#endif /* _APPLEDRI_SERVER_ */
#endif /* _APPLEDRI_H_ */

266
src/glx/apple/appledristr.h Normal file
View File

@@ -0,0 +1,266 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
Copyright 2000 VA Linux Systems, Inc.
Copyright (c) 2002, 2008, 2009 Apple Computer, Inc.
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 <martin@valinux.com>
* Jens Owen <jens@valinux.com>
* Rickard E. (Rik) Fiath <faith@valinux.com>
*
*/
#ifndef _APPLEDRISTR_H_
#define _APPLEDRISTR_H_
#include "appledri.h"
#define APPLEDRINAME "Apple-DRI"
#define APPLE_DRI_MAJOR_VERSION 1 /* current version numbers */
#define APPLE_DRI_MINOR_VERSION 0
#define APPLE_DRI_PATCH_VERSION 0
typedef struct _AppleDRIQueryVersion
{
CARD8 reqType; /* always DRIReqCode */
CARD8 driReqType; /* always X_DRIQueryVersion */
CARD16 length B16;
} xAppleDRIQueryVersionReq;
#define sz_xAppleDRIQueryVersionReq 4
typedef struct
{
BYTE type; /* X_Reply */
BOOL pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 majorVersion B16; /* major version of DRI protocol */
CARD16 minorVersion B16; /* minor version of DRI protocol */
CARD32 patchVersion B32; /* patch version of DRI protocol */
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xAppleDRIQueryVersionReply;
#define sz_xAppleDRIQueryVersionReply 32
typedef struct _AppleDRIQueryDirectRenderingCapable
{
CARD8 reqType; /* always DRIReqCode */
CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */
CARD16 length B16;
CARD32 screen B32;
} xAppleDRIQueryDirectRenderingCapableReq;
#define sz_xAppleDRIQueryDirectRenderingCapableReq 8
typedef struct
{
BYTE type; /* X_Reply */
BOOL pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
BOOL isCapable;
BOOL pad2;
BOOL pad3;
BOOL pad4;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
CARD32 pad8 B32;
CARD32 pad9 B32;
} xAppleDRIQueryDirectRenderingCapableReply;
#define sz_xAppleDRIQueryDirectRenderingCapableReply 32
typedef struct _AppleDRIAuthConnection
{
CARD8 reqType; /* always DRIReqCode */
CARD8 driReqType; /* always X_DRICloseConnection */
CARD16 length B16;
CARD32 screen B32;
CARD32 magic B32;
} xAppleDRIAuthConnectionReq;
#define sz_xAppleDRIAuthConnectionReq 12
typedef struct
{
BYTE type;
BOOL pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 authenticated B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xAppleDRIAuthConnectionReply;
#define zx_xAppleDRIAuthConnectionReply 32
typedef struct _AppleDRICreateSurface
{
CARD8 reqType; /* always DRIReqCode */
CARD8 driReqType; /* always X_DRICreateSurface */
CARD16 length B16;
CARD32 screen B32;
CARD32 drawable B32;
CARD32 client_id B32;
} xAppleDRICreateSurfaceReq;
#define sz_xAppleDRICreateSurfaceReq 16
typedef struct
{
BYTE type; /* X_Reply */
BOOL pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 key_0 B32;
CARD32 key_1 B32;
CARD32 uid B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xAppleDRICreateSurfaceReply;
#define sz_xAppleDRICreateSurfaceReply 32
typedef struct _AppleDRIDestroySurface
{
CARD8 reqType; /* always DRIReqCode */
CARD8 driReqType; /* always X_DRIDestroySurface */
CARD16 length B16;
CARD32 screen B32;
CARD32 drawable B32;
} xAppleDRIDestroySurfaceReq;
#define sz_xAppleDRIDestroySurfaceReq 12
typedef struct _AppleDRINotify
{
BYTE type; /* always eventBase + event type */
BYTE kind;
CARD16 sequenceNumber B16;
CARD32 time B32; /* time of change */
CARD32 pad1 B32;
CARD32 arg B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xAppleDRINotifyEvent;
#define sz_xAppleDRINotifyEvent 32
typedef struct
{
CARD8 reqType;
CARD8 driReqType;
CARD16 length B16;
CARD32 screen B32;
CARD32 drawable B32;
BOOL doubleSwap;
CARD8 pad1, pad2, pad3;
} xAppleDRICreateSharedBufferReq;
#define sz_xAppleDRICreateSharedBufferReq 16
typedef struct
{
BYTE type;
BYTE data1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 stringLength B32; /* 0 on error */
CARD32 width B32;
CARD32 height B32;
CARD32 pad1 B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
} xAppleDRICreateSharedBufferReply;
#define sz_xAppleDRICreateSharedBufferReply 32
typedef struct
{
CARD8 reqType;
CARD8 driReqType;
CARD16 length B16;
CARD32 screen B32;
CARD32 drawable B32;
} xAppleDRISwapBuffersReq;
#define sz_xAppleDRISwapBuffersReq 12
typedef struct
{
CARD8 reqType; /*1 */
CARD8 driReqType; /*2 */
CARD16 length B16; /*4 */
CARD32 screen B32; /*8 */
CARD32 drawable B32; /*12 */
} xAppleDRICreatePixmapReq;
#define sz_xAppleDRICreatePixmapReq 12
typedef struct
{
BYTE type; /*1 */
BOOL pad1; /*2 */
CARD16 sequenceNumber B16; /*4 */
CARD32 length B32; /*8 */
CARD32 width B32; /*12 */
CARD32 height B32; /*16 */
CARD32 pitch B32; /*20 */
CARD32 bpp B32; /*24 */
CARD32 size B32; /*28 */
CARD32 stringLength B32; /*32 */
} xAppleDRICreatePixmapReply;
#define sz_xAppleDRICreatePixmapReply 32
typedef struct
{
CARD8 reqType; /*1 */
CARD8 driReqType; /*2 */
CARD16 length B16; /*4 */
CARD32 drawable B32; /*8 */
} xAppleDRIDestroyPixmapReq;
#define sz_xAppleDRIDestroyPixmapReq 8
#ifdef _APPLEDRI_SERVER_
void AppleDRISendEvent(
#if NeedFunctionPrototypes
int /* type */ ,
unsigned int /* mask */ ,
int /* which */ ,
int /* arg */
#endif
);
#endif /* _APPLEDRI_SERVER_ */
#endif /* _APPLEDRISTR_H_ */

View File

@@ -0,0 +1,86 @@
package require Tcl 8.5
set license {
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
}
set this_script [info script]
proc main {argc argv} {
if {2 != $argc} {
puts stderr "syntax is: [set ::this_script] serialized-array-file output.h"
return 1
}
set fd [open [lindex $argv 0] r]
array set api [read $fd]
close $fd
set fd [open [lindex $argv 1] w]
puts $fd "/* This file was automatically generated by [set ::this_script]. */"
puts $fd $::license
puts $fd "
#ifndef APPLE_XGL_API_H
#define APPLE_XGL_API_H
"
puts $fd "struct apple_xgl_api \{"
set sorted [lsort -dictionary [array names api]]
foreach f $sorted {
set attr $api($f)
set pstr ""
if {[dict exists $attr alias_for] || [dict exists $attr noop]} {
#Skip this function.
continue
}
foreach p [dict get $attr parameters] {
append pstr "[lindex $p 0] [lindex $p 1], "
}
set pstr [string trimright $pstr ", "]
puts $fd "\t[dict get $attr return] (*[set f])([set pstr]);"
}
puts $fd "\};"
puts $fd "void apple_xgl_init_direct(void);
#endif /*APPLE_XGL_API_H*/
"
return 0
}
exit [main $::argc $::argv]

View File

@@ -0,0 +1,212 @@
package require Tcl 8.5
set license {
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
}
set gl_license {
/*
** 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.
*/
}
set init_code {
static void *glsym(void *handle, const char *name) {
void *sym = dlsym(handle, name);
if(NULL == sym) {
fprintf(stderr, "Error: symbol not found: '%s'. "
"Error information: %s\n",
name, dlerror());
abort();
}
return sym;
}
}
set dlopen_code {
#ifndef LIBGLNAME
#define LIBGLNAME "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
#endif LIBGLNAME
(void)dlerror(); /*drain dlerror()*/
handle = dlopen(LIBGLNAME, RTLD_LAZY);
if(NULL == handle) {
fprintf(stderr, "error: unable to dlopen "
LIBGLNAME " :" "%s\n", dlerror());
abort();
}
}
set this_script [info script]
proc main {argc argv} {
if {2 != $argc} {
puts stderr "syntax is: [set ::this_script] serialized-array-file output.c"
return 1
}
set fd [open [lindex $argv 0] r]
array set api [read $fd]
close $fd
set fd [open [lindex $argv 1] w]
puts $fd "/* This file was automatically generated by [set ::this_script]. */"
puts $fd $::license
puts $fd {
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <dlfcn.h>
#include "glxclient.h"
#include "apple_xgl_api.h"
#include "apple_glx_context.h"
}
puts $fd "struct apple_xgl_api __gl_api;"
set sorted [lsort -dictionary [array names api]]
set exclude [list DrawBuffer DrawBuffers DrawBuffersARB]
#These are special to glXMakeContextCurrent.
#See also: apple_xgl_api_read.c.
lappend exclude ReadPixels CopyPixels CopyColorTable
#This is excluded to work with surface updates.
lappend exclude Viewport
foreach f $sorted {
if {$f in $exclude} {
continue
}
set attr $api($f)
set pstr ""
foreach p [dict get $attr parameters] {
append pstr "[lindex $p 0] [lindex $p 1], "
}
set pstr [string trimright $pstr ", "]
if {![string length $pstr]} {
set pstr void
}
set callvars ""
foreach p [dict get $attr parameters] {
append callvars "[lindex $p end], "
}
set callvars [string trimright $callvars ", "]
set return ""
if {"void" ne [dict get $attr return]} {
set return "return "
}
if {[dict exists $attr noop]} {
if {"void" eq [dict get $attr return]} {
set body "/*noop*/"
} else {
set body "return 0; /*noop*/"
}
} elseif {[dict exists $attr alias_for]} {
set alias [dict get $attr alias_for]
set body "[set return] gl[set alias]([set callvars]);"
} else {
set body "[set return]__gl_api.[set f]([set callvars]);"
}
puts $fd "GLAPI [dict get $attr return] APIENTRY gl[set f]([set pstr]) \{\n\t$body\n\}"
}
puts $fd $::init_code
puts $fd "void apple_xgl_init_direct(void) \{"
puts $fd "\tvoid *handle;"
puts $fd $::dlopen_code
foreach f $sorted {
set attr $api($f)
puts $attr
puts $f
if {[dict exists $attr alias_for] || [dict exists $attr noop]} {
#Function f is an alias_for another, so we shouldn't try
#to load it.
continue
}
puts $fd "\t__gl_api.$f = glsym(handle, \"gl$f\");"
}
puts $fd "\}\n"
close $fd
return 0
}
exit [main $::argc $::argv]

View File

@@ -0,0 +1,50 @@
if 0 {
Copyright (c) 2008 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
}
package require Tcl 8.5
proc main {} {
set tclsh [info nameofexecutable]
puts TYPES
exec $tclsh ./gen_types.tcl stage.1
puts DEFS
exec $tclsh ./gen_defs.tcl specs/enum.spec stage.2
puts FUNCS
exec $tclsh ./gen_funcs.tcl specs/gl.spec stage.3 stage.4
puts HEADER
exec $tclsh ./gen_api_header.tcl stage.4 apple_xgl_api.h
puts "C API"
exec $tclsh ./gen_api_library.tcl stage.4 apple_xgl_api.c
puts "EXPORTS"
exec $tclsh ./gen_exports.tcl stage.4 exports.list
return 0
}
exit [main]

View File

@@ -0,0 +1,67 @@
#This parses and generates #defines from an enum.spec type of file.
proc main {argc argv} {
if {2 != $argc} {
puts stderr "syntax is: [info script] input.spec output.h"
exit 1
}
set fd [open [lindex $argv 0] r]
set data [read $fd]
close $fd
set fd [open [lindex $argv 1] w]
set state ""
puts $fd "#define GL_VERSION_1_1 1"
puts $fd "#define GL_VERSION_1_2 1"
puts $fd "#define GL_VERSION_1_3 1"
puts $fd "#define GL_VERSION_1_4 1"
puts $fd "#define GL_VERSION_1_5 1"
puts $fd "#define GL_VERSION_2_0 1"
#puts $fd "#define GL_VERSION_3_0 1"
set mask ""
array set ar {}
foreach line [split $data \n] {
if {[regexp {^\S*#.*} $line] > 0} {
#puts COMMENT:$line
set state ""
} elseif {"enum" eq $state} {
if {[string match "\t*" $line]} {
if {[regexp {^\tuse.*} $line] > 0} {
lassign [split [string trim $line]] use usemask def
set usemask [string trim $usemask]
set def [string trim $def]
puts $fd "/* GL_$def */"
} else {
lassign [split [string trim $line] =] def value
set def [string trim $def]
set value [string trim $value]
#Trim out the data like: 0x0B00 # 4 F
set value [lindex [split $value] 0]
puts $fd "#define GL_$def $value"
#Save this association with the value.
set d $ar($mask)
dict set d $def $value
set ar($mask) $d
}
} else {
set state ""
}
} elseif {[string match "* enum:*" $line]} {
lassign [split $line] mask _
puts $fd "\n/*[string trim $mask]*/"
set ar($mask) [dict create]
set state enum
}
}
close $fd
}
main $::argc $::argv

View File

@@ -0,0 +1,132 @@
if 0 {
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
}
package require Tcl 8.5
proc main {argc argv} {
if {2 != $argc} {
puts stderr "syntax is: [info script] serialized-array-file export.list"
return 1
}
set fd [open [lindex $argv 0] r]
array set api [read $fd]
close $fd
#Start with 1.0
set glxlist [list \
glXChooseVisual glXCreateContext glXDestroyContext \
glXMakeCurrent glXCopyContext glXSwapBuffers \
glXCreateGLXPixmap glXDestroyGLXPixmap \
glXQueryExtension glXQueryVersion \
glXIsDirect glXGetConfig \
glXGetCurrentContext glXGetCurrentDrawable \
glXWaitGL glXWaitX glXUseXFont]
#GLX 1.1 and later
lappend glxlist glXQueryExtensionsString glXQueryServerString \
glXGetClientString
#GLX 1.2 and later
lappend glxlist glXGetCurrentDisplay
#GLX 1.3 and later
lappend glxlist glXChooseFBConfig glXGetFBConfigAttrib \
glXGetFBConfigs glXGetVisualFromFBConfig \
glXCreateWindow glXDestroyWindow \
glXCreatePixmap glXDestroyPixmap \
glXCreatePbuffer glXDestroyPbuffer \
glXQueryDrawable glXCreateNewContext \
glXMakeContextCurrent glXGetCurrentReadDrawable \
glXQueryContext glXSelectEvent glXGetSelectedEvent
#GLX 1.4 and later
lappend glxlist glXGetProcAddress
#Extensions
lappend glxlist glXGetProcAddressARB
#Old extensions we don't support and never really have, but need for
#symbol compatibility. See also: glx_empty.c
lappend glxlist glXSwapIntervalSGI glXSwapIntervalMESA \
glXGetSwapIntervalMESA glXBeginFrameTrackingMESA \
glXEndFrameTrackingMESA glXGetFrameUsageMESA \
glXQueryFrameTrackingMESA glXGetVideoSyncSGI \
glXWaitVideoSyncSGI glXJoinSwapGroupSGIX \
glXBindSwapBarrierSGIX glXQueryMaxSwapBarriersSGIX \
glXGetSyncValuesOML glXSwapBuffersMscOML \
glXWaitForMscOML glXWaitForSbcOML \
glXAllocateMemoryMESA glXFreeMemoryMESA \
glXGetMemoryOffsetMESA glXReleaseBuffersMESA \
glXCreateGLXPixmapMESA glXCopySubBufferMESA \
glXQueryGLXPbufferSGIX glXCreateGLXPbufferSGIX \
glXDestroyGLXPbufferSGIX glXSelectEventSGIX \
glXGetSelectedEventSGIX
#These are for GLX_SGIX_fbconfig, which isn't implemented, because
#we have the GLX 1.3 GLXFBConfig functions which are in the standard spec.
#It should be possible to support these to some extent.
#The old libGL somewhat supported the GLXFBConfigSGIX code, but lacked
#pbuffer, and pixmap support.
#We mainly just need these stubs for linking with apps, because for
#some reason the OpenGL site suggests using the latest glxext.h,
#and glxext.h defines all GLX extensions, which doesn't seem right for
#compile-time capability detection.
#See also: http://www.mesa3d.org/brianp/sig97/exten.htm#Compile
#which conflicts with: the ABI registry from what I saw on opengl.org.
#By disabling some of the #defines in glxext.h we break some software,
#and by enabling them without the symbols we break others (in Mesa).
#I think a lot of OpenGL-based programs have issues one way or another.
#It seems that even Mesa developers are confused on this issue, because
#Mesa-7.3/progs/xdemos/glxgears_fbconfig.c has comments about breakage
#in some comments.
lappend glxlist glXGetFBConfigAttribSGIX \
glXChooseFBConfigSGIX \
glXGetVisualFromFBConfigSGIX \
glXCreateGLXPixmapWithConfigSGIX \
glXCreateContextWithConfigSGIX \
glXGetFBConfigFromVisualSGIX
set fd [open [lindex $argv 1] w]
foreach f [lsort -dictionary [array names api]] {
puts $fd _gl$f
}
foreach f [lsort -dictionary $glxlist] {
puts $fd _$f
}
close $fd
return 0
}
exit [main $::argc $::argv]

735
src/glx/apple/gen_funcs.tcl Normal file
View File

@@ -0,0 +1,735 @@
package require Tcl 8.5
#input is specs/gl.spec
set license {
/*
Copyright (c) 2008, 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
}
proc extension name {
global extensions
set extensions($name) 1
}
proc alias {from to} {
global aliases
set aliases($from) $to
}
proc promoted name {
global promoted
set promoted($name) 1
}
proc noop name {
global noop
set noop($name) 1
}
set dir [file dirname [info script]]
source [file join $dir GL_extensions]
source [file join $dir GL_aliases]
source [file join $dir GL_promoted]
source [file join $dir GL_noop]
proc is-extension-supported? name {
global extensions
return [info exists extensions($name)]
}
# This is going to need to be updated for future OpenGL versions:
# cat specs/gl.tm | grep -v '^#' | awk -F, '{sub(/[ \t]+/, ""); print " "$1 " \"" $4 "\""}'
# then change void from "*" to "void"
#
# TextureComponentCount is GLenum in SL for everything
# It is GLint in mesa, but is GLenum for glTexImage3DEXT
array set typemap {
AccumOp "GLenum"
AlphaFunction "GLenum"
AttribMask "GLbitfield"
BeginMode "GLenum"
BinormalPointerTypeEXT "GLenum"
BlendEquationMode "GLenum"
BlendEquationModeEXT "GLenum"
BlendFuncSeparateParameterEXT "GLenum"
BlendingFactorDest "GLenum"
BlendingFactorSrc "GLenum"
Boolean "GLboolean"
BooleanPointer "GLboolean*"
Char "GLchar"
CharPointer "GLchar*"
CheckedFloat32 "GLfloat"
CheckedInt32 "GLint"
ClampColorTargetARB "GLenum"
ClampColorModeARB "GLenum"
ClampedColorF "GLclampf"
ClampedFloat32 "GLclampf"
ClampedFloat64 "GLclampd"
ClampedStencilValue "GLint"
ClearBufferMask "GLbitfield"
ClientAttribMask "GLbitfield"
ClipPlaneName "GLenum"
ColorB "GLbyte"
ColorD "GLdouble"
ColorF "GLfloat"
ColorI "GLint"
ColorIndexValueD "GLdouble"
ColorIndexValueF "GLfloat"
ColorIndexValueI "GLint"
ColorIndexValueS "GLshort"
ColorIndexValueUB "GLubyte"
ColorMaterialParameter "GLenum"
ColorPointerType "GLenum"
ColorS "GLshort"
ColorTableParameterPName "GLenum"
ColorTableParameterPNameSGI "GLenum"
ColorTableTarget "GLenum"
ColorTableTargetSGI "GLenum"
ColorUB "GLubyte"
ColorUI "GLuint"
ColorUS "GLushort"
CombinerBiasNV "GLenum"
CombinerComponentUsageNV "GLenum"
CombinerMappingNV "GLenum"
CombinerParameterNV "GLenum"
CombinerPortionNV "GLenum"
CombinerRegisterNV "GLenum"
CombinerScaleNV "GLenum"
CombinerStageNV "GLenum"
CombinerVariableNV "GLenum"
CompressedTextureARB "GLvoid"
ControlPointNV "GLvoid"
ControlPointTypeNV "GLenum"
ConvolutionParameter "GLenum"
ConvolutionParameterEXT "GLenum"
ConvolutionTarget "GLenum"
ConvolutionTargetEXT "GLenum"
CoordD "GLdouble"
CoordF "GLfloat"
CoordI "GLint"
CoordS "GLshort"
CullFaceMode "GLenum"
CullParameterEXT "GLenum"
DepthFunction "GLenum"
DrawBufferMode "GLenum"
DrawBufferName "GLint"
DrawElementsType "GLenum"
ElementPointerTypeATI "GLenum"
EnableCap "GLenum"
ErrorCode "GLenum"
EvalMapsModeNV "GLenum"
EvalTargetNV "GLenum"
FeedbackElement "GLfloat"
FeedbackType "GLenum"
FenceNV "GLuint"
FenceConditionNV "GLenum"
FenceParameterNameNV "GLenum"
FfdMaskSGIX "GLbitfield"
FfdTargetSGIX "GLenum"
Float32 "GLfloat"
Float32Pointer "GLfloat*"
Float64 "GLdouble"
Float64Pointer "GLdouble*"
FogParameter "GLenum"
FogPointerTypeEXT "GLenum"
FogPointerTypeIBM "GLenum"
FragmentLightModelParameterSGIX "GLenum"
FragmentLightNameSGIX "GLenum"
FragmentLightParameterSGIX "GLenum"
FramebufferAttachment "GLenum"
FramebufferTarget "GLenum"
FrontFaceDirection "GLenum"
FunctionPointer "_GLfuncptr"
GetColorTableParameterPName "GLenum"
GetColorTableParameterPNameSGI "GLenum"
GetConvolutionParameterPName "GLenum"
GetHistogramParameterPName "GLenum"
GetHistogramParameterPNameEXT "GLenum"
GetMapQuery "GLenum"
GetMinmaxParameterPName "GLenum"
GetMinmaxParameterPNameEXT "GLenum"
GetPName "GLenum"
GetPointervPName "GLenum"
GetTextureParameter "GLenum"
HintMode "GLenum"
HintTarget "GLenum"
HintTargetPGI "GLenum"
HistogramTarget "GLenum"
HistogramTargetEXT "GLenum"
IglooFunctionSelectSGIX "GLenum"
IglooParameterSGIX "GLvoid"
ImageTransformPNameHP "GLenum"
ImageTransformTargetHP "GLenum"
IndexFunctionEXT "GLenum"
IndexMaterialParameterEXT "GLenum"
IndexPointerType "GLenum"
Int16 "GLshort"
Int32 "GLint"
Int8 "GLbyte"
InterleavedArrayFormat "GLenum"
LightEnvParameterSGIX "GLenum"
LightModelParameter "GLenum"
LightName "GLenum"
LightParameter "GLenum"
LightTextureModeEXT "GLenum"
LightTexturePNameEXT "GLenum"
LineStipple "GLushort"
List "GLuint"
ListMode "GLenum"
ListNameType "GLenum"
ListParameterName "GLenum"
LogicOp "GLenum"
MapAttribParameterNV "GLenum"
MapParameterNV "GLenum"
MapTarget "GLenum"
MapTargetNV "GLenum"
MapTypeNV "GLenum"
MaskedColorIndexValueF "GLfloat"
MaskedColorIndexValueI "GLuint"
MaskedStencilValue "GLuint"
MaterialFace "GLenum"
MaterialParameter "GLenum"
MatrixIndexPointerTypeARB "GLenum"
MatrixMode "GLenum"
MatrixTransformNV "GLenum"
MeshMode1 "GLenum"
MeshMode2 "GLenum"
MinmaxTarget "GLenum"
MinmaxTargetEXT "GLenum"
NormalPointerType "GLenum"
NurbsCallback "GLenum"
NurbsObj "GLUnurbs*"
NurbsProperty "GLenum"
NurbsTrim "GLenum"
OcclusionQueryParameterNameNV "GLenum"
PixelCopyType "GLenum"
PixelFormat "GLenum"
PixelInternalFormat "GLenum"
PixelMap "GLenum"
PixelStoreParameter "GLenum"
PixelTexGenModeSGIX "GLenum"
PixelTexGenParameterNameSGIS "GLenum"
PixelTransferParameter "GLenum"
PixelTransformPNameEXT "GLenum"
PixelTransformTargetEXT "GLenum"
PixelType "GLenum"
PointParameterNameARB "GLenum"
PolygonMode "GLenum"
ProgramNV "GLuint"
ProgramCharacterNV "GLubyte"
ProgramParameterNV "GLenum"
ProgramParameterPName "GLenum"
QuadricCallback "GLenum"
QuadricDrawStyle "GLenum"
QuadricNormal "GLenum"
QuadricObj "GLUquadric*"
QuadricOrientation "GLenum"
ReadBufferMode "GLenum"
RenderbufferTarget "GLenum"
RenderingMode "GLenum"
ReplacementCodeSUN "GLuint"
ReplacementCodeTypeSUN "GLenum"
SamplePassARB "GLenum"
SamplePatternEXT "GLenum"
SamplePatternSGIS "GLenum"
SecondaryColorPointerTypeIBM "GLenum"
SelectName "GLuint"
SeparableTarget "GLenum"
SeparableTargetEXT "GLenum"
ShadingModel "GLenum"
SizeI "GLsizei"
SpriteParameterNameSGIX "GLenum"
StencilFunction "GLenum"
StencilFaceDirection "GLenum"
StencilOp "GLenum"
StencilValue "GLint"
String "const GLubyte *"
StringName "GLenum"
TangentPointerTypeEXT "GLenum"
TessCallback "GLenum"
TessContour "GLenum"
TessProperty "GLenum"
TesselatorObj "GLUtesselator*"
TexCoordPointerType "GLenum"
Texture "GLuint"
TextureComponentCount "GLint"
TextureCoordName "GLenum"
TextureEnvParameter "GLenum"
TextureEnvTarget "GLenum"
TextureFilterSGIS "GLenum"
TextureGenParameter "GLenum"
TextureNormalModeEXT "GLenum"
TextureParameterName "GLenum"
TextureTarget "GLenum"
TextureUnit "GLenum"
UInt16 "GLushort"
UInt32 "GLuint"
UInt8 "GLubyte"
VertexAttribEnum "GLenum"
VertexAttribEnumNV "GLenum"
VertexAttribPointerTypeNV "GLenum"
VertexPointerType "GLenum"
VertexWeightPointerTypeEXT "GLenum"
Void "GLvoid"
VoidPointer "GLvoid*"
ConstVoidPointer "GLvoid* const"
WeightPointerTypeARB "GLenum"
WinCoord "GLint"
void "void"
ArrayObjectPNameATI "GLenum"
ArrayObjectUsageATI "GLenum"
ConstFloat32 "GLfloat"
ConstInt32 "GLint"
ConstUInt32 "GLuint"
ConstVoid "GLvoid"
DataTypeEXT "GLenum"
FragmentOpATI "GLenum"
GetTexBumpParameterATI "GLenum"
GetVariantValueEXT "GLenum"
ParameterRangeEXT "GLenum"
PreserveModeATI "GLenum"
ProgramFormatARB "GLenum"
ProgramTargetARB "GLenum"
ProgramTarget "GLenum"
ProgramPropertyARB "GLenum"
ProgramStringPropertyARB "GLenum"
ScalarType "GLenum"
SwizzleOpATI "GLenum"
TexBumpParameterATI "GLenum"
VariantCapEXT "GLenum"
VertexAttribPointerPropertyARB "GLenum"
VertexAttribPointerTypeARB "GLenum"
VertexAttribPropertyARB "GLenum"
VertexShaderCoordOutEXT "GLenum"
VertexShaderOpEXT "GLenum"
VertexShaderParameterEXT "GLenum"
VertexShaderStorageTypeEXT "GLenum"
VertexShaderTextureUnitParameter "GLenum"
VertexShaderWriteMaskEXT "GLenum"
VertexStreamATI "GLenum"
PNTrianglesPNameATI "GLenum"
BufferOffset "GLintptr"
BufferSize "GLsizeiptr"
BufferAccessARB "GLenum"
BufferOffsetARB "GLintptrARB"
BufferPNameARB "GLenum"
BufferPointerNameARB "GLenum"
BufferSizeARB "GLsizeiptrARB"
BufferTargetARB "GLenum"
BufferUsageARB "GLenum"
ObjectTypeAPPLE "GLenum"
VertexArrayPNameAPPLE "GLenum"
DrawBufferModeATI "GLenum"
Half16NV "GLhalfNV"
PixelDataRangeTargetNV "GLenum"
TypeEnum "GLenum"
GLbitfield "GLbitfield"
GLenum "GLenum"
Int64 "GLint64"
UInt64 "GLuint64"
handleARB "GLhandleARB"
charARB "GLcharARB"
charPointerARB "GLcharARB*"
sync "GLsync"
Int64EXT "GLint64EXT"
UInt64EXT "GLuint64EXT"
FramebufferAttachment "GLenum"
FramebufferAttachmentParameterName "GLenum"
Framebuffer "GLuint"
FramebufferStatus "GLenum"
FramebufferTarget "GLenum"
GetFramebufferParameter "GLenum"
Intptr "GLintptr"
ProgramFormat "GLenum"
ProgramProperty "GLenum"
ProgramStringProperty "GLenum"
ProgramTarget "GLenum"
Renderbuffer "GLuint"
RenderbufferParameterName "GLenum"
Sizeiptr "GLsizeiptr"
TextureInternalFormat "GLenum"
VertexBufferObjectAccess "GLenum"
VertexBufferObjectParameter "GLenum"
VertexBufferObjectUsage "GLenum"
BufferAccessMask "GLbitfield"
GetMultisamplePNameNV "GLenum"
SampleMaskNV "GLbitfield"
}
proc psplit s {
set r [list]
set token ""
foreach c [split $s ""] {
if {[string is space -strict $c]} {
if {[string length $token]} {
lappend r $token
}
set token ""
} else {
append token $c
}
}
if {[string length $token]} {
lappend r $token
}
return $r
}
proc is-extension? str {
#Check if the trailing name of the function is NV, or EXT, and so on.
if {[string is upper [string index $str end]]
&& [string is upper [string index $str end-1]]} {
return 1
}
return 0
}
proc parse {data arvar} {
upvar 1 $arvar ar
set state ""
set name ""
foreach line [split $data \n] {
if {"attr" eq $state} {
if {[string match "\t*" $line]} {
set plist [psplit [lindex [split $line "#"] 0]]
#puts PLIST:$plist
set master $ar($name)
set param [dict get $master parameters]
switch -- [llength $plist] {
1 {
dict set master [lindex $plist 0] ""
}
2 {
#standard key, value pair
set key [lindex $plist 0]
set value [lindex $plist 1]
dict set master $key $value
}
default {
set key [lindex $plist 0]
#puts PLIST:$plist
if {"param" eq $key} {
lappend param [list [lindex $plist 1] [lindex $plist 2] [lindex $plist 3] [lindex $plist 4]]
} else {
dict set master $key [lrange $plist 1 end]
}
}
}
dict set master parameters $param
set ar($name) $master
} else {
set state ""
}
} elseif {[regexp {^([A-Z_a-z0-9]+)\((.*)\)\S*} $line all name argv] > 0} {
#puts "MATCH:$name ARGV:$argv"
#Trim the spaces in the elements.
set newargv [list]
foreach a [split $argv ,] {
lappend newargv [string trim $a]
}
set d [dict create name $name arguments $newargv \
parameters [dict create]]
set ar($name) $d
set state attr
}
}
}
#This returns true if the category is valid for an extension.
proc is-valid-category? c {
set clist [list display-list drawing drawing-control feedback framebuf misc modeling pixel-op pixel-rw state-req xform VERSION_1_0 VERSION_1_0_DEPRECATED VERSION_1_1 VERSION_1_1_DEPRECATED VERSION_1_2 VERSION_1_2_DEPRECATED VERSION_1_3 VERSION_1_3_DEPRECATED VERSION_1_4 VERSION_1_4_DEPRECATED VERSION_1_5 VERSION_2_0 VERSION_2_1 VERSION_3_0 VERSION_3_0_DEPRECATED VERSION_3_1 VERSION_3_2]
set result [expr {$c in $clist}]
if {!$result} {
set result [is-extension-supported? $c]
}
return $result
}
proc translate-parameters {func parameters} {
global typemap
set newparams [list]
foreach p $parameters {
set var [lindex $p 0]
set ptype [lindex $p 1]
if {![info exists typemap($ptype)]} {
set ::missingTypes($ptype) $func
continue
}
set type $typemap($ptype)
if {"array" eq [lindex $p 3]} {
if {"in" eq [lindex $p 2]} {
set final_type "const $type *"
} else {
set final_type "$type *"
}
} else {
set final_type $type
}
lappend newparams [list $final_type $var]
}
return $newparams
}
proc api-new-entry {info func} {
global typemap
set master [dict create]
set rettype [dict get $info return]
if {![info exists typemap($rettype)]} {
set ::missingTypes($rettype) $func
} else {
dict set master return $typemap($rettype)
}
dict set master parameters [translate-parameters $func \
[dict get $info parameters]]
return $master
}
proc main {argc argv} {
global extensions typemap aliases promoted noop
set fd [open [lindex $argv 0] r]
set data [read $fd]
close $fd
array set ar {}
parse $data ar
array set newapi {}
array set missingTypes {}
foreach {key value} [array get ar] {
puts "KEY:$key VALUE:$value"
set category [dict get $value category]
#Invalidate any of the extensions and things not in the spec we support.
set valid [is-valid-category? $category]
puts VALID:$valid
if {!$valid} {
continue
}
puts "VALID:$key"
if {"BlitFramebuffer" eq $key} {
#This was promoted to an ARB extension after Leopard it seems.
set key BlitFramebufferEXT
}
if {"ARB_framebuffer_object" eq $category} {
#This wasn't an ARB extension in Leopard either.
if {![string match *EXT $key]} {
append key EXT
}
}
set newapi($key) [api-new-entry $value $key]
}
#Now iterate and support as many aliases as we can for promoted functions
#based on if the newapi contains the function.
foreach {func value} [array get ar] {
if {![info exists promoted([dict get $value category])]} {
continue
}
if {[dict exists $value alias]} {
#We have an alias. Let's see if we have the implementation.
set alias [dict get $value alias]
if {[info exists newapi($alias)] && ![info exists newapi($func)]} {
#We have an implementing function available.
puts "HAVE:$key ALIAS:$alias"
set master [api-new-entry $value $func]
dict set master alias_for $alias
set newapi($func) $master
}
}
}
parray noop
#Now handle the no-op compatibility categories.
foreach {func value} [array get ar] {
if {[info exists noop([dict get $value category])]} {
if {[info exists newapi($func)]} {
puts stderr "$func shouldn't be a noop"
exit 1
}
set master [api-new-entry $value $func]
dict set master noop 1
set newapi($func) $master
}
}
parray newapi
if {[array size ::missingTypes]} {
parray ::missingTypes
return 1
}
foreach {from to} [array get aliases] {
set d $newapi($to)
dict set d alias_for $to
set newapi($from) $d
}
#Iterate the nm output and set each symbol in an associative array.
array set validapi {}
foreach line [split [exec nm -j -g /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib] \n] {
set fn [string trim $line]
#Only match the _gl functions.
if {[string match _gl* $fn]} {
set finalfn [string range $fn 3 end]
puts FINALFN:$finalfn
set validapi($finalfn) $finalfn
}
}
puts "Correcting the API functions to match the OpenGL framework."
#parray validapi
#Iterate the newapi and unset any members that the
#libGL.dylib doesn't support, assuming they aren't no-ops.
foreach fn [array names newapi] {
if {![info exists validapi($fn)]} {
puts "WARNING: libGL.dylib lacks support for: $fn"
if {[dict exists $newapi($fn) noop]
&& [dict get $newapi($fn) noop]} {
#This is no-op, so we should skip it.
continue
}
#Is the function an alias for another in libGL?
if {[dict exists $newapi($fn) alias_for]} {
set alias [dict get $newapi($fn) alias_for]
if {![info exists validapi($alias)]} {
puts "WARNING: alias function doesn't exist for $fn."
puts "The alias is $alias."
puts "unsetting $fn"
unset newapi($fn)
}
} else {
puts "unsetting $fn"
unset newapi($fn)
}
}
}
#Now print a warning about any symbols that libGL supports that we don't.
foreach fn [array names validapi] {
if {![info exists newapi($fn)]} {
puts "AppleSGLX is missing $fn"
}
}
puts "NOW GENERATING:[lindex $::argv 1]"
set fd [open [lindex $::argv 1] w]
set sorted [lsort -dictionary [array names newapi]]
foreach f $sorted {
set attr $newapi($f)
set pstr ""
foreach p [dict get $attr parameters] {
append pstr "[lindex $p 0] [lindex $p 1], "
}
set pstr [string trimright $pstr ", "]
puts $fd "[dict get $attr return] gl[set f]($pstr); "
}
close $fd
if {$::argc == 3} {
puts "NOW GENERATING:[lindex $::argv 2]"
#Dump the array as a serialized list.
set fd [open [lindex $::argv 2] w]
puts $fd [array get newapi]
close $fd
}
return 0
}
exit [main $::argc $::argv]

View File

@@ -0,0 +1,32 @@
proc main {argc argv} {
if {1 != $argc} {
puts stderr "syntax is: [info script] output.h"
exit 1
}
set fd [open [lindex $argv 0] w]
puts $fd "
/*OpenGL primitive typedefs*/
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef signed char GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef unsigned char GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef float GLfloat;
typedef float GLclampf;
typedef double GLdouble;
typedef double GLclampd;
typedef void GLvoid;
typedef long GLintptr;
typedef long GLsizeiptr;
"
}
main $::argc $::argv

375
src/glx/apple/glx_empty.c Normal file
View File

@@ -0,0 +1,375 @@
#include "glxclient.h"
#include "glxextensions.h"
#include "glcontextmodes.h"
/*
** GLX_SGI_swap_control
*/
int
glXSwapIntervalSGI(int interval)
{
(void) interval;
return 0;
}
/*
** GLX_MESA_swap_control
*/
int
glXSwapIntervalMESA(unsigned int interval)
{
(void) interval;
return GLX_BAD_CONTEXT;
}
int
glXGetSwapIntervalMESA(void)
{
return 0;
}
/*
** GLX_MESA_swap_frame_usage
*/
int
glXBeginFrameTrackingMESA(Display * dpy, GLXDrawable drawable)
{
int status = GLX_BAD_CONTEXT;
(void) dpy;
(void) drawable;
return status;
}
int
glXEndFrameTrackingMESA(Display * dpy, GLXDrawable drawable)
{
int status = GLX_BAD_CONTEXT;
(void) dpy;
(void) drawable;
return status;
}
int
glXGetFrameUsageMESA(Display * dpy, GLXDrawable drawable, GLfloat * usage)
{
int status = GLX_BAD_CONTEXT;
(void) dpy;
(void) drawable;
(void) usage;
return status;
}
int
glXQueryFrameTrackingMESA(Display * dpy, GLXDrawable drawable,
int64_t * sbc, int64_t * missedFrames,
GLfloat * lastMissedUsage)
{
int status = GLX_BAD_CONTEXT;
(void) dpy;
(void) drawable;
(void) sbc;
(void) missedFrames;
(void) lastMissedUsage;
return status;
}
/*
** GLX_SGI_video_sync
*/
int
glXGetVideoSyncSGI(unsigned int *count)
{
(void) count;
return GLX_BAD_CONTEXT;
}
int
glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
{
(void) count;
return GLX_BAD_CONTEXT;
}
/*
** GLX_SGIX_swap_group
*/
void
glXJoinSwapGroupSGIX(Display * dpy, GLXDrawable drawable, GLXDrawable member)
{
(void) dpy;
(void) drawable;
(void) member;
}
/*
** GLX_SGIX_swap_barrier
*/
void
glXBindSwapBarrierSGIX(Display * dpy, GLXDrawable drawable, int barrier)
{
(void) dpy;
(void) drawable;
(void) barrier;
}
Bool
glXQueryMaxSwapBarriersSGIX(Display * dpy, int screen, int *max)
{
(void) dpy;
(void) screen;
(void) max;
return False;
}
/*
** GLX_OML_sync_control
*/
Bool
glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
int64_t * ust, int64_t * msc, int64_t * sbc)
{
(void) dpy;
(void) drawable;
(void) ust;
(void) msc;
(void) sbc;
return False;
}
int64_t
glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable,
int64_t target_msc, int64_t divisor, int64_t remainder)
{
(void) dpy;
(void) drawable;
(void) target_msc;
(void) divisor;
(void) remainder;
return 0;
}
Bool
glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
int64_t target_msc, int64_t divisor,
int64_t remainder, int64_t * ust,
int64_t * msc, int64_t * sbc)
{
(void) dpy;
(void) drawable;
(void) target_msc;
(void) divisor;
(void) remainder;
(void) ust;
(void) msc;
(void) sbc;
return False;
}
Bool
glXWaitForSbcOML(Display * dpy, GLXDrawable drawable,
int64_t target_sbc, int64_t * ust,
int64_t * msc, int64_t * sbc)
{
(void) dpy;
(void) drawable;
(void) target_sbc;
(void) ust;
(void) msc;
(void) sbc;
return False;
}
/**
* GLX_MESA_allocate_memory
*/
/*@{*/
PUBLIC void *
glXAllocateMemoryMESA(Display * dpy, int scrn,
size_t size, float readFreq,
float writeFreq, float priority)
{
(void) dpy;
(void) scrn;
(void) size;
(void) readFreq;
(void) writeFreq;
(void) priority;
return NULL;
}
PUBLIC void
glXFreeMemoryMESA(Display * dpy, int scrn, void *pointer)
{
#ifdef __DRI_ALLOCATE
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, scrn);
if (psc && psc->allocate)
(*psc->allocate->freeMemory) (psc->__driScreen, pointer);
#else
(void) dpy;
(void) scrn;
(void) pointer;
#endif /* __DRI_ALLOCATE */
}
PUBLIC GLuint
glXGetMemoryOffsetMESA(Display * dpy, int scrn, const void *pointer)
{
(void) dpy;
(void) scrn;
(void) pointer;
return ~0L;
}
Bool
glXReleaseBuffersMESA(Display * dpy, GLXDrawable d)
{
(void) dpy;
(void) d;
return False;
}
PUBLIC GLXPixmap
glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual,
Pixmap pixmap, Colormap cmap)
{
(void) dpy;
(void) visual;
(void) pixmap;
(void) cmap;
return 0;
}
/**
* GLX_MESA_copy_sub_buffer
*/
void
glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable,
int x, int y, int width, int height)
{
(void) dpy;
(void) drawable;
(void) x;
(void) y;
(void) width;
(void) height;
}
PUBLIC int
glXQueryGLXPbufferSGIX(Display * dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
(void) dpy;
(void) drawable;
(void) attribute;
(void) value;
return 0;
}
PUBLIC GLXDrawable
glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfig config,
unsigned int width, unsigned int height,
int *attrib_list)
{
(void) dpy;
(void) config;
(void) width;
(void) height;
(void) attrib_list;
return None;
}
#if 0
/* GLX_SGIX_fbconfig */
PUBLIC int
glXGetFBConfigAttribSGIX(Display * dpy, void *config, int a, int *b)
{
(void) dpy;
(void) config;
(void) a;
(void) b;
return 0;
}
PUBLIC void *
glXChooseFBConfigSGIX(Display * dpy, int a, int *b, int *c)
{
(void) dpy;
(void) a;
(void) b;
(void) c;
return NULL;
}
PUBLIC GLXPixmap
glXCreateGLXPixmapWithConfigSGIX(Display * dpy, void *config, Pixmap p)
{
(void) dpy;
(void) config;
(void) p;
return None;
}
PUBLIC GLXContext
glXCreateContextWithConfigSGIX(Display * dpy, void *config, int a,
GLXContext b, Bool c)
{
(void) dpy;
(void) config;
(void) a;
(void) b;
(void) c;
return NULL;
}
PUBLIC XVisualInfo *
glXGetVisualFromFBConfigSGIX(Display * dpy, void *config)
{
(void) dpy;
(void) config;
return NULL;
}
PUBLIC void *
glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * visinfo)
{
(void) dpy;
(void) visinfo;
return NULL;
}
#endif
PUBLIC
GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
(Display * dpy, GLXDrawable pbuf),
(dpy, pbuf), glXDestroyPbuffer)
PUBLIC GLX_ALIAS_VOID(glXSelectEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long mask), (dpy, drawable, mask),
glXSelectEvent)
PUBLIC GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
(Display * dpy, GLXDrawable drawable,
unsigned long *mask), (dpy, drawable, mask),
glXGetSelectedEvent)

65
src/glx/apple/glx_error.c Normal file
View File

@@ -0,0 +1,65 @@
/*
Copyright (c) 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <stdbool.h>
#include <X11/Xlibint.h>
#include <X11/extensions/extutil.h>
#include <X11/extensions/Xext.h>
#include "glxclient.h"
#include "glx_error.h"
extern XExtDisplayInfo *__glXFindDisplay(Display * dpy);
void
__glXSendError(Display * dpy, int errorCode, unsigned long resourceID,
unsigned long minorCode, bool coreX11error)
{
XExtDisplayInfo *info = __glXFindDisplay(dpy);
GLXContext gc = __glXGetCurrentContext();
xError error;
LockDisplay(dpy);
error.type = X_Error;
if (coreX11error) {
error.errorCode = errorCode;
}
else {
error.errorCode = info->codes->first_error + errorCode;
}
error.sequenceNumber = dpy->request;
error.resourceID = resourceID;
error.minorCode = minorCode;
error.majorCode = gc ? gc->majorOpcode : 0;
_XError(dpy, &error);
UnlockDisplay(dpy);
}

33
src/glx/apple/glx_error.h Normal file
View File

@@ -0,0 +1,33 @@
/*
Copyright (c) 2009 Apple Inc.
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, sublicense, 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 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
NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
HOLDER(S) 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.
Except as contained in this notice, the name(s) of the above
copyright holders shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without
prior written authorization.
*/
#include <stdbool.h>
#include <X11/Xlib.h>
void __glXSendError(Display * dpy, int errorCode, unsigned long resourceID,
unsigned long minorCode, bool coreX11error);

134
src/glx/apple/glxreply.c Normal file
View File

@@ -0,0 +1,134 @@
/*
* (C) Copyright Apple Inc. 2008
* (C) Copyright IBM Corporation 2004, 2005
* 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
* IBM,
* AND/OR THEIR 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.
*/
#include <GL/gl.h>
#include "glxclient.h"
#include <GL/glxproto.h>
CARD32
__glXReadReply(Display * dpy, size_t size, void *dest,
GLboolean reply_is_always_array)
{
xGLXSingleReply reply;
(void) _XReply(dpy, (xReply *) & reply, 0, False);
if (size != 0) {
if ((reply.length > 0) || reply_is_always_array) {
const GLint bytes = (reply_is_always_array)
? (4 * reply.length) : (reply.size * size);
const GLint extra = 4 - (bytes & 3);
_XRead(dpy, dest, bytes);
if (extra < 4) {
_XEatData(dpy, extra);
}
}
else {
(void) memcpy(dest, &(reply.pad3), size);
}
}
return reply.retval;
}
void
__glXReadPixelReply(Display * dpy, __GLXcontext * gc, unsigned max_dim,
GLint width, GLint height, GLint depth, GLenum format,
GLenum type, void *dest, GLboolean dimensions_in_reply)
{
xGLXSingleReply reply;
GLint size;
(void) _XReply(dpy, (xReply *) & reply, 0, False);
if (dimensions_in_reply) {
width = reply.pad3;
height = reply.pad4;
depth = reply.pad5;
if ((height == 0) || (max_dim < 2)) {
height = 1;
}
if ((depth == 0) || (max_dim < 3)) {
depth = 1;
}
}
size = reply.length * 4;
if (size != 0) {
void *buf = Xmalloc(size);
if (buf == NULL) {
_XEatData(dpy, size);
__glXSetError(gc, GL_OUT_OF_MEMORY);
}
else {
const GLint extra = 4 - (size & 3);
_XRead(dpy, buf, size);
if (extra < 4) {
_XEatData(dpy, extra);
}
__glEmptyImage(gc, 3, width, height, depth, format, type, buf, dest);
Xfree(buf);
}
}
}
#if 0
GLubyte *
__glXSetupSingleRequest(__GLXcontext * gc, GLint sop, GLint cmdlen)
{
xGLXSingleReq *req;
Display *const dpy = gc->currentDpy;
(void) __glXFlushRenderBuffer(gc, gc->pc);
LockDisplay(dpy);
GetReqExtra(GLXSingle, cmdlen, req);
req->reqType = gc->majorOpcode;
req->contextTag = gc->currentContextTag;
req->glxCode = sop;
return (GLubyte *) (req) + sz_xGLXSingleReq;
}
#endif
GLubyte *
__glXSetupVendorRequest(__GLXcontext * gc, GLint code, GLint vop,
GLint cmdlen)
{
xGLXVendorPrivateReq *req;
Display *const dpy = gc->currentDpy;
(void) __glXFlushRenderBuffer(gc, gc->pc);
LockDisplay(dpy);
GetReqExtra(GLXVendorPrivate, cmdlen, req);
req->reqType = gc->majorOpcode;
req->glxCode = code;
req->vendorCode = vop;
req->contextTag = gc->currentContextTag;
return (GLubyte *) (req) + sz_xGLXVendorPrivateReq;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

28563
src/glx/apple/specs/gl.spec Normal file

File diff suppressed because it is too large Load Diff

322
src/glx/apple/specs/gl.tm Normal file
View File

@@ -0,0 +1,322 @@
AccumOp,*,*, GLenum,*,*
AlphaFunction,*,*, GLenum,*,*
AttribMask,*,*, GLbitfield,*,*
BeginMode,*,*, GLenum,*,*
BinormalPointerTypeEXT,*,*, GLenum,*,*
BlendEquationMode,*,*, GLenum,*,*
BlendEquationModeEXT,*,*, GLenum,*,*
BlendFuncSeparateParameterEXT,*,*, GLenum,*,*
BlendingFactorDest,*,*, GLenum,*,*
BlendingFactorSrc,*,*, GLenum,*,*
Boolean,*,*, GLboolean,*,*
BooleanPointer,*,*, GLboolean*,*,*
Char,*,*, GLchar,*,*
CharPointer,*,*, GLchar*,*,*
CheckedFloat32,*,*, GLfloat,*,*
CheckedInt32,*,*, GLint,*,*
ClampColorTargetARB,*,*, GLenum,*,*
ClampColorModeARB,*,*, GLenum,*,*
ClampedColorF,*,*, GLclampf,*,*
ClampedFloat32,*,*, GLclampf,*,*
ClampedFloat64,*,*, GLclampd,*,*
ClampedStencilValue,*,*, GLint,*,*
ClearBufferMask,*,*, GLbitfield,*,*
ClientAttribMask,*,*, GLbitfield,*,*
ClipPlaneName,*,*, GLenum,*,*
ColorB,*,*, GLbyte,*,*
ColorD,*,*, GLdouble,*,*
ColorF,*,*, GLfloat,*,*
ColorI,*,*, GLint,*,*
ColorIndexValueD,*,*, GLdouble,*,*
ColorIndexValueF,*,*, GLfloat,*,*
ColorIndexValueI,*,*, GLint,*,*
ColorIndexValueS,*,*, GLshort,*,*
ColorIndexValueUB,*,*, GLubyte,*,*
ColorMaterialParameter,*,*, GLenum,*,*
ColorPointerType,*,*, GLenum,*,*
ColorS,*,*, GLshort,*,*
ColorTableParameterPName,*,*, GLenum,*,*
ColorTableParameterPNameSGI,*,*, GLenum,*,*
ColorTableTarget,*,*, GLenum,*,*
ColorTableTargetSGI,*,*, GLenum,*,*
ColorUB,*,*, GLubyte,*,*
ColorUI,*,*, GLuint,*,*
ColorUS,*,*, GLushort,*,*
CombinerBiasNV,*,*, GLenum,*,*
CombinerComponentUsageNV,*,*, GLenum,*,*
CombinerMappingNV,*,*, GLenum,*,*
CombinerParameterNV,*,*, GLenum,*,*
CombinerPortionNV,*,*, GLenum,*,*
CombinerRegisterNV,*,*, GLenum,*,*
CombinerScaleNV,*,*, GLenum,*,*
CombinerStageNV,*,*, GLenum,*,*
CombinerVariableNV,*,*, GLenum,*,*
CompressedTextureARB,*,*, GLvoid,*,*
ControlPointNV,*,*, GLvoid,*,*
ControlPointTypeNV,*,*, GLenum,*,*
ConvolutionParameter,*,*, GLenum,*,*
ConvolutionParameterEXT,*,*, GLenum,*,*
ConvolutionTarget,*,*, GLenum,*,*
ConvolutionTargetEXT,*,*, GLenum,*,*
CoordD,*,*, GLdouble,*,*
CoordF,*,*, GLfloat,*,*
CoordI,*,*, GLint,*,*
CoordS,*,*, GLshort,*,*
CullFaceMode,*,*, GLenum,*,*
CullParameterEXT,*,*, GLenum,*,*
DepthFunction,*,*, GLenum,*,*
DrawBufferMode,*,*, GLenum,*,*
DrawBufferName,*,*, GLint,*,*
DrawElementsType,*,*, GLenum,*,*
ElementPointerTypeATI,*,*, GLenum,*,*
EnableCap,*,*, GLenum,*,*
ErrorCode,*,*, GLenum,*,*
EvalMapsModeNV,*,*, GLenum,*,*
EvalTargetNV,*,*, GLenum,*,*
FeedbackElement,*,*, GLfloat,*,*
FeedbackType,*,*, GLenum,*,*
FenceNV,*,*, GLuint,*,*
FenceConditionNV,*,*, GLenum,*,*
FenceParameterNameNV,*,*, GLenum,*,*
FfdMaskSGIX,*,*, GLbitfield,*,*
FfdTargetSGIX,*,*, GLenum,*,*
Float32,*,*, GLfloat,*,*
Float32Pointer,*,*, GLfloat*,*,*
Float64,*,*, GLdouble,*,*
Float64Pointer,*,*, GLdouble*,*,*
FogParameter,*,*, GLenum,*,*
FogPointerTypeEXT,*,*, GLenum,*,*
FogPointerTypeIBM,*,*, GLenum,*,*
FragmentLightModelParameterSGIX,*,*,GLenum,*,*
FragmentLightNameSGIX,*,*, GLenum,*,*
FragmentLightParameterSGIX,*,*, GLenum,*,*
FramebufferAttachment,*,*, GLenum,*,*
FramebufferTarget,*,*, GLenum,*,*
FrontFaceDirection,*,*, GLenum,*,*
FunctionPointer,*,*, _GLfuncptr,*,*
GetColorTableParameterPName,*,*, GLenum,*,*
GetColorTableParameterPNameSGI,*,*, GLenum,*,*
GetConvolutionParameterPName,*,*, GLenum,*,*
GetHistogramParameterPName,*,*, GLenum,*,*
GetHistogramParameterPNameEXT,*,*, GLenum,*,*
GetMapQuery,*,*, GLenum,*,*
GetMinmaxParameterPName,*,*, GLenum,*,*
GetMinmaxParameterPNameEXT,*,*, GLenum,*,*
GetPName,*,*, GLenum,*,*
GetPointervPName,*,*, GLenum,*,*
GetTextureParameter,*,*, GLenum,*,*
HintMode,*,*, GLenum,*,*
HintTarget,*,*, GLenum,*,*
HintTargetPGI,*,*, GLenum,*,*
HistogramTarget,*,*, GLenum,*,*
HistogramTargetEXT,*,*, GLenum,*,*
IglooFunctionSelectSGIX,*,*, GLenum,*,*
IglooParameterSGIX,*,*, GLvoid,*,*
ImageTransformPNameHP,*,*, GLenum,*,*
ImageTransformTargetHP,*,*, GLenum,*,*
IndexFunctionEXT,*,*, GLenum,*,*
IndexMaterialParameterEXT,*,*, GLenum,*,*
IndexPointerType,*,*, GLenum,*,*
Int16,*,*, GLshort,*,*
Int32,*,*, GLint,*,*
Int8,*,*, GLbyte,*,*
InterleavedArrayFormat,*,*, GLenum,*,*
LightEnvParameterSGIX,*,*, GLenum,*,*
LightModelParameter,*,*, GLenum,*,*
LightName,*,*, GLenum,*,*
LightParameter,*,*, GLenum,*,*
LightTextureModeEXT,*,*, GLenum,*,*
LightTexturePNameEXT,*,*, GLenum,*,*
LineStipple,*,*, GLushort,*,*
List,*,*, GLuint,*,*
ListMode,*,*, GLenum,*,*
ListNameType,*,*, GLenum,*,*
ListParameterName,*,*, GLenum,*,*
LogicOp,*,*, GLenum,*,*
MapAttribParameterNV,*,*, GLenum,*,*
MapParameterNV,*,*, GLenum,*,*
MapTarget,*,*, GLenum,*,*
MapTargetNV,*,*, GLenum,*,*
MapTypeNV,*,*, GLenum,*,*
MaskedColorIndexValueF,*,*, GLfloat,*,*
MaskedColorIndexValueI,*,*, GLuint,*,*
MaskedStencilValue,*,*, GLuint,*,*
MaterialFace,*,*, GLenum,*,*
MaterialParameter,*,*, GLenum,*,*
MatrixIndexPointerTypeARB,*,*, GLenum,*,*
MatrixMode,*,*, GLenum,*,*
MatrixTransformNV,*,*, GLenum,*,*
MeshMode1,*,*, GLenum,*,*
MeshMode2,*,*, GLenum,*,*
MinmaxTarget,*,*, GLenum,*,*
MinmaxTargetEXT,*,*, GLenum,*,*
NormalPointerType,*,*, GLenum,*,*
NurbsCallback,*,*, GLenum,*,*
NurbsObj,*,*, GLUnurbs*,*,*
NurbsProperty,*,*, GLenum,*,*
NurbsTrim,*,*, GLenum,*,*
OcclusionQueryParameterNameNV,*,*, GLenum,*,*
PixelCopyType,*,*, GLenum,*,*
PixelFormat,*,*, GLenum,*,*
PixelInternalFormat,*,*, GLenum,*,*
PixelMap,*,*, GLenum,*,*
PixelStoreParameter,*,*, GLenum,*,*
PixelTexGenModeSGIX,*,*, GLenum,*,*
PixelTexGenParameterNameSGIS,*,*, GLenum,*,*
PixelTransferParameter,*,*, GLenum,*,*
PixelTransformPNameEXT,*,*, GLenum,*,*
PixelTransformTargetEXT,*,*, GLenum,*,*
PixelType,*,*, GLenum,*,*
PointParameterNameARB,*,*, GLenum,*,*
PolygonMode,*,*, GLenum,*,*
ProgramNV,*,*, GLuint,*,*
ProgramCharacterNV,*,*, GLubyte,*,*
ProgramParameterNV,*,*, GLenum,*,*
ProgramParameterPName,*,*, GLenum,*,*
QuadricCallback,*,*, GLenum,*,*
QuadricDrawStyle,*,*, GLenum,*,*
QuadricNormal,*,*, GLenum,*,*
QuadricObj,*,*, GLUquadric*,*,*
QuadricOrientation,*,*, GLenum,*,*
ReadBufferMode,*,*, GLenum,*,*
RenderbufferTarget,*,*, GLenum,*,*
RenderingMode,*,*, GLenum,*,*
ReplacementCodeSUN,*,*, GLuint,*,*
ReplacementCodeTypeSUN,*,*, GLenum,*,*
SamplePassARB,*,*, GLenum,*,*
SamplePatternEXT,*,*, GLenum,*,*
SamplePatternSGIS,*,*, GLenum,*,*
SecondaryColorPointerTypeIBM,*,*, GLenum,*,*
SelectName,*,*, GLuint,*,*
SeparableTarget,*,*, GLenum,*,*
SeparableTargetEXT,*,*, GLenum,*,*
ShadingModel,*,*, GLenum,*,*
SizeI,*,*, GLsizei,*,*
SpriteParameterNameSGIX,*,*, GLenum,*,*
StencilFunction,*,*, GLenum,*,*
StencilFaceDirection,*,*, GLenum,*,*
StencilOp,*,*, GLenum,*,*
StencilValue,*,*, GLint,*,*
String,*,*, const GLubyte *,*,*
StringName,*,*, GLenum,*,*
TangentPointerTypeEXT,*,*, GLenum,*,*
TessCallback,*,*, GLenum,*,*
TessContour,*,*, GLenum,*,*
TessProperty,*,*, GLenum,*,*
TesselatorObj,*,*, GLUtesselator*,*,*
TexCoordPointerType,*,*, GLenum,*,*
Texture,*,*, GLuint,*,*
TextureComponentCount,*,*, GLint,*,*
TextureCoordName,*,*, GLenum,*,*
TextureEnvParameter,*,*, GLenum,*,*
TextureEnvTarget,*,*, GLenum,*,*
TextureFilterSGIS,*,*, GLenum,*,*
TextureGenParameter,*,*, GLenum,*,*
TextureNormalModeEXT,*,*, GLenum,*,*
TextureParameterName,*,*, GLenum,*,*
TextureTarget,*,*, GLenum,*,*
TextureUnit,*,*, GLenum,*,*
UInt16,*,*, GLushort,*,*
UInt32,*,*, GLuint,*,*
UInt8,*,*, GLubyte,*,*
VertexAttribEnum,*,*, GLenum,*,*
VertexAttribEnumNV,*,*, GLenum,*,*
VertexAttribPointerTypeNV,*,*, GLenum,*,*
VertexPointerType,*,*, GLenum,*,*
VertexWeightPointerTypeEXT,*,*, GLenum,*,*
Void,*,*, GLvoid,*,*
VoidPointer,*,*, GLvoid*,*,*
ConstVoidPointer,*,*, GLvoid* const,*,*
WeightPointerTypeARB,*,*, GLenum,*,*
WinCoord,*,*, GLint,*,*
void,*,*, *,*,*
ArrayObjectPNameATI,*,*, GLenum,*,*
ArrayObjectUsageATI,*,*, GLenum,*,*,
ConstFloat32,*,*, GLfloat,*,*
ConstInt32,*,*, GLint,*,*
ConstUInt32,*,*, GLuint,*,*
ConstVoid,*,*, GLvoid,*,*
DataTypeEXT,*,*, GLenum,*,*
FragmentOpATI,*,*, GLenum,*,*
GetTexBumpParameterATI,*,*, GLenum,*,*
GetVariantValueEXT,*,*, GLenum,*,*
ParameterRangeEXT,*,*, GLenum,*,*
PreserveModeATI,*,*, GLenum,*,*
ProgramFormatARB,*,*, GLenum,*,*
ProgramTargetARB,*,*, GLenum,*,*
ProgramTarget,*,*, GLenum,*,*
ProgramPropertyARB,*,*, GLenum,*,*
ProgramStringPropertyARB,*,*, GLenum,*,*
ScalarType,*,*, GLenum,*,*
SwizzleOpATI,*,*, GLenum,*,*
TexBumpParameterATI,*,*, GLenum,*,*
VariantCapEXT,*,*, GLenum,*,*
VertexAttribPointerPropertyARB,*,*, GLenum,*,*
VertexAttribPointerTypeARB,*,*, GLenum,*,*
VertexAttribPropertyARB,*,*, GLenum,*,*
VertexShaderCoordOutEXT,*,*, GLenum,*,*
VertexShaderOpEXT,*,*, GLenum,*,*
VertexShaderParameterEXT,*,*, GLenum,*,*
VertexShaderStorageTypeEXT,*,*, GLenum,*,*
VertexShaderTextureUnitParameter,*,*, GLenum,*,*
VertexShaderWriteMaskEXT,*,*, GLenum,*,*
VertexStreamATI,*,*, GLenum,*,*
PNTrianglesPNameATI,*,*, GLenum,*,*
# ARB_vertex_buffer_object types and core equivalents for new types
BufferOffset,*,*, GLintptr,*,*
BufferSize,*,*, GLsizeiptr,*,*
BufferAccessARB,*,*, GLenum,*,*
BufferOffsetARB,*,*, GLintptrARB,*,*
BufferPNameARB,*,*, GLenum,*,*
BufferPointerNameARB,*,*, GLenum,*,*
BufferSizeARB,*,*, GLsizeiptrARB,*,*
BufferTargetARB,*,*, GLenum,*,*
BufferUsageARB,*,*, GLenum,*,*
# APPLE_fence
ObjectTypeAPPLE,*,*, GLenum,*,*
# APPLE_vertex_array_range
VertexArrayPNameAPPLE,*,*, GLenum,*,*
# ATI_draw_buffers
DrawBufferModeATI,*,*, GLenum,*,*
# NV_half
Half16NV,*,*, GLhalfNV,*,*
# NV_pixel_data_range
PixelDataRangeTargetNV,*,*, GLenum,*,*
# Generic types for as-yet-unspecified enums
TypeEnum,*,*, GLenum,*,*
GLbitfield,*,*, GLbitfield,*,*
GLenum,*,*, GLenum,*,*
Int64,*,*, GLint64,*,*
UInt64,*,*, GLuint64,*,*
# Object handle & data pointers
handleARB,*,*, GLhandleARB,*,*
charARB,*,*, GLcharARB,*,*
charPointerARB,*,*, GLcharARB*,*,*
sync,*,*, GLsync,*,*,
# EXT_timer_query
Int64EXT,*,*, GLint64EXT,*,*
UInt64EXT,*,*, GLuint64EXT,*,*
# EXT_direct_state_access
FramebufferAttachment,*,*, GLenum,*,*
FramebufferAttachmentParameterName,*,*, GLenum,*,*
Framebuffer,*,*, GLuint,*,*
FramebufferStatus,*,*, GLenum,*,*
FramebufferTarget,*,*, GLenum,*,*
GetFramebufferParameter,*,*, GLenum,*,*
Intptr,*,*, GLintptr,*,*
ProgramFormat,*,*, GLenum,*,*
ProgramProperty,*,*, GLenum,*,*
ProgramStringProperty,*,*, GLenum,*,*
ProgramTarget,*,*, GLenum,*,*
Renderbuffer,*,*, GLuint,*,*
RenderbufferParameterName,*,*, GLenum,*,*
Sizeiptr,*,*, GLsizeiptr,*,*
TextureInternalFormat,*,*, GLenum,*,*
VertexBufferObjectAccess,*,*, GLenum,*,*
VertexBufferObjectParameter,*,*, GLenum,*,*
VertexBufferObjectUsage,*,*, GLenum,*,*
# ARB_map_buffer_range
BufferAccessMask,*,*, GLbitfield,*,*
# NV_explicit_multisample
GetMultisamplePNameNV,*,*, GLenum,*,*
SampleMaskNV,*,*, GLbitfield,*,*

View File

@@ -0,0 +1,602 @@
# Copyright (c) 1991-2005 Silicon Graphics, Inc. All Rights Reserved.
# Copyright (c) 2006-2010 The Khronos Group, Inc.
#
# This document is licensed under the SGI Free Software B License Version
# 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
#
# $Revision: 10796 $ on $Date: 2010-03-19 17:31:10 -0700 (Fri, 19 Mar 2010) $
required-props:
param: retval retained
dlflags: notlistable handcode nop
glxflags: client-handcode server-handcode
glxvendorglx: *
vectorequiv: *
category: pixel-rw bgn-end display-list drawing drawing-control feedback framebuf misc modeling pixel-op pixel-rw state-req xform glx glxopcode
glxopcode: *
###############################################################################
#
# GLX1.0 commands
#
###############################################################################
Render()
return void
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 1
RenderLarge()
return void
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 2
CreateContext(gc_id, screen, visual, share_list)
return void
param gc_id Int32 in value
param screen Int32 in value
param visual Int32 in value
param share_list Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 3
DestroyContext(context)
return void
param context Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 4
MakeCurrent(drawable, context)
return void
param drawable Int32 in value
param context Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 5
IsDirect(dpy, context)
return void
param dpy Int32 in value
param context Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 6
QueryVersion(major, minor)
return void
param major Int32 out reference
param minor Int32 out reference
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 7
WaitGL(context)
return void
param context Int32 in value
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 8
WaitX()
return void
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 9
CopyContext(source, dest, mask)
return void
param source Int32 in value
param dest Int32 in value
param mask Int32 in value
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 10
SwapBuffers(drawable)
return void
param drawable Int32 in value
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 11
UseXFont(font, first, count, list_base)
return void
param font Int32 in value
param first Int32 in value
param count Int32 in value
param list_base Int32 in value
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 12
CreateGLXPixmap(visual, pixmap, glxpixmap)
return void
param visual Int32 in value
param pixmap Int32 in value
param glxpixmap Int32 in value
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 13
GetVisualConfigs()
return void
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 14
DestroyGLXPixmap(pixmap)
return void
param pixmap Int32 in value
glxflags client-handcode
category glx
dlflags notlistable
glxopcode 15
VendorPrivate()
return void
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 16
VendorPrivateWithReply()
return void
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 17
###############################################################################
#
# GLX1.1 commands
#
###############################################################################
QueryExtensionsString(screen)
return void
param screen Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 18
QueryServerString(screen, name)
return void
param screen Int32 in value
param name Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 19
ClientInfo()
return void
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxopcode 20
###############################################################################
#
# GLX1.3 commands
#
###############################################################################
GetFBConfigs()
return void
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxopcode 21
CreatePixmap(config, pixmap, glxpixmap)
return void
param config Int32 in value
param pixmap Int32 in value
param glxpixmap Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 22
DestroyPixmap(glxpixmap)
return void
param glxpixmap Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 23
CreateNewContext(config, render_type, share_list, direct)
return void
param config Int32 in value
param render_type Int32 in value
param share_list Int32 in value
param direct Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 24
QueryContext()
return void
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 25
MakeContextCurrent(drawable, readdrawable, context)
return void
param drawable Int32 in value
param readdrawable Int32 in value
param context Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 26
CreatePbuffer(config, pbuffer)
return void
param config Int32 in value
param pbuffer Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 27
DestroyPbuffer(pbuffer)
return void
param pbuffer Int32 in value
dlflags notlistable
glxflags client-handcode
category glx
glxopcode 28
GetDrawableAttributes(drawable)
return void
param drawable Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 29
ChangeDrawableAttributes(drawable)
return void
param drawable Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 30
CreateWindow(config, window, glxwindow)
return void
param config Int32 in value
param window Int32 in value
param glxwindow Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 31
DestroyWindow(glxwindow)
return void
param glxwindow Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxopcode 32
###############################################################################
#
# IRIX5.3 extension commands
#
###############################################################################
###############################################################################
#
# SGI_swap_control extension commands
#
###############################################################################
SwapIntervalSGI()
return void
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65536
###############################################################################
#
# IRIX5.3-PATCH154 extension commands
#
###############################################################################
###############################################################################
#
# SGI_make_current_read extension commands
#
###############################################################################
MakeCurrentReadSGI(drawable, readdrawable, context)
return void
param drawable Int32 in value
param readdrawable Int32 in value
param context Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65537
###############################################################################
#
# SGIX_video_source extension commands
#
###############################################################################
CreateGLXVideoSourceSGIX(dpy, screen, server, path, class, node)
return void
param dpy Int32 in value
param screen Int32 in value
param server Int32 in value
param path Int32 in value
param class Int32 in value
param node Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65538
DestroyGLXVideoSourceSGIX(dpy, glxvideosource)
return void
param dpy Int32 in value
param glxvideosource Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65539
###############################################################################
#
# IRIX6.2 extension commands
#
###############################################################################
###############################################################################
#
# EXT_import_context extension commands
#
###############################################################################
QueryContextInfoEXT()
return void
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxvendorglx 1024
###############################################################################
#
# SGIX_fbconfig extension commands
#
###############################################################################
GetFBConfigsSGIX()
return void
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxvendorglx 65540
CreateContextWithConfigSGIX(gc_id, screen, config, share_list)
return void
param gc_id Int32 in value
param screen Int32 in value
param config Int32 in value
param share_list Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65541
CreateGLXPixmapWithConfigSGIX(config, pixmap, glxpixmap)
return void
param config Int32 in value
param pixmap Int32 in value
param glxpixmap Int32 in value
category glx
dlflags notlistable
glxflags client-handcode server-handcode
glxvendorglx 65542
###############################################################################
#
# SGIX_pbuffer extension commands
#
###############################################################################
CreateGLXPbufferSGIX(config, pbuffer)
return void
param config Int32 in value
param pbuffer Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxvendorglx 65543
DestroyGLXPbufferSGIX(pbuffer)
return void
param pbuffer Int32 in value
dlflags notlistable
glxflags client-handcode
category glx
glxvendorglx 65544
ChangeDrawableAttributesSGIX(drawable)
return void
param drawable Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxvendorglx 65545
GetDrawableAttributesSGIX(drawable)
return void
param drawable Int32 in value
dlflags notlistable
glxflags client-handcode server-handcode
category glx
glxvendorglx 65546
###############################################################################
#
# SGIX_swap_group extension commands
#
###############################################################################
JoinSwapGroupSGIX(window,group)
return void
param window Int32 in value
param group Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65547
###############################################################################
#
# SGIX_swap_barrier extension commands
#
###############################################################################
BindSwapBarrierSGIX(window,barrier)
return void
param window Int32 in value
param barrier Int32 in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65548
QueryMaxSwapBarriersSGIX()
return void
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65549
###############################################################################
#
# SGIX_hyperpipe extension commands
#
###############################################################################
QueryHyperpipeNetworkSGIX(dpy, npipes)
return GLXHyperpipeNetworkPointer
param dpy Display out reference
param npipes int out reference
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65550
HyperpipeConfigSGIX(dpy, networkId, npipes, cfg, hpId)
return int
param dpy Display out reference
param networkId int in value
param npipes int in value
param cfg GLXHyperpipeConfig in array[npipes]
param hpId int out reference
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65552
QueryHyperpipeConfigSGIX(dpy, hpId, npipes)
return GLXHyperpipeConfigPointer
param dpy Display out reference
param hpId int in value
param npipes int out reference
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65551
DestroyHyperpipeConfigSGIX(dpy, hpId)
return int
param dpy Display out reference
param hpId int in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx 65553
BindHyperpipeSGIX(dpy, hpId)
return int
param dpy Display out reference
param hpId int in value
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx ???
QueryHyperpipeBestAttribSGIX(dpy, timeSlice, attrib, size, attribList, returnAttribList)
return int
param dpy Display out reference
param timeSlice int in value
param attrib int in value
param size int in value
param attribList Void in array[size]
param returnAttribList Void out array[size]
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx ???
HyperpipeAttribSGIX(dpy, timeSlice, attrib, size, attribList)
return int
param dpy Display out reference
param timeSlice int in value
param attrib int in value
param size int in value
param attribList void in array[size]
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx ???
QueryHyperpipeAttribSGIX(dpy, timeSlice, attrib, size, returnAttribList)
return int
param dpy Display out reference
param timeSlice int in value
param attrib int in value
param size int in value
param returnAttribList void in array[size]
glxflags client-handcode server-handcode
category glx
dlflags notlistable
glxvendorglx ???

View File

@@ -0,0 +1,420 @@
# Copyright (c) 1991-2005 Silicon Graphics, Inc. All Rights Reserved.
# Copyright (c) 2006-2010 The Khronos Group, Inc.
#
# This document is licensed under the SGI Free Software B License Version
# 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
#
# $Revision: 10796 $ on $Date: 2010-03-19 17:31:10 -0700 (Fri, 19 Mar 2010) $
# This is the GLX enumerant registry.
#
# It is an extremely important file. Do not mess with it unless
# you know what you're doing and have permission to do so.
#
# Rules for modification are the same as the rules for the OpenGL
# enumerant registry (gl.spec). Basically, don't modify this
# file unless you're the Khronos API Registrar.
Extensions define:
VERSION_1_1 = 1
VERSION_1_2 = 1
VERSION_1_3 = 1
VERSION_1_4 = 1
SGIS_multisample = 1
EXT_visual_info = 1
SGI_swap_control = 1
SGI_video_sync = 1
SGI_make_current_read = 1
SGIX_video_source = 1
EXT_visual_rating = 1
EXT_import_context = 1
SGIX_fbconfig = 1
SGIX_pbuffer = 1
SGI_cushion = 1
SGIX_video_resize = 1
SGIX_dmbuffer = 1
SGIX_swap_group = 1
SGIX_swap_barrier = 1
SGIS_blended_overlay = 1
SGIS_shared_multisample = 1
SUN_get_transparent_index = 1
3DFX_multisample = 1
MESA_copy_sub_buffer = 1
MESA_pixmap_colormap = 1
MESA_release_buffers = 1
MESA_set_3dfx_mode = 1
SGIX_visual_select_group = 1
SGIX_hyperpipe = 1
GLXStringName enum:
VENDOR = 0x1
VERSION = 0x2
EXTENSIONS = 0x3
GLXErrorCode enum:
BAD_SCREEN = 1
BAD_ATTRIBUTE = 2
NO_EXTENSION = 3
BAD_VISUAL = 4
BAD_CONTEXT = 5
BAD_VALUE = 6
BAD_ENUM = 7
BAD_HYPERPIPE_CONFIG_SGIX = 91 # SGIX_hyperpipe
BAD_HYPERPIPE_SGIX = 92 # "
# Reserved bits in bitfields of various purposes
GLXDrawableTypeMask enum:
WINDOW_BIT = 0x00000001 # DRAWABLE_TYPE value
PIXMAP_BIT = 0x00000002 # "
PBUFFER_BIT = 0x00000004 # "
WINDOW_BIT_SGIX = 0x00000001 # DRAWABLE_TYPE_SGIX value
PIXMAP_BIT_SGIX = 0x00000002 # "
PBUFFER_BIT_SGIX = 0x00000004 # "
GLXRenderTypeMask enum:
RGBA_BIT = 0x00000001 # RENDER_TYPE value
COLOR_INDEX_BIT = 0x00000002 # "
RGBA_BIT_SGIX = 0x00000001 # RENDER_TYPE_SGIX value
COLOR_INDEX_BIT_SGIX = 0x00000002 # "
RGBA_FLOAT_BIT_ARB = 0x00000004 # RENDER_TYPE value (from ARB_fbconfig_float)
RGBA_UNSIGNED_FLOAT_BIT_EXT = 0x00000008 # RENDER_TYPE value (from EXT_fbconfig_packed_float)
GLXSyncType enum:
SYNC_FRAME_SGIX = 0x00000000 # ChannelRectSyncSGIX synctype
SYNC_SWAP_SGIX = 0x00000001 # "
GLXEventMask enum:
PBUFFER_CLOBBER_MASK = 0x08000000 # SelectEvent mask
BUFFER_CLOBBER_MASK_SGIX = 0x08000000 # SelectEventSGIX mask
BUFFER_SWAP_COMPLETE_INTEL_MASK = 0x04000000 # SelectEvent mask (for GLX_INTEL_swap_event)
GLXPbufferClobberMask enum:
FRONT_LEFT_BUFFER_BIT = 0x00000001 # PbufferClobberEvent mask
FRONT_RIGHT_BUFFER_BIT = 0x00000002 # "
BACK_LEFT_BUFFER_BIT = 0x00000004 # "
BACK_RIGHT_BUFFER_BIT = 0x00000008 # "
AUX_BUFFERS_BIT = 0x00000010 # "
DEPTH_BUFFER_BIT = 0x00000020 # "
STENCIL_BUFFER_BIT = 0x00000040 # "
ACCUM_BUFFER_BIT = 0x00000080 # "
FRONT_LEFT_BUFFER_BIT_SGIX = 0x00000001 # BufferClobberEventSGIX mask
FRONT_RIGHT_BUFFER_BIT_SGIX = 0x00000002 # "
BACK_LEFT_BUFFER_BIT_SGIX = 0x00000004 # "
BACK_RIGHT_BUFFER_BIT_SGIX = 0x00000008 # "
AUX_BUFFERS_BIT_SGIX = 0x00000010 # "
DEPTH_BUFFER_BIT_SGIX = 0x00000020 # "
STENCIL_BUFFER_BIT_SGIX = 0x00000040 # "
ACCUM_BUFFER_BIT_SGIX = 0x00000080 # "
SAMPLE_BUFFERS_BIT_SGIX = 0x00000100 # "
GLXHyperpipeTypeMask enum:
HYPERPIPE_DISPLAY_PIPE_SGIX = 0x00000001 # SGIX_hyperpipe
HYPERPIPE_RENDER_PIPE_SGIX = 0x00000002 # "
GLXHyperpipeAttrib enum:
PIPE_RECT_SGIX = 0x00000001 # SGIX_hyperpipe
PIPE_RECT_LIMITS_SGIX = 0x00000002 # "
HYPERPIPE_STEREO_SGIX = 0x00000003 # "
HYPERPIPE_PIXEL_AVERAGE_SGIX = 0x00000004 # "
GLXHyperpipeMisc enum:
HYPERPIPE_PIPE_NAME_LENGTH_SGIX = 80 # SGIX_hyperpipe
GLXBindToTextureTargetMask enum:
TEXTURE_1D_BIT_EXT = 0x00000001 # EXT_texture_from_pixmap
TEXTURE_2D_BIT_EXT = 0x00000002
TEXTURE_RECTANGLE_BIT_EXT = 0x00000004
# CONTEXT_FLAGS_ARB bits
GLXContextFlags enum:
CONTEXT_DEBUG_BIT_ARB = 0x00000001 # ARB_create_context
CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x00000002 # ARB_create_context
# CONTEXT_PROFILE_MASK_ARB bits
GLXContextProfileMask enum:
CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001 # ARB_create_context_profile
CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002 # ARB_create_context_profile
GLXAttribute enum:
USE_GL = 1 # Visual attributes
BUFFER_SIZE = 2 # "
LEVEL = 3 # "
RGBA = 4 # "
DOUBLEBUFFER = 5 # "
STEREO = 6 # "
AUX_BUFFERS = 7 # "
RED_SIZE = 8 # "
GREEN_SIZE = 9 # "
BLUE_SIZE = 10 # "
ALPHA_SIZE = 11 # "
DEPTH_SIZE = 12 # "
STENCIL_SIZE = 13 # "
ACCUM_RED_SIZE = 14 # "
ACCUM_GREEN_SIZE = 15 # "
ACCUM_BLUE_SIZE = 16 # "
ACCUM_ALPHA_SIZE = 17 # "
CONFIG_CAVEAT = 0x20 # "
X_VISUAL_TYPE = 0x22 # "
TRANSPARENT_TYPE = 0x23 # "
TRANSPARENT_INDEX_VALUE = 0x24 # "
TRANSPARENT_RED_VALUE = 0x25 # "
TRANSPARENT_GREEN_VALUE = 0x26 # "
TRANSPARENT_BLUE_VALUE = 0x27 # "
TRANSPARENT_ALPHA_VALUE = 0x28 # "
DONT_CARE = 0xFFFFFFFF # may be specified for ChooseFBConfig attributes
NONE = 0x8000 # several attribute values
SLOW_CONFIG = 0x8001 # CONFIG_CAVEAT attribute value
TRUE_COLOR = 0x8002 # X_VISUAL_TYPE attribute value
DIRECT_COLOR = 0x8003 # "
PSEUDO_COLOR = 0x8004 # "
STATIC_COLOR = 0x8005 # "
GRAY_SCALE = 0x8006 # "
STATIC_GRAY = 0x8007 # "
TRANSPARENT_RGB = 0x8008 # TRANSPARENT_TYPE attribute value
TRANSPARENT_INDEX = 0x8009 # "
VISUAL_ID = 0x800B # Context attribute
SCREEN = 0x800C # "
NON_CONFORMANT_CONFIG = 0x800D # CONFIG_CAVEAT attribute value
DRAWABLE_TYPE = 0x8010 # FBConfig attribute
RENDER_TYPE = 0x8011 # "
X_RENDERABLE = 0x8012 # "
FBCONFIG_ID = 0x8013 # "
RGBA_TYPE = 0x8014 # CreateNewContext render_type value
COLOR_INDEX_TYPE = 0x8015 # "
MAX_PBUFFER_WIDTH = 0x8016 # FBConfig attribute
MAX_PBUFFER_HEIGHT = 0x8017 # "
MAX_PBUFFER_PIXELS = 0x8018 # "
PRESERVED_CONTENTS = 0x801B # CreateGLXPbuffer attribute
LARGEST_PBUFFER = 0x801C # "
WIDTH = 0x801D # Drawable attribute
HEIGHT = 0x801E # "
EVENT_MASK = 0x801F # "
DAMAGED = 0x8020 # PbufferClobber event_type value
SAVED = 0x8021 # "
WINDOW = 0x8022 # PbufferClobber draw_type value
PBUFFER = 0x8023 # "
PBUFFER_HEIGHT = 0x8040 # CreateGLXPbuffer attribute
PBUFFER_WIDTH = 0x8041 # "
VISUAL_CAVEAT_EXT = 0x20 # Visual attribute
X_VISUAL_TYPE_EXT = 0x22 # "
TRANSPARENT_TYPE_EXT = 0x23 # "
TRANSPARENT_INDEX_VALUE_EXT = 0x24 # "
TRANSPARENT_RED_VALUE_EXT = 0x25 # "
TRANSPARENT_GREEN_VALUE_EXT = 0x26 # "
TRANSPARENT_BLUE_VALUE_EXT = 0x27 # "
TRANSPARENT_ALPHA_VALUE_EXT = 0x28 # "
NONE_EXT = 0x8000 # several EXT attribute values
SLOW_VISUAL_EXT = 0x8001 # VISUAL_CAVEAT_EXT attribute value
TRUE_COLOR_EXT = 0x8002 # X_VISUAL_TYPE_EXT attribute value
DIRECT_COLOR_EXT = 0x8003 # "
PSEUDO_COLOR_EXT = 0x8004 # "
STATIC_COLOR_EXT = 0x8005 # "
GRAY_SCALE_EXT = 0x8006 # "
STATIC_GRAY_EXT = 0x8007 # "
TRANSPARENT_RGB_EXT = 0x8008 # TRANSPARENT_TYPE_EXT attribute value
TRANSPARENT_INDEX_EXT = 0x8009 # "
SHARE_CONTEXT_EXT = 0x800A # QueryContextInfoEXT attribute
VISUAL_ID_EXT = 0x800B # "
SCREEN_EXT = 0x800C # "
NON_CONFORMANT_VISUAL_EXT = 0x800D # VISUAL_CAVEAT_EXT attribute value
DRAWABLE_TYPE_SGIX = 0x8010 # FBConfigSGIX attribute
RENDER_TYPE_SGIX = 0x8011 # "
X_RENDERABLE_SGIX = 0x8012 # "
FBCONFIG_ID_SGIX = 0x8013 # "
RGBA_TYPE_SGIX = 0x8014 # CreateContextWithConfigSGIX render_type value
COLOR_INDEX_TYPE_SGIX = 0x8015 # "
MAX_PBUFFER_WIDTH_SGIX = 0x8016 # FBConfigSGIX attribute
MAX_PBUFFER_HEIGHT_SGIX = 0x8017 # "
MAX_PBUFFER_PIXELS_SGIX = 0x8018 # "
OPTIMAL_PBUFFER_WIDTH_SGIX = 0x8019 # "
OPTIMAL_PBUFFER_HEIGHT_SGIX = 0x801A # "
PRESERVED_CONTENTS_SGIX = 0x801B # PbufferSGIX attribute
LARGEST_PBUFFER_SGIX = 0x801C # "
WIDTH_SGIX = 0x801D # "
HEIGHT_SGIX = 0x801E # "
EVENT_MASK_SGIX = 0x801F # "
DAMAGED_SGIX = 0x8020 # BufferClobberSGIX event_type value
SAVED_SGIX = 0x8021 # "
WINDOW_SGIX = 0x8022 # BufferClobberSGIX draw_type value
PBUFFER_SGIX = 0x8023 # "
DIGITAL_MEDIA_PBUFFER_SGIX = 0x8024 # PbufferSGIX attribute
BLENDED_RGBA_SGIS = 0x8025 # TRANSPARENT_TYPE_EXT attribute value
MULTISAMPLE_SUB_RECT_WIDTH_SGIS = 0x8026 # Visual attribute (shared_multisample)
MULTISAMPLE_SUB_RECT_HEIGHT_SGIS = 0x8027 # "
VISUAL_SELECT_GROUP_SGIX = 0x8028 # Visual attribute (visual_select_group)
HYPERPIPE_ID_SGIX = 0x8030 # Associated hyperpipe ID (SGIX_hyperpipe)
SAMPLE_BUFFERS_SGIS = 100000 # Visual attribute (SGIS_multisample)
SAMPLES_SGIS = 100001 # "
SAMPLE_BUFFERS_ARB = 100000 # Visual attribute (ARB_multisample - alias of SGIS_multisample)
SAMPLES_ARB = 100001 # "
SAMPLE_BUFFERS = 100000 # Visual attribute (GLX 1.4 core - alias of SGIS_multisample)
SAMPLES = 100001 # "
###############################################################################
# ARB: 0x2070-0x209F (shared with WGL)
# Also includes a bitmask - see ContextFlags above
# ARB_create_context enum:
CONTEXT_MAJOR_VERSION_ARB = 0x2091
CONTEXT_MINOR_VERSION_ARB = 0x2092
CONTEXT_FLAGS_ARB = 0x2094
###############################################################################
# NVIDIA: 0x20A0 - 0x219F (shared with WGL)
# NV_float_buffer enum:
FLOAT_COMPONENTS_NV = 0x20B0
# EXT_fbconfig_packed_float enum:
RGBA_UNSIGNED_FLOAT_TYPE_EXT = 0x20B1
# EXT_framebuffer_sRGB enum:
FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20B2
# NV_future_use: 0x20B3-0x20B8
# ARB_fbconfig_float enum:
RGBA_FLOAT_TYPE_ARB = 0x20B9
# NV_future_use: 0x20BA-0x20C2
# NV_video_out enum:
VIDEO_OUT_COLOR_NV = 0x20C3
VIDEO_OUT_ALPHA_NV = 0x20C4
VIDEO_OUT_DEPTH_NV = 0x20C5
VIDEO_OUT_COLOR_AND_ALPHA_NV = 0x20C6
VIDEO_OUT_COLOR_AND_DEPTH_NV = 0x20C7
VIDEO_OUT_FRAME_NV = 0x20C8
VIDEO_OUT_FIELD_1_NV = 0x20C9
VIDEO_OUT_FIELD_2_NV = 0x20CA
VIDEO_OUT_STACKED_FIELDS_1_2_NV = 0x20CB
VIDEO_OUT_STACKED_FIELDS_2_1_NV = 0x20CC
# NV_video_capture enum:
DEVICE_ID_NV = 0x20CD
UNIQUE_ID_NV = 0x20CE
NUM_VIDEO_CAPTURE_SLOTS_NV = 0x20CF
# EXT_texture_from_pixmap enum:
BIND_TO_TEXTURE_RGB_EXT = 0x20D0
BIND_TO_TEXTURE_RGBA_EXT = 0x20D1
BIND_TO_MIPMAP_TEXTURE_EXT = 0x20D2
BIND_TO_TEXTURE_TARGETS_EXT = 0x20D3
Y_INVERTED_EXT = 0x20D4
TEXTURE_FORMAT_EXT = 0x20D5
TEXTURE_TARGET_EXT = 0x20D6
MIPMAP_TEXTURE_EXT = 0x20D7
TEXTURE_FORMAT_NONE_EXT = 0x20D8
TEXTURE_FORMAT_RGB_EXT = 0x20D9
TEXTURE_FORMAT_RGBA_EXT = 0x20DA
TEXTURE_1D_EXT = 0x20DB
TEXTURE_2D_EXT = 0x20DC
TEXTURE_RECTANGLE_EXT = 0x20DD
FRONT_LEFT_EXT = 0x20DE
FRONT_RIGHT_EXT = 0x20DF
BACK_LEFT_EXT = 0x20E0
BACK_RIGHT_EXT = 0x20E1
FRONT_EXT = GLX_FRONT_LEFT_EXT
BACK_EXT = GLX_BACK_LEFT_EXT
AUX0_EXT = 0x20E2
AUX1_EXT = 0x20E3
AUX2_EXT = 0x20E4
AUX3_EXT = 0x20E5
AUX4_EXT = 0x20E6
AUX5_EXT = 0x20E7
AUX6_EXT = 0x20E8
AUX7_EXT = 0x20E9
AUX8_EXT = 0x20EA
AUX9_EXT = 0x20EB
# NV_future_use: 0x20EC-0x20EF
NV_present_video enum:
NUM_VIDEO_SLOTS_NV = 0x20F0
EXT_swap_control enum:
SWAP_INTERVAL_EXT = 0x20F1
MAX_SWAP_INTERVAL_EXT = 0x20F2
# NV_future_use: 0x20F3-0x219F
###############################################################################
# MESA (not in a reserved block)
# MESA_set_3dfx_mode enum:
# 3DFX_WINDOW_MODE_MESA = 0x1
# 3DFX_FULLSCREEN_MODE_MESA = 0x2
###############################################################################
# SGI_future_use: 0x8029-0x802F
# SGIX_hyperpipe adds attribute name HYPERPIPE_ID_SGIX = 0x8030
# SGI_future_use: 0x8031-0x803F
###############################################################################
# ARB_future_use: 0x8042-0x804F
###############################################################################
# 3DFX: 0x8050-0x805F
# 3DFX_multisample enum:
# SAMPLE_BUFFERS_3DFX = 0x8050
# SAMPLES_3DFX = 0x8051
###############################################################################
# OML: 0x8060-0x806F
# OML_swap_method enum:
# SWAP_METHOD_OML = 0x8060
# SWAP_EXCHANGE_OML = 0x8061
# SWAP_COPY_OML = 0x8062
# SWAP_UNDEFINED_OML = 0x8063
# OML_future_use: 0x8064-0x806F
###############################################################################
# NVIDIA: 0x8070 - 0x816F
NVIDIA_future_use: 0x8070-0x816F
###############################################################################
# SUN: 0x8170 - 0x817F
SUN_future_use: 0x8170-0x817F
###############################################################################
# INTEL: 0x8180 - 0x818F
# INTEL_swap_event: 0x8180-0x8182
# EXCHANGE_COMPLETE_INTEL = 0x8180
# COPY_COMPLETE_INTEL = 0x8181
# FLIP_COMPLETE_INTEL = 0x8182
INTEL_future_use: 0x8183-0x818F
###############################################################################
### Please remember that new GLX enum allocations must be obtained by request
### to the Khronos API Registrar (see comments at the top of this file)
### File requests in the Khronos Bugzilla, OpenGL project, Registry component.
###############################################################################
# Any_vendor_future_use: 0x8180-0x9125
# Also includes a bitmask - see ContextProfileMask above
# ARB_create_context_profile enum: (equivalent to corresponding GL token)
CONTEXT_PROFILE_MASK_ARB = 0x9126
# Any_vendor_future_use: 0x9127-0xFFFF
#
# This range must be the last range in the file. To generate a new
# range, allocate multiples of 16 from the beginning of the
# Any_vendor_future_use range and update glxenum.spec, glxenumext.spec,
# and extensions.reserved.

View File

@@ -0,0 +1,515 @@
# Copyright (c) 1991-2005 Silicon Graphics, Inc. All Rights Reserved.
# Copyright (c) 2006-2010 The Khronos Group, Inc.
#
# This document is licensed under the SGI Free Software B License Version
# 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
#
# $Revision: 10796 $ on $Date: 2010-03-19 17:31:10 -0700 (Fri, 19 Mar 2010) $
# List of GLX enumerants for glxext.h header
#
# This is NOT the master GLX enumerant registry (glxenum.spec).
#
# Unlike glxenum.spec, glxenumext.spec is
# (1) In order by extension number.
# (2) Includes only GLX extensions and GLX 1.3/1.4 core enumerants,
# since it's assumed all <glx.h> today support at least GLX 1.2.
# (3) Has no 'Extensions' section, since enums are always
# conditionally protected against multiple definition
# by glextenum.pl.
# (4) Is processed by glextenum.pl, which has evolved
# from enum.pl - should merge back into one script.
# glxext.h version number - this should be automatically updated,
# when changing either enum or template spec files.
passthru:
passthru: /* Header file version number, required by OpenGL ABI for Linux */
passthru: /* glxext.h last updated 2010/02/10 */
passthru: /* Current version at http://www.opengl.org/registry/ */
passthru: #define GLX_GLXEXT_VERSION 27
###############################################################################
#
# GLX 1.3 enums
#
###############################################################################
VERSION_1_3 enum:
WINDOW_BIT = 0x00000001 # DRAWABLE_TYPE value
PIXMAP_BIT = 0x00000002 # "
PBUFFER_BIT = 0x00000004 # "
RGBA_BIT = 0x00000001 # RENDER_TYPE value
COLOR_INDEX_BIT = 0x00000002 # "
PBUFFER_CLOBBER_MASK = 0x08000000 # SelectEvent mask
FRONT_LEFT_BUFFER_BIT = 0x00000001 # PbufferClobberEvent mask
FRONT_RIGHT_BUFFER_BIT = 0x00000002 # "
BACK_LEFT_BUFFER_BIT = 0x00000004 # "
BACK_RIGHT_BUFFER_BIT = 0x00000008 # "
AUX_BUFFERS_BIT = 0x00000010 # "
DEPTH_BUFFER_BIT = 0x00000020 # "
STENCIL_BUFFER_BIT = 0x00000040 # "
ACCUM_BUFFER_BIT = 0x00000080 # "
CONFIG_CAVEAT = 0x20 # "
X_VISUAL_TYPE = 0x22 # "
TRANSPARENT_TYPE = 0x23 # "
TRANSPARENT_INDEX_VALUE = 0x24 # "
TRANSPARENT_RED_VALUE = 0x25 # "
TRANSPARENT_GREEN_VALUE = 0x26 # "
TRANSPARENT_BLUE_VALUE = 0x27 # "
TRANSPARENT_ALPHA_VALUE = 0x28 # "
DONT_CARE = 0xFFFFFFFF # may be specified for ChooseFBConfig attributes
NONE = 0x8000 # several attribute values
SLOW_CONFIG = 0x8001 # CONFIG_CAVEAT attribute value
TRUE_COLOR = 0x8002 # X_VISUAL_TYPE attribute value
DIRECT_COLOR = 0x8003 # "
PSEUDO_COLOR = 0x8004 # "
STATIC_COLOR = 0x8005 # "
GRAY_SCALE = 0x8006 # "
STATIC_GRAY = 0x8007 # "
TRANSPARENT_RGB = 0x8008 # TRANSPARENT_TYPE attribute value
TRANSPARENT_INDEX = 0x8009 # "
VISUAL_ID = 0x800B # Context attribute
SCREEN = 0x800C # "
NON_CONFORMANT_CONFIG = 0x800D # CONFIG_CAVEAT attribute value
DRAWABLE_TYPE = 0x8010 # FBConfig attribute
RENDER_TYPE = 0x8011 # "
X_RENDERABLE = 0x8012 # "
FBCONFIG_ID = 0x8013 # "
RGBA_TYPE = 0x8014 # CreateNewContext render_type value
COLOR_INDEX_TYPE = 0x8015 # "
MAX_PBUFFER_WIDTH = 0x8016 # FBConfig attribute
MAX_PBUFFER_HEIGHT = 0x8017 # "
MAX_PBUFFER_PIXELS = 0x8018 # "
PRESERVED_CONTENTS = 0x801B # CreateGLXPbuffer attribute
LARGEST_PBUFFER = 0x801C # "
WIDTH = 0x801D # Drawable attribute
HEIGHT = 0x801E # "
EVENT_MASK = 0x801F # "
DAMAGED = 0x8020 # PbufferClobber event_type value
SAVED = 0x8021 # "
WINDOW = 0x8022 # PbufferClobber draw_type value
PBUFFER = 0x8023 # "
PBUFFER_HEIGHT = 0x8040 # CreateGLXPbuffer attribute
PBUFFER_WIDTH = 0x8041 # "
###############################################################################
#
# GLX 1.4 enums
#
###############################################################################
VERSION_1_4 enum:
SAMPLE_BUFFERS = 100000
SAMPLES = 100001
###############################################################################
#
# ARB GLX extensions, in ARB extension order
#
###############################################################################
###############################################################################
# No new tokens
# ARB Extension #2
ARB_get_proc_address enum:
###############################################################################
# ARB Extension #5
ARB_multisample enum:
SAMPLE_BUFFERS_ARB = 100000
SAMPLES_ARB = 100001
###############################################################################
# ARB Extension #39
ARB_fbconfig_float enum:
RGBA_FLOAT_TYPE_ARB = 0x20B9
RGBA_FLOAT_BIT_ARB = 0x00000004
###############################################################################
# ARB Extension #56
ARB_create_context enum:
CONTEXT_DEBUG_BIT_ARB = 0x00000001
CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x00000002
CONTEXT_MAJOR_VERSION_ARB = 0x2091
CONTEXT_MINOR_VERSION_ARB = 0x2092
CONTEXT_FLAGS_ARB = 0x2094
###############################################################################
# ARB Extension #75
ARB_create_context_profile enum:
CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001
CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002
CONTEXT_PROFILE_MASK_ARB = 0x9126
###############################################################################
#
# non-ARB GLX extensions, in registry order
#
###############################################################################
###############################################################################
# Unfortunately, the SGIS_multisample specification and the IRIX
# implementation are inconsistent; the spec assigns enums as follows.
# ARB_multisample reuses these enums with ARB suffixes, and it can't
# be changed at this point. So in the interest of supporting both
# extensions on non-IRIX platforms, the SGIS enums will be defined
# here as originally specified.
# Extension #25
SGIS_multisample enum:
SAMPLE_BUFFERS_SGIS = 100000
SAMPLES_SGIS = 100001
###############################################################################
# Extension #28
EXT_visual_info enum:
X_VISUAL_TYPE_EXT = 0x22
TRANSPARENT_TYPE_EXT = 0x23
TRANSPARENT_INDEX_VALUE_EXT = 0x24
TRANSPARENT_RED_VALUE_EXT = 0x25
TRANSPARENT_GREEN_VALUE_EXT = 0x26
TRANSPARENT_BLUE_VALUE_EXT = 0x27
TRANSPARENT_ALPHA_VALUE_EXT = 0x28
NONE_EXT = 0x8000
TRUE_COLOR_EXT = 0x8002
DIRECT_COLOR_EXT = 0x8003
PSEUDO_COLOR_EXT = 0x8004
STATIC_COLOR_EXT = 0x8005
GRAY_SCALE_EXT = 0x8006
STATIC_GRAY_EXT = 0x8007
TRANSPARENT_RGB_EXT = 0x8008
TRANSPARENT_INDEX_EXT = 0x8009
###############################################################################
# No new tokens
# Extension #40
SGI_swap_control enum:
###############################################################################
# No new tokens
# Extension #41
SGI_video_sync enum:
###############################################################################
# No new tokens
# Extension #42
SGI_make_current_read enum:
###############################################################################
# No new tokens
# Extension #43
SGIX_video_source enum:
###############################################################################
# Extension #44
EXT_visual_rating enum:
VISUAL_CAVEAT_EXT = 0x20
SLOW_VISUAL_EXT = 0x8001
NON_CONFORMANT_VISUAL_EXT = 0x800D
use EXT_visual_info NONE_EXT
###############################################################################
# Extension #47
EXT_import_context enum:
SHARE_CONTEXT_EXT = 0x800A
VISUAL_ID_EXT = 0x800B
SCREEN_EXT = 0x800C
###############################################################################
# Extension #49
SGIX_fbconfig enum:
WINDOW_BIT_SGIX = 0x00000001
PIXMAP_BIT_SGIX = 0x00000002
RGBA_BIT_SGIX = 0x00000001
COLOR_INDEX_BIT_SGIX = 0x00000002
DRAWABLE_TYPE_SGIX = 0x8010
RENDER_TYPE_SGIX = 0x8011
X_RENDERABLE_SGIX = 0x8012
FBCONFIG_ID_SGIX = 0x8013
RGBA_TYPE_SGIX = 0x8014
COLOR_INDEX_TYPE_SGIX = 0x8015
use EXT_import_context SCREEN_EXT
###############################################################################
# Extension #50
SGIX_pbuffer enum:
PBUFFER_BIT_SGIX = 0x00000004
BUFFER_CLOBBER_MASK_SGIX = 0x08000000
FRONT_LEFT_BUFFER_BIT_SGIX = 0x00000001
FRONT_RIGHT_BUFFER_BIT_SGIX = 0x00000002
BACK_LEFT_BUFFER_BIT_SGIX = 0x00000004
BACK_RIGHT_BUFFER_BIT_SGIX = 0x00000008
AUX_BUFFERS_BIT_SGIX = 0x00000010
DEPTH_BUFFER_BIT_SGIX = 0x00000020
STENCIL_BUFFER_BIT_SGIX = 0x00000040
ACCUM_BUFFER_BIT_SGIX = 0x00000080
SAMPLE_BUFFERS_BIT_SGIX = 0x00000100
MAX_PBUFFER_WIDTH_SGIX = 0x8016
MAX_PBUFFER_HEIGHT_SGIX = 0x8017
MAX_PBUFFER_PIXELS_SGIX = 0x8018
OPTIMAL_PBUFFER_WIDTH_SGIX = 0x8019
OPTIMAL_PBUFFER_HEIGHT_SGIX = 0x801A
PRESERVED_CONTENTS_SGIX = 0x801B
LARGEST_PBUFFER_SGIX = 0x801C
WIDTH_SGIX = 0x801D
HEIGHT_SGIX = 0x801E
EVENT_MASK_SGIX = 0x801F
DAMAGED_SGIX = 0x8020
SAVED_SGIX = 0x8021
WINDOW_SGIX = 0x8022
PBUFFER_SGIX = 0x8023
###############################################################################
# Extension #62
SGI_cushion enum:
# CUSHION_BUFFERS_SGI ????
###############################################################################
# Extension #83
SGIX_video_resize enum:
SYNC_FRAME_SGIX = 0x00000000
SYNC_SWAP_SGIX = 0x00000001
###############################################################################
# Extension #86
SGIX_dmbuffer enum:
DIGITAL_MEDIA_PBUFFER_SGIX = 0x8024
###############################################################################
# No new tokens
# Extension #91
SGIX_swap_group enum:
###############################################################################
# No new tokens
# Extension #92
SGIX_swap_barrier enum:
###############################################################################
# Extension #142
SGIS_blended_overlay enum:
BLENDED_RGBA_SGIS = 0x8025
###############################################################################
# Extension #143
SGIS_shared_multisample enum:
MULTISAMPLE_SUB_RECT_WIDTH_SGIS = 0x8026
MULTISAMPLE_SUB_RECT_HEIGHT_SGIS = 0x8027
###############################################################################
# No new tokens
# Extension #183
SUN_get_transparent_index enum:
###############################################################################
# Extension #207
3DFX_multisample enum:
SAMPLE_BUFFERS_3DFX = 0x8050
SAMPLES_3DFX = 0x8051
###############################################################################
# No new tokens
# Extension #215
MESA_copy_sub_buffer enum:
###############################################################################
# No new tokens
# Extension #216
MESA_pixmap_colormap enum:
###############################################################################
# No new tokens
# Extension #217
MESA_release_buffers enum:
###############################################################################
# Extension #218
MESA_set_3dfx_mode enum:
3DFX_WINDOW_MODE_MESA = 0x1
3DFX_FULLSCREEN_MODE_MESA = 0x2
###############################################################################
# Extension #234
SGIX_visual_select_group enum:
VISUAL_SELECT_GROUP_SGIX = 0x8028
###############################################################################
# Extension #237
OML_swap_method enum:
SWAP_METHOD_OML = 0x8060
SWAP_EXCHANGE_OML = 0x8061
SWAP_COPY_OML = 0x8062
SWAP_UNDEFINED_OML = 0x8063
###############################################################################
# No new tokens
# Extension #238
OML_sync_control enum:
###############################################################################
# Extension #281
NV_float_buffer enum:
FLOAT_COMPONENTS_NV = 0x20B0
###############################################################################
# Extension #307
SGIX_hyperpipe enum:
HYPERPIPE_PIPE_NAME_LENGTH_SGIX = 80
BAD_HYPERPIPE_CONFIG_SGIX = 91
BAD_HYPERPIPE_SGIX = 92
HYPERPIPE_DISPLAY_PIPE_SGIX = 0x00000001
HYPERPIPE_RENDER_PIPE_SGIX = 0x00000002
PIPE_RECT_SGIX = 0x00000001
PIPE_RECT_LIMITS_SGIX = 0x00000002
HYPERPIPE_STEREO_SGIX = 0x00000003
HYPERPIPE_PIXEL_AVERAGE_SGIX = 0x00000004
HYPERPIPE_ID_SGIX = 0x8030
###############################################################################
# No new tokens
# Extension #308
MESA_agp_offset enum:
###############################################################################
# Extension #328
EXT_fbconfig_packed_float enum:
RGBA_UNSIGNED_FLOAT_TYPE_EXT = 0x20B1
RGBA_UNSIGNED_FLOAT_BIT_EXT = 0x00000008
###############################################################################
# Extension #337
EXT_framebuffer_sRGB enum:
FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20B2
###############################################################################
# Extension #344
EXT_texture_from_pixmap enum:
TEXTURE_1D_BIT_EXT = 0x00000001
TEXTURE_2D_BIT_EXT = 0x00000002
TEXTURE_RECTANGLE_BIT_EXT = 0x00000004
BIND_TO_TEXTURE_RGB_EXT = 0x20D0
BIND_TO_TEXTURE_RGBA_EXT = 0x20D1
BIND_TO_MIPMAP_TEXTURE_EXT = 0x20D2
BIND_TO_TEXTURE_TARGETS_EXT = 0x20D3
Y_INVERTED_EXT = 0x20D4
TEXTURE_FORMAT_EXT = 0x20D5
TEXTURE_TARGET_EXT = 0x20D6
MIPMAP_TEXTURE_EXT = 0x20D7
TEXTURE_FORMAT_NONE_EXT = 0x20D8
TEXTURE_FORMAT_RGB_EXT = 0x20D9
TEXTURE_FORMAT_RGBA_EXT = 0x20DA
TEXTURE_1D_EXT = 0x20DB
TEXTURE_2D_EXT = 0x20DC
TEXTURE_RECTANGLE_EXT = 0x20DD
FRONT_LEFT_EXT = 0x20DE
FRONT_RIGHT_EXT = 0x20DF
BACK_LEFT_EXT = 0x20E0
BACK_RIGHT_EXT = 0x20E1
FRONT_EXT = GLX_FRONT_LEFT_EXT
BACK_EXT = GLX_BACK_LEFT_EXT
AUX0_EXT = 0x20E2
AUX1_EXT = 0x20E3
AUX2_EXT = 0x20E4
AUX3_EXT = 0x20E5
AUX4_EXT = 0x20E6
AUX5_EXT = 0x20E7
AUX6_EXT = 0x20E8
AUX7_EXT = 0x20E9
AUX8_EXT = 0x20EA
AUX9_EXT = 0x20EB
###############################################################################
# Extension #347
NV_present_video enum:
NUM_VIDEO_SLOTS_NV = 0x20F0
###############################################################################
# Extension #348
NV_video_out enum:
VIDEO_OUT_COLOR_NV = 0x20C3
VIDEO_OUT_ALPHA_NV = 0x20C4
VIDEO_OUT_DEPTH_NV = 0x20C5
VIDEO_OUT_COLOR_AND_ALPHA_NV = 0x20C6
VIDEO_OUT_COLOR_AND_DEPTH_NV = 0x20C7
VIDEO_OUT_FRAME_NV = 0x20C8
VIDEO_OUT_FIELD_1_NV = 0x20C9
VIDEO_OUT_FIELD_2_NV = 0x20CA
VIDEO_OUT_STACKED_FIELDS_1_2_NV = 0x20CB
VIDEO_OUT_STACKED_FIELDS_2_1_NV = 0x20CC
###############################################################################
# No new tokens
# Extension #350
NV_swap_group enum:
###############################################################################
# Extension #374
NV_video_capture enum:
DEVICE_ID_NV = 0x20CD
UNIQUE_ID_NV = 0x20CE
NUM_VIDEO_CAPTURE_SLOTS_NV = 0x20CF
###############################################################################
# Extension #375
EXT_swap_control enum:
SWAP_INTERVAL_EXT = 0x20F1
MAX_SWAP_INTERVAL_EXT = 0x20F2
###############################################################################
# No new tokens
# Extension #376
NV_copy_image enum:
###############################################################################
# Extension #384
INTEL_swap_event enum:
BUFFER_SWAP_COMPLETE_INTEL_MASK = 0x04000000
EXCHANGE_COMPLETE_INTEL = 0x8180
COPY_COMPLETE_INTEL = 0x8181
FLIP_COMPLETE_INTEL = 0x8182

File diff suppressed because it is too large Load Diff

4
src/glx/apple/specs/update.sh Executable file
View File

@@ -0,0 +1,4 @@
for f in enum.spec enumext.spec gl.spec gl.tm glx.spec glxenum.spec glxenumext.spec glxext.spec ; do
curl -LO http://www.opengl.org/registry/api/$f
done

View File

@@ -35,6 +35,7 @@
/*****************************************************************************/
#ifndef GLX_USE_APPLEGL
static void
do_enable_disable(GLenum array, GLboolean val)
{
@@ -123,6 +124,7 @@ __indirect_glPopClientAttrib(void)
return;
}
}
#endif
void
__glFreeAttributeState(__GLXcontext * gc)

View File

@@ -30,7 +30,7 @@
* Kristian Høgsberg (krh@redhat.com)
*/
#ifdef GLX_DIRECT_RENDERING
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
#include <X11/Xlib.h>
#include <X11/extensions/Xfixes.h>
@@ -188,6 +188,7 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
pdraw->base.psc = psc;
pdraw->bufferCount = 0;
pdraw->swap_interval = 1;
pdraw->have_back = 0;
DRI2CreateDrawable(psc->dpy, xDrawable);

View File

@@ -33,7 +33,7 @@
* Kristian Høgsberg (krh@redhat.com)
*/
#ifdef GLX_DIRECT_RENDERING
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
#include <unistd.h>
#include <dlfcn.h>

View File

@@ -32,7 +32,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifdef GLX_DIRECT_RENDERING
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
#include <X11/Xlib.h>
#include <X11/extensions/Xfixes.h>

View File

@@ -21,7 +21,7 @@
* SOFTWARE.
*/
#ifdef GLX_DIRECT_RENDERING
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
#include <X11/Xlib.h>
#include "glxclient.h"

Some files were not shown because too many files have changed in this diff Show More