Compare commits

..

480 Commits

Author SHA1 Message Date
Vladimir Dergachev
f50a1964d1 Cleanup !
I can not trigger any lockups now..
2005-01-02 06:16:44 +00:00
Vladimir Dergachev
d6be8dd651 I think I fixed the lockups issue. 2005-01-02 05:57:15 +00:00
Vladimir Dergachev
9a04b25c60 Get textures to work with NeHe lesson06.
The code is still disabled since we are displaying random image data instead of actual texture and because I had to put a sleep(1) in lesson06 drawing loop to prevent lockups.
2005-01-02 04:46:25 +00:00
Adam Jackson
3c80f5c56b linux-dri-x86 build fix from Andreas Stenglein. 2005-01-02 03:36:53 +00:00
Felix Kuehling
7a231da442 Improved the performance of software fallbacks by not waiting for idle
in every single span function. Instead flush and wait in the
SpanRenderStart hook and in wrappers around _swrast_Copy/Draw/ReadPixels.
Misc. cleanups in savagespan.c while I'm there.
2005-01-02 01:22:10 +00:00
Felix Kuehling
1067ce0cea Removed all direct hardware access (MMIO, BCI) from the Savage DRI
driver. It uses the new DRM version 2.0.x now, which has just been
committed to DRM CVS.
2005-01-01 20:40:14 +00:00
Felix Kuehling
467d64a177 Use DRM headers from $(DRM_SOURCE_PATH)/shared-core instead of .../shared. 2005-01-01 20:33:45 +00:00
Vladimir Dergachev
404d925b58 Add a convenience function to issue CP delays. 2005-01-01 18:41:43 +00:00
Vladimir Dergachev
e443d1ec47 Qualify the magic 20B0 register as SE_VTE_CNTL similar to R200. Looks like disabling Z offset and scaling displays gears properly, not sure why. Perhaps the meaning of the bits has changed ?
Cleanup code a bit.
2004-12-31 21:28:36 +00:00
Vladimir Dergachev
92d47e79f1 Sync with master copy. 2004-12-31 20:57:48 +00:00
Vladimir Dergachev
11374bdb86 Add texture drawing code. Note: it is broken at the moment and is disabled in CVS. However, all hooks are there.
Fix vertex buffer drawing code.
2004-12-31 19:39:03 +00:00
Vladimir Dergachev
24b5e49141 Rework slightly r300_get_primitive_type - make it clearer and more compact.. 2004-12-30 20:24:30 +00:00
Keith Whitwell
179cc373f1 Get scissor test working again. Passes glean scissor test. 2004-12-30 17:47:08 +00:00
Keith Whitwell
c664f0c515 Calculate DEPTH_SCALE correctly for polygon offset. 2004-12-30 16:30:26 +00:00
Keith Whitwell
8be4747fd6 Simplify viaBlit a bit more.
Implement masked clears.
2004-12-30 16:13:35 +00:00
Vladimir Dergachev
4a04f002db Add missing files. 2004-12-30 16:06:37 +00:00
Keith Whitwell
8f1ba083ba Initialize depth pointer correctly. 2004-12-30 16:05:07 +00:00
Keith Whitwell
58cc2e9124 Don't need to adjust for drawXoff in fallback clipping. 2004-12-30 15:58:45 +00:00
Keith Whitwell
18551e75ea fix regression with fallbacks from recent commits 2004-12-30 14:32:19 +00:00
Keith Whitwell
6fcc6c4965 Fix MagFilter state for texunit 0 2004-12-30 14:21:46 +00:00
Vladimir Dergachev
bcd1a9ed68 Update vertex buffer code (still does not work properly..) 2004-12-30 11:43:04 +00:00
Vladimir Dergachev
2269445f6d Update to recent r300_lib.
Cleanup code that is not relevant anymore.
Play with unknown2 parameter.
2004-12-30 11:17:42 +00:00
Vladimir Dergachev
b53030a94c Hooked up projection matrix - the gears actually rotate ! 2004-12-30 10:27:04 +00:00
Vladimir Dergachev
a656dc251e Restructure code.
Add drawing code that uses vertex buffers - does not lockup, but does not draw correctly either.. Perhaps something to do with vertices being overwritten ?
Start using hardware state retained by the driver and cut back on direct register writes significantly.
2004-12-30 10:11:39 +00:00
Vladimir Dergachev
51050efe0e Change default RS settings so that glxgears will display something.. 2004-12-30 07:50:15 +00:00
Vladimir Dergachev
7d8c1fb03a Clarify some of the unkXXXX atoms. 2004-12-30 07:11:28 +00:00
Vladimir Dergachev
74bf43051c Port viewport setting code from R200.
Take it outside R300ResetHwState.
2004-12-30 06:06:54 +00:00
Keith Whitwell
5be14fd59a Fix some wrapping bugs in the last commit. Probably there are more
remaining.
2004-12-29 21:17:06 +00:00
Keith Whitwell
490e764d7a Simplfy clear() and swapbuffers() code.
Fix various mishandling of cliprects.
Allow multiple primitives to be emitted to a single dma buffer, which
was largely impossible previously.
Re-enable the fast unclipped render stage.
2004-12-29 20:46:27 +00:00
Keith Whitwell
ef494c06b6 Use Point._Size in calculation 2004-12-29 14:38:17 +00:00
Keith Whitwell
54ef88109b use clamped Line._Width in calculations 2004-12-29 14:36:58 +00:00
Keith Whitwell
e158292ee3 Don't advertise wide lines or points. 2004-12-29 14:09:21 +00:00
Keith Whitwell
e972497310 Make line stipple a fallback.
Make sure fallbacks are wrapped by SpanRenderStart/SpanRenderFinish
2004-12-29 14:06:09 +00:00
Keith Whitwell
f102f7ae3d Don't pingpong cliprects through sarea on CopyBuffer(). 2004-12-29 14:05:16 +00:00
Keith Whitwell
cb0cc796d2 Fallback on 3d textures correctly. 2004-12-29 13:03:12 +00:00
Keith Whitwell
3b486d795d Get twoside-lit triangles working again 2004-12-29 12:48:50 +00:00
Keith Whitwell
13ae06cf36 Large update
- Remove via duplicates of shared template files
	- Update driver to work with current versions of the above
	- Rework dma accounting
	- Rework emitting to dma to use a consistent set of macros

The handling of cliprects in the driver is still pretty questionable.
2004-12-29 12:39:50 +00:00
Vladimir Dergachev
7b05b70c2a Rearrange code so we don't dump state as often. 2004-12-29 04:51:46 +00:00
Vladimir Dergachev
4c3f041862 Get most primitives working using immediate mode.
Glxgears displays "rotating" gears, all in the same place (no transform mode, remember ?)
Work needs to be done to understand how to have glxgears working properly.
2004-12-29 04:33:33 +00:00
Vladimir Dergachev
5bdb4652f9 Bring in latest revision of r300_lib.
New capabilities: using vertex buffers, immediate vertex data, immediate indices.
2004-12-29 03:48:05 +00:00
Vladimir Dergachev
6a50fc43cb Use R300_CMD_END3D for end_3d(). 2004-12-27 23:30:39 +00:00
Adam Jackson
c6cca6a3b8 Fix read-from-uninitialized in s3vMakeCurrent() 2004-12-27 22:57:05 +00:00
Adam Jackson
29c88396db Unused variable cleanup. 2004-12-27 22:08:34 +00:00
Adam Jackson
d9fcfa2797 Bug #1859: Initialize 'size' before first use in intelTryReadPixels() 2004-12-27 21:52:17 +00:00
Adam Jackson
0983c9dd99 Build s3v and trident by default too.
Smoky the bear says: Only you can prevent bitrot.
2004-12-27 20:38:29 +00:00
Adam Jackson
c3eaa17b37 Get s3v building with a minimum of warnings. 2004-12-27 20:31:56 +00:00
Vladimir Dergachev
99edafd4e8 Implement rendering of (flat color) QUAD primitives as an experiment. 2004-12-27 17:18:48 +00:00
Ian Romanick
83fcf49647 Fixed two problems with the handling of GLX protocol replies. The logic
for determining when extra data needed to be read after a reply (to ensure
4-byte alignment) and the logic to determine whether or not to read reply
data after the SingleReply packet were both slightly wrong.
2004-12-27 08:29:54 +00:00
Vladimir Dergachev
3cbc2bd833 Expose primitive types being rendered, in preparation to implement fixed pipeline primitive drawing.
Note: these are only visible when export LIBGL_DEBUG=verbose is specified.
2004-12-26 21:42:14 +00:00
Vladimir Dergachev
1b2a655521 Update with most recent version. 2004-12-26 19:32:21 +00:00
Adam Jackson
46a35b2284 Get trident building and -Werror clean.
- Added Makefile
- Deleted references to old headers
- Added prototypes all over the place
- Lots of type updates (drmHandle -> drm_handle_t etc.)
- Added __driCreateNewScreen(), deleted __driCreateScreen()
- Fixed context creation to match other drivers
- Fixed various bitfield names
- Bumped driver date

Still nowhere close to usable, the DDX isn't DRI-aware and there's no DRM.
2004-12-24 03:04:14 +00:00
Felix Kuehling
1c86c7ad9c Simplified and optimized _savage_texnorm_stage. 2004-12-23 20:26:59 +00:00
Keith Whitwell
3deaf21745 Remove the VIA_PERFORMANCE code. A step towards moving the driver
back to using the shared template files.
2004-12-23 18:26:40 +00:00
Keith Whitwell
9876730f7a Chop out more dead code.
Get the drawXoff adjustment working a bit better.
Seems to pass the glean orthoPos tests.
2004-12-23 18:16:22 +00:00
Keith Whitwell
15da29b5e7 Fix merge error. 2004-12-22 19:31:10 +00:00
Keith Whitwell
7db50bb3a8 Remove dead code.
Fix 24/8 depth/stencil visuals.
2004-12-22 19:30:02 +00:00
Felix Kuehling
922bfd70ff Enabled hardware rendering of 1D textures. No need for a software fallback. 2004-12-22 16:12:59 +00:00
Felix Kuehling
80dd3c7917 - Fake projective textures on a single texture unit. A fallback is only
needed if a second texture unit is enabled.
- Also worked around an application bug in Chromium B.S.U.: it sends 3D
  texture coordinates while only a 2D texture is enabled. This used to
  trigger a PTEX fallback. Now the 3rd coordinate is just ignored.
- Fixed the _savage_texnorm_stage to never normalize homogenous texture
  coordinates.
2004-12-22 00:21:32 +00:00
Keith Whitwell
8bdaa927eb Remove debug code which referenced an old global variable. 2004-12-21 23:07:13 +00:00
Ian Romanick
990dec7ea0 Used GCC's __builtin_expect when available. Change the way code is
generated for commands that can use RenderLarge packets.  Tweak the code for
__glXFlushRenderBuffer slightly.
2004-12-21 23:06:02 +00:00
Keith Whitwell
302c5694c6 Push a number of global variables into the viaContext struct.
Remove the bogus 'current_vmesa' pointer.
2004-12-21 22:42:00 +00:00
Ian Romanick
1d27084043 Added some comments and fixed typeos. Slightly refactored the way
function parameters are iterated.  There are no changes in the generated
code.
2004-12-21 21:26:36 +00:00
Daniel Borca
b756990b84 t' was not initialized (use texture' instead?) 2004-12-21 15:45:41 +00:00
Brian Paul
3ec0631e95 fix bug in _mesa_IsTexture() 2004-12-21 15:13:41 +00:00
Keith Whitwell
50694eeff9 Note that state is dirty on contended lock. Allows two applications
to run together correctly, though scheduling between them still isn't
great.
2004-12-21 13:23:10 +00:00
Keith Whitwell
3955313e7c Add missing swap-control calculations.
Remove debug printf.
2004-12-21 12:35:04 +00:00
Keith Whitwell
314f8e4d9d Add vsync swapbuffers. This waits on the irq so gears run in this mode
will have a very low cpu utilization (and also a very low framerate).

Fix up the pageflipping code.  This works now but is totally oblivious
to the X server (ie. it works but it's broken).  Turned off by a #define.
2004-12-21 11:57:03 +00:00
Daniel Borca
91a04617c4 added GL_EXT_stencil_two_side (yes, it works) 2004-12-21 08:21:52 +00:00
Daniel Borca
d7b9d6046d missing `or' in preprocessor conditional 2004-12-21 08:05:43 +00:00
Keith Whitwell
16db15718d Add a -fullscreen option 2004-12-20 14:48:19 +00:00
Keith Whitwell
14bc684990 Remove #ifdef DEBUG's in code, but still allow compiler to remove debug
code if DEBUG not defined.
2004-12-20 12:52:21 +00:00
Daniel Borca
b51600716e put back clipmask code; it proved to be a MinGW/gcc 3.3.x error in t_vb_cliptmp.h(47), where it would still send clipped vertices to the hw... oh, dear... 2004-12-20 08:24:10 +00:00
Daniel Borca
6bb1be010e use float constants.
fixed a small debug error.
2004-12-20 08:20:39 +00:00
Daniel Borca
7799294459 removed ifdef'ed out code (to whom it may concern: it can be found in dri/tdfx driver) 2004-12-20 08:19:28 +00:00
Daniel Borca
16d4166d14 removed detritus (ncc). 2004-12-20 08:18:19 +00:00
Daniel Borca
7b50d773d3 comment reorg.
removed detritus (ncc).
2004-12-20 08:17:36 +00:00
Daniel Borca
ad149e3e65 made some functions static. 2004-12-20 08:16:24 +00:00
Daniel Borca
9e821269fc comment reorg.
made some functions static.
hide vp behind an envvar.
removed unnecessary multitex constraint for napalm hw.
2004-12-20 08:15:50 +00:00
Daniel Borca
6a7b4690e3 allow greater swappendingcount for older hw (v1/v2) 2004-12-20 08:12:09 +00:00
Daniel Borca
00b7aba567 misc cleanup 2004-12-20 08:09:25 +00:00
Daniel Borca
0d7da6c3e0 allow ARB vp/fp query program errors 2004-12-20 08:08:15 +00:00
Daniel Borca
2982dce27e really protect against npot compressed textures (logbase2 never returns -1). 2004-12-20 08:03:01 +00:00
Ian Romanick
0d84c68313 Use GLX protocol code generated by glX_proto_send.py. 2004-12-20 04:53:00 +00:00
Ian Romanick
46be433c47 No GLX protocol for GL_ATI_fragment_shader. 2004-12-20 04:47:46 +00:00
Vladimir Dergachev
55fb41ade8 Fix cut and paste error (reported by Jerome Glisse) 2004-12-19 15:39:40 +00:00
Dave Airlie
7f752fed99 Implement software ATI_fragment_shader
no error detection, slow, may not be 100% correct but a good start
2004-12-19 03:06:59 +00:00
Brian Paul
a803b0c891 Consolidate _swrast_write_texture_span() into _swrast_write_rgba_span(). 2004-12-18 22:03:07 +00:00
Brian Paul
feac302567 added GL_ARB_pixel_buffer_object extension string 2004-12-18 16:19:08 +00:00
Brian Paul
2a5afe3ab8 Added PRINT instruction for GL_NV_fragment_program. 2004-12-18 16:18:00 +00:00
Thomas Hellström
6cec977773 Unichrome DRI driver:
Fix for proplem where polygons partly outside the drawing window would get
one vertex clamped to the opposite window side. This bug could also cause
a hardlock. (Bugzilla #2066, Yann Vernier)
2004-12-18 12:16:12 +00:00
Felix Kuehling
3d04879801 Made debugging output controllable via environment variable
SAVAGE_DEBUG. Added fallback debugs. Added no_rast option to disable
hardware rasterization (everything as software fallback).
2004-12-17 15:55:17 +00:00
Brian Paul
538541e300 VMS update 2004-12-17 14:48:00 +00:00
Daniel Borca
cf95169542 fxRasterPrimitive wasn't always receiving the reduced primitive 2004-12-17 10:40:32 +00:00
Daniel Borca
02978f1092 fxRasterPrimitive wasn't always receiving the reduced primitive 2004-12-17 08:08:37 +00:00
Felix Kuehling
0d39c4ebc9 Added a TNL pipeline stage that normalizes texture coordinates as a
workaround for bad Savage hardware interpolation of big texture
coordinates.
2004-12-17 00:01:15 +00:00
Adam Jackson
c403bcb8a7 Import s3virge and trident drivers. Not functional yet; no Makefile, no DRI-aware DDX. 2004-12-16 19:26:23 +00:00
Brian Paul
8662c5d98f fix typos in texcoord setup - fixes perspective correction bug 2004-12-16 17:33:36 +00:00
Vladimir Dergachev
7771c92d35 The types uint32_t and uint8_t are not used in Mesa tree.
Put a couple of defines to use GL counterparts.
2004-12-16 14:04:49 +00:00
Brian Paul
575700fbdc Experimental PRINT instruction for NV_vertex_program.
Basically, this lets you put a "PRINT 'mesage', register;" statement in a
vertex program to aid in debugging.
2004-12-16 03:07:18 +00:00
Brian Paul
c75900e7a2 don't divide texcoords by q if using a fragment program 2004-12-16 02:14:19 +00:00
Adam Jackson
d16aa9859c Also PUBLICize the config option table 2004-12-16 00:23:47 +00:00
Adam Jackson
3d7aec70c9 Mark __driCreateNewScreen PUBLIC 2004-12-15 23:26:49 +00:00
Adam Jackson
791ce02244 _glapi_* is effectively PUBLIC API for the DRI drivers. 2004-12-15 23:14:29 +00:00
Adam Jackson
4890f2605e Mark the XF86DRI client-side extension API as PUBLIC. 2004-12-15 23:07:55 +00:00
Adam Jackson
2719b54f53 fxt1_decode_1() needs to be non-static for the tdfx and glide drivers. 2004-12-15 22:57:59 +00:00
Thomas Hellström
20456d6a3d Unichrome DRI:
Updated the driver to the new VIA security mechanisms in DRM. All command
submissions now passes through DRM ioctls. If the DRM AGP ring-buffer is
not enabled, it will use a DRM mechanism for submitting commands to the
hardware via a PCI bus mechanism.

Removed all direct write accesses to the hardware. Among other things the
VQ was previously turned off for the PCI path, apparently for Tuxracer.
That seemed unneeded and was removed. No visible impact on Tuxracer.

Abstracted all buffer blit operations in via_ioctl.c. The blitter context
is now reprogrammed before each blitting operation.

Updated driver date and drm version requirement.
(Bugzilla Bug #1950, Thomas Hellstrm)
2004-12-15 21:59:25 +00:00
Thomas Hellström
b4f58e99eb Unichrome DRI:
Stop the driver from giving empty texture levels with erroneous HW addresses
to the hardware. These will get caught and rejected in the DRM command
verifier.
2004-12-15 21:27:49 +00:00
Thomas Hellström
de541439d3 Unichrome DRI:
Fixed an apparent race condition during locking and drawable info updating,
the result of which was the DRI client leaving traces on the screen rendering
where the drawable previously had been.
If the driver hangs X for a second or so and then restarts, this is probably
the place to look. (Thomas Hellstrm)
2004-12-15 21:17:51 +00:00
Thomas Hellström
a47c4c37ce Unichrome DRI driver:
Check for texture allocation failure (Bugzilla #1633, Bartlomiej Krol)
Reenabled AGP textures (Thomas Hellstrm)
2004-12-15 21:05:26 +00:00
Felix Kuehling
58f5b91b1b Added configuration support to the Savage driver. Three options are
supported so far.
2004-12-15 17:45:23 +00:00
Adam Jackson
489ccef398 Fix up glx/x11 to work when built with -fvisibility=hidden. 2004-12-15 17:18:06 +00:00
Felix Kuehling
5566127701 Fixed GL_CLAM_TO_EDGE. It's not supported in hardware. Use GL_CLAMP
instead of GL_REPEAT.
2004-12-15 16:59:58 +00:00
Felix Kuehling
e9fbc23024 Fixed initialization of some stencil-related S4 registers, which was
misplaced in savageDDInitState_s3d, where was overwriting completely
unrelated S3D registers with garbage.
2004-12-15 16:54:19 +00:00
Felix Kuehling
91fd299b6b Moved some code from savageCreateContext to savageInitDriver, where it
belongs. Removed some obviously useless code. Fixed computation of
MaxTextureLevels.
2004-12-15 16:50:57 +00:00
Felix Kuehling
9fb668c576 Fixed some missing uint8_t -> u_int8_t. 2004-12-15 15:44:28 +00:00
Keith Whitwell
cc488b03a3 Add _mesa_delete_texture_object() call to viaDeleteTexture
[Freedesktop BUG 2080]
2004-12-15 13:59:47 +00:00
Keith Whitwell
ae68c3212b Add some catchall commands to realclean target to remove built files
which are forgotten about when the configs/current symlink changes.
2004-12-15 11:03:41 +00:00
Daniel Borca
3f1205819a updated makefiles for gcc 3.4.3 and bnu 2.15 2004-12-15 08:00:43 +00:00
Daniel Borca
65dfab66e5 minor info update 2004-12-15 07:56:49 +00:00
Daniel Borca
8b563fd4c5 added DMesaProc type to prevent gcc 3.4.3 warnings 2004-12-15 07:55:38 +00:00
Daniel Borca
654dccfd85 added DMesaProc type to prevent gcc 3.4.3 warnings.
sw tc is disabled by default
2004-12-15 07:54:20 +00:00
Daniel Borca
ea38858127 protected elfish code against non-elf compilers 2004-12-15 07:52:35 +00:00
Brian Paul
3df033a93b fixes for fragment programs 2004-12-15 01:13:39 +00:00
Brian Paul
69a5896238 init span.w, dwdx, dwdy in case we're running a fragment program 2004-12-15 01:11:36 +00:00
Brian Paul
55481b3a29 tweaks to the LIT instructions 2004-12-15 01:07:52 +00:00
Brian Paul
244adeb639 s/DP3/DP3_SAT/ to prevent negative values 2004-12-15 00:54:17 +00:00
Alan Hourihane
968cbf94d9 uint*t -> u_int*t 2004-12-14 22:37:46 +00:00
Alan Hourihane
fc84bec654 fix warning 2004-12-14 10:59:37 +00:00
Alan Hourihane
38b317d508 uint*t -> u_int*t changes 2004-12-14 09:11:52 +00:00
Ian Romanick
9fb024ba97 Added many (hopefully all) missing 'output="true"' attributes. Added
missing enum information for GL_EXT_cull_vertex and
GL_SGIS_texture_color_mask.  Added GL_SUN_mesh_array.  Corrected the
spelling of the "length" parameter to GetActiveUniformARB.
2004-12-13 23:58:09 +00:00
Ian Romanick
dea44ca491 Trivial shell script to search the API definition file and print out the
next numerically available API entry-point offset.
2004-12-13 21:26:50 +00:00
Daniel Borca
8c0b1d8826 disabled ClipMask usage in vb emitter (clipping bugs?) 2004-12-13 08:44:46 +00:00
Brian Paul
8402149766 removed unused visInfo var 2004-12-12 22:24:09 +00:00
Brian Paul
af808afbe7 fix recursion problem introduced on Nov 27 2004-12-12 22:22:10 +00:00
Brian Paul
68d293b035 Added driver hooks for GetTexImage() and GetCompressedTexImage().
Added fallback _mesa_get_[compressed]_teximage() routines to texstore.c
2004-12-12 19:03:16 +00:00
Keith Whitwell
5aa1a111a4 Fix a couple of glitches 2004-12-10 17:18:00 +00:00
Daniel Borca
3cc28c96cd allow GetTexImage with RGBA format and COLOR_INDEX internalformat 2004-12-10 07:36:35 +00:00
Brian Paul
7af80ca8c1 typo 2004-12-09 23:23:14 +00:00
Brian Paul
a8158599df bring in 6.2.1 changes 2004-12-09 23:21:36 +00:00
Brian Paul
8597dd3e96 check if using a PBuffer in clip_for_xgetimage() 2004-12-09 16:23:03 +00:00
Keith Whitwell
da3e15c2fd Get linux-solo dependencies building correctly,
Make sure symlinks are built in driver directories before running makedepend.
2004-12-09 08:42:19 +00:00
Daniel Borca
2fc3a958a4 make sure we're cleaning up everything 2004-12-09 07:44:37 +00:00
Daniel Borca
a280d3347a simplistic ICD implementation for fx/Mesa 2004-12-09 07:43:59 +00:00
Dave Airlie
0e01b23798 back out Keiths last checkin - for Solo the include order is important 2004-12-09 00:25:06 +00:00
Dave Airlie
b2ad61fd40 fixup pci code for Jon's last checkin for changing page size 2004-12-09 00:18:59 +00:00
Roland Scheidegger
b31b7836d6 (Stephane Marchesin, me) add hyperz support to radeon and r200 drivers. Only fast z clear and z buffer compression are supported for now, hierarchical-z is not. Still problems with multiple apps and z/stencil readback, which is why hyperz is disabled per default. Also add the new point sprite packet drm 1.13 accepts to the sanity code. 2004-12-08 17:32:46 +00:00
Keith Whitwell
fc23672327 Improve the behaviour of the build system wrt depend files.
- Remove the -Y option for makedepend, so that the standard
	  directories are searched
	- No longer pipe the multiple errors that the -Y option caused
	  into /dev/null -- we want to know about these failures.
	- Fix up a few other misc makedepend failures.
2004-12-08 15:16:36 +00:00
Keith Whitwell
e5aa3dd29b Demonstrate using a color matrix for yuv-to-rgb conversion at texture
upload time.
2004-12-08 14:56:40 +00:00
Alan Hourihane
c69d60fbe4 Use union type to avoid strict aliasing problems. 2004-12-08 14:26:48 +00:00
Alan Hourihane
c63f3cf85d silence warnings 2004-12-08 14:00:46 +00:00
Alan Hourihane
8635615501 Check for some header defines before redefining functions. Silences warnings. 2004-12-08 12:59:15 +00:00
Alan Hourihane
03dc05a605 silence warning 2004-12-08 12:35:55 +00:00
Dave Airlie
23b033ad28 From: Stephane Marchesin <marchesin@icps.u-strasbg.fr>
Attached is a patch that adds pci init code for mesa solo on radeon. It's been
tested on an itanium 2 with a radeon 7000 and it works here.
The patch adds a new field in the miniglx.conf config file, to choose between
pci and agp.
2004-12-08 06:15:01 +00:00
Roland Scheidegger
e1b4fec71c fix depth/stencil readback if coordinates are larger than 1023 (https://bugs.freedesktop.org/show_bug.cgi?id=2010). Should now work up to 2047, which is the current limit for 3d rendering. 2004-12-08 03:07:34 +00:00
Daniel Borca
3b65cab455 fixed an include path 2004-12-07 15:57:33 +00:00
Daniel Borca
c049d4bc89 explicit cast in a few places 2004-12-06 08:11:14 +00:00
Daniel Borca
d033ce63da disable junk for mingw 2004-12-06 08:10:33 +00:00
Daniel Borca
ac7091078f small fix for debug paths 2004-12-06 08:10:01 +00:00
Daniel Borca
fa9ab2d052 sync with glut/glx 2004-12-06 08:09:22 +00:00
Brian Paul
ddfd2067ae report bugs at freedesktop.org 2004-12-05 18:03:21 +00:00
Brian Paul
86cbfc2fac direct bug reports to freedesktop.org 2004-12-05 18:02:01 +00:00
Ian Romanick
74764061fa Move common GLX code to glX_XML.py. This will make adding glX_proto_recv.py
easier later on.
2004-12-03 20:31:59 +00:00
Ian Romanick
47719fda0c Fix a minor bug in glXEnumFunction::PrintUsingTable. Add some comments.
Add the (currently unused) utility funciton glXFunction::opcode_real_value.
2004-12-03 20:24:50 +00:00
Brian Paul
cbc527cd17 mask color indexes against palette size, per the spec 2004-12-03 18:12:08 +00:00
Roland Scheidegger
0fdb7ef877 only enable GL_MESA_ycbcr_texture for real r200 chips, not the derivatives, since yuv textures do not work for some reason on the other chips. 2004-12-03 18:09:40 +00:00
Roland Scheidegger
de7b071b55 enable GL_EXT_stencil_wrap (patch from idr), including some hacks for original radeons which have some broken stencil ops. 2004-12-03 17:26:41 +00:00
Brian Paul
25b67e6404 Use the GL datatypes. Lots of assorted clean-ups. 2004-12-03 15:58:07 +00:00
Brian Paul
404055216d silence warning 2004-12-03 15:39:58 +00:00
Brian Paul
2d846b712c re-disable TRACE 2004-12-03 15:39:08 +00:00
Brian Paul
a760ccf6d8 silence a variety of warnings found with g++ 3.4.2 2004-12-03 15:24:34 +00:00
Alan Hourihane
025aa9efcd silence warnings 2004-12-02 14:50:13 +00:00
Alan Hourihane
8694285053 reverse some debug that slipped through 2004-12-02 13:32:55 +00:00
Alan Hourihane
22ae633d1e Fix some warnings 2004-12-02 13:29:40 +00:00
Ian Romanick
ba807fbe29 Updated the schema. Added comments explaining some of the non-obvious
attributes.  Modified a couple handcode functions to use the count_scale
attribute instead.
2004-12-02 00:01:12 +00:00
Ian Romanick
00d153eb72 Corrected a problem with the sizes of the MAP[12]_* enums. 2004-12-01 23:53:43 +00:00
Ian Romanick
5ee2f9aed4 Added a couple missing always_array annotations and a couple trival
enum-only extensions.
2004-12-01 21:25:52 +00:00
Ian Romanick
596ccff699 Prevent possible divide-by-zero error. 2004-12-01 20:20:13 +00:00
Ian Romanick
77e297c368 Refactor ExtractDir and OpenDriver to be a bit more clear. 2004-12-01 09:41:14 +00:00
Ian Romanick
9bba1cfc39 Use indirect_size.c and indirect_size.h generated by using
src/mesa/glapi/glX_proto_send.py with the '-m size_c' and '-m size_h'
options.
2004-12-01 09:11:04 +00:00
Ian Romanick
b53df18624 Slightly tweak the format of the size prototypes. 2004-12-01 09:06:34 +00:00
Ian Romanick
548435215d Use the indirect_init.c generate by using src/mesa/glapi/glX_proto_send.py
with the '-m init_c' option.
2004-12-01 08:49:41 +00:00
Ian Romanick
4f4854a4af Make the transition to script-genereated GLX code easier.
Convert GL 1.4 function names to EXT_blend_func_separate names.
2004-12-01 08:47:35 +00:00
Ian Romanick
529381ff75 Make the transition to script-genereated GLX code easier.
Convert GL 1.4 / ARB_point_parameter function names to EXT_point_parameter /
NV_point_sprite names.
2004-12-01 08:42:31 +00:00
Ian Romanick
e9789cf071 Python script to generate various bits of client-side GLX protocol code. 2004-12-01 08:35:37 +00:00
Ian Romanick
6b89a8363b Make the transition to script-genereated GLX code easier.
Move "handcoded" ARB_window_pos / MESA_window_pos functions to their own
file.  Modify the ARB_window_pos functions to use the MESA_window_pos names.
2004-12-01 08:31:15 +00:00
Ian Romanick
bb427b10b1 Make the transition to script-genereated GLX code easier.
Move "handcoded" ARB_transpose_matrix functions to their own file.  From
here on out, such handcoded functions should go in a file named
indirect_FOO.c, where "FOO" is some logical name for the functionality
(e.g., part of the extension name, etc.).
2004-12-01 08:22:44 +00:00
Ian Romanick
c8c24d049d Make the transition to script-genereated GLX code easier.
Move EXT_vertex_array wrapper functions from indirect_init.c to vertarr.c.
Fix problems with EXT_multi_draw_arrays function names.
2004-12-01 08:15:01 +00:00
Ian Romanick
345ed3ac8c Make the transition to script-genereated GLX code easier.
Eliminate the need for indirect_wrap.h and NEED_GL_FUNCS_WRAPPED.
Basically, this means prepending __indirect_ to all the definitions and
calls of GL functions that don't already have it.
2004-12-01 08:02:50 +00:00
Ian Romanick
249a5552f1 Make the transition to script-genereated GLX code easier.
Convert GL_ARB_texture_compression related functions to use the extension
version of the names instead of the GL 1.3 versions.
2004-12-01 07:34:25 +00:00
Ian Romanick
4f0a75e724 Added the ability to get the size of a parameter as a string. Changed the
meaning of "variable length array" to include variables that are "counted"
instead of just ones that use an enum to map to a count.  Added glParameter
to the glItemFactory.
2004-12-01 00:29:48 +00:00
Ian Romanick
9001d67309 Added enums for GL_OES_read_format. 2004-12-01 00:25:46 +00:00
Ian Romanick
fc43857cc9 Add trivial support ARB_texture_rectangle and OES_read_format. 2004-12-01 00:20:22 +00:00
Ian Romanick
05f4a2b92d Missed GL_OES_read_format_bit in last commit. 2004-12-01 00:18:01 +00:00
Ian Romanick
f1f18cd1b8 Since we know the problem with HP_occlusion_test is / was on the server-side,
re-enable the extension on the client-side.
2004-11-30 23:29:51 +00:00
Ian Romanick
6106502fdf PrioritizeTextures, GetClipPlane, and WindowPos3fMESA don't need to be
handcoded, but Enable and Disable do.  Corrected some minor problems in the
PixelMap functions and some ARB_vertex_program functions.  Added size data
for the enums that can be passed to the Map[12][fd] functions.  Added the
enums for EXT_pixel_buffer_objects.
2004-11-30 23:27:33 +00:00
Keith Whitwell
4f144b6087 EXT_422_pixels test 2004-11-30 19:15:06 +00:00
Brian Paul
bf4c23d00f no need to include stddef.h anymore 2004-11-29 17:31:03 +00:00
Brian Paul
dc991a2085 silence a warning 2004-11-29 17:30:21 +00:00
Brian Paul
55656a53d4 added __glXFindDRIScreen to glXGetProcAddress (bug 1068879) 2004-11-29 17:26:19 +00:00
Brian Paul
0d5e6ccfd6 fixed OSF/1 shared lib problem (bug 1065260) 2004-11-29 17:23:12 +00:00
Brian Paul
e25c7c2ad5 update from Jouk 2004-11-29 14:41:46 +00:00
Brian Paul
9cf65c5a5b fix missing width/height error 2004-11-28 18:07:33 +00:00
Brian Paul
65a66f5bc3 Remove _mesa_ResizeBuffersMESA() call from _mesa_set_viewport().
Now, the driver's Viewport routine should call _mesa_ResizeBuffersMESA()
if necessary.
Cleaned up code related to GLframebuffer width/height initialization.
Set initial viewport/scissor params in _mesa_make_current2(), instead of
in the drivers' MakeCurrent functions.
2004-11-27 22:47:59 +00:00
Brian Paul
118a8bad73 new comments and assertions 2004-11-27 22:44:35 +00:00
Brian Paul
29926a11b1 Remove the redundant width, height fields in xmesa_buffer struct. Just use
the values in the contained GLframebuffer.
Removed some other unneeded code.
2004-11-27 21:20:37 +00:00
Brian Paul
b371e50d6d remove _glapi_add_entrypoint() calls, they're already in context.c 2004-11-27 20:21:25 +00:00
Brian Paul
de43484c73 add a few functions in add_newer_entrypoints() 2004-11-27 20:14:03 +00:00
Brian Paul
b5b8d22c4e Change the dispatch offsets for the VertexAttrib*NV functions so they don't
alias with the corresponding ARB functions.
GL_ARB_vertex_shader (and OpenGL 2.0's) VertexAttrib functions don't alias
with conventional vertex attributes, as GL_NV_vertex_program does.
So, the ARB and NV version of VertexAttrib need to be distinct.
2004-11-27 20:07:08 +00:00
Brian Paul
0699b0bb17 silence warnings 2004-11-27 19:57:46 +00:00
Brian Paul
6bca16b877 misc updates 2004-11-27 19:42:16 +00:00
Brian Paul
91d09a9ffa Set symbol visibility to 'default', if supported by gcc. 2004-11-27 17:32:03 +00:00
Brian Paul
819b519534 use new PUBLIC macro for symbol export 2004-11-27 17:30:41 +00:00
Brian Paul
3903c1f2bc don't need glut_fbc.c 2004-11-27 16:57:06 +00:00
Brian Paul
1d97c277e0 new GetOverlayInfo() function to reduce code and silence warnings 2004-11-27 16:49:52 +00:00
Brian Paul
4d880987d2 Have OSMesaGetProcAddress() return new OSMESAproc typedef. 2004-11-27 16:24:39 +00:00
Brian Paul
21f6978c53 clean up code related to dispatch table initialization 2004-11-27 05:05:32 +00:00
Brian Paul
13435525c4 clean up 'depend' commands 2004-11-27 04:58:39 +00:00
Brian Paul
2dd5b9edaa typedef GLUTproc, return it from glutGetProcAddress() 2004-11-27 04:54:48 +00:00
Brian Paul
59fcd54f29 remove -Wmissing-prototypes from g++ flags, per gcc 3.4 2004-11-27 04:50:34 +00:00
Brian Paul
11a0a99d1b use @ to silence some unneeded output 2004-11-27 04:37:25 +00:00
Brian Paul
209bd3a5b4 make get_static_proc_address() return a _glapi_proc 2004-11-27 04:02:32 +00:00
Brian Paul
7ee79c80ea use _glapi_proc 2004-11-27 03:51:25 +00:00
Brian Paul
767e15a78a Use new _glapi_proc typedef instead of void * for function pointers.
Misc clean-ups in glapi.c
2004-11-27 03:51:11 +00:00
Brian Paul
1136412013 fix typo, update version/date 2004-11-27 03:47:14 +00:00
Brian Paul
911a8bc62c remove the GLAPI/GLAPIENTRY defines - they're already in gl.h 2004-11-27 03:29:39 +00:00
Brian Paul
39c86eac9b removed a bunch of #define cruft, in case anyone still uses this code 2004-11-27 03:21:43 +00:00
Brian Paul
568f7578d3 Removed GLCALLBACK stuff - apparently never used anywhere.
Removed GLWINAPI stuff - only used (unnecessarily?) in enums.c
2004-11-27 03:14:57 +00:00
Brian Paul
d2c1027d40 added X11 and OSMESA source to ALL_SOURCES, updated etags command 2004-11-26 16:23:22 +00:00
Brian Paul
4fe34f340c (GLint*) casts in glGetIntegerv calls 2004-11-26 13:43:17 +00:00
Brian Paul
59651a076d update some type names 2004-11-26 13:34:45 +00:00
Brian Paul
c5f9aa7750 Use a generic function typedef instead of void * to avoid gcc 3.4 warnings. 2004-11-25 23:26:16 +00:00
Brian Paul
be2de8b299 Use __GLXextFuncPtr type instead of void * for generic functions to
avoid gcc 3.4 compiler warnings.
Remove the unused/obsolete GLX_render_texture stuff.
2004-11-25 23:25:33 +00:00
Brian Paul
4dafbc3dc7 Some new comments, clean-up formatting, etc. 2004-11-25 23:23:40 +00:00
Brian Paul
936028f8b0 Started some assorted clean-ups in #defines, typedefs, etc.
Next: move all the Windows/WGL stuff into the drivers/windows/ directory.
2004-11-25 23:22:56 +00:00
Brian Paul
b653aaede5 minor APIENTRY clean-ups 2004-11-25 23:20:07 +00:00
Keith Whitwell
7a293a9962 Update expected DRM version to 2.0.0 2004-11-25 14:05:05 +00:00
Ian Romanick
6dbb8ead0f Added support for several additional enum-only extensions:
ARB_texture_rectangle, EXT_texture_env_dot3, EXT_texture_mirror_clamp,
ATI_texture_mirror_once, IBM_texture_mirrored_repeat,
NV_packed_depth_stencil, and NV_texture_rectangle.
2004-11-24 18:55:45 +00:00
Ian Romanick
e0a1cd3112 Added information about numerous enums to aid the development of automatic
code generation for GLX protocol.  This includes adding support for several
additional enum-only extensions: EXT_filter_anisotropic, NV_expand_normal
NV_fog_distance, NV_texture_env_combine4, SGIS_generate_mipmap,
SGIX_clipmap, SGIX_depth_texture, SGIX_fog_offset, SGIX_shadow,
SGIX_shadow_ambient, SGIX_texture_coordinate_clamp, SGIX_texture_lod_bias,
and SGIX_texture_scale_bias.
2004-11-24 18:13:43 +00:00
Brian Paul
6b6c96bdeb update _mesa_store_teximageXd() comments and minor code clean-up 2004-11-23 23:29:42 +00:00
Roland Scheidegger
ba62741261 revert enabling of hw quads for swtcl. It lead to problems with quad_strips, since they'll get reduced to quads sometimes if hw quads are enabled. But this needs more thought, since it looks like clipped primitives will always be emitted as polys, so the reduced primitives for triangles, quads, quads_strips, polys all need to be the same, otherwise get lockups with for instance the olympic test. Render templates would probably need to be changed for this to work. 2004-11-23 18:49:18 +00:00
Ian Romanick
180b0db344 Set the "ignore" flag for any functions that the open-source libGL doesn't
already support GLX protocol for.
2004-11-23 00:19:51 +00:00
Brian Paul
a789252feb Don't allow queries/etc of buffer object 0 - it's invisible to users.
Misc clean-ups.
2004-11-22 20:01:25 +00:00
Brian Paul
ebe8d3152d added GL_RED/GREEN/BLUE to is_color_format() 2004-11-22 19:58:59 +00:00
Brian Paul
d0a82a652d silence warning, minor clean-up 2004-11-22 19:39:16 +00:00
Brian Paul
c247c7f66f applied SPARC patch (freedesktop bug 1898) 2004-11-22 19:27:40 +00:00
Brian Paul
263317d00a include <X11/Xthreads.h> instead of "Xthreads.h" 2004-11-22 19:11:01 +00:00
Brian Paul
65b79057b9 misc updates 2004-11-22 17:49:15 +00:00
Daniel Borca
f76be3d6f2 handle ENABLE_BIT for EXT_stencil_two_side 2004-11-22 08:46:53 +00:00
Brian Paul
4b4e7a982a fix APP_LIB_DEPS (bug 1065260) 2004-11-15 16:54:14 +00:00
Adam Jackson
ad919c30df Sync with Xorg head: mingw build fixes from Alexander Gottwald. 2004-11-15 15:31:32 +00:00
Daniel Borca
c0be56e5e8 moved windoze specific code outside drivers/glide/ 2004-11-15 10:54:57 +00:00
Daniel Borca
4ffc5fa7a5 work around a bug in gcc 3.3.3 (which duplicates ASM block) 2004-11-15 08:06:55 +00:00
Daniel Borca
fdd74136b3 fix _mesa_image_address2d invocation 2004-11-15 08:05:59 +00:00
Daniel Borca
37918cf3d9 use float constants 2004-11-15 08:04:33 +00:00
Daniel Borca
fd9b30750a use parentheses to avoid warning 2004-11-15 08:03:22 +00:00
Daniel Borca
16e6f05772 the win32 interface will be moving under windows/ 2004-11-15 08:02:24 +00:00
Daniel Borca
05cb9468f3 emphasize on the contents of Glide SDK 2004-11-15 08:01:20 +00:00
Roland Scheidegger
e6cd5d675f enable hw quad primitive for swtcl 2004-11-12 18:34:35 +00:00
Roland Scheidegger
ce055c26f0 add LOCK_HARDWARE/UNLOCK_HARDWARE to radeonClear so state gets updated which hopefully fixes lockups (?) (from r200 driver) 2004-11-12 18:29:51 +00:00
Roland Scheidegger
8e39265752 (from r200 driver) If an application cleared before any state had been emitted, that clear would
happen before any state had been set, causing a hang later on.  Fix this by
calling radeonFlush instead of FIREVERTICES (which checks if any state has been
emitted but not flushed, before calling Flush) in radeonClear.  While here, add
some more debugging info which was useful, and remove an unnecessary
save/restore in BackUpAndEmit.
2004-11-12 18:27:14 +00:00
Roland Scheidegger
6cf002c0c2 fix quads to use GL_QUADS instead of GL_TRIANGLES as primitive 2004-11-12 18:00:44 +00:00
Daniel Borca
8d88f826b9 small note regarding SSE under pure DOS 2004-11-12 15:00:30 +00:00
Daniel Borca
0676fc357a added a few sanity checks
made coding style a bit more consistent
2004-11-12 14:58:26 +00:00
Daniel Borca
885f10706a added DD_TRI_TWOSTENCIL to ease EXT_stencil_two_side in device drivers 2004-11-12 10:23:10 +00:00
Daniel Borca
f37383c1c6 wip hack for EXT_stencil_two_side 2004-11-12 10:11:04 +00:00
Daniel Borca
79a98dea91 pop(stencil) for EXT_stencil_two_side 2004-11-12 09:56:33 +00:00
Adam Jackson
a2c2393d91 brown paper bag, r100 can't do hardware quads. 2004-11-12 04:20:15 +00:00
Adam Jackson
4d17d00bfc make render_quads_verts call EMIT_PRIM with the arguments in the right order,
and enable hardware quads on r200 and radeon.  samples/prim renders quads
correctly now.
2004-11-12 04:13:27 +00:00
Brian Paul
b271ce8eda allow specifying image file on command line 2004-11-10 23:16:22 +00:00
Brian Paul
60909388ab GL_(UN)PACK_SKIP_IMAGES should only be applied to 3D texture pack/unpacking
and ignored for 1D and 2D images.
Need to pass in image dimensions (1,2,3) to the _mesa_image_address() function.
This change gets propogated to some other routines.
Also added new _mesa_image_address[123]d() convenience functions.
2004-11-10 15:46:52 +00:00
Brian Paul
f00d7edd74 added shaderobjects.c 2004-11-10 15:25:37 +00:00
Roland Scheidegger
de08b0d7ed add some chip ids 2004-11-10 01:49:01 +00:00
Brian Paul
b12594d2a0 do clipping prior to XGetImage, just in case the image would extend beyond the screen's bounds 2004-11-09 01:20:57 +00:00
Brian Paul
2a10ad16a6 use the new _mesa_clip_readpixels() routine 2004-11-09 01:10:36 +00:00
Brian Paul
e677da9e54 added a comment and assertion in _mesa_clip_drawpixels() for PixelZoom 2004-11-09 01:08:04 +00:00
Brian Paul
c55c963f4c Removed _swrast_clip_pixelrect(). Use _mesa_clip_drawpixels() instead. 2004-11-09 01:04:50 +00:00
Brian Paul
4084e3c215 added _mesa_clip_drawpixels() and _mesa_clip_readpixels() 2004-11-09 01:03:49 +00:00
Brian Paul
4f28c9c35a don't use ctx->Pack, use the function argument 2004-11-09 00:55:13 +00:00
Brian Paul
83889ffd97 Remove need for defining _MSC_VER when building Mesa for windows with
a non MS C compiler (MinGW).  (Gregor Anich)
2004-11-08 15:08:48 +00:00
Brian Paul
5849e3d353 shorter error messages when calling a GL function without a bound context (FDO bug 1775) 2004-11-05 18:32:02 +00:00
Ian Romanick
cb7f212f93 Add EXT_stencil_wrap test that doesn't depend on stencil read-back
functioning.
2004-11-04 22:32:41 +00:00
Adam Jackson
473fe6d6bf constify a few arrays. 2004-11-03 18:55:31 +00:00
Adam Jackson
5dd18e95d9 static char * -> static char [] 2004-11-03 18:55:20 +00:00
Roland Scheidegger
d294f79190 enable GL_EXT_fog_coord. Calculate fog factors and submit them instead of fog coords (it seems the chip cannot do fog factor computation when not using fragment depth as fog coord source). vtxfmt uses fallback for now (most code present but some magic would be needed if replaying vertices is necessary later on). 2004-11-03 17:29:39 +00:00
Ian Romanick
bdd53efe83 Added MMX optimized version of the RGB565 ReadRGBASpan routine. 2004-11-02 18:25:45 +00:00
Nicolai Haehnle
2302cc1a25 No visible changes, but commit the groundwork for further experiments:
- Install custom (though inactive) pipeline
- Track depth test and culling state in hardware registers
2004-11-02 13:06:45 +00:00
Nicolai Haehnle
b187341e63 Add culling registers, sync versions of r300_reg.h 2004-11-02 13:05:40 +00:00
Brian Paul
b17a1a1826 merge the AIX and AIX64 cases 2004-11-01 22:28:42 +00:00
Keith Whitwell
cc78e40172 Nicolai's sw-clipspan-fixes.patch 2004-11-01 20:27:43 +00:00
Daniel Borca
3d2b4bfa95 cleaned up the mess a bit 2004-11-01 09:06:17 +00:00
Daniel Borca
95e2a8099b small aesthetic correction 2004-11-01 08:49:55 +00:00
Daniel Borca
e14119f143 updated "clean" target in makefiles 2004-11-01 08:40:03 +00:00
Daniel Borca
63a2f2a977 protected against old djgpp distros 2004-11-01 08:38:12 +00:00
Daniel Borca
3c17d73c87 fixed compilation error 2004-11-01 07:40:53 +00:00
Brian Paul
051cf9df6a fix convolution regression from revision 1.48 to 1.49 2004-11-01 01:00:16 +00:00
Brian Paul
a6c21a2af1 don't advertise GL_ARB_vertex/fragment_shader until they're done 2004-10-31 18:55:00 +00:00
Brian Paul
a196565e04 added a cast to ADD_POINTERS macro 2004-10-31 18:54:10 +00:00
Brian Paul
aea02adc7b remove PBO work from to-do list 2004-10-31 18:44:24 +00:00
Brian Paul
753476c162 finished up PBO support 2004-10-31 18:43:46 +00:00
Brian Paul
effb720882 indentation fix 2004-10-31 18:41:38 +00:00
Brian Paul
450e917c9d Use the _mesa_scale_and_bias_rgba() function in the convolution functions.
Minor clean-ups.
2004-10-31 18:40:55 +00:00
Brian Paul
331cc1dcba PBO support for gl[Get]PixelMap functions 2004-10-31 18:31:07 +00:00
Brian Paul
66f3231322 PBO support for glColorTable, glColorSubTable, glGetColorTable, etc. 2004-10-31 17:56:28 +00:00
Brian Paul
bd3b40ad75 PBO support for glConvolutionFilter1D/2D, glGetConvolutionFilter, etc. 2004-10-31 17:36:23 +00:00
Brian Paul
d56928f10d updated for PBOs 2004-10-31 17:04:07 +00:00
Brian Paul
b6f97582dd glPolygonStipple() and glGetPolygonStipple() updated for PBOs. 2004-10-31 16:52:48 +00:00
Brian Paul
1c86813922 PBO support for glGetCompressedTexImage(). 2004-10-31 16:35:06 +00:00
Brian Paul
b46712ca9d glGetTexImage() now works with PBOs. 2004-10-31 16:24:32 +00:00
Brian Paul
c0ebc4931a Map/Unmap PBO as needed so that the texstore routines can work with
hardware-based PBOs in the future.
2004-10-31 16:18:07 +00:00
Brian Paul
ba164c4614 Removed _swrast_validate_pbo_access().
In x11 driver, map/unmap PBO as needed in DrawPixels functions.
2004-10-31 15:49:59 +00:00
Brian Paul
355467bed8 Allow the software fallback glDrawPixels, glReadPixels, glBitmap commands to
work with real, hardware-based PBOs in the future by mapping/unmapping the
PBO buffer as needed.
2004-10-31 15:39:04 +00:00
Brian Paul
c6136ea62c unbind GL_PIXEL_UNPACK_BUFFER_EXT before calling glBitmap! 2004-10-31 15:27:12 +00:00
Brian Paul
7eab337d9c use _mesa_unmap_buffer by default 2004-10-31 15:23:42 +00:00
Brian Paul
2daa4137b6 Remove redundant error checking.
Added _mesa_buffer_unmap().
Minor clean-ups.
2004-10-31 00:17:42 +00:00
Brian Paul
9ae96a5ce8 remove debug code 2004-10-29 19:31:52 +00:00
Brian Paul
7520e25995 Updated getprocaddress test to use gl_API.xml instead of old APIspec file. 2004-10-29 19:12:08 +00:00
Michal Krol
efb8b3e251 slang syntax conforming spec rev. 1.10.59 2004-10-29 17:09:40 +00:00
Daniel Borca
b0996b19f0 make sure we don't generate random alpha 2004-10-29 13:35:56 +00:00
Daniel Borca
03501e7a29 decoder "width" parameter represents "stride-in-pixels" 2004-10-29 13:25:44 +00:00
Brian Paul
7faf519233 VertexAttrib3svNV was incorrect 2004-10-29 04:00:50 +00:00
Adam Jackson
0b8acd90b3 libGL needs libXxf86vm.a. 2004-10-29 00:10:43 +00:00
Brian Paul
4e120c9718 obsolete 2004-10-28 22:18:52 +00:00
Brian Paul
98fa2bf364 minor clean-ups, found with pychecker 2004-10-28 21:11:02 +00:00
Brian Paul
fa557e904d name parameter to glGetActiveAttribARB() should not be const.
Added shaderobjects.c to sources file.
2004-10-28 21:03:19 +00:00
Michal Krol
af7a807650 renumber ARB_shader_objects and ARB_vertex_shader offsets
to get BlendEquation have offset 710
fix param name lack with GetInfoLogARB
2004-10-28 11:14:02 +00:00
Eric Anholt
cc182213c8 Add FreeBSD DRI build targets. Doesn't build at the moment, due to the same
problems as Linux.
2004-10-28 00:19:21 +00:00
Eric Anholt
948f2720f7 Use the generic __amd64__, instead of __AMD64__ which has to be defined by hand. 2004-10-28 00:18:02 +00:00
Brian Paul
51c026b265 updated PLIB URL 2004-10-27 23:01:47 +00:00
Adam Jackson
3291de6d06 Bug #1713: Some rare libGL's have __glXFindDRIScreen defined but do not
export it via glXGetProcAddress.  These are not supported anymore, so print
an error message to that effect.
2004-10-27 17:50:09 +00:00
Michal Krol
b28031d57e remove unused entries 2004-10-27 17:36:23 +00:00
Michal Krol
80d468c1c9 fill api entries for ARB_shader_objects and ARB_vertex_shader 2004-10-27 17:34:27 +00:00
Michal Krol
678ea6cd5c add entries for extensions ARB_shader_objects, ARB_fragment_shader and
ARB_vertex_shader
2004-10-27 17:27:57 +00:00
Michal Krol
2f11cbd15b add FEATURE flags for ARB_shader_objects, ARB_vertex_shader and
ARB_fragment_shader
2004-10-27 17:16:06 +00:00
Michal Krol
c1fe469870 by karoshi - ARB_shader_objects implementation
empty routines by now
2004-10-27 17:09:10 +00:00
Michal Krol
ed2c18c08c by karoshi - header file for ARB_shader_objects implementation 2004-10-27 16:57:04 +00:00
Michal Krol
26bf36ce49 add support for ARB_shader_objects and ARB_vertex_shader 2004-10-27 16:46:26 +00:00
Michal Krol
beb9554273 add support for ARB_shader_objects and ARB_vertex_shader 2004-10-27 16:39:09 +00:00
Michal Krol
a97bc422d6 assign api offsets for ARB_shader_objects and ARB_vertex_shader 2004-10-27 16:37:24 +00:00
Michal Krol
71eb0a7fd6 regenerate with correct script 2004-10-27 15:40:46 +00:00
Michal Krol
b7293dc2b7 regenerate with correct script 2004-10-27 15:34:31 +00:00
Michal Krol
ec3ad66696 fix DrawBufferARB entry 2004-10-27 15:29:05 +00:00
Michal Krol
1c0f9d71bd fix DrawBuffersARB entry 2004-10-27 15:27:08 +00:00
Michal Krol
455c8177ad the file was empty! 2004-10-27 15:20:08 +00:00
Michal Krol
b15fd4ba76 by karoshi - add support for ARB_shader objects and ARB_vertex_shader 2004-10-27 15:06:18 +00:00
Ian Romanick
95ba352497 As per suggestions my Michel Daenzer, improve the fix for bugzilla #1513. 2004-10-26 19:20:40 +00:00
Brian Paul
640492aec9 added an attention-getting comment for developers who get stopped in _mesa_test_os_sse_support() while debugging 2004-10-26 17:29:59 +00:00
Brian Paul
2083131643 added stereo option (Jacek Rosik) 2004-10-26 14:36:32 +00:00
Adam Jackson
1cda832fd9 remove a -Werror from testing. 2004-10-25 22:19:43 +00:00
Adam Jackson
61702d4afe Add glx/x11 to the DRI configs, and change the Solo configs to build glx/mini. 2004-10-25 21:23:08 +00:00
Adam Jackson
312c68fab3 Add DRI_LIB_DEPS for the DRI drivers to link against. Remove expat from the
link list for libGL itself under DRI configurations, since the XML parsing
code is in the drivers themselves.
2004-10-25 21:20:29 +00:00
Adam Jackson
7badefa6c4 Bug #1679: Link DRI drivers against DRI_LIB_DEPS, not GL_LIB_DEPS. 2004-10-25 21:18:52 +00:00
Adam Jackson
cb3610e37c Import the GLX client side library, formerly from xc/lib/GL/glx. Build it
by adding 'glx/x11' to SRC_DIRS in your build config.
2004-10-25 21:09:16 +00:00
Adam Jackson
bcd8735546 Import sarea.h from Xorg, needed for client GLX code. 2004-10-25 20:52:11 +00:00
Nicolai Haehnle
5a9fd2afc6 Implement ColorMask 2004-10-24 06:17:20 +00:00
Nicolai Haehnle
d586540eaf Hardware accelerated depth clear 2004-10-24 05:52:10 +00:00
Adam Jackson
94987beb2c Bug #1682: Mesa core code that gets linked into DRI drivers should never call
through the GL API directly, but should instead use the GL_CALL macro.
2004-10-24 02:05:40 +00:00
Brian Paul
07553c58fd wrap angle value (Philipp Klaus Krause) 2004-10-23 18:55:48 +00:00
Brian Paul
e57b6d5a4f addes osdemo32 target (J.P. Delport) 2004-10-23 16:58:32 +00:00
Brian Paul
0aa0343fb0 minor fixes from J.P. Delport 2004-10-23 16:57:44 +00:00
Ian Romanick
74b0080086 Big-endian fixes for R200 sw TCL path. 2004-10-23 00:42:17 +00:00
Michal Krol
cb499595aa - add decimal literal integer support
- fix bug with c-style comment closing - sequences
  like /***/ were not correctly parsed
2004-10-22 12:42:37 +00:00
Michal Krol
c69ceaf8eb forgot about revision increment 2004-10-21 14:11:06 +00:00
Michal Krol
b80bc055bc - use new program option values from arbprogram.syn
- remove redundant check of parsed program target
- remove redundant check of relative addressing range
- use faster grammar interface
2004-10-21 14:09:54 +00:00
Michal Krol
ed60e19d8a remove redundant check of parsed program target 2004-10-21 14:06:18 +00:00
Michal Krol
718ba9773b change program options numbering to accommodate future
options (up to 256)
2004-10-21 13:57:24 +00:00
Michal Krol
cbef98c2ea add new grammar_check_fast entry for faster parsing 2004-10-20 15:19:58 +00:00
Michal Krol
904ef741de - speed up syntax parsing - the parser is now 4 times faster
note: to use it you must use grammar_check_fast entry
- allow decimal format for literal integers in .syn files
- raise am error if syntax has duplicate or unreferenced
  symbols
- do some little clean-up with linked-list stuff
- make macro APPEND_CHARACTER a function
- fix minor typos and bugs
2004-10-20 14:54:17 +00:00
Daniel Borca
a7855e835d fixed compilation errors 2004-10-20 11:59:28 +00:00
Daniel Borca
05517d02be fix compilation error in `convertPalette' (still have to fix the issue, though) 2004-10-19 06:35:01 +00:00
Ian Romanick
f404ff7b76 Small optimization for big-endian (e.g., PowerPC) systems. 2004-10-18 23:24:51 +00:00
Michal Krol
f459b9f9c0 conform to shader spec 1.10.59 2004-10-18 12:18:33 +00:00
Michal Krol
cfb62331bc conform to language version 1.10 rev 59
resolve TODOs
2004-10-18 09:49:25 +00:00
Daniel Borca
a0720cf104 print an error message in convertPalette before dying.
this is NOT a fix, but it'll have to wait a little...
2004-10-18 08:17:17 +00:00
Daniel Borca
c99a99b3bc small fix to match new _mesa_rescale_teximage2d 2004-10-18 08:07:26 +00:00
Daniel Borca
1cfe1e8925 changed _mesa_rescale_teximage2d to allow rescaling of padded images 2004-10-18 08:04:21 +00:00
Daniel Borca
8cd728f436 added dstRowStride to dxtCompressTexFuncExt;
good for subimages, padded images and such.
NB: intentionally, this is the last parameter, to avoid
breaking the current API! adding a new parameter
is not harmful, at worst it will be ignored, since all
platforms use a CDECL calling convention.
2004-10-18 07:54:09 +00:00
Daniel Borca
13ec04c480 use RowStride instead of Width in texel fetchers.
changed some pointers to be (char *) instead of (long)
2004-10-18 07:49:26 +00:00
Ian Romanick
b430a1ae22 Fix compile errors when DEBUG is defined. 2004-10-18 00:00:41 +00:00
Ian Romanick
48da4a4a86 Fix t_vertex byte-ordering issues for PowerPC. This was tested with gears
and tunnel (for fog).
2004-10-17 21:54:41 +00:00
Ian Romanick
40e852271b Add ARGB modes to support big-endian systems. 2004-10-17 21:53:43 +00:00
Ian Romanick
add38812f0 Fix hangs on big-endian (e.g., PowerPC) hardware. 2004-10-17 21:29:58 +00:00
Nicolai Haehnle
ff42a00402 - FIX: flickering
- Scissor support works now
2004-10-17 20:26:06 +00:00
Brian Paul
158a251a6b added initial support for -exports option, Linux/OpenBSD only for now 2004-10-16 15:10:45 +00:00
Brian Paul
901d9b9a92 GL_OES_read_format info 2004-10-16 15:04:43 +00:00
Brian Paul
c498742768 if CXX or CC env vars aren't set, use g++, gcc by default (Linux) 2004-10-16 15:02:16 +00:00
Ville Syrjala
3152b1586c Removed two unnecessary variables. 2004-10-16 11:26:06 +00:00
Ville Syrjala
63e9a968ff Fixed off by one errors in clipping. 2004-10-16 11:09:26 +00:00
Eric Anholt
b1ebd306bf Add code to support projective texturing and fix mixed enabling of texture
coordinate generation.  Original code by Roland Schiedegger, with changes by
myself.  While here, ensure that the swtcl path does tnl_install_attrs enough
when fog/specular are being (en/dis)abled.

Notable effects:
- projtex test works with TCL and is closer with swtcl (Bugzilla #1461)
- 8/9 squares work in texgenmix instead of 3.
- texcyl "reflect" mode works (GL_SPHERE_MAP is now a fallback -- unclear if the
  hardware can actually support it).
- flickering in doom3 replaced by just plain darkness.
- blocktube fixed (Bugzilla #984)
- fixes stex3d
2004-10-16 03:36:14 +00:00
Eric Anholt
a1af92877d Always turn on the TAM_DEBUG3=0x6 workaround on real r200s. It appears that
the current cases for turning it on were insufficient (Bugzilla #1519, 729, 814)
and it has no significant performance impact.  Performance tested with quake3
in GL_LINEAR mode both with and without anisotropy, with the workaround always
on or always off.
2004-10-16 01:58:02 +00:00
Ian Romanick
33899b7c35 Add support for OES_read_format. As soon as glext.h is updated with the
enums for this extension, the changes to gl.h can be removed.
2004-10-16 01:16:54 +00:00
Brian Paul
83c74b7279 fix if/else bug in _mesa_ProgramEnvParameter4fARB (fdo bug 1645) 2004-10-16 00:29:03 +00:00
Ian Romanick
1aa37f97c4 Only build the MMX/SSE/SSE2 versions for ReadRGBASpan when the pixel format
matches what they optimized versions actually expect.
2004-10-16 00:03:27 +00:00
Ian Romanick
12b53f2079 Fixed a few places that should have been using GET_SRC_PTR. 2004-10-15 23:46:53 +00:00
Ian Romanick
ea6786b453 Convert MGA driver to use new spantmp2.h interface. 2004-10-15 23:00:52 +00:00
Nicolai Haehnle
5696710f96 Huge dumb drop. State:
- Color buffer clear is accelerated, but flickers (possibly caused by a
  recent DDX or Mesa change or bad merge)
- Everything else uses software fallback rendering
- There should be no clipping-related artifacts with the
  sw-clipspan-fixes.patch against Mesa (posted on dri-devel)
- Multiple clients should be rock solid with a DDX patch that is soon to
  come (soon = within the next hour or so)
2004-10-15 20:52:47 +00:00
Ian Romanick
0648794518 Add support for optimized versions of the code underlying ReadPixels
(and DrawPixels).  The R200, R128, and Unichrome drivers get support
in this commit.  Other drivers would be easy enough to add for people
that have the cards.

The DRI (CVS) build will need to be updated to account for the new
source files.
2004-10-14 00:59:12 +00:00
Keith Whitwell
dc45ee7a4b Add a license to this file. It was written on VA's watch, so they get
the honours.
2004-10-13 23:16:02 +00:00
Ian Romanick
07bd4c585c Added some documentation that I managed to figure out through
experimentation.
2004-10-13 22:38:31 +00:00
Ian Romanick
82f2e80f14 Make the GL_RENDERER string include the actual chipset information
instead of always saying "CLE266".
2004-10-13 22:36:26 +00:00
Ian Romanick
447cdd536f Initial support for PowerPC specific code in Mesa and DRI drivers. DRI
drivers built on PowerPC systems should now show things like "PowerPC" or
"PowerPC/Altivec" in the GL_RENDERER string.

The VMX moniker is used for Altivec/Velocity Engine/VMX SIMD additions.  I
chose this not because I work for IBM but because it's a LOT shorter to
type. :)
2004-10-13 19:56:15 +00:00
Ian Romanick
b72ed81818 Refactor the code in driGetRendererString a bit to make it easier to
add support for features of non-x86 CPU types.
2004-10-13 19:23:26 +00:00
Brian Paul
f599716b93 updated fsv URL 2004-10-13 17:29:46 +00:00
Ian Romanick
81f67fc4e9 Eliminate the funky SSE exception test from DRI builds. It's not need
(see the comment in the code), and it's just annoying.
2004-10-13 17:29:33 +00:00
Brian Paul
612d5f6e84 initial 6.3 changes 2004-10-13 15:57:55 +00:00
Brian Paul
dfe508ca7a Fix minor fog / fragment program state bug.
Don't add diffuse and specular colors when using fragment program.
2004-10-13 15:54:48 +00:00
Adam Jackson
886df0926f Bug #1588: abort if no palette format matches. (Egbert Eich, Stefan Dirsch) 2004-10-13 14:33:49 +00:00
Philippe Houdoin
f58c61ddb5 Let's build again after the support for GL_ARB_draw_buffers was added. 2004-10-13 01:23:32 +00:00
Philippe Houdoin
d334067193 Fix a potential memory leak. 2004-10-13 01:17:52 +00:00
Philippe Houdoin
fd7f62a508 Forgot a contributor.
Update build requirements since we can build with BeOS vanilla gcc *and*
more recent gcc 2.95.3 versions (recommended for best performance).
2004-10-13 00:35:55 +00:00
Philippe Houdoin
ac855a6688 Implement BGLView::CopyPixelsIn/Out().
BGLView::ErrorCallback() is now actually called on error!
Plus usual minor changes.
2004-10-13 00:29:21 +00:00
Daniel Borca
701c289ff3 support for external libraries 2004-10-12 07:33:03 +00:00
Daniel Borca
3c9faa448c SWTC trick (disabled for now) 2004-10-12 07:32:11 +00:00
Daniel Borca
2bff8bd8de SWTC trick, enabled new extensions 2004-10-12 07:31:26 +00:00
Daniel Borca
92e1d5fd34 SWTC trick 2004-10-12 06:44:34 +00:00
Daniel Borca
65a9ca3381 bump version numbers to their real values 2004-10-12 06:43:57 +00:00
Daniel Borca
f5e7629685 doc update 2004-10-12 06:43:00 +00:00
Daniel Borca
189f7e31d6 avoid the patch if Mesa_DXTn flag is set 2004-10-12 06:42:02 +00:00
Daniel Borca
76908ab9d4 add more mess to the dynamic linking system 2004-10-12 06:41:20 +00:00
Daniel Borca
3d322f6c5e add newline to end of file 2004-10-12 06:37:18 +00:00
Felix Kuehling
def29a3f87 Fix strange white space that gcc didn't like. 2004-10-11 22:26:40 +00:00
Michal Krol
ab2c0bed5a Prefix operator and constructor keywords with two consequtive underscores
( __ ). This will be more compatible with glslang spec.
2004-10-11 15:06:02 +00:00
Michal Krol
ad22ce8143 Enable draw_buffers only if GL_ARB_draw_buffers string is
present in GL_EXTENSIONS string.
Parse OPTION ARB_draw_buffers.
2004-10-11 08:13:25 +00:00
Eric Anholt
739823d250 This statechange is vtx state, not tcl. 2004-10-09 23:29:07 +00:00
Eric Anholt
57f1b25caf Use the right FALLBACK macro for projtex so that projective textures actually
cause a fallback, and simplify the tmu handling a little.
2004-10-08 23:24:04 +00:00
Eric Anholt
ea6f4f6079 Add fallback debugging (R128_DEBUG=fall) output, and set DO_DEBUG=1 by default
so that we can use the env var to get output.  Add a no_rast driconf option to
force software fallbacks.
2004-10-08 23:03:38 +00:00
Eric Anholt
b4d269f35f Don't compile WriteMonoDepthSpan if HAVE_HW_DEPTH_SPANS is defined -- it won't
be used in that case, and it wanting WRITE_DEPTH was making r128 die on
the undefined symbol.
2004-10-08 22:21:09 +00:00
Eric Anholt
f6cdaa9c81 Add support for NV_blend_square, and print errors if an unsupported blend
function is used.
2004-10-08 21:37:08 +00:00
Ian Romanick
3eccddb746 Massively cleaned up the code that calculates front/back/depth buffer
pitch and size.  Cut out a bunch of dead code.

This fixes bugzilla #1555.
2004-10-08 01:15:52 +00:00
Ian Romanick
a2dc424acf Reject unsupported texture formats passed to glCompressedTexImage?D. This
fixes Mesa bug #1028405.
2004-10-08 01:03:10 +00:00
Ian Romanick
af0a4690db Add simple test program for Mesa bug #1028405. 2004-10-08 00:56:08 +00:00
Alex Deucher
cb1642a75c Apply Eric's stencil wrap patch (Eric Anholt) 2004-10-08 00:31:51 +00:00
Eric Anholt
d09209f553 Add Roland Scheidegger's S3TC patch. This patch does not implement the
(patented) S3TC/DXTC algorithms, but adds an option to dlopen a library module
providing functions to do so.  Because it uses dlopen, it is only enabled if
USE_EXTERNAL_DXTN_LIB=1 is defined (which is only in linux-dri config, so far).
It adds support for S3TC to several DRI drivers, and adds a DRI config option to
force enabling S3TC even if the software compression/decompression is
unavailable.  This may allow people to use apps that require S3TC even though
they don't have a license to implement the patented material themselves, if
those apps use precompressed textures.

Ideally we would get permission from the current holder of the patents to
implement the algorithm in Mesa, at which point the dlopen mess could go away.
Until then, this allows some to run applications they couldn't otherwise, and
hopefully will provide us with more push to get the final step of getting that
permission done.
2004-10-07 23:30:29 +00:00
Ian Romanick
554e5a2eaf Prevent Y-offset from exceeding valid range in texture upload code. This
fixes bugzilla #960.
2004-10-07 16:39:20 +00:00
Felix Kuehling
1695cfe991 Fix emitting fog without secondary color and vice-versa. 2004-10-07 10:07:35 +00:00
Karl Schultz
89353febc0 *** empty log message *** 2004-10-06 21:45:48 +00:00
Brian Paul
fb170c8bd7 more GL_ARB_draw_buffers updates from Michale Krol 2004-10-06 15:56:38 +00:00
Brian Paul
0b89f7a93a fix GetVertexAttrib problem 2004-10-06 15:52:43 +00:00
Ian Romanick
be50caa52c Convert tdfxDDInitExtensions to use driInitExtensions. 2004-10-06 02:02:53 +00:00
Daniel Borca
e9be96d39e put Rush in the list of supported HW 2004-10-05 08:43:22 +00:00
Daniel Borca
0efa4a8f96 stencil wrap works, either HW or SW (Ian Romanick) 2004-10-05 08:42:10 +00:00
Daniel Borca
cb932046a8 enable 2_0 extensions 2004-10-05 08:39:32 +00:00
Ian Romanick
617add69ca Use the driFillInModes utility function. 2004-10-04 22:58:39 +00:00
Ian Romanick
ee3b7e390a Also export fbconfigs with 0/0 depth/stencil modes. This fixes "driver
claims not to support visual 0xXX" warnings in X.org 6.8.1.
2004-10-04 22:23:29 +00:00
Ian Romanick
b82333db3e Add some Savage3D stencil documentation based on discussions during the
20-Sep-2004 #dri-devel meeting.
2004-10-04 17:17:49 +00:00
Brian Paul
ddfec59bcd make clean should remove depend.bak too (Sérgio Moneiro Basto) 2004-10-04 14:47:48 +00:00
Brian Paul
be76b7fe1e ARB_fp support for GL_ARB_draw_buffers (Karl Rasche) 2004-10-04 14:40:05 +00:00
Ian Romanick
00fb3a054a Set MaxTextureImageUnits and MaxTextureCoordUnits to match MaxTextureUnits.
This fixes bugzilla #1511.
2004-10-04 03:19:01 +00:00
Ian Romanick
5e243bd57e The alpha post-scale and the RGB post-scale were mistakenly reversed. 2004-10-04 02:54:49 +00:00
Eric Anholt
e8250c6271 Remove empty r128_vb.h. 2004-10-03 18:09:57 +00:00
Brian Paul
58d84409a3 put glapi_x86.S into the x86/ directory 2004-10-02 22:48:59 +00:00
Brian Paul
788ff5b5c7 remove unused413 stuff, glDrawBuffersARB uses that slot now 2004-10-02 22:47:48 +00:00
Brian Paul
feac4f6ba5 GL_ARB_draw_buffers 2004-10-02 22:43:44 +00:00
Brian Paul
3298ec4670 fix _DrawDestMask[0][0] typos 2004-10-02 22:38:43 +00:00
Brian Paul
53f82c5aad added support for GL_ARB_draw_buffers 2004-10-02 16:39:09 +00:00
Brian Paul
289ffee2a0 fix indentation 2004-10-02 15:56:50 +00:00
Brian Paul
cbef8c4776 fix a comment 2004-10-02 15:56:33 +00:00
Brian Paul
83fb8c34fb bump version to 6.3 2004-10-02 15:43:26 +00:00
Brian Paul
9cef3efc29 initial stuff for 6.3 2004-10-02 15:43:14 +00:00
Brian Paul
7e73b1afa2 a few more updates for the 6.2 release 2004-10-02 15:26:25 +00:00
Brian Paul
9ca8392484 fix LoadProgramNV regression when I had fixed the RefCount bug 2004-10-02 15:16:59 +00:00
Brian Paul
07dead7a51 added PBO known issues 2004-10-02 14:59:29 +00:00
Brian Paul
bdd3c2e44e set 6.2 release date 2004-10-02 14:56:17 +00:00
Eric Anholt
599ea624a3 If an application cleared before any state had been emitted, that clear would
happen before any state had been set, causing a hang later on.  Fix this by
calling r200Flush instead of FIREVERTICES (which checks if any state has been
emitted but not flushed, before calling Flush) in r200Clear.  While here, add
some more debugging info which was useful, and remove an unnecessary
save/restore in BackUpAndEmit.
2004-10-02 05:22:19 +00:00
Eric Anholt
e5856a2960 Convert Rage 128 over to t_vertex.c. While it's slightly slower (10% in ipers)
it's not that big of a deal in more normal apps, and axes a good bit of code.
And I assume that t_vertex will only get faster.  Removes ~43k from compiled
binary.

Tested with:	quake3, ut, ipers, texcyl, chromium, tuxracer, neverball (kinda)
2004-10-02 01:33:46 +00:00
Eric Anholt
fc552c530f Add an option for vertices emitted to be swapped CPU_TO_LE32, to be used by the
r128 code.
2004-10-02 01:28:38 +00:00
Ian Romanick
5b73371e05 Cut out all of the old texture environment code and rewrote it from
scratch.  There were just too many cut-and-paste errors in the code,
and it was too hard to follow.

This fixes Mesa bugzilla #1508.  #1509 is probably also fixed, but
I'd like to do some more testing before I close that particular bug.
Additionally, this cuts almost 4,600 lines of code from the driver.
2004-10-02 01:23:46 +00:00
Karl Schultz
7ff3c9e4fc minor updates and improvements 2004-10-01 21:22:10 +00:00
Karl Schultz
4c2fbb0538 Add the glut project to the demos workspace. 2004-10-01 20:55:23 +00:00
Karl Schultz
0303409732 Remove glut project from the Mesa workspace. This allows users to build
this entire workspace by only unzipping MesaLib.zip.  The project will
be moved to the demos workspace, which is contained in the MesaDemos zip
file.
2004-10-01 20:53:28 +00:00
Karl Schultz
786eef2b1e Add HP shared lib configs. 2004-10-01 20:19:16 +00:00
Karl Schultz
ba52e79b4e HP shared lib config 2004-10-01 20:18:42 +00:00
Ian Romanick
bf4b63f836 Replace the numerous switch-statements to derive GL_COMBINE post-scale
state with a function.  This function sets the bits correctly.  Did some
trivial refactoring on some of the GL_COMBINE code.

First pass at replacing classic texture environments with GL_COMBINE.
This is controlled by the EXPERIMENTAL_COMBINE_MODE define.
2004-10-01 18:32:25 +00:00
Karl Schultz
5e2e9ef45c fix problems in previous version 2004-10-01 16:29:39 +00:00
Karl Schultz
a16bdb5fb7 Enable builds on AIX 64-bit 2004-10-01 13:33:26 +00:00
Dave Airlie
75672d2e94 Fix mesa solo with doublebuffered apps, the drawable index/stamp weren't
being updated properly..
2004-10-01 04:34:01 +00:00
Ian Romanick
75e2f0698e Factored out code for setting texture coordinate wrap bits. Added support
for GL_ARB_texture_mirrored_repeat.  Enabled GL_NV_blend_square.  It has
always actually been supported.  Removed redundant EXT versions of ARB
extension strings.
2004-09-30 21:18:23 +00:00
Brian Paul
ba467e86fe set span.y prior to each span write in draw_depth_pixels, like Karl's other fix 2004-09-30 15:39:43 +00:00
Eric Anholt
6a2ca962db Bugzilla #1058: Fix some potential 64bit pointer issues by storing differences
between pointers in appropriate types.

Submitted by:	  Ronny V. Vindenes <s864@ii.uib.no>
2004-09-30 00:40:21 +00:00
Eric Anholt
7a086dc05e OK, one more time. Simplify the state-backup system by just storing the full
state in a ready-to-emit cmdbuf, which avoids the issue Nicolai Haehnle reported
where the check() could return differently during backup-and-emit than it should
have if it were called at the right time.  Move the lit emission before most of
the TCL state emission on r200, which fixes neverball issues.

Tested with:	r100/r200 with neverball, tuxracer, chromium, quake3, ipers
2004-09-30 00:08:05 +00:00
Karl Schultz
fa569c0a73 Fix bug in glDrawPixels when writing color indexed images on color indexed
devices.  In draw_index_pixels(), use the correct variables for the span Y
and span end values.
2004-09-28 18:53:44 +00:00
575 changed files with 70968 additions and 41363 deletions

View File

@@ -25,6 +25,10 @@ realclean:
$(MAKE) clean
-rm -rf lib*
-rm -f $(TOP)/configs/current
-rm -f `find . -name \*.o`
-rm -f `find . -name \*.a`
-rm -f `find . -name \*.so`
install:
@@ -45,17 +49,22 @@ $(TOP)/configs/current:
# Rules to set/install a specific build configuration
aix \
aix-64 \
aix-gcc \
aix-static \
beos \
darwin \
darwin-static \
freebsd \
freebsd-dri \
freebsd-dri-x86 \
hpux10 \
hpux10-gcc \
hpux10-static \
hpux11-32 \
hpux11-32-static \
hpux11-32-static-nothreads \
hpux11-64 \
hpux11-64-static \
hpux9 \
hpux9-gcc \
@@ -72,6 +81,7 @@ linux-debug \
linux-dri \
linux-dri-x86 \
linux-dri-x86-64 \
linux-dri-ppc \
linux-glide \
linux-icc \
linux-icc-static \

View File

@@ -20,9 +20,9 @@
# 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.
# DOS/DJGPP makefile v1.5 for Mesa
# DOS/DJGPP makefile v1.6 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -64,7 +64,7 @@ CPU ?= pentium
GLU ?= mesa
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
export CFLAGS

View File

@@ -20,9 +20,9 @@
# 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.
# MinGW makefile v1.1 for Mesa
# MinGW makefile v1.2 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -66,7 +66,7 @@ else
# I love c89
CFLAGS = -Wall -W -pedantic
endif
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
export CFLAGS

View File

@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
Project: "array_cache"=.\SRC\MESA\array_cache\array_cache.dsp - Package Owner=<4>
Project: "array_cache"=".\SRC\MESA\array_cache\array_cache.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -15,7 +15,7 @@ Package=<4>
###############################################################################
Project: "gdi"=.\src\mesa\drivers\windows\gdi\gdi.dsp - Package Owner=<4>
Project: "gdi"=".\src\mesa\drivers\windows\gdi\gdi.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -51,7 +51,7 @@ Package=<4>
###############################################################################
Project: "glapi"=.\SRC\MESA\glapi\glapi.dsp - Package Owner=<4>
Project: "glapi"=".\SRC\MESA\glapi\glapi.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -63,7 +63,7 @@ Package=<4>
###############################################################################
Project: "glu"=.\src\glu\sgi\glu.dsp - Package Owner=<4>
Project: "glu"=".\src\glu\sgi\glu.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -78,22 +78,7 @@ Package=<4>
###############################################################################
Project: "glut"=.\src\glut\glx\glut.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glu
End Project Dependency
}}}
###############################################################################
Project: "main"=.\SRC\MESA\main\main.dsp - Package Owner=<4>
Project: "main"=".\SRC\MESA\main\main.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -105,7 +90,7 @@ Package=<4>
###############################################################################
Project: "math"=.\SRC\MESA\math\math.dsp - Package Owner=<4>
Project: "math"=".\SRC\MESA\math\math.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -117,7 +102,7 @@ Package=<4>
###############################################################################
Project: "osmesa"=.\SRC\MESA\DRIVERS\osmesa\osmesa.dsp - Package Owner=<4>
Project: "osmesa"=".\SRC\MESA\DRIVERS\osmesa\osmesa.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -132,7 +117,7 @@ Package=<4>
###############################################################################
Project: "shader"=.\SRC\MESA\shader\shader.dsp - Package Owner=<4>
Project: "shader"=".\SRC\MESA\shader\shader.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -144,7 +129,7 @@ Package=<4>
###############################################################################
Project: "swrast"=.\SRC\MESA\swrast\swrast.dsp - Package Owner=<4>
Project: "swrast"=".\SRC\MESA\swrast\swrast.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -156,7 +141,7 @@ Package=<4>
###############################################################################
Project: "swrast_setup"=.\SRC\MESA\swrast_setup\swrast_setup.dsp - Package Owner=<4>
Project: "swrast_setup"=".\SRC\MESA\swrast_setup\swrast_setup.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -168,7 +153,7 @@ Package=<4>
###############################################################################
Project: "tnl"=.\SRC\MESA\tnl\tnl.dsp - Package Owner=<4>
Project: "tnl"=".\SRC\MESA\tnl\tnl.dsp" - Package Owner=<4>
Package=<5>
{{{

View File

@@ -21,6 +21,7 @@
# -arch ARCH override using `uname` to determine architecture
# -archopt OPT specify an extra achitecture-specific option OPT
# -noprefix don't prefix library name with "lib" or any suffix
# -exports FILE only export the symbols listed in FILE
#
# The library name should just be "GL" or "GLU", etc. The 'lib' prefix
# will be added here if needed, as well as the ".so" or ".a" suffix,
@@ -48,6 +49,7 @@ INSTALLDIR="."
ARCH="auto"
ARCHOPT=""
NOPREFIX=0
EXPORTS=""
#
@@ -68,6 +70,7 @@ do
'-arch') shift 1; ARCH=$1;;
'-archopt') shift 1; ARCHOPT=$1;;
'-noprefix') NOPREFIX=1;;
'-exports') shift 1; EXPORTS=$1;;
-*) echo "mklib: Unknown option: " $1 ; exit 1;;
*) break
esac
@@ -104,6 +107,7 @@ if [ ] ; then
echo MINOR is $MINOR
echo PATCH is $PATCH
echo DEPS are $DEPS
echo "EXPORTS in" $EXPORTS
echo "-----------------"
fi
@@ -114,7 +118,15 @@ fi
case $ARCH in
'Linux' | 'OpenBSD')
# GCC-based environment
# we assume gcc
# Set default compilers if env vars not set
if [ "x$CXX" = "x" ] ; then
CXX=g++
fi
if [ "x$CC" = "x" ] ; then
CC=gcc
fi
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
@@ -149,6 +161,18 @@ case $ARCH in
else
OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
fi
if [ $EXPORTS ] ; then
#OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}"
# Make the 'exptmp' file for --version-script option
echo "VERSION_${MAJOR}.${MINOR} {" > exptmp
echo "global:" >> exptmp
sed 's/$/;/' ${EXPORTS} >> exptmp
echo "local:" >> exptmp
echo "*;" >> exptmp
echo "};" >> exptmp
OPTS="${OPTS} -Xlinker --version-script=exptmp"
# exptmp is removed below
fi
if [ x${PATCH} = "x" ] ; then
VERSION="${MAJOR}.${MINOR}"
else
@@ -175,6 +199,7 @@ case $ARCH in
ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so
# finish up
FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so"
# rm -f exptmp
fi
;;
@@ -331,19 +356,27 @@ case $ARCH in
fi
;;
'AIX')
'AIX' | 'AIX64')
if [ $ARCH = "AIX64" ] ; then
X64="-X64"
fi
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making AIX static library: " ${LIBNAME}
ar -ruv ${LIBNAME} ${OBJECTS}
ar -ruv ${X64} ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
EXPFILE="lib${LIBNAME}.exp"
OFILE=shr.o #Want to be consistent with the IBM libGL.a
LIBNAME="lib${LIBNAME}.a" # shared objects are still stored in the .a libraries
OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry"
if [ $ARCH = "AIX64" ] ; then
OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry -q64"
else
OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry"
fi
rm -f ${EXPFILE} ${OFILE}
NM="/bin/nm -eC"
NM="/bin/nm -eC ${X64}"
echo "#! /usr/lib/${LIBNAME}" > ${EXPFILE}
${NM} ${OBJECTS} | awk '{
if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \
@@ -360,22 +393,11 @@ case $ARCH in
}
}' | sort -u >> ${EXPFILE}
cc ${OPTS} -o ${OFILE} ${OBJECTS} ${DEPS}
ar -r ${LIBNAME} ${OFILE}
ar ${X64} -r ${LIBNAME} ${OFILE}
FINAL_LIBS="${LIBNAME}"
fi
;;
'AIX64')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making AIX static library: " ${LIBNAME}
ar -X64 -ruv ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
echo "mklib: PROBLEM: AIX64 shared libs not supported!!!"
fi
;;
'OpenSTEP')
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making OpenSTEP static library: " ${LIBNAME}
@@ -394,8 +416,13 @@ case $ARCH in
VERSION="${MAJOR}.${MINOR}"
LIBNAME="lib${LIBNAME}.so"
echo "mklib: Making OSF/1 shared library: " ${LIBNAME}
if [ $CPLUSPLUS = 1 ] ; then
LINK=$CXX
else
LINK=$CC
fi
rm -f ${LIBNAME}.${VERSION}
ld -o ${LIBNAME}.${VERSION} -shared -no_archive -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS}
${LINK} -o ${LIBNAME}.${VERSION} -shared -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS}
ln -sf ${LIBNAME}.${VERSION} ${LIBNAME}
FINAL_LIBS="${LIBNAME} ${LIBNAME}.${VERSION}"
fi

28
configs/aix-64 Normal file
View File

@@ -0,0 +1,28 @@
# Configuration for AIX 64-bit, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = aix-64
# Compiler and flags
CC = xlc
CXX = xlC
CFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3
CXXFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3
MKLIB_OPTIONS = -arch AIX64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lm
GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC
GLUT_LIB_DEPS = -L$(TOP)/lib -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXt -lX11
OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)
APP_LIB_DEPS = -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC

View File

@@ -7,7 +7,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=6
MESA_MINOR=2
MESA_MINOR=3
MESA_TINY=0
# external projects
@@ -23,7 +23,7 @@ GLU_CFLAGS =
# Misc tools and flags
MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -Y -fdepend
MKDEP_OPTIONS = -fdepend
MAKE = make
# Library names (base name)

41
configs/freebsd-dri Normal file
View File

@@ -0,0 +1,41 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd
CONFIG_NAME = freebsd-dri
# Compiler and flags
CC = gcc
CXX = g++
WARN_FLAGS = -Wall
OPT_FLAGS = -O
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
DEFINES = -DDRI_NEW_INTERFACE_ONLY
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math -I/usr/local/include $(X11_INCLUDES)
CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
ASM_SOURCES =
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -pthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11
# Directories
SRC_DIRS = mesa glu glut/glx glw glx/x11
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri
DRM_SOURCE_PATH=$(TOP)/../drm
# ffb and gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon tdfx \
unichrome savage sis

12
configs/freebsd-dri-x86 Normal file
View File

@@ -0,0 +1,12 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86
# Unnecessary on x86, generally.
PIC_FLAGS =
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
ASM_SOURCES = $(X86_SOURCES)

26
configs/hpux11-32 Normal file
View File

@@ -0,0 +1,26 @@
# Configuration for HPUX v11
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Aa +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

27
configs/hpux11-64 Normal file
View File

@@ -0,0 +1,27 @@
# Configuration for HPUX v11, 64-bit
include $(TOP)/configs/default
CONFIG_NAME = hpux11-64
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +DD64 +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Aa +DD64 +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
MKLIB_OPTIONS =
LIBDIR = $(TOP)/lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -10,7 +10,7 @@ CXX = g++
CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG
CXXFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
GLUT_CFLAGS = -fexceptions

View File

@@ -9,36 +9,45 @@ CONFIG_NAME = linux-dri
CC = gcc
CXX = g++
MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
WARN_FLAGS = -Wall
OPT_FLAGS = -O
SOURCE_FLAGS = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE
OPT_FLAGS = -O -g
PIC_FLAGS = -fPIC
CFLAGS = -DDRI_NEW_INTERFACE_ONLY $(WARN_FLAGS) -g $(OPT_FLAGS) $(ASM_FLAGS) \
-std=c99 $(PIC_FLAGS) -ffast-math $(SOURCE_FLAGS) -DPTHREADS \
-I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
CXXFLAGS = -DDRI_NEW_INTERFACE_ONLY $(WARN_FLAGS) -g $(OPT_FLAGS) -fPIC \
$(SOURCE_FLAGS)
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(ASM_FLAGS) -std=c99 $(PIC_FLAGS) -ffast-math \
$(DEFINES)
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) \
$(DEFINES)
ASM_SOURCES =
# Library/program dependencies
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
# Directories
SRC_DIRS = mesa glu glut/glx glw
SRC_DIRS = mesa glu glut/glx glw glx/x11
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri
# ffb and gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon tdfx \
unichrome savage sis
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \
savage sis tdfx trident unichrome

17
configs/linux-dri-ppc Normal file
View File

@@ -0,0 +1,17 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-ppc
OPT_FLAGS = -Os -mcpu=603
PIC_FLAGS = -fPIC
ASM_FLAGS = -DUSE_PPC_ASM -DUSE_VMX_ASM
ASM_SOURCES = $(PPC_SOURCES)
# Build only the drivers for cards that exist on PowerPC. At some point MGA
# will be added, but not yet.
DRI_DIRS = dri_client mach64 r128 r200 radeon tdfx

View File

@@ -9,21 +9,25 @@ CONFIG_NAME = linux-dri-x86-64
CC = gcc
CXX = g++
CFLAGS = -DDRI_NEW_INTERFACE_ONLY -m64 -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -D_GNU_SOURCE -D__AMD64__ -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -D_GNU_SOURCE -D__AMD64__
CXXFLAGS = -DDRI_NEW_INTERFACE_ONLY -m64 -Wall -g -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D__AMD64__
CFLAGS = -m64 -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math $(DEFINES)
CXXFLAGS = -m64 -Wall -g -ansi -pedantic -fPIC $(DEFINES)
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
#ASM_SOURCES = $(X86_SOURCES)
LIB_DIR = $(TOP)/lib64
# Library/program dependencies
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lm -lpthread -lexpat -ldl
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib64 -lXt -lX11
# Directories
SRC_DIRS = mesa glu glut/glx glw
SRC_DIRS = mesa glu glut/glx glw glx/x11
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri

View File

@@ -8,23 +8,24 @@ CONFIG_NAME = linux-solo
CC = gcc
CXX = g++
CCOMMON = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE
CFLAGS = $(CCOMMON) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CXXFLAGS = $(CCOMMON) -Wall -O3 -ansi -pedantic -fPIC
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
ASM_SOURCES = $(X86_SOURCES)
# Library/program dependencies
GL_LIB_DEPS = -lm -lpthread -lexpat -ldl
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
# Directories
SRC_DIRS = mesa glx glu glut/mini
SRC_DIRS = mesa glx/mini glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx

View File

@@ -8,20 +8,21 @@ CONFIG_NAME = linux-solo-ia64
CC = gcc
CXX = g++
CCOMMON = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE
CFLAGS = $(CCOMMON) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CXXFLAGS = $(CCOMMON) -Wall -O3 -ansi -pedantic -fPIC
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
# Library/program dependencies
GL_LIB_DEPS = -lm -lpthread -lexpat -ldl
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -lm -lpthread -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
# Directories
SRC_DIRS = mesa glx glu glut/mini
SRC_DIRS = mesa glx/mini glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx

View File

@@ -8,22 +8,23 @@ CONFIG_NAME = linux-solo-x86
CC = gcc
CXX = g++
CCOMMON = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS
CFLAGS = $(CCOMMON) -Wmissing-prototypes -O3 -g -std=c99 -Wundef -fPIC -ffast-math
CFLAGS = $(DEFINES) -Wmissing-prototypes -O3 -g -std=c99 -Wundef -fPIC -ffast-math
CXXFLAGS = $(CCOMMON) -Wall -O3 -ansi -pedantic -fPIC
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
ASM_SOURCES = $(X86_SOURCES)
# Library/program dependencies
GL_LIB_DEPS = -lm -lpthread -lexpat -ldl
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -lm -lpthread -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
# Directories
SRC_DIRS = mesa glx glu glut/mini
SRC_DIRS = mesa glx/mini glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx

View File

@@ -12,7 +12,7 @@ TCC_DIR=/home/progs/tcc-0.9.20
CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DUSE_TCC -I$(TCC_DIR)
CXXFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
GLUT_CFLAGS = -fexceptions

View File

@@ -13,6 +13,4 @@ CXXFLAGS = -O2 -std ansi -ieee
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -lXext -lXmu -lXi -lm
APP_LIB_DEPS = -L$(LIB_DIR) -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm

View File

@@ -3,49 +3,46 @@
Mesa-6.2 release notes:
-----------------------
Requirements:
-------------
1) Glide2 support has been ceased; please visit the Glide SourceForge and
help us improve Glide3.
2) The current release is a WIP; among other things, the Linux build works
only to some extent. Voodoo Rush not fully tested. Any help will be
appreciated.
3) Although Mesa is designed to work with any Glide3, it would benefit from
interacting with newer Glide libraries, which can export functions like:
`grGetRegistryOrEnvironmentStringExt', `grSetNumPendingBuffers', Texus2
and pointcast palette. The latest Glide3 can be reached here:
http://sourceforge.net/projects/glide/
A Voodoo-based videocard/accelerator
DOS (with DJGPP), Windows9x/2k (with MinGW), Linux
Glide3x library for your OS
Known supported HW/OS:
----------------------
Voodoo-based videocards/accelerators
DOS (DJGPP), Windows9x/2k (MinGW/MSVC), Linux
http://sourceforge.net/projects/glide/
How to compile:
---------------
DJGPP/MinGW:
DJGPP:
Place the Glide3 SDK in the top Mesa directory:
$(MESA)/glide3/include/*.h
$(MESA)/glide3/include/
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
$(MESA)/glide3/lib/
Required headers:
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
Required libraries:
OS specific
libgld3x.a, libgld3i.a, glide3x.dxe
Type:
make -f Makefile.DJ X86=1 FX=1
or
Look into the makefile for further information.
MinGW:
Place the Glide3 SDK in the top Mesa directory:
$(MESA)/glide3/include/
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
$(MESA)/glide3/lib/
libglide3x.a, glide3x.dll
Type:
make -f Makefile.mgw X86=1 FX=1
Look into the corresponding makefiles for further information.
Look into the makefile for further information.
Linux:
Place the Glide3 SDK in /usr/local/glide
/usr/local/glide/include/
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
/usr/local/glide/lib/
libglide3x.a, libglide3x.so
Type:
make linux-glide
or
@@ -63,12 +60,7 @@ FX_TRAP_GLIDE
FX_PACKEDCOLOR
use packed color in vertex structure
FX_TC_NAPALM
map GL_COMPRESSED_RGB[A] to FXT1. This will have effect on Napalm
only (can coexist with FX_TC_NCC, but has higher priority)
FX_TC_NCC
experimental
map GL_COMPRESSED_RGB[A] to NCC. This will have effect on any 3dfx
HW (can coexist with FX_TC_NAPALM, but has lesser priority)
map GL_COMPRESSED_RGB[A] to FXT1. Works with VSA100-based cards only.
FX_COMPRESS_S3TC_AS_FXT1_HACK
map S3TC to FXT1
FX_RESCALE_BIG_TEXURES_HACK
@@ -105,7 +97,7 @@ FX_GLIDE_SWAPPENDINGCOUNT
HW: all
Desc: max # of buffers allowed to build up
Note: (*) (!)
Value: "0", "1", "2" or "3"
Value: "0", "1", "2", "3", "4", "5" or "6"
FX_GLIDE_SWAPINTERVAL
OS: all
HW: all
@@ -148,7 +140,7 @@ MESA_FX_NOSNAP
OS: all
HW: Voodoo1, Rush, Banshee
Desc: do not snap vertices inside Mesa
Note: to be used with Glide3x that snaps vertices itself
Note: to be used with Glide3x that snaps vertices internally
MESA_FX_POINTCAST
OS: all
HW: dual-TMU cards (some Voodoo1, Voodoo2, Avenger, Napalm)
@@ -193,15 +185,25 @@ MESA_FX_MAXLOD
"9" - 512x512 textures
"10" - 1024x1024 textures
"11" - 2048x2048 textures
MESA_FX_ALLOW_VP
OS: all
HW: all
Desc: allow vertex program extensions
MESA_GLX_FX
OS: linux
HW: Voodoo1, Rush, Voodoo2
Desc: display mode
Note: (!) experimental: "w" may work in Win32 using non-V1/V2 HW
Note: (!) experimental
Value:
"w" - windowed mode
"f" - fullscreen mode
"d" - disable glide driver
OS: win32
HW: Rush, Banshee, Avenger, Napalm
Desc: display mode
Note: (!) experimental
Value:
"w" - windowed mode

View File

@@ -28,9 +28,11 @@ working. No optimizations have been made at this time.
* Compiling
Requirements:
- gcc version 2.95.3 for BeOS
You can find it here: http://www.bebits.com/app/2157
Since Mesa 6.x, it can be build under BeOS with both the R5 builtin gcc version
or more recent gcc versions available for BeOS, like this gcc version 2.95.3 for BeOS
you can find at http://www.bebits.com/app/2157.
Anyway, keep in mind that to take full advantage of Mesa x86 optimizations, you better
want to use gcc 2.95.3 or sooner versions...
To build Mesa-powered BeOS libGL.so version, open an Terminal window,
move to Mesa root folder and type this command:
@@ -111,6 +113,7 @@ cause a fatal error when running with Be's OpenGL.
Jake Hamby jhamby <at> anobject <dot> com
Marcin Konicki ahwayakchih <at> neoni <dot> net
Francois Revol revol <at> free <dot> fr
Nathan Whitehorn nathanw <at> uchicago <dot> edu
* Older BeOS Driver
@@ -131,4 +134,4 @@ as of February, 1999.
----------------------------------------------------------------------
$Id: README.BEOS,v 1.11 2004/08/24 08:31:57 phoudoin Exp $
$Id: README.BEOS,v 1.12 2004/10/13 00:35:55 phoudoin Exp $

View File

@@ -1,4 +1,4 @@
Mesa 6.1 DOS/DJGPP Port v1.6
Mesa 6.3 DOS/DJGPP Port v1.7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -6,7 +6,7 @@
Description:
~~~~~~~~~~~~
Well, guess what... this is the DOS port of Mesa 6.1, for DJGPP fans... Whoa!
Well, guess what... this is the DOS port of Mesa 6.3, for DJGPP fans... Whoa!
The driver has its origins in ddsample.c, written by Brian Paul and found by me
in Mesa 3.4.2.
@@ -59,7 +59,7 @@ Tested on:
CPU: AMD Athlon XP 1800+
Mainboard: GA-7VTXE w/ 512 MB DDRAM
Video card: Voodoo5 6000 AGP w/ 128 MB SDRAM
DJGPP: djdev 2.04 + gcc v3.3.2 + make v3.80
DJGPP: djdev 2.04 + gcc v3.4.3 + make v3.80
OS: DOS and Win98SE
@@ -91,8 +91,12 @@ FAQ:
2. Using Mesa for DJGPP
Q) Every test I tried crashes badly.
A) If you have compiled with SSE and you're running under plain DOS, you
have to disable SSE at run-time. See environment variables below.
Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
A) Is that a question? If you have a 3dfx Voodoo or higher card, you're
A) Is that a question? If you have a 3dfx Voodoo (any model), you're
lucky (check http://sourceforge.net/projects/glide for the DJGPP port).
If you haven't, sorry; everything is done in software. Suggestions?
@@ -134,7 +138,7 @@ FAQ:
struct {
int xres, yres;
int bpp;
} **l = malloc(n * sizeof(void **));
} **l = malloc(n * sizeof(void *));
Now pass the newly allocated buffer to fill in:
DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, (GLint *)l);
And collect the info:
@@ -194,6 +198,7 @@ Environment variables:
~~~~~~~~~~~~~~~~~~~~~~
DMESA_NULDRV - (any value) force NUL driver
GLUT_FPS - print frames/second statistics to stderr
MESA_NO_SSE - (any value) safe option under pure DOS
DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3)
DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8)
DMESA_GLUT_ALPHA - set default alpha bits (8)
@@ -257,6 +262,11 @@ v1.6 (aug-2004)
! fixed a horrible bug in VGA initialization routine
! fixed partial clears
v1.7 (???-2005)
+ enabled OpenGL 2.0 support
+ added support for sw texture compression
* minor rework
Contact:

View File

@@ -1,6 +1,6 @@
File: docs/README.WIN32
Last updated: Sep 18, 2003 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: Oct 01, 2004 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
@@ -14,16 +14,36 @@ The build system has been changed to use Microsoft Visual Studio project
workspaces and projects. Makefiles are no longer shipped or supported, but
can be generated from the projects using Visual Studio.
The workspace and project files were created with Visual Studio 6, so that
they can be used with VS6 and so that they can also be imported into VS 7.
Details and Notes
- To build the Mesa libraries, open the Mesa.dsw workspace file
in the top directory. You can build each project one-by-one,
or build the glut project to build everything except osmesa,
which needs to be built separately. The build process will
create a lib directory in the top directory and will put the
following files there:
OPENGL32.LIB, GLU32.LIB, GLUT32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, GLUT32.DLL, OSMESA32.DLL
in the top directory. You will need to build at least one
driver. Currently, only the gdi and osmesa drivers are available.
Select one or the other as the active project and build it.
If you want glu, select the glu project as active and build that as well.
- Glut is no longer in the Mesa.dsw workspace. It is now built in
the demo workspace (see below).
- The build process will create a lib directory in the top directory
and will put the following files there as you build them:
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
- Some users have reported problems building glu with VS7 after importing
and converting the VS6 project files. The problem is caused by a custom
build step that was put in place to work around a problem with VS6 not
recognizing .cc files as C++ source files. It appears that VS7 can be
configured to recognize .cc files as C++ files and so it compiles these
glu files with the default settings, and does not use settings that are
required to compile the files correctly. The easiest way to solve the
problem is to remove the .cc files from the glu project. This does not
delete the files, but removes them from the project so that VS does not
try to compile them at all. This allows the custom build step to compile
the files with the proper settings.
- After building, you can copy the above DLL files to a place in your PATH
such as $SystemRoot/SYSTEM32. If you don't like putting things in a
@@ -51,9 +71,6 @@ Details and Notes
- The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code.
- The osmesa driver builds and should work on Windows as well as
any other platform.
- The Windows driver (in src/Windows) builds and runs at least at
a minimal level. I modified this driver to work with the new
Mesa 4.0 code and driver architecture, but I did not do a great

View File

@@ -1,7 +1,7 @@
Mesa 6.2 release notes
Month, day, 2004
October 2, 2004
PLEASE READ!!!!
@@ -19,6 +19,19 @@ This release primarily just fixes bugs found in the Mesa 6.1 release.
See the VERSIONS file for details.
ToDo: PBO for polygon stipple, convolution filter, etc.
Known Issues
------------
The GL_EXT_pixel_buffer_object extension isn't fully implemented for
functions like glPolygonStipple, glConvolutionFilter, glColorTable,
etc. The important functions like glRead/DrawPixels, glTex[Sub]Image,
and glBitmap work with PBOs.
Driver Status
---------------------- ---------------------
@@ -36,4 +49,4 @@ D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.2,v 3.1 2004/08/22 17:43:31 brianp Exp $
$Id: RELNOTES-6.2,v 3.4 2004/10/02 15:43:14 brianp Exp $

50
docs/RELNOTES-6.2.1 Normal file
View File

@@ -0,0 +1,50 @@
Mesa 6.2.1 release notes
December 9, 2004
PLEASE READ!!!!
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.1) designate new developmental releases.
Even numbered versions (such as 6.2.x) designate stable releases.
This release primarily just fixes bugs found in the Mesa 6.2 release.
See the VERSIONS file for details.
Known Issues
------------
The GL_EXT_pixel_buffer_object extension isn't fully implemented for
functions like glPolygonStipple, glConvolutionFilter, glColorTable,
etc. The important functions like glRead/DrawPixels, glTex[Sub]Image,
and glBitmap work with PBOs. This has been fixed for Mesa 6.3.
Driver Status
---------------------- ---------------------
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA implements OpenGL 1.3
Wind River UGL implements OpenGL 1.3
Windows/Win32 implements OpenGL 1.5
DJGPP implements OpenGL 1.5
GGI implements OpenGL 1.3
BeOS implements OpenGL 1.5
Allegro needs updating
D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.2.1,v 3.1 2004/12/09 23:21:36 brianp Exp $

56
docs/RELNOTES-6.3 Normal file
View File

@@ -0,0 +1,56 @@
Mesa 6.3 release notes
month day, 2004
PLEASE READ!!!!
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.3) designate new developmental releases.
Even numbered versions (such as 6.2) designate stable releases.
New Features
------------
GL_ARB_draw_buffers - allows a fragment program to write to a number of
separate color buffers, instead of just one.
GL_OES_read_format - allows one to query the fastest glReadPixels format
and datatype.
To Do before release
--------------------
Fix dinoshade bug
Switch to freeglut
Increase MAX_DRAWBUFFERS
driver hooks for BeginQuery/EndQuery
Driver Status
---------------------- ---------------------
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA implements OpenGL 1.3
Wind River UGL implements OpenGL 1.3
Windows/Win32 implements OpenGL 1.5
DJGPP implements OpenGL 1.5
GGI implements OpenGL 1.3
BeOS implements OpenGL 1.5
Allegro needs updating
D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.3,v 3.6 2004/12/09 23:21:36 brianp Exp $

View File

@@ -1276,7 +1276,7 @@ Mesa Version History
- fixed a number of minor memory leaks (bug #1002030)
6.2 Month, day, 2004
6.2 October 2, 2004
New:
- enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
- updated Doxygen support (Jose Fonseca)
@@ -1293,3 +1293,35 @@ Mesa Version History
- repeated calls to glDeleteTexture(t) could lead to a crash
- fixed potential ref count bugs in VBOs and vertex/fragment programs
- spriteblast demo didn't handle window size changes correctly
- glTexSubImage didn't handle pixels=NULL correctly for PBOs
- fixed color index mode glDrawPixels bug (Karl Schultz)
6.2.1 December 9, 2004
Bug fixes:
- don't apply regular fog or color sum when using a fragment program
- glProgramEnvParameter4fARB always generated an error on
GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
- glVertexAttrib3svNV and glVertexAttrib3svARB were broken
- fixed width/height mix-up in glSeparableFilter2D()
- fixed regression in glCopyPixels + convolution
- glReadPixels from a clipped front color buffer didn't always work
- glTexImage didn't accept GL_RED/GREEN/BLUE as the format
- Attempting queries/accesses of VBO 0 weren't detected as errors
- paletted textures failed if the palette had fewer that 256 entries
Changes:
- fixed a bunch of compiler warnings found with gcc 3.4
- bug reports should to go bugzilla.freedesktop.org
6.3 Month day, 2004
New:
- GL_ARB_draw_buffers extension
- GL_OES_read_format extension (Ian Romanick)
- full support for GL_EXT_pixel_buffer_object (convolution filters,
polygon stipple, colormaps, etc)
Changes:
- added -stereo option for glxgears demo (Jacek Rosik)
Bug fixes:
fixes from 6.2.1, plus:
-

View File

@@ -7,9 +7,20 @@
<H1>Bug Database</H1>
<p>
Bug reports can be filed in the <a
href="http://sourceforge.net/bugs/?group_id=3" target="_parent">Bug
Database</a> on sourceforge.net. Please follow these guidelines:
The Mesa bug database is now hosted on
<a href="http://freedesktop.org" target="_parent">freedesktop.org</a>
instead of SourceForge.
</p>
<p>
To file a Mesa bug, go to
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"
target="_parent">
Bugzilla on freedesktop.org</a>
</p>
<p>
Please follow these bug reporting guidelines:
</p>
<ul>
@@ -21,7 +32,8 @@ Database</a> on sourceforge.net. Please follow these guidelines:
</ul>
<p>
Bug reports will automatically be forwarded to the Mesa developer's list.
Bug reports will automatically be forwarded to the Mesa developer's mailing
list.
</p>
<p>

View File

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

View File

@@ -15,25 +15,25 @@ code while a CVS branch has the latest stable code.
</p>
<p>
Currently (Nov 2003), the trunk is the Mesa 5.1 development code
while the mesa_5_0_branch branch has the stable Mesa 5.0.x code.
Currently (Oct 2004), the trunk is the Mesa 6.3 development code
while the mesa_6_2_branch branch has the stable Mesa 6.2.x code.
</p>
<p>
Mesa releases use an even/odd numbering scheme to represent stable/development
releases.
For example, Mesa 5.0.x (0 is considered even) is a stable release while
Mesa 5.1.x is a development release.
For example, Mesa 6.2 (0 is considered even) is a stable release while
Mesa 6.3 is a development release.
</p>
<p>
To checkout a specific CVS branch pass <code>-r</code> and
the branch tag after your CVS command.
For example <code>cvs checkout -r mesa_5_0_branch Mesa</code> will
checkout the 5.0.x branch and <code>cvs update -r
mesa_5_0_branch</code> will convert your current CVS tree to the 5.0.x
For example <code>cvs checkout -r mesa_6_2_branch Mesa</code> will
checkout the 6.2 branch and <code>cvs update -r
mesa_6_2_branch</code> will convert your current CVS tree to the 6.2
branch.
Consult <a href="http://www.durak.org/cvswebsites/doc/cvs_5.php3#SEC54"

View File

@@ -39,7 +39,7 @@ To add a new GL extension to Mesa you have to do at least the following.
extension is rather large, try to implement it in a new source file.
</li>
<li>
If hew extension adds new GL state, the functions in get.c, enable.c
If the new extension adds new GL state, the functions in get.c, enable.c
and attrib.c will most likely require new code.
</li>
</ul>
@@ -94,7 +94,7 @@ Constants and macros are ALL_UPPERCASE, with _ between words
</p>
<p>
Global vars not allowed.
Global variables are not allowed.
</p>
<p>
@@ -109,110 +109,85 @@ Function name examples:
</pre>
<H2>Writing a Device Driver</H2>
<p>
XXX to do
</p>
<H2>Making a New Mesa Release</H2>
<p>
These are the instructions for making a new Mesa release.
</p>
<H3>Get latest source files</H3>
<p>
Prerequisites (later versions may work):
</p>
<ul>
<li> autoconf 2.50
<li> automake 1.4-p2
<li> libtool 1.4
</ul>
<p>
Be sure to do a "cvs update -d ." in the Mesa directory to
get all the latest files.
Use "cvs update -dAP " to get the latest Mesa files from CVS.
</p>
<p>
Update the version definitions in src/version.h
</p>
<H3>Verify and update version info</H3>
<p>
Create/edit the docs/RELNOTES-X.Y file to document what's new in the release.
Edit the docs/VERSIONS file too.
Add the new RELNOTES-X.Y file to <a href="relnotes.html">relnotes.html</a>.
Update the docs/VERSIONS file too.
</p>
<p>
Edit Make-config and change the MESA_MAJOR and/or MESA_MINOR versions.
Edit configs/default and change the MESA_MAJOR, MESA_MINOR and MESA_TINY
version numbers.
</p>
<p>
Edit the GNU configure stuff to change versions numbers as needed:
Update the version string (second argument) in the line
"AM_INIT_AUTOMAKE(Mesa, 3.3)" in the configure.in file.
Make sure the values in src/mesa/main/version.h is correct.
</p>
<p>
Remove the leading `dnl' from the line "dnl AM_MAINTAINER_MODE".
Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and
DEMO_NAME are correct.
</p>
<p>
Verify the version numbers near the top of configure.in
Update the docs/news.html file and docs/contents.html files.
</p>
<p>
Run "fixam -f" to disable automatic dependency tracking.
Check in all updates to CVS.
</p>
<p>
Run the bootstrap script to generate the configure script.
Tag the CVS files with the release name (in the form <b>mesa_X_Y</b>).
</p>
<p>
Edit Makefile.X11 and verify DIRECTORY is set correctly. The Mesa
sources must be in that directory (or there must be a symbolic link).
</p>
<H3>Make the tarballs</H3>
<p>
Edit Makefile.X11 and verify that LIB_NAME and DEMO_NAME are correct.
If it's a beta release, be sure the bump up the beta release number.
</p>
<p>
cp Makefile.X11 to Makefile so that the old-style Mesa makefiles
still work. ./configure will overwrite it if that's what the user runs.
</p>
<p>
Make a symbolic link from $(DIRECTORY) to Mesa. For example,
ln -s Mesa Mesa-3.3 This is needed in order to make a correct
tar file in the next step.
Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
ln -s Mesa Mesa-6.3
This is needed in order to make a correct tar file in the next step.
</p>
<p>
Make the distribution files. From inside the Mesa directory:
<pre>
make -f Makefile.X11 lib_tar
make -f Makefile.X11 demo_tar
make -f Makefile.X11 lib_zip
make -f Makefile.X11 demo_zip
make tarballs
</pre>
<p>
After the tarballs are created, the md5 checksums for the files will
be computed.
Add them to the docs/news.html file.
</p>
<p>
Copy the distribution files to a temporary directory, unpack them,
compile everything, and run some demos to be sure everything works.
</p>
<H3>Update the website and announce the release</H3>
<p>
Upload the *.tar.gz and *.zip files to ftp.mesa3d.org
Follow the directions on SourceForge for creating a new "release" and
uploading the tarballs.
</p>
<p>
Update the web site.
Update the web site by copying the docs/ directory's files to
/home/users/b/br/brianp/mesa-www/htdocs/
</p>
<p>
@@ -224,17 +199,6 @@ and
</p>
<H2>Autoconf info</H2>
<p>
In order to run the bootstrap script you'll need:
<p>
<pre>
autoconf 2.50
automake 1.4-p5
libtool 1.4
</pre>
</body>
</html>

View File

@@ -7,7 +7,7 @@
<center>
<h1>Mesa Frequently Asked Questions</h1>
Last updated: 27 April 2004
Last updated: 17 November 2004
</center>
<br>
@@ -53,7 +53,7 @@ the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
are the modern ones.
</p>
<h2>1.3 What purpose does Mesa (software-based rendering) serve today?</h2>
<h2>1.3 What purpose does Mesa serve today?</h2>
<p>
Hardware-accelerated OpenGL implementations are available for most popular
operating systems today.
@@ -80,7 +80,39 @@ Still, Mesa serves at least these purposes:
</li>
</ul>
<h2>1.4 How do I upgrade my DRI installation to use a new Mesa release?</h2>
<h2>1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?</h2>
<p>
<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
On systems running the X Window System, it does all its rendering through
the Xlib API.
<ul>
<li>The GLX API is supported, but it's really just an emulation of the
real thing.
<li>The GLX wire protocol is not supported and there's no OpenGL extension
loaded by the X server.
<li>There is no hardware acceleration.
<li>The OpenGL library, libGL.so, contains everything (the programming API,
the GLX functions and all the rendering code).
</ul>
</p>
<p>
Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
within the DRI (Direct Rendering Infrastructure):
<ul>
<li>The libGL.so library provides the GL and GLX API functions, a GLX
protocol encoder, and a device driver loader.
<li>The device driver modules (such as r200_dri.so) contain a built-in
copy of the core Mesa code.
<li>The X server loads the GLX module.
The GLX module decodes incoming GLX protocol and dispatches the commands
to a rendering module.
For the DRI, this module is basically a software Mesa renderer.
</ul>
<h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
<p>
You don't! A copy of the Mesa source code lives inside the XFree86/DRI source
tree and gets compiled into the individual DRI driver modules.
@@ -100,7 +132,7 @@ if there's newer drivers.
</p>
<h2>1.5 Are there other open-source implementations of OpenGL?</h2>
<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
<p>
Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html"
target="_parent">
@@ -135,12 +167,13 @@ but it does export the OpenGL API. It allows tiled rendering, sort-last
rendering, etc.
</p>
<p>
There may be other open OpenGL implementations, but Mesa is the most
popular and feature-complete.
</p>
<br>
<br>
@@ -156,38 +189,24 @@ has Mesa packages (like RPM or DEB) which you can easily install.
</a></p>
<h2><a name="part2">2.2 Running <code>configure; make</code> Doesn't Work</a></h2>
<h2><a name="part2">2.2 Running <code>configure; make</code> doesn't Work</a></h2>
<p>
<a name="part2">Unfortunately, the GNU autoconf/automake/libtool system doesn't seem to work
too well on non GNU/Linux systems, even after installing gmake, gcc, etc.
For that reason, Mesa's <b>old-style</b> makefile system is still included.
The old-style system uses good old traditional Makefiles. Try the following:
</a></p><pre><a name="part2"> cd Mesa-x.y.z
cp Makefile.X11 Makefile
make
</a></pre>
<a name="part2">You'll see a list of system configurations from which to choose.
For example:
</a><pre><a name="part2"> make linux-x86
</a></pre>
<p>
<a name="part2">If you're experienced with GNU autoconf/automake/libtool and think you can help
with maintence, contact the Mesa developers.
FYI, the Mesa developers generally don't use the autoconf/automake system.
We're especially annoyed with the fact that a +5000-line script (libtool)
is needed to make shared libraries (ugh).
</a></p>
Mesa no longer supports GNU autoconf/automake. Why?
<ul>
<li>It seemed to seldom work on anything but Linux
<li>The config files were hard to maintain and hard to understand
<li>libtool caused a lot of grief
</ul>
<h2><a name="part2">2.3 Mesa still doesn't compile</a></h2>
<p>
<a name="part2">If the old-style Makefile system doesn't work either, make sure you have
the most recent version of Mesa.
Otherwise, file a bug report or post to the Mesa3d-users mailing list.
Give as much info as possible when describing your problem.
</a></p>
Now, Mesa again uses a conventional Makefile system (as it did originally).
Basically, each Makefile in the tree includes one of the configuration
files from the config/ directory.
The config files specify all the variables for a variety of popular systems.
</p>
<h2><a name="part2">2.4 I get undefined symbols such as bgnpolygon, v3f, etc...</a></h2>
<h2><a name="part2">2.3 I get undefined symbols such as bgnpolygon, v3f, etc...</a></h2>
<p>
<a name="part2">You're application is written in IRIS GL, not OpenGL.
IRIS GL was the predecessor to OpenGL and is a different thing (almost)
@@ -196,7 +215,7 @@ Mesa's not the solution.
</a></p>
<h2><a name="part2">2.5 Where is the GLUT library?</a></h2>
<h2><a name="part2">2.4 Where is the GLUT library?</a></h2>
<p>
<a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaDemos-x.y.z.tar.gz file.
If you don't already have GLUT installed, you should grab the MesaDemos
@@ -205,7 +224,7 @@ package and unpack it before compiling Mesa.
<h2><a name="part2">2.6 What's the proper place for the libraries and headers?</a></h2>
<h2><a name="part2">2.5 What's the proper place for the libraries and headers?</a></h2>
<p>
<a name="part2">On Linux-based systems you'll want to follow the
</a><a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html"

View File

@@ -36,7 +36,7 @@ Open SG PLUS</a> - a scene-graph library
</a> - a scene-graph library
<li><a href="http://www.openvrml.org/" target="_parent">OpenVRML</a>
- a VRML parsing/display library with "lookat" - an example VRML browser
<li><a href="http://www.woodsoup.org/projs/plib" target="_parent">PLIB</a> - A collection of portable games libraries, including an OpenGL GUI and a simple Scene Graph API
<li><a href="http://plib.sourceforge.net/" target="_parent">PLIB</a> - A collection of portable games libraries, including an OpenGL GUI and a simple Scene Graph API
<li><a href="ftp://ftp.troll.no/contest/Pryan-1.2.tar.gz" target="_parent">Pryan</a> - an OpenInventor-like toolkit
<li><a href="http://starship.python.net:9673/crew/da/Code/PyOpenGL" target="_parent">PyOpenGL</a> - OpenGL interface for Python
<li><a href="http://www.quesa.org/" target="_parent">Quesa</a> - QuickDraw3D-compatible library based on OpenGL, Mesa or Direct3D

View File

@@ -7,6 +7,78 @@
<H1>News</H1>
<h2>December 9, 2004</h2>
<p>
Mesa 6.2.1 has been released.
This is a stable release which just fixes bugs since the 6.2 release.
</p>
<pre>
Bug fixes:
- don't apply regular fog or color sum when using a fragment program
- glProgramEnvParameter4fARB always generated an error on
GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
- glVertexAttrib3svNV and glVertexAttrib3svARB were broken
- fixed width/height mix-up in glSeparableFilter2D()
- fixed regression in glCopyPixels + convolution
- glReadPixels from a clipped front color buffer didn't always work
- glTexImage didn't accept GL_RED/GREEN/BLUE as the format
- Attempting queries/accesses of VBO 0 weren't detected as errors
- paletted textures failed if the palette had fewer that 256 entries
Changes:
- fixed a bunch of compiler warnings found with gcc 3.4
- bug reports should to go bugzilla.freedesktop.org
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
80008a92f6e055d3bfdde2cf331ec3fa MesaLib-6.2.1.tar.gz
f43228cd2bf70f583ef3275c1c545421 MesaLib-6.2.1.tar.bz2
dec26cfd40116ad021020fea2d94f652 MesaLib-6.2.1.zip
2c7af3c986a7571c8713c8bfee7e49e3 MesaDemos-6.2.1.tar.gz
3cac74667b50bcbd4f67f594fb4224a2 MesaDemos-6.2.1.tar.bz2
75b3edd12eb2b370caf05f29b99e508a MesaDemos-6.2.1.zip
</pre>
<h2>October 2, 2004</h2>
<p>
Mesa 6.2 has been released.
This is a stable release which just fixes bugs since the 6.1 release.
</p>
<pre>
New:
- enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
- updated Doxygen support (Jose Fonseca)
Changes:
- some GGI driver updates (Christoph Egger, bug 1025977)
Bug fixes:
- Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features
- fixed a few compilation issues on IRIX
- fixed a matrix classification bug (reported by Wes Bethel)
- we weren't reseting the vertex/fragment program error state
before parsing (Dave Reveman)
- adjust texcoords for sampling texture rectangles (Dave Reveman)
- glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented
- repeated calls to glDeleteTexture(t) could lead to a crash
- fixed potential ref count bugs in VBOs and vertex/fragment programs
- spriteblast demo didn't handle window size changes correctly
- glTexSubImage didn't handle pixels=NULL correctly for PBOs
- fixed color index mode glDrawPixels bug (Karl Schultz)
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
9e8f34b059272dbb8e1f2c968b33bbf0 MesaLib-6.2.tar.gz
3d6a6362390b6a37d3cb2e615f3ac7db MesaLib-6.2.tar.bz2
6cfd7895d28e695c0dbbed9469564091 MesaLib-6.2.zip
3e06e33b0809f09855cb60883b8bdfef MesaDemos-6.2.tar.gz
9d160009c3dfdb35fe7e4088c9ba8f85 MesaDemos-6.2.tar.bz2
856f7ec947122eb3c8985ebc2f654dcd MesaDemos-6.2.zip
</pre>
<h2>August 18, 2004</h2>
<p>
Mesa 6.1 has been released.
@@ -886,6 +958,6 @@ source code</a>.</p>
<hr>
$Id: news.html,v 3.14 2004/08/18 22:41:09 brianp Exp $
$Id: news.html,v 3.16 2004/12/09 23:21:36 brianp Exp $
</body>
</html>

View File

@@ -10,6 +10,7 @@
Basically, FBconfigs and PBuffers allow you to do off-screen rendering
with OpenGL. The OSMesa interface does basically the same thing, but
fbconfigs and pbuffers are supported by more vendors.
PBuffer rendering may also be hardware accelerated.
</p>
<p>

View File

@@ -11,6 +11,8 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
<LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A>
<LI><A HREF="RELNOTES-6.2">RELNOTES-6.2</A>
<LI><A HREF="RELNOTES-6.1">RELNOTES-6.1</A>
<LI><A HREF="RELNOTES-6.0">RELNOTES-6.0</A>

View File

@@ -7,8 +7,8 @@
<H1>Utilities</H1>
<ul>
<li><a href="http://fox.mit.edu/skunk/soft/fsv/"
target="_parent">fvs</a> - 3D file system visualizer
<li><a href="http://fsv.sourceforge.net/"
target="_parent">fsv</a> - 3D file system visualizer
<li><a href="http://www.dgp.utoronto.ca/%7Emac/projects/glbiff.html"
target="_parent">glbiff</a> - GL version of xbiff

View File

@@ -23,9 +23,9 @@
*/
/*
* DOS/DJGPP device driver v1.6 for Mesa
* DOS/DJGPP device driver v1.7 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
* Copyright (C) 2002 - Daniel Borca
* Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
@@ -35,7 +35,7 @@
#define DMESA_H_included
#define DMESA_MAJOR_VERSION 6
#define DMESA_MINOR_VERSION 1
#define DMESA_MINOR_VERSION 3
/* Sample Usage:
*
@@ -138,7 +138,8 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
/*
* DMesa functions
*/
void *DMesaGetProcAddress (const char *name);
typedef void (*DMesaProc) (void);
DMesaProc DMesaGetProcAddress (const char *name);
/*
* DMesa state retrieval.

View File

@@ -38,8 +38,8 @@ extern "C" {
#endif
#define FXMESA_MAJOR_VERSION 5
#define FXMESA_MINOR_VERSION 0
#define FXMESA_MAJOR_VERSION 6
#define FXMESA_MINOR_VERSION 3
/*

View File

@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.2
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -38,8 +38,6 @@
*/
#if !defined(__SCITECH_SNAP__)
#include <stddef.h> /* to get ptrdiff_t, used below */
#if defined(__BEOS__)
#include <stdlib.h> /* to get some BeOS-isms */
#endif
@@ -53,9 +51,9 @@
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
@@ -64,11 +62,7 @@
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
# define GLAPI extern
# define GLAPIENTRY __stdcall
#else
/* non-Windows compilation */
# define GLAPI extern
# define GLAPIENTRY
#endif /* WIN32 / CYGWIN bracket */
#endif /* WIN32 && !CYGWIN */
#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
# define PRAGMA_EXPORT_SUPPORTED 1
@@ -95,10 +89,22 @@
#pragma import on
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#ifndef APIENTRY
#define APIENTRY GLAPIENTRY
#endif
/* "P" suffix for when function returns a pointer */
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif
#ifndef GLAPIENTRYP
#define GLAPIENTRYP GLAPIENTRY *
@@ -844,7 +850,7 @@ GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
GLAPI GLenum GLAPIENTRY glGetError( void );
GLAPI const GLubyte* GLAPIENTRY glGetString( GLenum name );
GLAPI const GLubyte GLAPIENTRYP glGetString( GLenum name );
GLAPI void GLAPIENTRY glFinish( void );
@@ -2226,6 +2232,17 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
#endif /* GL_ATI_blend_equation_separate */
/* As soon as the official glext.h is updated to include this, it will be
* removed from here.
*/
#ifndef GL_OES_read_format
#define GL_OES_read_format 1
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
#endif /* GL_OES_read_format */
/**
** NOTE!!!!! If you add new functions to this file, or update
** glext.h be sure to regenerate the gl_mangle.h file. See comments

View File

@@ -30,7 +30,6 @@
/* Internal symbols which may collide with other OpenGL implementations. */
#define __glCoreCreateContext __mglCoreCreateContext
#define __glCoreNopDispatch __mglCoreNopDispatch
#define gl__unused413 MANGLE(__unused413)
/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */

View File

@@ -75,7 +75,7 @@ extern "C" {
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
/* XXX This is from Win32's <process.h> */
# if !defined(_MSC_VER) && !defined(__cdecl)
# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
/* Define __cdecl for non-Microsoft compilers. */
# define __cdecl
# define GLUT_DEFINED___CDECL
@@ -108,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int);
and redifinition of Windows system defs, also removes requirement of
pretty much any standard windows header from this file */
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
# define GLUTAPIENTRY __stdcall
#else
# define GLUTAPIENTRY
@@ -664,7 +664,8 @@ GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
#endif
#if (GLUT_API_VERSION >= 5)
GLUTAPI void * GLUTAPIENTRY glutGetProcAddress(const char *procName);
typedef void (*GLUTproc)();
GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
#endif
/* GLUT font sub-API */

View File

@@ -331,6 +331,15 @@ typedef struct {
} GLXBufferClobberEventSGIX;
#endif
#if defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
#elif defined( __VMS )
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#endif
#ifndef GLX_VERSION_1_3
#define GLX_VERSION_1_3 1
#ifdef GLX_GLXEXT_PROTOTYPES
@@ -597,11 +606,6 @@ typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
#ifndef GLX_OML_sync_control
#define GLX_OML_sync_control 1
#if defined(__STDC_VERSION__)
#if __STDC_VERSION__ >= 199901L
/* Include ISO C99 integer types for OML_sync_control; need a better test */
#include <inttypes.h>
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
@@ -614,8 +618,6 @@ typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, i
typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
#endif /* C99 version test */
#endif /* STDC test */
#endif
#ifndef GLX_SGIX_hyperpipe_group
@@ -673,7 +675,6 @@ extern unsigned int glXGetAGPOffsetMESA (const void *);
typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -149,6 +149,8 @@ typedef GLboolean (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int s
int * backX, int * backY,
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
/* Test for the xf86dri.h header file */
#ifndef _XF86DRI_H_
extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen,
__DRIid context_id );
@@ -157,6 +159,7 @@ extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen,
extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen,
__DRIid drawable);
#endif
/*@}*/

View File

@@ -0,0 +1,94 @@
/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
/**
* \file sarea.h
* SAREA definitions.
*
* \author Kevin E. Martin <kevin@precisioninsight.com>
* \author Jens Owen <jens@tungstengraphics.com>
* \author Rickard E. (Rik) Faith <faith@valinux.com>
*/
/*
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2000 VA Linux Systems, 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.
*/
/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
#ifndef _SAREA_H_
#define _SAREA_H_
#include "xf86drm.h"
/* SAREA area needs to be at least a page */
#if defined(__alpha__)
#define SAREA_MAX 0x2000
#elif defined(__ia64__)
#define SAREA_MAX 0x10000 /* 64kB */
#else
/* Intel 830M driver needs at least 8k SAREA */
#define SAREA_MAX 0x2000
#endif
#define SAREA_MAX_DRAWABLES 256
#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
/**
* SAREA per drawable information.
*
* \sa _XF86DRISAREA.
*/
typedef struct _XF86DRISAREADrawable {
unsigned int stamp;
unsigned int flags;
} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
/**
* SAREA frame information.
*
* \sa _XF86DRISAREA.
*/
typedef struct _XF86DRISAREAFrame {
unsigned int x;
unsigned int y;
unsigned int width;
unsigned int height;
unsigned int fullscreen;
} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
/**
* SAREA definition.
*/
typedef struct _XF86DRISAREA {
/** first thing is always the DRM locking structure */
drmLock lock;
/** \todo Use readers/writer lock for drawable_lock */
drmLock drawable_lock;
XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
XF86DRISAREAFrameRec frame;
drm_context_t dummy_context;
} XF86DRISAREARec, *XF86DRISAREAPtr;
#endif

View File

@@ -32,7 +32,7 @@
#define _mesa_wgl_h_
#include <gl/gl.h>
#include <GL/gl.h>
#ifdef __cplusplus
extern "C" {
@@ -40,10 +40,10 @@ extern "C" {
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# define WGLAPI __declspec(dllexport)
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# define WGLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */

View File

@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
* Version: 4.1
* Version: 6.3
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2003 Brian Paul 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"),
@@ -60,8 +60,8 @@ extern "C" {
#include <GL/gl.h>
#define OSMESA_MAJOR_VERSION 4
#define OSMESA_MINOR_VERSION 1
#define OSMESA_MAJOR_VERSION 6
#define OSMESA_MINOR_VERSION 3
#define OSMESA_PATCH_VERSION 0
@@ -252,12 +252,18 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
/**
* This typedef is new in Mesa 6.3.
*/
typedef void (*OSMESAproc)();
/*
* Return pointer to the named function.
*
* New in Mesa 4.1
* Return OSMESAproc in 6.3.
*/
GLAPI void * GLAPIENTRY
GLAPI OSMESAproc GLAPIENTRY
OSMesaGetProcAddress( const char *funcName );

View File

@@ -50,7 +50,7 @@ extern "C" {
#endif
#include "gl\gl.h"
#include "GL/gl.h"
#if defined(_MSV_VER) && !defined(__GNUC__)
# pragma warning (disable:4273)

View File

@@ -87,8 +87,8 @@ extern struct Library *XLibBase;
#endif
#define XMESA_MAJOR_VERSION 4
#define XMESA_MINOR_VERSION 1
#define XMESA_MAJOR_VERSION 6
#define XMESA_MINOR_VERSION 3

View File

@@ -7,6 +7,8 @@ INCDIR = $(TOP)/include
OSMESA_LIBS = -L$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
OSMESA32_LIBS = -L$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME) $(LIB_DIR)/$(GLUT_LIB_NAME)
PROGS = \
@@ -88,3 +90,8 @@ readtex.h:
# special case: need the -lOSMesa library:
osdemo: osdemo.c
$(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
# another special case: need the -lOSMesa32 library:
osdemo32: osdemo32.c
$(CC) -I$(INCDIR) $(CFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@

View File

@@ -134,6 +134,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name spriteblast
End Project Dependency
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -146,6 +149,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -158,6 +164,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -170,6 +179,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -182,6 +194,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -194,6 +209,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -206,6 +224,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -218,6 +239,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -230,6 +254,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -242,6 +269,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -252,6 +282,21 @@ Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
Project: "glut"="..\..\..\src\glut\glx\glut.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
@@ -266,6 +311,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -278,6 +326,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -290,6 +341,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -302,6 +356,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -314,6 +371,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -326,6 +386,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -338,6 +401,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -350,6 +416,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -362,6 +431,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -374,6 +446,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -386,6 +461,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -398,6 +476,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -410,6 +491,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -422,6 +506,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -434,6 +521,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -446,6 +536,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -458,6 +551,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -470,6 +566,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -482,6 +581,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -494,6 +596,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -506,6 +611,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -518,6 +626,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -530,6 +641,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -542,6 +656,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -554,6 +671,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -566,6 +686,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -578,6 +701,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -590,6 +716,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -602,6 +731,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -614,6 +746,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -626,6 +761,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################

View File

@@ -217,7 +217,7 @@ static void Init( void )
"MUL normal, fragment.texcoord[0], len.y; \n"
"# Compute dot product of light direction and normal vector\n"
"DP3 dotProd, lightDir, normal; \n"
"DP3_SAT dotProd, lightDir, normal; # limited to [0,1]\n"
"MUL diffuseColor, Diffuse, dotProd; # diffuse attenuation\n"

View File

@@ -241,16 +241,16 @@ static void SpecialKey( int key, int x, int y )
}
static void Init( GLboolean ciMode )
static void Init( GLboolean ciMode, const char *filename )
{
static const GLfloat fogColor[4] = {0, 1, 0, 0};
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
Image = LoadRGBImage( IMAGE_FILE, &ImgWidth, &ImgHeight, &ImgFormat );
Image = LoadRGBImage( filename, &ImgWidth, &ImgHeight, &ImgFormat );
if (!Image) {
printf("Couldn't read %s\n", IMAGE_FILE);
printf("Couldn't read %s\n", filename);
exit(0);
}
@@ -320,9 +320,15 @@ static void Usage(void)
int main( int argc, char *argv[] )
{
GLboolean ciMode = GL_FALSE;
const char *filename = IMAGE_FILE;
int i = 1;
if (argc > 1 && strcmp(argv[1], "-ci")==0) {
if (argc > i && strcmp(argv[i], "-ci")==0) {
ciMode = GL_TRUE;
i++;
}
if (argc > i) {
filename = argv[i];
}
glutInit( &argc, argv );
@@ -336,7 +342,7 @@ int main( int argc, char *argv[] )
glutCreateWindow(argv[0]);
Init(ciMode);
Init(ciMode, filename);
Usage();
glutReshapeFunc( Reshape );

View File

@@ -180,7 +180,7 @@ static void Init( void )
"MUL R1, f[TEX0], R1.y;\n"
"# Compute dot product of light direction and normal vector\n"
"DP3 R2, R0, R1;"
"DP3_SAT R2, R0, R1;"
"MUL R3, Diffuse, R2; # diffuse attenuation\n"

View File

@@ -207,6 +207,8 @@ Key( unsigned char key, int x, int y )
static void
Init( GLboolean ciMode )
{
GLboolean have_read_format = GL_FALSE;
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
@@ -234,6 +236,20 @@ Init( GLboolean ciMode )
}
}
#ifdef GL_OES_read_format
if ( glutExtensionSupported( "GL_OES_read_format" ) ) {
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES, (GLint *) &ReadType);
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES, (GLint *) &ReadFormat);
have_read_format = GL_TRUE;
}
#endif
printf( "GL_OES_read_format %ssupported. "
"Using type / format = 0x%04x / 0x%04x\n",
(have_read_format) ? "" : "not ",
ReadType, ReadFormat );
printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

View File

@@ -47,7 +47,7 @@ clean:
depend: $(SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null 2>&1
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
# Emacs tags

View File

@@ -20,9 +20,9 @@
# 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.
# DOS/DJGPP samples makefile v1.5 for Mesa
# DOS/DJGPP samples makefile v1.6 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -58,7 +58,7 @@ GLIDE ?= $(TOP)/glide3
CC = gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
CFLAGS += -I$(TOP)/include -I../util
CFLAGS += -DGLUT_IMPORT_LIB
ifeq ($(FX),1)

View File

@@ -20,9 +20,9 @@
# 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.
# MinGW samples makefile v1.1 for Mesa
# MinGW samples makefile v1.2 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -48,7 +48,7 @@ CPU ?= pentium
CC = mingw32-gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
CFLAGS += -I$(TOP)/include -I../util
ifeq ($(FX),1)
CFLAGS += -DFX

View File

@@ -31,12 +31,14 @@ SOURCES = antialias.c \
getprocaddress.c \
manytex.c \
multipal.c \
no_s3tc.c \
packedpixels.c \
pbo.c \
projtex.c \
seccolor.c \
sharedtex.c \
stencilwrap.c \
stencil_wrap.c \
tex1d.c \
texline.c \
texrect.c \
@@ -86,7 +88,7 @@ clean:
# auto code generation
getprocaddress: getprocaddress.c getproclist.h
getproclist.h: $(TOP)/src/mesa/glapi/APIspec getprocaddress.c getprocaddress.py
getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
python getprocaddress.py > getproclist.h

View File

@@ -70,10 +70,13 @@ class results:
def compare_results(self, other):
for name in self.cycles:
if other.cycles.has_key(name):
a = float(self.cycles[name]) / self.iterations
b = float(other.cycles[name]) / other.iterations
p = (100.0 * b / a) - 100.0
print "%- 20s %7.2f - %7.2f = % -6.2f (%+.1f%%)" % (name, a, b, a - b, p)
a = float(self.cycles[name]) / float(self.iterations)
b = float(other.cycles[name]) / float(other.iterations)
if abs( a ) < 0.000001:
print "a = %f, b = %f" % (a, b)
else:
p = (100.0 * b / a) - 100.0
print "%- 20s %7.2f - %7.2f = % -6.2f (%+.1f%%)" % (name, a, b, a - b, p)
return

258
progs/tests/ext422square.c Normal file
View File

@@ -0,0 +1,258 @@
/*
* Exercise the EXT_422_pixels extension, a less convenient
* alternative to MESA_ycbcr_texture. Requires ARB_fragment_program
* to perform the final YUV->RGB conversion.
*
* Brian Paul 13 September 2002
* Keith Whitwell 30 November 2004
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glut.h>
#include <assert.h>
#include "../util/readtex.c" /* I know, this is a hack. */
#define TEXTURE_FILE "../images/tile.rgb"
static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
static GLint ImgWidth, ImgHeight;
static GLushort *ImageYUV = NULL;
static const GLuint yuvObj = 100;
static const GLuint rgbObj = 101;
static void Init( int argc, char *argv[] );
static void DrawObject(void)
{
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(-1.0, -1.0);
glTexCoord2f(1, 0);
glVertex2f(1.0, -1.0);
glTexCoord2f(1, 1);
glVertex2f(1.0, 1.0);
glTexCoord2f(0, 1);
glVertex2f(-1.0, 1.0);
glEnd();
}
static void Display( void )
{
static int firsttime = 1;
if (firsttime) {
firsttime = 0;
Init( 0, 0 ); /* don't ask */
}
glClear( GL_COLOR_BUFFER_BIT );
glBindTexture(GL_TEXTURE_2D, yuvObj);
glPushMatrix();
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glTranslatef( -1.1, 0.0, -15.0 );
glRotatef(Xrot, 1.0, 0.0, 0.0);
glRotatef(Yrot, 0.0, 1.0, 0.0);
glRotatef(Zrot, 0.0, 0.0, 1.0);
glBindTexture(GL_TEXTURE_2D, yuvObj);
DrawObject();
glPopMatrix();
glPushMatrix();
glDisable(GL_FRAGMENT_PROGRAM_ARB);
glTranslatef( 1.1, 0.0, -15.0 );
glRotatef(Xrot, 1.0, 0.0, 0.0);
glRotatef(Yrot, 0.0, 1.0, 0.0);
glRotatef(Zrot, 0.0, 0.0, 1.0);
glBindTexture(GL_TEXTURE_2D, rgbObj);
DrawObject();
glPopMatrix();
glutSwapBuffers();
}
static void Reshape( int width, int height )
{
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -1.1, 1.1, -1.1, 1.1, 10.0, 100.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -15.0 );
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void SpecialKey( int key, int x, int y )
{
float step = 3.0;
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
Xrot += step;
break;
case GLUT_KEY_DOWN:
Xrot -= step;
break;
case GLUT_KEY_LEFT:
Yrot += step;
break;
case GLUT_KEY_RIGHT:
Yrot -= step;
break;
}
glutPostRedisplay();
}
/* #define LINEAR_FILTER */
static void Init( int argc, char *argv[] )
{
const char *file;
const GLfloat yuvtorgb[16] = {
1.164, 1.164, 1.164, 0,
0, -.391, 2.018, 0,
1.596, -.813, 0.0, 0,
(-.0625*1.164 + -.5*1.596), (-.0625*1.164 + -.5*-.813 + -.5*-.391), (-.0625*1.164 + -.5*2.018), 1
};
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
if (!glutExtensionSupported("GL_EXT_422_pixels")) {
printf("Error: GL_EXT_422_pixels not supported!\n");
exit(1);
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
file = TEXTURE_FILE;
/* Load the texture as YCbCr.
*/
glBindTexture(GL_TEXTURE_2D, yuvObj);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
ImageYUV = LoadYUVImage(file, &ImgWidth, &ImgHeight );
if (!ImageYUV) {
printf("Couldn't read %s\n", TEXTURE_FILE);
exit(0);
}
glTexImage2D(GL_TEXTURE_2D, 0,
GL_RGB,
ImgWidth, ImgHeight, 0,
GL_422_EXT,
GL_UNSIGNED_BYTE, ImageYUV);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
{
static const char *modulateYUV =
"!!ARBfp1.0\n"
"TEMP R0;\n"
"TEX R0, fragment.texcoord[0], texture[0], 2D; \n"
"ADD R0, R0, {-0.0625, -0.5, -0.5, 0.0}; \n"
"DP3 result.color.x, R0, {1.164, 1.596, 0.0}; \n"
"DP3 result.color.y, R0, {1.164, -0.813, -0.391}; \n"
"DP3 result.color.z, R0, {1.164, 0.0, 2.018}; \n"
"MOV result.color.w, R0.w; \n"
"END"
;
GLuint modulateProg;
/* Setup the fragment program */
glGenProgramsARB(1, &modulateProg);
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
strlen(modulateYUV), (const GLubyte *)modulateYUV);
printf("glGetError = 0x%x\n", (int) glGetError());
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
assert(glIsProgramARB(modulateProg));
}
/* Now the same, but use a color matrix to do the conversion at
* upload time:
*/
glBindTexture(GL_TEXTURE_2D, rgbObj);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glMatrixMode( GL_COLOR_MATRIX );
glLoadMatrixf( yuvtorgb );
glTexImage2D(GL_TEXTURE_2D, 0,
GL_RGB,
ImgWidth, ImgHeight, 0,
GL_422_EXT,
GL_UNSIGNED_BYTE, ImageYUV);
glLoadIdentity();
glMatrixMode( GL_MODELVIEW );
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glShadeModel(GL_FLAT);
glClearColor(0.3, 0.3, 0.4, 1.0);
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowSize( 300, 300 );
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
glutMainLoop();
return 0;
}

View File

@@ -35,10 +35,12 @@
#include <math.h>
typedef void (*generic_func)();
#define EQUAL(X, Y) (fabs((X) - (Y)) < 0.001)
static GLboolean
test_ActiveTextureARB(void *func)
test_ActiveTextureARB(generic_func func)
{
PFNGLACTIVETEXTUREARBPROC activeTexture = (PFNGLACTIVETEXTUREARBPROC) func;
GLint t;
@@ -52,7 +54,7 @@ test_ActiveTextureARB(void *func)
static GLboolean
test_SecondaryColor3fEXT(void *func)
test_SecondaryColor3fEXT(generic_func func)
{
PFNGLSECONDARYCOLOR3FEXTPROC secColor3f = (PFNGLSECONDARYCOLOR3FEXTPROC) func;
GLfloat color[4];
@@ -66,7 +68,7 @@ test_SecondaryColor3fEXT(void *func)
static GLboolean
test_ActiveStencilFaceEXT(void *func)
test_ActiveStencilFaceEXT(generic_func func)
{
PFNGLACTIVESTENCILFACEEXTPROC activeFace = (PFNGLACTIVESTENCILFACEEXTPROC) func;
GLint face;
@@ -80,7 +82,7 @@ test_ActiveStencilFaceEXT(void *func)
static GLboolean
test_VertexAttrib1fvARB(void *func)
test_VertexAttrib1fvARB(generic_func func)
{
PFNGLVERTEXATTRIB1FVARBPROC vertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -97,7 +99,7 @@ test_VertexAttrib1fvARB(void *func)
}
static GLboolean
test_VertexAttrib4NubvARB(void *func)
test_VertexAttrib4NubvARB(generic_func func)
{
PFNGLVERTEXATTRIB4NUBVARBPROC vertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -115,7 +117,7 @@ test_VertexAttrib4NubvARB(void *func)
static GLboolean
test_VertexAttrib4NuivARB(void *func)
test_VertexAttrib4NuivARB(generic_func func)
{
PFNGLVERTEXATTRIB4NUIVARBPROC vertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -133,7 +135,7 @@ test_VertexAttrib4NuivARB(void *func)
static GLboolean
test_VertexAttrib4ivARB(void *func)
test_VertexAttrib4ivARB(generic_func func)
{
PFNGLVERTEXATTRIB4IVARBPROC vertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -151,7 +153,7 @@ test_VertexAttrib4ivARB(void *func)
static GLboolean
test_VertexAttrib4NsvARB(void *func)
test_VertexAttrib4NsvARB(generic_func func)
{
PFNGLVERTEXATTRIB4NSVARBPROC vertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -169,7 +171,7 @@ test_VertexAttrib4NsvARB(void *func)
static GLboolean
test_VertexAttrib4NusvARB(void *func)
test_VertexAttrib4NusvARB(generic_func func)
{
PFNGLVERTEXATTRIB4NUSVARBPROC vertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -187,7 +189,7 @@ test_VertexAttrib4NusvARB(void *func)
static GLboolean
test_VertexAttrib4ubNV(void *func)
test_VertexAttrib4ubNV(generic_func func)
{
PFNGLVERTEXATTRIB4UBNVPROC vertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC) func;
PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
@@ -205,7 +207,7 @@ test_VertexAttrib4ubNV(void *func)
static GLboolean
test_VertexAttrib2sNV(void *func)
test_VertexAttrib2sNV(generic_func func)
{
PFNGLVERTEXATTRIB2SNVPROC vertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC) func;
PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
@@ -223,7 +225,7 @@ test_VertexAttrib2sNV(void *func)
static GLboolean
test_VertexAttrib3fNV(void *func)
test_VertexAttrib3fNV(generic_func func)
{
PFNGLVERTEXATTRIB3FNVPROC vertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC) func;
PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
@@ -241,7 +243,7 @@ test_VertexAttrib3fNV(void *func)
static GLboolean
test_VertexAttrib4dvNV(void *func)
test_VertexAttrib4dvNV(generic_func func)
{
PFNGLVERTEXATTRIB4DVNVPROC vertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC) func;
PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
@@ -308,7 +310,7 @@ check_functions( const char *extensions )
passes = 0;
}
else if (doTests) {
void *funcPtr = (void *) glXGetProcAddressARB((const GLubyte *) entry->name);
generic_func funcPtr = (generic_func) glXGetProcAddressARB((const GLubyte *) entry->name);
if (funcPtr) {
if (entry->test) {
GLboolean b;

View File

@@ -1,39 +1,17 @@
#!/usr/bin/env python
# $Id: getprocaddress.py,v 1.3 2003/06/10 14:54:37 brianp Exp $
# $Id: getprocaddress.py,v 1.6 2004/11/27 19:57:46 brianp Exp $
# Helper for the getprocaddress.c test.
from xml.sax import saxutils
from xml.sax import make_parser
from xml.sax.handler import feature_namespaces
import re, string
def PrintHead():
print """
struct name_test_pair {
const char *name;
GLboolean (*test)(void *);
};
static struct name_test_pair functions[] = {"""
def PrintTail():
print"""
{ NULL, NULL }
};
"""
def HaveTest(function):
testFuncs = [
"glActiveTextureARB",
"glSampleCoverageARB"
]
if function in testFuncs:
return 1
else:
return 0
import sys, getopt, re
sys.path.append("../../src/mesa/glapi/" )
import gl_XML
import license
def FindTestFunctions():
@@ -52,45 +30,66 @@ def FindTestFunctions():
return functions
def PrintFunctions(specFile, tests):
class PrintExports(gl_XML.FilterGLAPISpecBase):
name = "gl_exports.py (from Mesa)"
# init some vars
prevCategory = ''
funcName = ''
def __init__(self):
gl_XML.FilterGLAPISpecBase.__init__(self)
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
self.tests = FindTestFunctions()
self.prevCategory = ""
f = open(specFile)
for line in f.readlines():
def printRealHeader(self):
print """
struct name_test_pair {
const char *name;
GLboolean (*test)(generic_func);
};
static struct name_test_pair functions[] = {"""
# split line into tokens
tokens = string.split(line)
def printRealFooter(self):
print"""
{ NULL, NULL }
};
"""
if len(tokens) > 0 and line[0] != '#':
if tokens[0] == 'name':
if funcName != '':
if category != prevCategory:
print ' { "-%s", NULL},' % category
prevCategory = category
if funcName in tests:
test = "test_%s" % funcName
else:
test = "NULL"
print ' { "gl%s", %s },' % (funcName, test)
funcName = tokens[1]
elif tokens[0] == 'category':
category = tokens[1]
#endif
#endif
#endfor
#enddef
def printFunction(self, f):
if f.category != self.prevCategory:
print ' { "-%s", NULL},' % f.category
self.prevCategory = f.category
if f.name in self.tests:
test = "test_%s" % f.name
else:
test = "NULL"
print ' { "gl%s", %s },' % (f.name, test)
return
tests = FindTestFunctions()
PrintHead()
PrintFunctions("../../src/mesa/glapi/APIspec", tests)
PrintTail()
if __name__ == '__main__':
file_name = "../../src/mesa/glapi/gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
show_usage()
for (arg,val) in args:
if arg == "-f":
file_name = val
dh = PrintExports()
parser = make_parser()
parser.setFeature(feature_namespaces, 0)
parser.setContentHandler(dh)
f = open(file_name)
parser.parse(f)
dh.printHeader()
dh.printFunctions()
dh.printFooter()

97
progs/tests/no_s3tc.c Normal file
View File

@@ -0,0 +1,97 @@
/*
* (C) Copyright IBM Corporation 2004
* 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
* VA LINUX SYSTEM, 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.
*/
/**
* \file no_s3tc.c
* Test program to verify the behavior of an OpenGL implementation when
* an application calls \c glCompressedTexImage2D with an unsupported (but
* valid) compression format. The most common example is calling it with
* \c GL_COMPRESSED_RGBA_S3TC_DXT1_EXT when GL_EXT_texture_compression_s3tc
* is not supported.
*
* This tests Mesa bug #1028405.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/glut.h>
#include <GL/glext.h>
static unsigned data[16];
int
main( int argc, char ** argv )
{
float gl_version;
GLenum format;
GLuint size;
GLuint width;
GLenum err;
glutInit( & argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 300, 300 );
glutCreateWindow( "No S3TC Test" );
gl_version = strtod( (const char *) glGetString( GL_VERSION ), NULL );
if ( ! glutExtensionSupported( "GL_ARB_texture_compression" )
&& (gl_version < 1.3) ) {
fprintf( stderr, "Either OpenGL 1.3 or GL_ARB_texture_compression "
"must be supported.\n" );
return( EXIT_SUCCESS );
}
if ( ! glutExtensionSupported( "GL_EXT_texture_compression_s3tc" ) ) {
format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
width = 4;
size = 8;
}
else if ( ! glutExtensionSupported( "GL_3DFX_texture_compression_FXT1" ) ) {
format = GL_COMPRESSED_RGBA_FXT1_3DFX;
width = 8;
size = 16;
}
else {
fprintf( stderr, "Either GL_EXT_texture_compression_s3tc or "
"GL_3DFX_texture_compression_FXT1 must NOT be supported.\n" );
return( EXIT_SUCCESS );
}
glCompressedTexImage2D( GL_TEXTURE_2D, 0, format, width, 4, 0,
size, data );
err = glGetError();
if ( err != GL_INVALID_ENUM ) {
fprintf( stderr, "GL error 0x%04x should have been generated, but "
"0x%04x was generated instead.\n", GL_INVALID_ENUM, err );
}
return (err == GL_INVALID_ENUM) ? EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@@ -103,6 +103,7 @@ Display( void )
/*** Draw from the DrawPBO */
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, 0);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
/* do readpixels, drawpixels */
glRasterPos2i(BPosX, 5);
@@ -138,6 +139,7 @@ Display( void )
/*** draw from the Temp PBO */
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, TempPBO);
glDrawPixels(ImgWidth, ImgHeight, ReadFormat, ReadType, 0);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
/* do copypixels */
glRasterPos2i(CPosX, 5);

257
progs/tests/stencil_wrap.c Normal file
View File

@@ -0,0 +1,257 @@
/*
* (C) Copyright IBM Corporation 2004
* 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
* VA LINUX SYSTEM, 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.
*/
/**
* \file stencil_wrap.c
*
* Simple test of GL_EXT_stencil_wrap functionality. Four squares are drawn
* with different stencil modes, but all should be rendered with the same
* final color.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
static int Width = 550;
static int Height = 200;
static const GLfloat Near = 5.0, Far = 25.0;
static void Display( void )
{
GLint max_stencil;
GLint stencil_bits;
unsigned i;
glGetIntegerv( GL_STENCIL_BITS, & stencil_bits );
max_stencil = (1U << stencil_bits) - 1;
printf( "Stencil bits = %u, maximum stencil value = 0x%08x\n",
stencil_bits, max_stencil );
glClearStencil( 0 );
glClearColor( 0.2, 0.2, 0.8, 0 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
| GL_STENCIL_BUFFER_BIT );
glPushMatrix();
/* This is the "reference" square.
*/
glDisable(GL_STENCIL_TEST);
glTranslatef(-6.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glEnable(GL_STENCIL_TEST);
/* Draw the first two squares using the two non-wrap (i.e., saturate)
* modes.
*/
glStencilFunc(GL_ALWAYS, 0, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
glTranslatef(3.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.9, 0.9, 0.9 );
for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
}
glEnd();
glStencilFunc(GL_EQUAL, max_stencil, ~0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glStencilFunc(GL_ALWAYS, 0, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_DECR);
glTranslatef(3.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.9, 0.9, 0.9 );
for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
}
glEnd();
glStencilFunc(GL_EQUAL, 0, ~0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
/* Draw the last two squares using the two wrap modes.
*/
glStencilFunc(GL_ALWAYS, 0, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP);
glTranslatef(3.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.9, 0.9, 0.9 );
for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
}
glEnd();
glStencilFunc(GL_EQUAL, 4, ~0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glStencilFunc(GL_ALWAYS, 0, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP);
glTranslatef(3.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.9, 0.9, 0.9 );
for ( i = 0 ; i < 5 ; i++ ) {
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
}
glEnd();
glStencilFunc(GL_EQUAL, (max_stencil - 4), ~0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glPopMatrix();
glutSwapBuffers();
}
static void Reshape( int width, int height )
{
GLfloat ar = (float) width / (float) height;
Width = width;
Height = height;
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -15.0 );
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void Init( void )
{
const char * const ver_string = (const char * const)
glGetString( GL_VERSION );
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", ver_string);
if ( !glutExtensionSupported("GL_EXT_stencil_wrap")
&& (atof( ver_string ) < 1.4) ) {
printf("Sorry, this program requires either GL_EXT_stencil_wrap or OpenGL 1.4.\n");
exit(1);
}
printf("\nAll 5 squares should be the same color.\n");
glEnable( GL_BLEND );
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
glutCreateWindow( "GL_EXT_stencil_wrap test" );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
Init();
glutMainLoop();
return 0;
}

View File

@@ -25,6 +25,7 @@
*
* Command line options:
* -info print GL implementation information
* -stereo use stereo enabled GLX visual
*
*/
@@ -84,6 +85,12 @@ static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
static GLboolean fullscreen = GL_FALSE; /* Create a single fullscreen window */
static GLboolean stereo = GL_FALSE; /* Enable stereo. */
static GLfloat eyesep = 5.0; /* Eye separation. */
static GLfloat fix_point = 40.0; /* Fixation point distance. */
static GLfloat left, right, asp; /* Stereo frustum params. */
/*
*
@@ -225,7 +232,7 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
static void
draw(void)
do_draw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -255,21 +262,69 @@ draw(void)
glPopMatrix();
}
static void
draw(void)
{
if (stereo) {
/* First left eye. */
glDrawBuffer(GL_BACK_LEFT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(left, right, -asp, asp, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslated(+0.5 * eyesep, 0.0, 0.0);
do_draw();
glPopMatrix();
/* Then right eye. */
glDrawBuffer(GL_BACK_RIGHT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-right, -left, -asp, asp, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslated(-0.5 * eyesep, 0.0, 0.0);
do_draw();
glPopMatrix();
} else
do_draw();
}
/* new window size or exposure */
static void
reshape(int width, int height)
{
GLfloat h = (GLfloat) height / (GLfloat) width;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
if (stereo) {
GLfloat w;
asp = (GLfloat) height / (GLfloat) width;
w = fix_point * (1.0 / 5.0);
left = -5.0 * ((w - 0.5 * eyesep) / fix_point);
right = 5.0 * ((w + 0.5 * eyesep) / fix_point);
} else {
GLfloat h = (GLfloat) height / (GLfloat) width;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
}
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -40.0);
}
static void
@@ -318,13 +373,21 @@ make_window( Display *dpy, const char *name,
int x, int y, int width, int height,
Window *winRet, GLXContext *ctxRet)
{
int attrib[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
None };
int attribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
None };
int stereoAttribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
GLX_STEREO,
None };
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
@@ -336,9 +399,22 @@ make_window( Display *dpy, const char *name,
scrnum = DefaultScreen( dpy );
root = RootWindow( dpy, scrnum );
visinfo = glXChooseVisual( dpy, scrnum, attrib );
if (fullscreen) {
x = 0; y = 0;
width = DisplayWidth( dpy, scrnum );
height = DisplayHeight( dpy, scrnum );
}
if (stereo)
visinfo = glXChooseVisual( dpy, scrnum, stereoAttribs );
else
visinfo = glXChooseVisual( dpy, scrnum, attribs );
if (!visinfo) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");
if (stereo) {
printf("Error: couldn't get an RGB, "
"Double-buffered, Stereo visual\n");
} else
printf("Error: couldn't get an RGB, Double-buffered visual\n");
exit(1);
}
@@ -347,7 +423,8 @@ make_window( Display *dpy, const char *name,
attr.border_pixel = 0;
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
attr.override_redirect = fullscreen;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
win = XCreateWindow( dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
@@ -424,6 +501,8 @@ event_loop(Display *dpy, Window win)
/* next frame */
angle += 2.0;
if (angle > 3600.0)
angle -= 3600.0;
draw();
glXSwapBuffers(dpy, win);
@@ -458,7 +537,7 @@ main(int argc, char *argv[])
Display *dpy;
Window win;
GLXContext ctx;
char *dpyName = ":0";
char *dpyName = NULL;
GLboolean printInfo = GL_FALSE;
int i;
@@ -470,11 +549,20 @@ main(int argc, char *argv[])
else if (strcmp(argv[i], "-info") == 0) {
printInfo = GL_TRUE;
}
else if (strcmp(argv[i], "-stereo") == 0) {
stereo = GL_TRUE;
}
else if (strcmp(argv[i], "-fullscreen") == 0) {
fullscreen = GL_TRUE;
}
else
printf("Warrning: unknown parameter: %s\n", argv[i]);
}
dpy = XOpenDisplay(dpyName);
if (!dpy) {
printf("Error: couldn't open display %s\n", dpyName);
printf("Error: couldn't open display %s\n",
dpyName ? dpyName : getenv("DISPLAY"));
return -1;
}

View File

@@ -138,7 +138,6 @@ static int
Setup(int width, int height)
{
#if defined(GLX_VERSION_1_3) || defined(GLX_VERSION_1_4)
XVisualInfo *visInfo;
GLXContext glCtx;
/* Open the X display */
@@ -175,7 +174,6 @@ Setup(int width, int height)
}
else {
printf("Error: Couldn't create GLXContext\n");
XFree(visInfo);
XCloseDisplay(gDpy);
return 0;
}
@@ -183,7 +181,6 @@ Setup(int width, int height)
/* Bind context to pbuffer */
if (!glXMakeCurrent(gDpy, gPBuffer, glCtx)) {
printf("Error: glXMakeCurrent failed\n");
XFree(visInfo);
XCloseDisplay(gDpy);
return 0;
}

View File

@@ -20,9 +20,9 @@
# 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.
# DOS/DJGPP glu makefile v1.4 for Mesa
# DOS/DJGPP glu makefile v1.5 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -54,7 +54,7 @@ CC = gcc
CFLAGS += -I$(TOP)/include
AR = ar
ARFLAGS = rus
ARFLAGS = crus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)

View File

@@ -1,8 +1,7 @@
/*
* Mesa 3-D graphics library
* Version: 3.3
* Copyright (C) 1995-2000 Brian Paul
* Version: 6.3
* Copyright (C) 1995-2004 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -36,7 +35,7 @@
#if defined(_WIN32) && !defined(__WIN32__)
# define __WIN32__
# define __WIN32__
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
@@ -51,65 +50,22 @@
# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
# endif
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# define WGLAPI __declspec(dllexport)
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# define WGLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
# define WGLAPI __declspec(dllimport)
# endif /* _STATIC_MESA support */
# define GLAPIENTRY __stdcall
# define GLAPIENTRYP __stdcall *
# define GLCALLBACK __stdcall
# define GLCALLBACKP __stdcall *
# if defined(__CYGWIN__)
# define GLCALLBACKPCAST *
# else
# define GLCALLBACKPCAST __stdcall *
# endif
# define GLWINAPI __stdcall
# define GLWINAPIV __cdecl
#else
/* non-Windows compilation */
# define GLAPI extern
# define GLAPIENTRY
# define GLAPIENTRYP *
# define GLCALLBACK
# define GLCALLBACKP *
# define GLCALLBACKPCAST *
# define GLWINAPI
# define GLWINAPIV
#endif /* WIN32 / CYGWIN bracket */
/* compatability guard so we don't need to change client code */
#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
# define CALLBACK GLCALLBACK
typedef int (GLAPIENTRY *PROC)();
typedef void *HGLRC;
typedef void *HDC;
typedef unsigned long COLORREF;
#endif
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
# define WGL_FONT_LINES 0
# define WGL_FONT_POLYGONS 1
#ifndef _GNU_H_WINDOWS32_FUNCTIONS
# ifdef UNICODE
# define wglUseFontBitmaps wglUseFontBitmapsW
# define wglUseFontOutlines wglUseFontOutlinesW
# else
# define wglUseFontBitmaps wglUseFontBitmapsA
# define wglUseFontOutlines wglUseFontOutlinesA
# endif /* !UNICODE */
#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
#include <GL/mesa_wgl.h>
#endif

View File

@@ -20,9 +20,9 @@
# 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.
# DOS/DJGPP glu makefile v1.4 for Mesa
# DOS/DJGPP glu makefile v1.5 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -56,7 +56,7 @@ CXX = gpp
CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
AR = ar
ARFLAGS = rus
ARFLAGS = crus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)

View File

@@ -92,6 +92,6 @@ clean:
depend: $(SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null 2>&1
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
include depend

View File

@@ -20,9 +20,9 @@
# 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.
# DOS/DJGPP glut makefile v1.5 for Mesa
# DOS/DJGPP glut makefile v1.6 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -62,7 +62,7 @@ CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW
CFLAGS += -DGLUT_IMPORT_LIB
AR = ar
ARFLAGS = rus
ARFLAGS = crus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)

View File

@@ -64,9 +64,9 @@ int APIENTRY glutExtensionSupported (const char *extension)
}
void * APIENTRY
GLUTproc APIENTRY
glutGetProcAddress (const char *procName)
{
/* TODO - handle glut namespace */
return DMesaGetProcAddress(procName);
return (GLUTproc)DMesaGetProcAddress(procName);
}

View File

@@ -36,7 +36,6 @@ SOURCES = \
glut_dstr.c \
glut_event.c \
glut_ext.c \
glut_fbc.c \
glut_fullscrn.c \
glut_gamemode.c \
glut_get.c \
@@ -105,7 +104,9 @@ clean:
depend: $(SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(SOURCES)
@ echo "running $(MKDEP)"
@ touch depend
@ $(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(SOURCES) \
> /dev/null
include depend

View File

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

View File

@@ -65,7 +65,7 @@ $(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
# what's included by any source file.
depend: $(SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null 2>&1
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
# Emacs tags
tags:

View File

@@ -45,7 +45,7 @@ $(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS)
depend: $(GLW_SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(GLW_SOURCES) \
> /dev/null 2>&1
> /dev/null
include depend

View File

@@ -68,7 +68,7 @@ drmtest: xf86drm.o drmtest.o
depend: $(C_SOURCES) $(ASM_SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
> /dev/null 2>&1
> /dev/null
# Emacs tags

View File

@@ -67,7 +67,8 @@ typedef struct DRIDriverContextRec {
int bpp;
int cpp;
int agpmode;
int isPCI;
unsigned long FBStart; /**< \brief physical address of the framebuffer */
unsigned long MMIOStart; /**< \brief physical address of the MMIO region */

View File

@@ -14,6 +14,9 @@ clientDriverName=radeon_dri.so
# look in /proc/pci.
pciBusID=PCI:1:0:0
# Is the card PCI or AGP ?
isPCI=0
# Virtual screen dimensions. Can reduce this to save videocard memory
# at the expense of maximum window size available.
virtualWidth=1280

View File

@@ -830,6 +830,7 @@ static int __read_config_file( Display *dpy )
dpy->driverContext.cpp = 4;
dpy->rotateMode = 0;
dpy->driverContext.agpmode = 1;
dpy->driverContext.isPCI = 0;
fname = getenv("MINIGLX_CONF");
if (!fname) fname = "/etc/miniglx.conf";
@@ -899,6 +900,9 @@ static int __read_config_file( Display *dpy )
if (sscanf(val, "%d", &dpy->driverContext.agpmode) != 1)
fprintf(stderr, "malformed agpmode: %s\n", opt);
}
else if (strcmp(opt, "isPCI") == 0) {
dpy->driverContext.isPCI = atoi(val) ? 1 : 0;
}
}
fclose(file);
@@ -1711,7 +1715,7 @@ glXChooseVisual( Display *dpy, int screen, int *attribList )
GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0;
GLint indexBits = 0, depthBits = 0, stencilBits = 0;
GLint numSamples = 0;
int i;
int i=0;
/*
* XXX in the future, <screen> might be interpreted as a VT
@@ -1805,6 +1809,7 @@ glXChooseVisual( Display *dpy, int screen, int *attribList )
(void) alphaBits;
(void) stereoFlag;
for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) {
i++;
if (mode->rgbMode == rgbFlag &&
mode->doubleBufferMode == dbFlag &&
mode->redBits >= redBits &&
@@ -2149,7 +2154,8 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
{
GLXDrawable drawable = (GLXDrawable) draw;
drm_clip_rect_t * cliprect;
Display* display = (Display*)dpy;
__DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private;
if (drawable == 0) {
return GL_FALSE;
}
@@ -2159,15 +2165,20 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
cliprect->y1 = drawable->y;
cliprect->x2 = drawable->x + drawable->w;
cliprect->y2 = drawable->y + drawable->h;
/* the drawable index is by client id */
*index = display->clientID;
*stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp;
*x = drawable->x;
*y = drawable->y;
*width = drawable->w;
*height = drawable->h;
*numClipRects = 1;
*pClipRects = cliprect;
*backX = 0;
*backY = 0;
*backX = drawable->x;
*backY = drawable->y;
*numBackClipRects = 0;
*pBackClipRects = 0;
@@ -2249,6 +2260,7 @@ void (*glXGetProcAddress(const GLubyte *procname))( void )
{ "__glXGetDrawableInfo", (void *) __glXGetDrawableInfo },
{ "__glXWindowExists", (void *) __glXWindowExists },
{ "__glXCreateContextModes", (void *) _gl_context_modes_create },
{ "__glXFindDRIScreen", (void *)__glXFindDRIScreen },
{ NULL, NULL }
};
const struct name_address *entry;

114
src/glx/x11/Makefile Normal file
View File

@@ -0,0 +1,114 @@
TOP = ../../..
include $(TOP)/configs/current
# This is a bit messy. We want this libGL to be capable of loading old
# interface drivers, so we have to turn off DRI_NEW_INTERFACE_ONLY. However,
# glcontextmodes.c is built elsewhere with DNIO on, so we symlink it across.
#
# Furthermore, context creation has evolved over the years, such that this
# code will not build with DNIO defined. When we finally drop old interface
# support in libGL, we need to clean up both glxcmds.c and dri_interface.h.
DEFINES += -DGLX_DIRECT_RENDERING -DGLXEXT -DXF86DRI -DGLX_USE_DLOPEN \
-DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UDRI_NEW_INTERFACE_ONLY
C_SOURCES = \
$(TOP)/src/mesa/glapi/glapi.c \
$(TOP)/src/mesa/glapi/glthread.c \
glcontextmodes.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drm.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmHash.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmRandom.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmSL.c \
clientattrib.c \
compsize.c \
dispatch.c \
eval.c \
glxcmds.c \
glxext.c \
glxextensions.c \
indirect.c \
indirect_init.c \
indirect_size.c \
indirect_window_pos.c \
indirect_transpose_matrix.c \
pixel.c \
pixelstore.c \
render2.c \
renderpix.c \
single2.c \
singlepix.c \
vertarr.c \
xfont.c \
glx_pbuffer.c \
glx_query.c \
glx_texture_compression.c \
dri_glx.c \
XF86dri.c \
X86_SOURCES = $(TOP)/src/mesa/x86/glapi_x86.S
# ASM_SOURCES = $(X86_SOURCES)
OBJECTS = $(C_SOURCES:.c=.o) \
$(ASM_SOURCES:.S=.o)
INCLUDES = -I. \
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/math \
-I$(TOP)/src/mesa/transform \
-I$(TOP)/src/mesa/swrast \
-I$(TOP)/src/mesa/swrast_setup \
-I$(TOP)/src/mesa/drivers/dri/common \
-I$(DRM_SOURCE_PATH)/libdrm \
-I$(DRM_SOURCE_PATH)/shared \
$(X11_INCLUDES)
##### RULES #####
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
.S.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
##### TARGETS #####
default: depend $(LIB_DIR)/$(GL_LIB_NAME)
glcontextmodes.c:
ln -s $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c .
# Make libGL
$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
CC=$(CC) CXX=$(CXX) $(TOP)/bin/mklib -o $(GL_LIB) -major 1 -minor 2 $(MKLIB_OPTIONS) \
-install $(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS)
drmtest: xf86drm.o drmtest.o
rm -f drmtest && $(CC) -o drmtest xf86drm.o drmtest.o
depend: $(C_SOURCES) $(ASM_SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
> /dev/null
# Emacs tags
tags:
etags `find . -name \*.[ch]` `find ../include`
# Remove .o and backup files
clean:
-rm -f $(LIB_DIR)/libGL.so*
-rm -f *.o *~
-rm -f depend
include depend

617
src/glx/x11/XF86dri.c Normal file
View File

@@ -0,0 +1,617 @@
/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.13 2002/10/30 12:51:25 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
Copyright 2000 VA Linux Systems, 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@tungstengraphics.com>
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
/* THIS IS NOT AN X CONSORTIUM STANDARD */
#define NEED_REPLIES
#include <X11/Xlibint.h>
#include "xf86dristr.h"
#include <X11/extensions/Xext.h>
#include "extutil.h"
#include "glheader.h"
static XExtensionInfo _xf86dri_info_data;
static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
static char xf86dri_extension_name[] = XF86DRINAME;
#define XF86DRICheckExtension(dpy,i,val) \
XextCheckExtension (dpy, i, xf86dri_extension_name, val)
/*****************************************************************************
* *
* private utility routines *
* *
*****************************************************************************/
static int close_display(Display *dpy, XExtCodes *extCodes);
static /* const */ XExtensionHooks xf86dri_extension_hooks = {
NULL, /* create_gc */
NULL, /* copy_gc */
NULL, /* flush_gc */
NULL, /* free_gc */
NULL, /* create_font */
NULL, /* free_font */
close_display, /* close_display */
NULL, /* wire_to_event */
NULL, /* event_to_wire */
NULL, /* error */
NULL, /* error_string */
};
static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86dri_info,
xf86dri_extension_name,
&xf86dri_extension_hooks,
0, NULL)
static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86dri_info)
/*****************************************************************************
* *
* public XFree86-DRI Extension routines *
* *
*****************************************************************************/
#if 0
#include <stdio.h>
#define TRACE(msg) fprintf(stderr,"XF86DRI%s\n", msg);
#else
#define TRACE(msg)
#endif
PUBLIC Bool XF86DRIQueryExtension (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;
}
}
PUBLIC Bool XF86DRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
Display* dpy;
int* majorVersion;
int* minorVersion;
int* patchVersion;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIQueryVersionReply rep;
xXF86DRIQueryVersionReq *req;
TRACE("QueryVersion...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIQueryVersion, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIQueryVersion;
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;
}
PUBLIC Bool XF86DRIQueryDirectRenderingCapable(dpy, screen, isCapable)
Display* dpy;
int screen;
Bool* isCapable;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIQueryDirectRenderingCapableReply rep;
xXF86DRIQueryDirectRenderingCapableReq *req;
TRACE("QueryDirectRenderingCapable...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIQueryDirectRenderingCapable, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIQueryDirectRenderingCapable;
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;
}
PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
Display* dpy;
int screen;
drm_handle_t * hSAREA;
char **busIdString;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIOpenConnectionReply rep;
xXF86DRIOpenConnectionReq *req;
TRACE("OpenConnection...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIOpenConnection, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIOpenConnection;
req->screen = screen;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("OpenConnection... return False");
return False;
}
*hSAREA = rep.hSAREALow;
#ifdef LONG64
*hSAREA |= ((drm_handle_t)rep.hSAREAHigh) << 32;
#endif
if (rep.length) {
if (!(*busIdString = (char *)Xcalloc(rep.busIdStringLength + 1, 1))) {
_XEatData(dpy, ((rep.busIdStringLength+3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
TRACE("OpenConnection... return False");
return False;
}
_XReadPad(dpy, *busIdString, rep.busIdStringLength);
} else {
*busIdString = NULL;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("OpenConnection... return True");
return True;
}
PUBLIC Bool XF86DRIAuthConnection(dpy, screen, magic)
Display* dpy;
int screen;
drm_magic_t magic;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIAuthConnectionReq *req;
xXF86DRIAuthConnectionReply rep;
TRACE("AuthConnection...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIAuthConnection, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIAuthConnection;
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;
}
PUBLIC Bool XF86DRICloseConnection(dpy, screen)
Display* dpy;
int screen;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICloseConnectionReq *req;
TRACE("CloseConnection...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRICloseConnection, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRICloseConnection;
req->screen = screen;
UnlockDisplay(dpy);
SyncHandle();
TRACE("CloseConnection... return True");
return True;
}
PUBLIC Bool XF86DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion,
ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName)
Display* dpy;
int screen;
int* ddxDriverMajorVersion;
int* ddxDriverMinorVersion;
int* ddxDriverPatchVersion;
char** clientDriverName;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIGetClientDriverNameReply rep;
xXF86DRIGetClientDriverNameReq *req;
TRACE("GetClientDriverName...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIGetClientDriverName, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIGetClientDriverName;
req->screen = screen;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetClientDriverName... return False");
return False;
}
*ddxDriverMajorVersion = rep.ddxDriverMajorVersion;
*ddxDriverMinorVersion = rep.ddxDriverMinorVersion;
*ddxDriverPatchVersion = rep.ddxDriverPatchVersion;
if (rep.length) {
if (!(*clientDriverName = (char *)Xcalloc(rep.clientDriverNameLength + 1, 1))) {
_XEatData(dpy, ((rep.clientDriverNameLength+3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetClientDriverName... return False");
return False;
}
_XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength);
} else {
*clientDriverName = NULL;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetClientDriverName... return True");
return True;
}
PUBLIC Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context,
hHWContext)
Display* dpy;
int screen;
int configID;
XID* context;
drm_context_t * hHWContext;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICreateContextReply rep;
xXF86DRICreateContextReq *req;
TRACE("CreateContext...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRICreateContext, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRICreateContext;
req->visual = configID;
req->screen = screen;
*context = XAllocID(dpy);
req->context = *context;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateContext... return False");
return False;
}
*hHWContext = rep.hHWContext;
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateContext... return True");
return True;
}
PUBLIC Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext)
Display* dpy;
int screen;
Visual* visual;
XID* context;
drm_context_t * hHWContext;
{
return XF86DRICreateContextWithConfig( dpy, screen, visual->visualid,
context, hHWContext );
}
PUBLIC GLboolean XF86DRIDestroyContext( __DRInativeDisplay * ndpy, int screen,
__DRIid context )
{
Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIDestroyContextReq *req;
TRACE("DestroyContext...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIDestroyContext, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIDestroyContext;
req->screen = screen;
req->context = context;
UnlockDisplay(dpy);
SyncHandle();
TRACE("DestroyContext... return True");
return True;
}
PUBLIC GLboolean XF86DRICreateDrawable( __DRInativeDisplay * ndpy, int screen,
__DRIid drawable, drm_drawable_t * hHWDrawable )
{
Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICreateDrawableReply rep;
xXF86DRICreateDrawableReq *req;
TRACE("CreateDrawable...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRICreateDrawable, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRICreateDrawable;
req->screen = screen;
req->drawable = drawable;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateDrawable... return False");
return False;
}
*hHWDrawable = rep.hHWDrawable;
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateDrawable... return True");
return True;
}
PUBLIC GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay * ndpy, int screen,
__DRIid drawable )
{
Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIDestroyDrawableReq *req;
TRACE("DestroyDrawable...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIDestroyDrawable, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIDestroyDrawable;
req->screen = screen;
req->drawable = drawable;
UnlockDisplay(dpy);
SyncHandle();
TRACE("DestroyDrawable... return True");
return True;
}
PUBLIC Bool XF86DRIGetDrawableInfo(Display* dpy, int screen, Drawable drawable,
unsigned int* index, unsigned int* stamp,
int* X, int* Y, int* W, int* H,
int* numClipRects, drm_clip_rect_t ** pClipRects,
int* backX, int* backY,
int* numBackClipRects, drm_clip_rect_t ** pBackClipRects )
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIGetDrawableInfoReply rep;
xXF86DRIGetDrawableInfoReq *req;
int total_rects;
TRACE("GetDrawableInfo...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIGetDrawableInfo, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIGetDrawableInfo;
req->screen = screen;
req->drawable = drawable;
if (!_XReply(dpy, (xReply *)&rep, 1, xFalse))
{
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDrawableInfo... return False");
return False;
}
*index = rep.drawableTableIndex;
*stamp = rep.drawableTableStamp;
*X = (int)rep.drawableX;
*Y = (int)rep.drawableY;
*W = (int)rep.drawableWidth;
*H = (int)rep.drawableHeight;
*numClipRects = rep.numClipRects;
total_rects = *numClipRects;
*backX = rep.backX;
*backY = rep.backY;
*numBackClipRects = rep.numBackClipRects;
total_rects += *numBackClipRects;
#if 0
/* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks
* backwards compatibility (Because of the >> 2 shift) but the fix
* enables multi-threaded apps to work.
*/
if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) -
SIZEOF(xGenericReply) +
total_rects * sizeof(drm_clip_rect_t)) + 3) & ~3) >> 2)) {
_XEatData(dpy, rep.length);
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDrawableInfo... return False");
return False;
}
#endif
if (*numClipRects) {
int len = sizeof(drm_clip_rect_t) * (*numClipRects);
*pClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
if (*pClipRects)
_XRead(dpy, (char*)*pClipRects, len);
} else {
*pClipRects = NULL;
}
if (*numBackClipRects) {
int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
*pBackClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
if (*pBackClipRects)
_XRead(dpy, (char*)*pBackClipRects, len);
} else {
*pBackClipRects = NULL;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDrawableInfo... return True");
return True;
}
PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer,
fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate)
Display* dpy;
int screen;
drm_handle_t * hFrameBuffer;
int* fbOrigin;
int* fbSize;
int* fbStride;
int* devPrivateSize;
void** pDevPrivate;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIGetDeviceInfoReply rep;
xXF86DRIGetDeviceInfoReq *req;
TRACE("GetDeviceInfo...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIGetDeviceInfo, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIGetDeviceInfo;
req->screen = screen;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDeviceInfo... return False");
return False;
}
*hFrameBuffer = rep.hFrameBufferLow;
#ifdef LONG64
*hFrameBuffer |= ((drm_handle_t)rep.hFrameBufferHigh) << 32;
#endif
*fbOrigin = rep.framebufferOrigin;
*fbSize = rep.framebufferSize;
*fbStride = rep.framebufferStride;
*devPrivateSize = rep.devPrivateSize;
if (rep.length) {
if (!(*pDevPrivate = (void *)Xcalloc(rep.devPrivateSize, 1))) {
_XEatData(dpy, ((rep.devPrivateSize+3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDeviceInfo... return False");
return False;
}
_XRead(dpy, (char*)*pDevPrivate, rep.devPrivateSize);
} else {
*pDevPrivate = NULL;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDeviceInfo... return True");
return True;
}
PUBLIC Bool XF86DRIOpenFullScreen(dpy, screen, drawable)
Display* dpy;
int screen;
Drawable drawable;
{
/* This function and the underlying X protocol are deprecated.
*/
(void) dpy;
(void) screen;
(void) drawable;
return False;
}
PUBLIC Bool XF86DRICloseFullScreen(dpy, screen, drawable)
Display* dpy;
int screen;
Drawable drawable;
{
/* This function and the underlying X protocol are deprecated.
*/
(void) dpy;
(void) screen;
(void) drawable;
return True;
}

185
src/glx/x11/clientattrib.c Normal file
View File

@@ -0,0 +1,185 @@
/* $XFree86: xc/lib/GL/glx/clientattrib.c,v 1.5 2001/03/21 16:04:39 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include <assert.h>
#include "glxclient.h"
/*****************************************************************************/
void __indirect_glEnableClientState(GLenum array)
{
__GLXcontext *gc = __glXGetCurrentContext();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
switch (array) {
case GL_COLOR_ARRAY:
ENABLE_ARRAY(state, color);
break;
case GL_EDGE_FLAG_ARRAY:
ENABLE_ARRAY(state, edgeFlag);
break;
case GL_INDEX_ARRAY:
ENABLE_ARRAY(state, index);
break;
case GL_NORMAL_ARRAY:
ENABLE_ARRAY(state, normal);
break;
case GL_TEXTURE_COORD_ARRAY:
ENABLE_TEXARRAY(state, state->vertArray.activeTexture);
break;
case GL_VERTEX_ARRAY:
ENABLE_ARRAY(state, vertex);
break;
case GL_SECONDARY_COLOR_ARRAY:
ENABLE_ARRAY(state, secondaryColor);
break;
case GL_FOG_COORD_ARRAY:
ENABLE_ARRAY(state, fogCoord);
break;
default:
__glXSetError(gc, GL_INVALID_ENUM);
}
}
void __indirect_glDisableClientState(GLenum array)
{
__GLXcontext *gc = __glXGetCurrentContext();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
switch (array) {
case GL_COLOR_ARRAY:
DISABLE_ARRAY(state, color);
break;
case GL_EDGE_FLAG_ARRAY:
DISABLE_ARRAY(state, edgeFlag);
break;
case GL_INDEX_ARRAY:
DISABLE_ARRAY(state, index);
break;
case GL_NORMAL_ARRAY:
DISABLE_ARRAY(state, normal);
break;
case GL_TEXTURE_COORD_ARRAY:
DISABLE_TEXARRAY(state, state->vertArray.activeTexture);
break;
case GL_VERTEX_ARRAY:
DISABLE_ARRAY(state, vertex);
break;
case GL_SECONDARY_COLOR_ARRAY:
DISABLE_ARRAY(state, secondaryColor);
break;
case GL_FOG_COORD_ARRAY:
DISABLE_ARRAY(state, fogCoord);
break;
default:
__glXSetError(gc, GL_INVALID_ENUM);
}
}
/************************************************************************/
void __indirect_glPushClientAttrib(GLuint mask)
{
__GLXcontext *gc = __glXGetCurrentContext();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
__GLXattribute **spp = gc->attributes.stackPointer, *sp;
if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
if (!(sp = *spp)) {
sp = (__GLXattribute *)Xmalloc(sizeof(__GLXattribute));
*spp = sp;
}
sp->mask = mask;
gc->attributes.stackPointer = spp + 1;
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
sp->storePack = state->storePack;
sp->storeUnpack = state->storeUnpack;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
sp->vertArray = state->vertArray;
}
} else {
__glXSetError(gc, GL_STACK_OVERFLOW);
return;
}
}
void __indirect_glPopClientAttrib(void)
{
__GLXcontext *gc = __glXGetCurrentContext();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
__GLXattribute **spp = gc->attributes.stackPointer, *sp;
GLuint mask;
if (spp > &gc->attributes.stack[0]) {
--spp;
sp = *spp;
assert(sp != 0);
mask = sp->mask;
gc->attributes.stackPointer = spp;
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
state->storePack = sp->storePack;
state->storeUnpack = sp->storeUnpack;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
state->vertArray = sp->vertArray;
}
sp->mask = 0;
} else {
__glXSetError(gc, GL_STACK_UNDERFLOW);
return;
}
}
void __glFreeAttributeState(__GLXcontext *gc)
{
__GLXattribute *sp, **spp;
for (spp = &gc->attributes.stack[0];
spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
spp++) {
sp = *spp;
if (sp) {
XFree((char *)sp);
} else {
break;
}
}
}

172
src/glx/x11/compsize.c Normal file
View File

@@ -0,0 +1,172 @@
/* $XFree86: xc/lib/GL/glx/compsize.c,v 1.6 2004/01/28 18:11:38 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include <GL/gl.h>
#include "size.h"
/*
** Return the number of elements per group of a specified format
*/
GLint __glElementsPerGroup(GLenum format, GLenum type)
{
/*
** To make row length computation valid for image extraction,
** packed pixel types assume elements per group equals one.
*/
switch(type) {
case GL_UNSIGNED_BYTE_3_3_2:
case GL_UNSIGNED_BYTE_2_3_3_REV:
case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_5_6_5_REV:
case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
case GL_UNSIGNED_SHORT_5_5_5_1:
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL_UNSIGNED_SHORT_8_8_APPLE:
case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
case GL_UNSIGNED_SHORT_15_1_MESA:
case GL_UNSIGNED_SHORT_1_15_REV_MESA:
case GL_UNSIGNED_INT_8_8_8_8:
case GL_UNSIGNED_INT_8_8_8_8_REV:
case GL_UNSIGNED_INT_10_10_10_2:
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_24_8_NV:
case GL_UNSIGNED_INT_24_8_MESA:
case GL_UNSIGNED_INT_8_24_REV_MESA:
return 1;
default:
break;
}
switch(format) {
case GL_RGB:
case GL_BGR:
return 3;
case GL_422_EXT:
case GL_422_REV_EXT:
case GL_422_AVERAGE_EXT:
case GL_422_REV_AVERAGE_EXT:
case GL_YCBCR_422_APPLE:
case GL_LUMINANCE_ALPHA:
return 2;
case GL_RGBA:
case GL_BGRA:
case GL_ABGR_EXT:
return 4;
case GL_COLOR_INDEX:
case GL_STENCIL_INDEX:
case GL_DEPTH_COMPONENT:
case GL_RED:
case GL_GREEN:
case GL_BLUE:
case GL_ALPHA:
case GL_LUMINANCE:
case GL_INTENSITY:
return 1;
default:
return 0;
}
}
/*
** Return the number of bytes per element, based on the element type (other
** than GL_BITMAP).
*/
GLint __glBytesPerElement(GLenum type)
{
switch(type) {
case GL_UNSIGNED_SHORT:
case GL_SHORT:
case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_5_6_5_REV:
case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
case GL_UNSIGNED_SHORT_5_5_5_1:
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL_UNSIGNED_SHORT_8_8_APPLE:
case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
case GL_UNSIGNED_SHORT_15_1_MESA:
case GL_UNSIGNED_SHORT_1_15_REV_MESA:
return 2;
case GL_UNSIGNED_BYTE:
case GL_BYTE:
case GL_UNSIGNED_BYTE_3_3_2:
case GL_UNSIGNED_BYTE_2_3_3_REV:
return 1;
case GL_INT:
case GL_UNSIGNED_INT:
case GL_FLOAT:
case GL_UNSIGNED_INT_8_8_8_8:
case GL_UNSIGNED_INT_8_8_8_8_REV:
case GL_UNSIGNED_INT_10_10_10_2:
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_24_8_NV:
case GL_UNSIGNED_INT_24_8_MESA:
case GL_UNSIGNED_INT_8_24_REV_MESA:
return 4;
default:
return 0;
}
}
/*
** Compute memory required for internal packed array of data of given type
** and format.
*/
GLint __glImageSize(GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type)
{
int bytes_per_row;
int components;
if (width < 0 || height < 0 || depth < 0) {
return 0;
}
/*
** Zero is returned if either format or type are invalid.
*/
components = __glElementsPerGroup(format,type);
if (type == GL_BITMAP) {
if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) {
bytes_per_row = (width + 7) >> 3;
} else {
return 0;
}
} else {
bytes_per_row = __glBytesPerElement(type) * width;
}
return bytes_per_row * height * depth * components;
}

74
src/glx/x11/dispatch.c Normal file
View File

@@ -0,0 +1,74 @@
/* $XFree86: xc/lib/GL/glx/dispatch.c,v 1.5 2003/06/30 01:45:10 torrey Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/*
* Authors:
* Brian Paul <brian@precisioninsight.com>
*
*/
#ifndef GLX_USE_APPLEGL
#include <GL/gl.h>
#include "glheader.h"
#include "glapi.h"
#include "glapitable.h"
/*
* NOTE: this file implements C-based dispatch of the OpenGL entrypoints
* (glAccum, glBegin, etc).
* This code IS NOT USED if we're compiling on an x86 system and using
* the glapi_x86.S assembly code.
*/
#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
#define KEYWORD1 PUBLIC
#define KEYWORD2
#define NAME(func) gl##func
#define DISPATCH(func, args, msg) \
const struct _glapi_table *dispatch; \
dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
(dispatch->func) args
#define RETURN_DISPATCH(func, args, msg) \
const struct _glapi_table *dispatch; \
dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
return (dispatch->func) args
#include "glapitemp.h"
#endif /* USE_X86_ASM */
#endif /* !GLX_USE_APPLEGL */

490
src/glx/x11/dri_glx.c Normal file
View File

@@ -0,0 +1,490 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/* $XFree86: xc/lib/GL/dri/dri_glx.c,v 1.14 2003/07/16 00:54:00 dawes Exp $ */
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian Paul <brian@precisioninsight.com>
*
*/
#ifdef GLX_DIRECT_RENDERING
#include <unistd.h>
#include <X11/Xlibint.h>
#include <X11/extensions/Xext.h>
#include "extutil.h"
#include "glxclient.h"
#include "xf86dri.h"
#include "sarea.h"
#include <stdio.h>
#include <dlfcn.h>
#include "dri_glx.h"
#include <sys/types.h>
#include <stdarg.h>
#ifndef RTLD_NOW
#define RTLD_NOW 0
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif
#ifdef BUILT_IN_DRI_DRIVER
extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config);
#else /* BUILT_IN_DRI_DRIVER */
#ifndef DEFAULT_DRIVER_DIR
/* this is normally defined in the Imakefile */
#define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri"
#endif
static __DRIdriver *Drivers = NULL;
/*
* printf wrappers
*/
static void InfoMessageF(const char *f, ...)
{
va_list args;
const char *env;
if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) {
fprintf(stderr, "libGL: ");
va_start(args, f);
vfprintf(stderr, f, args);
va_end(args);
}
}
static void ErrorMessageF(const char *f, ...)
{
va_list args;
if (getenv("LIBGL_DEBUG")) {
fprintf(stderr, "libGL error: ");
va_start(args, f);
vfprintf(stderr, f, args);
va_end(args);
}
}
/*
* We'll save a pointer to this function when we couldn't find a
* direct rendering driver for a given screen.
*/
static void *DummyCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
(void) dpy;
(void) scrn;
(void) psc;
(void) numConfigs;
(void) config;
return NULL;
}
/**
* Extract the ith directory path out of a colon-separated list of paths. No
* more than \c dirLen characters, including the terminating \c NUL, will be
* written to \c dir.
*
* \param index Index of path to extract (starting at zero)
* \param paths The colon-separated list of paths
* \param dirLen Maximum length of result to store in \c dir
* \param dir Buffer to hold the extracted directory path
*
* \returns
* The number of characters that would have been written to \c dir had there
* been enough room. This does not include the terminating \c NUL. When
* extraction fails, zero will be returned.
*
* \todo
* It seems like this function could be rewritten to use \c strchr.
*/
static size_t
ExtractDir(int index, const char *paths, int dirLen, char *dir)
{
int i, len;
const char *start, *end;
/* find ith colon */
start = paths;
i = 0;
while (i < index) {
if (*start == ':') {
i++;
start++;
}
else if (*start == 0) {
/* end of string and couldn't find ith colon */
dir[0] = 0;
return 0;
}
else {
start++;
}
}
while (*start == ':')
start++;
/* find next colon, or end of string */
end = start + 1;
while (*end != ':' && *end != 0) {
end++;
}
/* copy string between <start> and <end> into result string */
len = end - start;
if (len > dirLen - 1)
len = dirLen - 1;
strncpy(dir, start, len);
dir[len] = 0;
return( end - start );
}
/**
* Try to \c dlopen the named driver.
*
* This function adds the "_dri.so" suffix to the driver name and searches the
* directories specified by the \c LIBGL_DRIVERS_PATH environment variable in
* order to find the driver.
*
* \param driverName - a name like "tdfx", "i810", "mga", etc.
*
* \returns
* A handle from \c dlopen, or \c NULL if driver file not found.
*/
static __DRIdriver *OpenDriver(const char *driverName)
{
char *libPaths = NULL;
char libDir[1000];
int i;
__DRIdriver *driver;
/* First, search Drivers list to see if we've already opened this driver */
for (driver = Drivers; driver; driver = driver->next) {
if (strcmp(driver->name, driverName) == 0) {
/* found it */
return driver;
}
}
if (geteuid() == getuid()) {
/* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
libPaths = getenv("LIBGL_DRIVERS_PATH");
if (!libPaths)
libPaths = getenv("LIBGL_DRIVERS_DIR"); /* deprecated */
}
if (!libPaths)
libPaths = DEFAULT_DRIVER_DIR;
for ( i = 0 ; ExtractDir(i, libPaths, 1000, libDir) != 0 ; i++ ) {
char realDriverName[200];
void *handle = NULL;
if ( handle == NULL ) {
snprintf(realDriverName, 200, "%s/%s_dri.so", libDir, driverName);
InfoMessageF("OpenDriver: trying %s\n", realDriverName);
handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL);
}
if ( handle != NULL ) {
/* allocate __DRIdriver struct */
driver = (__DRIdriver *) Xmalloc(sizeof(__DRIdriver));
if (!driver)
return NULL; /* out of memory! */
/* init the struct */
driver->name = __glXstrdup(driverName);
if (!driver->name) {
Xfree(driver);
return NULL; /* out of memory! */
}
driver->createScreenFunc = (CreateScreenFunc)
dlsym(handle, "__driCreateScreen");
driver->createNewScreenFunc = (CreateNewScreenFunc)
dlsym(handle, "__driCreateNewScreen");
if ( (driver->createScreenFunc == NULL)
&& (driver->createNewScreenFunc == NULL) ) {
/* If the driver doesn't have this symbol then something's
* really, really wrong.
*/
ErrorMessageF("Neither __driCreateScreen or __driCreateNewScreen "
"are defined in %s_dri.so!\n", driverName);
Xfree(driver);
dlclose(handle);
continue;
}
driver->handle = handle;
/* put at head of linked list */
driver->next = Drivers;
Drivers = driver;
return driver;
}
else {
ErrorMessageF("dlopen %s failed (%s)\n", realDriverName, dlerror());
}
}
ErrorMessageF("unable to find driver: %s_dri.so\n", driverName);
return NULL;
}
/*
* Given a display pointer and screen number, determine the name of
* the DRI driver for the screen. (I.e. "r128", "tdfx", etc).
* Return True for success, False for failure.
*/
static Bool GetDriverName(Display *dpy, int scrNum, char **driverName)
{
int directCapable;
Bool b;
int driverMajor, driverMinor, driverPatch;
*driverName = NULL;
if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) {
ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed\n");
return False;
}
if (!directCapable) {
ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false\n");
return False;
}
b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor,
&driverPatch, driverName);
if (!b) {
ErrorMessageF("Cannot determine driver name for screen %d\n", scrNum);
return False;
}
InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
driverMajor, driverMinor, driverPatch, *driverName, scrNum);
return True;
}
/*
* Given a display pointer and screen number, return a __DRIdriver handle.
* Return NULL if anything goes wrong.
*/
__DRIdriver *driGetDriver(Display *dpy, int scrNum)
{
char *driverName;
if (GetDriverName(dpy, scrNum, &driverName)) {
__DRIdriver *ret;
ret = OpenDriver(driverName);
if (driverName)
Xfree(driverName);
return ret;
}
return NULL;
}
/*
* Exported function for querying the DRI driver for a given screen.
*
* The returned char pointer points to a static array that will be
* overwritten by subsequent calls.
*/
const char *glXGetScreenDriver (Display *dpy, int scrNum) {
static char ret[32];
char *driverName;
if (GetDriverName(dpy, scrNum, &driverName)) {
int len;
if (!driverName)
return NULL;
len = strlen (driverName);
if (len >= 31)
return NULL;
memcpy (ret, driverName, len+1);
Xfree(driverName);
return ret;
}
return NULL;
}
/*
* Exported function for obtaining a driver's option list (UTF-8 encoded XML).
*
* The returned char pointer points directly into the driver. Therefore
* it should be treated as a constant.
*
* If the driver was not found or does not support configuration NULL is
* returned.
*
* Note: The driver remains opened after this function returns.
*/
const char *glXGetDriverConfig (const char *driverName) {
__DRIdriver *driver = OpenDriver (driverName);
if (driver)
return dlsym (driver->handle, "__driConfigOptions");
else
return NULL;
}
#endif /* BUILT_IN_DRI_DRIVER */
/* This function isn't currently used.
*/
static void driDestroyDisplay(Display *dpy, void *private)
{
__DRIdisplayPrivate *pdpyp = (__DRIdisplayPrivate *)private;
if (pdpyp) {
const int numScreens = ScreenCount(dpy);
int i;
for (i = 0; i < numScreens; i++) {
if (pdpyp->libraryHandles[i])
dlclose(pdpyp->libraryHandles[i]);
}
Xfree(pdpyp->libraryHandles);
Xfree(pdpyp);
}
}
/*
* Allocate, initialize and return a __DRIdisplayPrivate object.
* This is called from __glXInitialize() when we are given a new
* display pointer.
*/
void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
{
const int numScreens = ScreenCount(dpy);
__DRIdisplayPrivate *pdpyp;
int eventBase, errorBase;
int major, minor, patch;
int scrn;
/* Initialize these fields to NULL in case we fail.
* If we don't do this we may later get segfaults trying to free random
* addresses when the display is closed.
*/
pdisp->private = NULL;
pdisp->destroyDisplay = NULL;
pdisp->createScreen = NULL;
if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) {
return NULL;
}
if (!XF86DRIQueryVersion(dpy, &major, &minor, &patch)) {
return NULL;
}
pdpyp = (__DRIdisplayPrivate *)Xmalloc(sizeof(__DRIdisplayPrivate));
if (!pdpyp) {
return NULL;
}
pdpyp->driMajor = major;
pdpyp->driMinor = minor;
pdpyp->driPatch = patch;
pdisp->destroyDisplay = driDestroyDisplay;
/* allocate array of pointers to createScreen funcs */
pdisp->createScreen = (CreateScreenFunc *) Xmalloc(numScreens * sizeof(void *));
if (!pdisp->createScreen) {
Xfree(pdpyp);
return NULL;
}
/* allocate array of pointers to createScreen funcs */
pdisp->createNewScreen = (CreateNewScreenFunc *) Xmalloc(numScreens * sizeof(void *));
if (!pdisp->createNewScreen) {
Xfree(pdisp->createScreen);
Xfree(pdpyp);
return NULL;
}
/* allocate array of library handles */
pdpyp->libraryHandles = (void **) Xmalloc(numScreens * sizeof(void*));
if (!pdpyp->libraryHandles) {
Xfree(pdisp->createNewScreen);
Xfree(pdisp->createScreen);
Xfree(pdpyp);
return NULL;
}
#ifdef BUILT_IN_DRI_DRIVER
/* we'll statically bind to the built-in __driCreateScreen function */
for (scrn = 0; scrn < numScreens; scrn++) {
pdisp->createScreen[scrn] = __driCreateScreen;
pdisp->createNewScreen[scrn] = NULL;
pdpyp->libraryHandles[scrn] = NULL;
}
#else
/* dynamically discover DRI drivers for all screens, saving each
* driver's "__driCreateScreen" function pointer. That's the bootstrap
* entrypoint for all DRI drivers.
*/
for (scrn = 0; scrn < numScreens; scrn++) {
__DRIdriver *driver = driGetDriver(dpy, scrn);
if (driver) {
pdisp->createScreen[scrn] = driver->createScreenFunc;
pdisp->createNewScreen[scrn] = driver->createNewScreenFunc;
pdpyp->libraryHandles[scrn] = driver->handle;
}
else {
pdisp->createScreen[scrn] = DummyCreateScreen;
pdisp->createNewScreen[scrn] = NULL;
pdpyp->libraryHandles[scrn] = NULL;
}
}
#endif
return (void *)pdpyp;
}
#endif /* GLX_DIRECT_RENDERING */

61
src/glx/x11/dri_glx.h Normal file
View File

@@ -0,0 +1,61 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian Paul <brian@precisioninsight.com>
*
*/
#ifndef _DRI_GLX_H_
#define _DRI_GLX_H_
#ifdef GLX_DIRECT_RENDERING
struct __DRIdisplayPrivateRec {
/*
** XFree86-DRI version information
*/
int driMajor;
int driMinor;
int driPatch;
/*
** Array of library handles [indexed by screen number]
*/
void **libraryHandles;
};
typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate;
typedef struct __DRIscreenPrivateRec __DRIscreenPrivate;
typedef struct __DRIvisualPrivateRec __DRIvisualPrivate;
typedef struct __DRIcontextPrivateRec __DRIcontextPrivate;
typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate;
#endif
#endif /* _DRI_GLX_H_ */

132
src/glx/x11/eval.c Normal file
View File

@@ -0,0 +1,132 @@
/* $XFree86$ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include "packrender.h"
/*
** Routines to pack evaluator maps into the transport buffer. Maps are
** allowed to have extra arbitrary data, so these routines extract just
** the information that the GL needs.
*/
void __glFillMap1f(GLint k, GLint order, GLint stride,
const GLfloat *points, GLubyte *pc)
{
if (stride == k) {
/* Just copy the data */
__GLX_PUT_FLOAT_ARRAY(0, points, order * k);
} else {
GLint i;
for (i = 0; i < order; i++) {
__GLX_PUT_FLOAT_ARRAY(0, points, k);
points += stride;
pc += k * __GLX_SIZE_FLOAT32;
}
}
}
void __glFillMap1d(GLint k, GLint order, GLint stride,
const GLdouble *points, GLubyte *pc)
{
if (stride == k) {
/* Just copy the data */
__GLX_PUT_DOUBLE_ARRAY(0, points, order * k);
} else {
GLint i;
for (i = 0; i < order; i++) {
__GLX_PUT_DOUBLE_ARRAY(0, points, k);
points += stride;
pc += k * __GLX_SIZE_FLOAT64;
}
}
}
void __glFillMap2f(GLint k, GLint majorOrder, GLint minorOrder,
GLint majorStride, GLint minorStride,
const GLfloat *points, GLfloat *data)
{
GLint i, j, x;
if ((minorStride == k) && (majorStride == minorOrder*k)) {
/* Just copy the data */
__GLX_MEM_COPY(data, points, majorOrder * majorStride *
__GLX_SIZE_FLOAT32);
return;
}
for (i = 0; i < majorOrder; i++) {
for (j = 0; j < minorOrder; j++) {
for (x = 0; x < k; x++) {
data[x] = points[x];
}
points += minorStride;
data += k;
}
points += majorStride - minorStride * minorOrder;
}
}
void __glFillMap2d(GLint k, GLint majorOrder, GLint minorOrder,
GLint majorStride, GLint minorStride,
const GLdouble *points, GLdouble *data)
{
int i,j,x;
if ((minorStride == k) && (majorStride == minorOrder*k)) {
/* Just copy the data */
__GLX_MEM_COPY(data, points, majorOrder * majorStride *
__GLX_SIZE_FLOAT64);
return;
}
#ifdef __GLX_ALIGN64
x = k * __GLX_SIZE_FLOAT64;
#endif
for (i = 0; i<majorOrder; i++) {
for (j = 0; j<minorOrder; j++) {
#ifdef __GLX_ALIGN64
__GLX_MEM_COPY(data, points, x);
#else
for (x = 0; x<k; x++) {
data[x] = points[x];
}
#endif
points += minorStride;
data += k;
}
points += majorStride - minorStride * minorOrder;
}
}

557
src/glx/x11/glx_pbuffer.c Normal file
View File

@@ -0,0 +1,557 @@
/*
* (C) Copyright IBM Corporation 2004
* 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
* 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.
*/
/**
* \file glx_pbuffer.c
* Implementation of pbuffer related functions.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <inttypes.h>
#include "glxclient.h"
#include <extutil.h>
#include <Xext.h>
#include <assert.h>
#include <string.h>
#include "glapi.h"
#include "glxextensions.h"
#include "glcontextmodes.h"
#include "glheader.h"
#ifdef IN_DOXYGEN
#define GLX_PREFIX(x) x
#endif /* IN_DOXYGEN */
static void ChangeDrawableAttribute( Display * dpy, GLXDrawable drawable,
const CARD32 * attribs, size_t num_attribs );
static void DestroyPbuffer( Display * dpy, GLXDrawable drawable );
static GLXDrawable CreatePbuffer( Display *dpy,
const __GLcontextModes * fbconfig, unsigned int width, unsigned int height,
const int *attrib_list, GLboolean size_in_attribs );
static int GetDrawableAttribute( Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value );
/**
* Change a drawable's attribute.
*
* This function is used to implement \c glXSelectEvent and
* \c glXSelectEventSGIX.
*
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static void
ChangeDrawableAttribute( Display * dpy, GLXDrawable drawable,
const CARD32 * attribs, size_t num_attribs )
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
CARD32 * output;
if ( (dpy == NULL) || (drawable == 0) ) {
return;
}
LockDisplay(dpy);
if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
xGLXChangeDrawableAttributesReq *req;
GetReqExtra( GLXChangeDrawableAttributes, 8 + (8 * num_attribs), req );
output = (CARD32 *) (req + 1);
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = X_GLXChangeDrawableAttributes;
req->drawable = drawable;
req->numAttribs = (CARD32) num_attribs;
}
else {
xGLXVendorPrivateWithReplyReq *vpreq;
GetReqExtra( GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq );
output = (CARD32 *) (vpreq + 1);
vpreq->reqType = __glXSetupForCommand(dpy);
vpreq->glxCode = X_GLXVendorPrivateWithReply;
vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX;
output[0] = (CARD32) drawable;
output++;
}
(void) memcpy( output, attribs, sizeof( CARD32 ) * 2 * num_attribs );
UnlockDisplay(dpy);
SyncHandle();
return;
}
/**
* Destroy a pbuffer.
*
* This function is used to implement \c glXDestroyPbuffer and
* \c glXDestroyGLXPbufferSGIX.
*
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static void
DestroyPbuffer( Display * dpy, GLXDrawable drawable )
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
if ( (dpy == NULL) || (drawable == 0) ) {
return;
}
LockDisplay(dpy);
if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
xGLXDestroyPbufferReq * req;
GetReqExtra( GLXDestroyPbuffer, 4, req );
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = X_GLXDestroyPbuffer;
req->pbuffer = (GLXPbuffer) drawable;
}
else {
xGLXVendorPrivateWithReplyReq *vpreq;
CARD32 * data;
GetReqExtra( GLXVendorPrivateWithReply, 4, vpreq );
data = (CARD32 *) (vpreq + 1);
data[0] = (CARD32) drawable;
vpreq->reqType = __glXSetupForCommand(dpy);
vpreq->glxCode = X_GLXVendorPrivateWithReply;
vpreq->vendorCode = X_GLXvop_DestroyGLXPbufferSGIX;
}
UnlockDisplay(dpy);
SyncHandle();
return;
}
/**
* Get a drawable's attribute.
*
* This function is used to implement \c glXGetSelectedEvent and
* \c glXGetSelectedEventSGIX.
*
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
*
* \todo
* The number of attributes returned is likely to be small, probably less than
* 10. Given that, this routine should try to use an array on the stack to
* capture the reply rather than always calling Xmalloc.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static int
GetDrawableAttribute( Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value )
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
xGLXGetDrawableAttributesReply reply;
CARD32 * data;
unsigned int length;
unsigned int i;
unsigned int num_attributes;
GLboolean use_glx_1_3 = ((priv->majorVersion > 1)
|| (priv->minorVersion >= 3));
if ( (dpy == NULL) || (drawable == 0) ) {
return 0;
}
LockDisplay(dpy);
if ( use_glx_1_3 ) {
xGLXGetDrawableAttributesReq *req;
GetReqExtra( GLXGetDrawableAttributes, 4, req );
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = X_GLXGetDrawableAttributes;
req->drawable = drawable;
}
else {
xGLXVendorPrivateWithReplyReq *vpreq;
GetReqExtra( GLXVendorPrivateWithReply, 4, vpreq );
data = (CARD32 *) (vpreq + 1);
data[0] = (CARD32) drawable;
vpreq->reqType = __glXSetupForCommand(dpy);
vpreq->glxCode = X_GLXVendorPrivateWithReply;
vpreq->vendorCode = X_GLXvop_GetDrawableAttributesSGIX;
}
_XReply(dpy, (xReply*) &reply, 0, False);
length = reply.length;
num_attributes = (use_glx_1_3) ? reply.numAttribs : length / 2;
data = (CARD32 *) Xmalloc( length * sizeof(CARD32) );
if ( data == NULL ) {
/* Throw data on the floor */
_XEatData(dpy, length);
} else {
_XRead(dpy, (char *)data, length * sizeof(CARD32) );
}
UnlockDisplay(dpy);
SyncHandle();
/* Search the set of returned attributes for the attribute requested by
* the caller.
*/
for ( i = 0 ; i < num_attributes ; i++ ) {
if ( data[i*2] == attribute ) {
*value = data[ (i*2) + 1 ];
break;
}
}
Xfree( data );
return 0;
}
/**
* Create a non-pbuffer GLX drawable.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static GLXDrawable
CreateDrawable( Display *dpy, const __GLcontextModes * fbconfig,
Drawable drawable, const int *attrib_list,
CARD8 glxCode )
{
xGLXCreateWindowReq * req;
CARD32 * data;
unsigned int i;
for ( i = 0 ; attrib_list[i * 2] != None ; i++ )
/* empty */ ;
LockDisplay(dpy);
GetReqExtra( GLXCreateWindow, 20 + (8 * i), req );
data = (CARD32 *) (req + 1);
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = glxCode;
req->screen = (CARD32) fbconfig->screen;
req->fbconfig = fbconfig->fbconfigID;
req->window = (GLXPbuffer) drawable;
req->numAttribs = (CARD32) i;
UnlockDisplay(dpy);
SyncHandle();
return drawable;
}
/**
* Destroy a non-pbuffer GLX drawable.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static void
DestroyDrawable( Display * dpy, GLXDrawable drawable, CARD32 glxCode )
{
xGLXDestroyPbufferReq * req;
if ( (dpy == NULL) || (drawable == 0) ) {
return;
}
LockDisplay(dpy);
GetReqExtra( GLXDestroyPbuffer, 4, req );
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = glxCode;
req->pbuffer = (GLXPbuffer) drawable;
UnlockDisplay(dpy);
SyncHandle();
return;
}
/**
* Create a pbuffer.
*
* This function is used to implement \c glXCreatePbuffer and
* \c glXCreateGLXPbufferSGIX.
*
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static GLXDrawable
CreatePbuffer( Display *dpy, const __GLcontextModes * fbconfig,
unsigned int width, unsigned int height,
const int *attrib_list, GLboolean size_in_attribs )
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
GLXDrawable id = 0;
CARD32 * data;
unsigned int i;
for ( i = 0 ; attrib_list[i * 2] != None ; i++ )
/* empty */ ;
LockDisplay(dpy);
id = XAllocID(dpy);
if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
xGLXCreatePbufferReq * req;
unsigned int extra = (size_in_attribs) ? 0 : 2;
GetReqExtra( GLXCreatePbuffer, (8 * (i + extra)), req );
data = (CARD32 *) (req + 1);
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = X_GLXCreatePbuffer;
req->screen = (CARD32) fbconfig->screen;
req->fbconfig = fbconfig->fbconfigID;
req->pbuffer = (GLXPbuffer) id;
req->numAttribs = (CARD32) (i + extra);
if ( ! size_in_attribs ) {
data[(2 * i) + 0] = GLX_PBUFFER_WIDTH;
data[(2 * i) + 1] = width;
data[(2 * i) + 2] = GLX_PBUFFER_HEIGHT;
data[(2 * i) + 3] = height;
data += 4;
}
}
else {
xGLXVendorPrivateReq *vpreq;
GetReqExtra( GLXVendorPrivate, 20 + (8 * i), vpreq );
data = (CARD32 *) (vpreq + 1);
vpreq->reqType = __glXSetupForCommand(dpy);
vpreq->glxCode = X_GLXVendorPrivate;
vpreq->vendorCode = X_GLXvop_CreateGLXPbufferSGIX;
data[0] = (CARD32) fbconfig->screen;
data[1] = (CARD32) fbconfig->fbconfigID;
data[2] = (CARD32) id;
data[3] = (CARD32) width;
data[4] = (CARD32) height;
data += 5;
}
(void) memcpy( data, attrib_list, sizeof(CARD32) * 2 * i );
UnlockDisplay(dpy);
SyncHandle();
return id;
}
/**
* Create a new pbuffer.
*/
PUBLIC GLXPbufferSGIX
GLX_PREFIX(glXCreateGLXPbufferSGIX)(Display *dpy, GLXFBConfigSGIX config,
unsigned int width, unsigned int height,
int *attrib_list)
{
return (GLXPbufferSGIX) CreatePbuffer( dpy, (__GLcontextModes *) config,
width, height,
attrib_list, GL_FALSE );
}
/**
* Create a new pbuffer.
*/
PUBLIC GLXPbuffer
GLX_PREFIX(glXCreatePbuffer)(Display *dpy, GLXFBConfig config,
const int *attrib_list)
{
return (GLXPbuffer) CreatePbuffer( dpy, (__GLcontextModes *) config,
0, 0,
attrib_list, GL_TRUE );
}
/**
* Destroy an existing pbuffer.
*/
PUBLIC void
GLX_PREFIX(glXDestroyPbuffer)(Display *dpy, GLXPbuffer pbuf)
{
DestroyPbuffer( dpy, pbuf );
}
/**
* Query an attribute of a drawable.
*/
PUBLIC void
GLX_PREFIX(glXQueryDrawable)(Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
GetDrawableAttribute( dpy, drawable, attribute, value );
}
/**
* Query an attribute of a pbuffer.
*/
PUBLIC int
GLX_PREFIX(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX drawable,
int attribute, unsigned int *value)
{
return GetDrawableAttribute( dpy, drawable, attribute, value );
}
/**
* Select the event mask for a drawable.
*/
PUBLIC void
GLX_PREFIX(glXSelectEvent)(Display *dpy, GLXDrawable drawable,
unsigned long mask)
{
CARD32 attribs[2];
attribs[0] = (CARD32) GLX_EVENT_MASK;
attribs[1] = (CARD32) mask;
ChangeDrawableAttribute( dpy, drawable, attribs, 1 );
}
/**
* Get the selected event mask for a drawable.
*/
PUBLIC void
GLX_PREFIX(glXGetSelectedEvent)(Display *dpy, GLXDrawable drawable,
unsigned long *mask)
{
unsigned int value;
/* The non-sense with value is required because on LP64 platforms
* sizeof(unsigned int) != sizeof(unsigned long). On little-endian
* we could just type-cast the pointer, but why?
*/
GetDrawableAttribute( dpy, drawable, GLX_EVENT_MASK_SGIX, & value );
*mask = value;
}
PUBLIC GLXPixmap
GLX_PREFIX(glXCreatePixmap)( Display *dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list )
{
return CreateDrawable( dpy, (__GLcontextModes *) config,
(Drawable) pixmap, attrib_list,
X_GLXCreatePixmap );
}
PUBLIC GLXWindow
GLX_PREFIX(glXCreateWindow)( Display *dpy, GLXFBConfig config, Window win,
const int *attrib_list )
{
return CreateDrawable( dpy, (__GLcontextModes *) config,
(Drawable) win, attrib_list,
X_GLXCreateWindow );
}
PUBLIC void
GLX_PREFIX(glXDestroyPixmap)(Display *dpy, GLXPixmap pixmap)
{
DestroyDrawable( dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap );
}
PUBLIC void
GLX_PREFIX(glXDestroyWindow)(Display *dpy, GLXWindow win)
{
DestroyDrawable( dpy, (GLXDrawable) win, X_GLXDestroyWindow );
}
PUBLIC GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
(Display *dpy, GLXPbufferSGIX 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)

102
src/glx/x11/glx_query.c Normal file
View File

@@ -0,0 +1,102 @@
/*
* (C) Copyright IBM Corporation 2004
* 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
* 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.
*/
/**
* \file glx_query.c
* Generic utility functions to query internal data from the server.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include "glxclient.h"
/**
* GLX protocol structure for the ficticious "GXLGenericGetString" request.
*
* This is a non-existant protocol packet. It just so happens that all of
* the real protocol packets used to request a string from the server have
* an identical binary layout. The only difference between them is the
* meaning of the \c for_whom field and the value of the \c glxCode.
*/
typedef struct GLXGenericGetString {
CARD8 reqType;
CARD8 glxCode;
CARD16 length B16;
CARD32 for_whom B32;
CARD32 name B32;
} xGLXGenericGetStringReq;
/* These defines are only needed to make the GetReq macro happy.
*/
#define sz_xGLXGenericGetStringReq 12
#define X_GLXGenericGetString 0
/**
* Query the Server GLX string and cache it in the display private.
* This routine will allocate the necessay space for the string.
*/
char *
__glXGetStringFromServer( Display * dpy, int opcode, CARD32 glxCode,
CARD32 for_whom, CARD32 name )
{
xGLXGenericGetStringReq *req;
xGLXSingleReply reply;
int length;
int numbytes;
char * buf;
LockDisplay( dpy );
/* All of the GLX protocol requests for getting a string from the server
* look the same. The exact meaning of the for_whom field is usually
* either the screen number (for glXQueryServerString) or the context tag
* (for GLXSingle).
*/
GetReq( GLXGenericGetString, req );
req->reqType = opcode;
req->glxCode = glxCode;
req->for_whom = for_whom;
req->name = name;
_XReply( dpy, (xReply *) & reply, 0, False );
length = reply.length * 4;
numbytes = reply.size;
buf = (char *) Xmalloc( numbytes );
if ( buf != NULL ) {
_XRead( dpy, buf, numbytes );
length -= numbytes;
}
_XEatData( dpy, length );
UnlockDisplay( dpy );
SyncHandle();
return buf;
}

View File

@@ -0,0 +1,346 @@
/*
* (C) Copyright IBM Corporation 2004
* 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
* THE COPYRIGHT HOLDERS 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 glx_texture_compression.c
* Contains the routines required to implement GLX protocol for
* ARB_texture_compression and related extensions.
*
* \sa http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_compression.txt
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include "packrender.h"
#include "packsingle.h"
#include <assert.h>
void
__indirect_glGetCompressedTexImageARB( GLenum target, GLint level,
GLvoid * img )
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXGetTexImageReply reply;
size_t image_bytes;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN( X_GLsop_GetCompressedTexImage, 8 );
__GLX_SINGLE_PUT_LONG( 0, target );
__GLX_SINGLE_PUT_LONG( 4, level );
__GLX_SINGLE_READ_XREPLY();
image_bytes = reply.width;
assert( image_bytes <= ((4 * reply.length) - 0) );
assert( image_bytes >= ((4 * reply.length) - 3) );
if ( image_bytes != 0 ) {
_XRead( dpy, (char *) img, image_bytes );
if ( image_bytes < (4 * reply.length) ) {
_XEatData( dpy, (4 * reply.length) - image_bytes );
}
}
__GLX_SINGLE_END();
}
/**
* Internal function used for \c glCompressedTexImage1D and
* \c glCompressedTexImage2D.
*/
static void
CompressedTexImage1D2D( GLenum target, GLint level,
GLenum internal_format,
GLsizei width, GLsizei height,
GLint border, GLsizei image_size,
const GLvoid *data, CARD32 rop )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if ( gc->currentDpy == NULL ) {
return;
}
if ( (target == GL_PROXY_TEXTURE_1D)
|| (target == GL_PROXY_TEXTURE_2D)
|| (target == GL_PROXY_TEXTURE_CUBE_MAP) ) {
compsize = 0;
}
else {
compsize = image_size;
}
cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE
+ compsize );
if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
__GLX_BEGIN_VARIABLE( rop, cmdlen );
__GLX_PUT_LONG( 4, target );
__GLX_PUT_LONG( 8, level );
__GLX_PUT_LONG( 12, internal_format );
__GLX_PUT_LONG( 16, width );
__GLX_PUT_LONG( 20, height );
__GLX_PUT_LONG( 24, border );
__GLX_PUT_LONG( 28, image_size );
if ( compsize != 0 ) {
__GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE,
data, image_size );
}
__GLX_END( cmdlen );
}
else {
assert( compsize != 0 );
__GLX_BEGIN_VARIABLE_LARGE( rop, cmdlen + 4 );
__GLX_PUT_LONG( 8, target );
__GLX_PUT_LONG( 12, level );
__GLX_PUT_LONG( 16, internal_format );
__GLX_PUT_LONG( 20, width );
__GLX_PUT_LONG( 24, height );
__GLX_PUT_LONG( 28, border );
__GLX_PUT_LONG( 32, image_size );
__glXSendLargeCommand( gc, gc->pc,
__GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE + 4,
data, image_size );
}
}
/**
* Internal function used for \c glCompressedTexSubImage1D and
* \c glCompressedTexSubImage2D.
*/
static void
CompressedTexSubImage1D2D( GLenum target, GLint level,
GLsizei xoffset, GLsizei yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei image_size,
const GLvoid *data, CARD32 rop )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if ( gc->currentDpy == NULL ) {
return;
}
if ( target == GL_PROXY_TEXTURE_3D ) {
compsize = 0;
}
else {
compsize = image_size;
}
cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE
+ compsize );
if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
__GLX_BEGIN_VARIABLE( rop, cmdlen );
__GLX_PUT_LONG( 4, target );
__GLX_PUT_LONG( 8, level );
__GLX_PUT_LONG( 12, xoffset );
__GLX_PUT_LONG( 16, yoffset );
__GLX_PUT_LONG( 20, width );
__GLX_PUT_LONG( 24, height );
__GLX_PUT_LONG( 28, format );
__GLX_PUT_LONG( 32, image_size );
if ( compsize != 0 ) {
__GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE,
data, image_size );
}
__GLX_END( cmdlen );
}
else {
assert( compsize != 0 );
__GLX_BEGIN_VARIABLE_LARGE( rop, cmdlen + 4 );
__GLX_PUT_LONG( 8, target );
__GLX_PUT_LONG( 12, level );
__GLX_PUT_LONG( 16, xoffset );
__GLX_PUT_LONG( 20, yoffset );
__GLX_PUT_LONG( 24, width );
__GLX_PUT_LONG( 28, height );
__GLX_PUT_LONG( 32, format );
__GLX_PUT_LONG( 36, image_size );
__glXSendLargeCommand( gc, gc->pc,
__GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE + 4,
data, image_size );
}
}
void
__indirect_glCompressedTexImage1DARB( GLenum target, GLint level,
GLenum internal_format, GLsizei width,
GLint border, GLsizei image_size,
const GLvoid *data )
{
CompressedTexImage1D2D( target, level, internal_format, width, 0,
border, image_size, data,
X_GLrop_CompressedTexImage1D );
}
void
__indirect_glCompressedTexImage2DARB( GLenum target, GLint level,
GLenum internal_format,
GLsizei width, GLsizei height,
GLint border, GLsizei image_size,
const GLvoid *data )
{
CompressedTexImage1D2D( target, level, internal_format, width, height,
border, image_size, data,
X_GLrop_CompressedTexImage2D );
}
void
__indirect_glCompressedTexImage3DARB( GLenum target, GLint level,
GLenum internal_format,
GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLsizei image_size,
const GLvoid *data )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if ( gc->currentDpy == NULL ) {
return;
}
cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE
+ image_size );
if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
__GLX_BEGIN_VARIABLE( X_GLrop_CompressedTexImage3D, cmdlen );
__GLX_PUT_LONG( 4, target );
__GLX_PUT_LONG( 8, level );
__GLX_PUT_LONG( 12, internal_format );
__GLX_PUT_LONG( 16, width );
__GLX_PUT_LONG( 20, height );
__GLX_PUT_LONG( 24, depth );
__GLX_PUT_LONG( 28, border );
__GLX_PUT_LONG( 32, image_size );
if ( image_size != 0 ) {
__GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE,
data, image_size );
}
__GLX_END( cmdlen );
}
else {
__GLX_BEGIN_VARIABLE_LARGE( X_GLrop_CompressedTexImage3D,
cmdlen + 4 );
__GLX_PUT_LONG( 8, target );
__GLX_PUT_LONG( 12, level );
__GLX_PUT_LONG( 16, internal_format );
__GLX_PUT_LONG( 20, width );
__GLX_PUT_LONG( 24, height );
__GLX_PUT_LONG( 28, depth );
__GLX_PUT_LONG( 32, border );
__GLX_PUT_LONG( 36, image_size );
__glXSendLargeCommand( gc, gc->pc,
__GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE + 4,
data, image_size );
}
}
void
__indirect_glCompressedTexSubImage1DARB( GLenum target, GLint level,
GLint xoffset,
GLsizei width,
GLenum format, GLsizei image_size,
const GLvoid *data )
{
CompressedTexSubImage1D2D( target, level, xoffset, 0, width, 0,
format, image_size, data,
X_GLrop_CompressedTexSubImage1D );
}
void
__indirect_glCompressedTexSubImage2DARB( GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei image_size,
const GLvoid *data )
{
CompressedTexSubImage1D2D( target, level, xoffset, yoffset, width, height,
format, image_size, data,
X_GLrop_CompressedTexSubImage2D );
}
void
__indirect_glCompressedTexSubImage3DARB( GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLsizei image_size,
const GLvoid *data )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if ( gc->currentDpy == NULL ) {
return;
}
cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE
+ image_size );
if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
__GLX_BEGIN_VARIABLE( X_GLrop_CompressedTexSubImage3D, cmdlen );
__GLX_PUT_LONG( 4, target );
__GLX_PUT_LONG( 8, level );
__GLX_PUT_LONG( 12, xoffset );
__GLX_PUT_LONG( 16, yoffset );
__GLX_PUT_LONG( 20, zoffset );
__GLX_PUT_LONG( 24, width );
__GLX_PUT_LONG( 28, height );
__GLX_PUT_LONG( 32, depth );
__GLX_PUT_LONG( 36, format );
__GLX_PUT_LONG( 40, image_size );
if ( image_size != 0 ) {
__GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE,
data, image_size );
}
__GLX_END( cmdlen );
}
else {
__GLX_BEGIN_VARIABLE_LARGE( X_GLrop_CompressedTexSubImage3D,
cmdlen + 4 );
__GLX_PUT_LONG( 8, target );
__GLX_PUT_LONG( 12, level );
__GLX_PUT_LONG( 16, xoffset );
__GLX_PUT_LONG( 20, yoffset );
__GLX_PUT_LONG( 24, zoffset );
__GLX_PUT_LONG( 28, width );
__GLX_PUT_LONG( 32, height );
__GLX_PUT_LONG( 36, depth );
__GLX_PUT_LONG( 40, format );
__GLX_PUT_LONG( 44, image_size );
__glXSendLargeCommand( gc, gc->pc,
__GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE + 4,
data, image_size );
}
}

833
src/glx/x11/glxclient.h Normal file
View File

@@ -0,0 +1,833 @@
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.21 2004/02/09 23:46:31 alanh Exp $ */
/**
* \file glxclient.h
* Direct rendering support added by Precision Insight, Inc.
*
* \author Kevin E. Martin <kevin@precisioninsight.com>
*/
#ifndef _GLX_client_h_
#define _GLX_client_h_
#define NEED_REPLIES
#define NEED_EVENTS
#include <X11/Xproto.h>
#include <X11/Xlibint.h>
#define GLX_GLXEXT_PROTOTYPES
#include <GL/glx.h>
#include <GL/glxext.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef WIN32
#include <stdint.h>
#endif
#include "GL/glxint.h"
#include "GL/glxproto.h"
#include "GL/internal/glcore.h"
#include "glapitable.h"
#ifdef XTHREADS
#include "Xthreads.h"
#endif
#ifdef GLX_BUILT_IN_XMESA
#include "realglx.h" /* just silences prototype warnings */
#endif
#define GLX_MAJOR_VERSION 1 /* current version numbers */
#define GLX_MINOR_VERSION 4
#define __GLX_MAX_TEXTURE_UNITS 32
typedef struct __GLXcontextRec __GLXcontext;
typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate;
typedef struct _glapi_table __GLapi;
/************************************************************************/
#ifdef GLX_DIRECT_RENDERING
#include <GL/internal/dri_interface.h>
typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config);
typedef void *(*CreateNewScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes, const __DRIversion * ddx_version,
const __DRIversion * dri_version, const __DRIversion * drm_version,
const __DRIframebuffer * frame_buffer, void * pSAREA,
int fd, int internal_api_version, __GLcontextModes ** driver_modes);
/**
* Display dependent methods. This structure is initialized during the
* \c driCreateDisplay call.
*/
struct __DRIdisplayRec {
/**
* Method to destroy the private DRI display data.
*/
void (*destroyDisplay)(Display *dpy, void *displayPrivate);
/**
* Methods to create the private DRI screen data and initialize the
* screen dependent methods.
* This is an array [indexed by screen number] of function pointers.
*
* \deprecated This array of function pointers has been replaced by
* \c __DRIdisplayRec::createNewScreen.
* \sa __DRIdisplayRec::createNewScreen
*/
CreateScreenFunc * createScreen;
/**
* Opaque pointer to private per display direct rendering data.
* \c NULL if direct rendering is not supported on this display.
*/
struct __DRIdisplayPrivateRec *private;
/**
* Array of pointers to methods to create and initialize the private DRI
* screen data.
*
* \sa __DRIdisplayRec::createScreen
*/
CreateNewScreenFunc * createNewScreen;
};
/*
** We keep a linked list of these structures, one per DRI device driver.
*/
struct __DRIdriverRec {
const char *name;
void *handle;
CreateScreenFunc createScreenFunc;
CreateNewScreenFunc createNewScreenFunc;
struct __DRIdriverRec *next;
};
/*
** Function to create and DRI display data and initialize the display
** dependent methods.
*/
extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp);
extern __DRIdriver *driGetDriver(Display *dpy, int scrNum);
extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
/*
** Functions to obtain driver configuration information from a direct
** rendering client application
*/
extern const char *glXGetScreenDriver (Display *dpy, int scrNum);
extern const char *glXGetDriverConfig (const char *driverName);
#endif
/************************************************************************/
#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
typedef struct __GLXpixelStoreModeRec {
GLboolean swapEndian;
GLboolean lsbFirst;
GLuint rowLength;
GLuint imageHeight;
GLuint imageDepth;
GLuint skipRows;
GLuint skipPixels;
GLuint skipImages;
GLuint alignment;
} __GLXpixelStoreMode;
/* The next 3 structures are deprecated. Client state is no longer tracked
* using them. They only remain to maintain the layout / structure offset of
* __GLXcontextRec. In XFree86 5.0 they will be removed altogether.
*/
typedef struct __GLXvertexArrayPointerStateRecDEPRECATED {
GLboolean enable;
void (*proc)(const void *);
const GLubyte *ptr;
GLsizei skip;
GLint size;
GLenum type;
GLsizei stride;
} __GLXvertexArrayPointerStateDEPRECATED;
typedef struct __GLXvertArrayStateRecDEPRECATED {
__GLXvertexArrayPointerStateDEPRECATED vertex;
__GLXvertexArrayPointerStateDEPRECATED normal;
__GLXvertexArrayPointerStateDEPRECATED color;
__GLXvertexArrayPointerStateDEPRECATED index;
__GLXvertexArrayPointerStateDEPRECATED texCoord[__GLX_MAX_TEXTURE_UNITS];
__GLXvertexArrayPointerStateDEPRECATED edgeFlag;
GLint maxElementsVertices;
GLint maxElementsIndices;
GLint activeTexture;
} __GLXvertArrayStateDEPRECATED;
typedef struct __GLXattributeRecDEPRECATED {
GLuint mask;
/*
** Pixel storage state. Most of the pixel store mode state is kept
** here and used by the client code to manage the packing and
** unpacking of data sent to/received from the server.
*/
__GLXpixelStoreMode storePack, storeUnpack;
/*
** Vertex Array storage state. The vertex array component
** state is stored here and is used to manage the packing of
** DrawArrays data sent to the server.
*/
__GLXvertArrayStateDEPRECATED vertArray;
} __GLXattributeDEPRECATED;
typedef struct __GLXvertexArrayPointerStateRec {
void (*proc)(const void *);
void (*mtex_proc)(GLenum, const void *);
const GLubyte *ptr;
GLsizei skip;
GLint size;
GLenum type;
GLsizei stride;
} __GLXvertexArrayPointerState;
/**
* Define which entries of \c __GLXvertArrayState::arrays match which
* vertex arrays in the client-state vector. These are only the one-of
* arrays. See the \c __GLXvertArrayState::arrays documentation for more
* details.
*
* \sa __GLXvertArrayState
*/
enum {
edgeFlag_ARRAY, /**< \c GL_EDGE_FLAG_ARRAY */
index_ARRAY, /**< \c GL_INDEX_ARRAY */
fogCoord_ARRAY, /**< \c GL_FOG_COORD_ARRAY */
secondaryColor_ARRAY, /**< \c GL_SECONDARY_COLOR_ARRAY */
color_ARRAY, /**< \c GL_COLOR_ARRAY */
normal_ARRAY, /**< \c GL_NORMAL_ARRAY */
/**
* \c GL_VERTEX_ARRAY \b must be last! All of the code for emitting arrays
* and array elements is written based on the assumption that the vertex
* array is last.
*/
vertex_ARRAY,
__GLX_MAX_ARRAYS /**< Place holder entry. */
};
#define ENABLE_ARRAY(state,a) \
do { (state)->vertArray.enables |= (1U << (a ## _ARRAY)); } while( 0 )
#define DISABLE_ARRAY(state,a) \
do { (state)->vertArray.enables &= ~(1U << (a ## _ARRAY)); } while( 0 )
#define IS_ARRAY_ENABLED_BY_INDEX(state, i) \
(((state)->vertArray.enables & (1U << (i))) != 0)
#define IS_ARRAY_ENABLED(state, a) \
IS_ARRAY_ENABLED_BY_INDEX(state, a ## _ARRAY)
#define ENABLE_TEXARRAY(state,a) \
do { (state)->vertArray.texture_enables |= (1U << a); } while( 0 )
#define DISABLE_TEXARRAY(state,a) \
do { (state)->vertArray.texture_enables &= ~(1U << a); } while( 0 )
#define IS_TEXARRAY_ENABLED(state, a) \
(((state)->vertArray.texture_enables & (1U << a)) != 0)
/**
* Client-side vertex array state.
*/
typedef struct __GLXvertArrayStateRec {
/**
* Which client-side arrays are enabled? These are the flag bits for
* all of the non-texture coordinate arrays.
*/
GLuint enables;
/**
* Which of the texture coordinate arrays are enabled?
*/
GLuint texture_enables;
/**
* State for "one-of" arrays. These are the arrays, such as
* GL_COLOR_ARRAY or GL_FOG_COORD_ARRAY for which there is only one
* array. There are also "many-of" arrays, such as
* GL_TEXTURE_COORD_ARRAY.
*/
__GLXvertexArrayPointerState arrays[__GLX_MAX_ARRAYS];
__GLXvertexArrayPointerState texCoord[__GLX_MAX_TEXTURE_UNITS];
GLint maxElementsVertices;
GLint maxElementsIndices;
GLint activeTexture;
} __GLXvertArrayState;
typedef struct __GLXattributeRec {
GLuint mask;
/*
** Pixel storage state. Most of the pixel store mode state is kept
** here and used by the client code to manage the packing and
** unpacking of data sent to/received from the server.
*/
__GLXpixelStoreMode storePack, storeUnpack;
/*
** Vertex Array storage state. The vertex array component
** state is stored here and is used to manage the packing of
** DrawArrays data sent to the server.
*/
__GLXvertArrayState vertArray;
/**
* Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically
* disabled?
*/
GLboolean NoDrawArraysProtocol;
} __GLXattribute;
typedef struct __GLXattributeMachineRec {
__GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
__GLXattribute **stackPointer;
} __GLXattributeMachine;
/**
* GLX state that needs to be kept on the client. One of these records
* exist for each context that has been made current by this client.
*/
struct __GLXcontextRec {
/**
* \name Drawing command buffer.
*
* Drawing commands are packed into this buffer before being sent as a
* single GLX protocol request. The buffer is sent when it overflows or
* is flushed by \c __glXFlushRenderBuffer. \c pc is the next location
* in the buffer to be filled. \c limit is described above in the buffer
* slop discussion.
*
* Commands that require large amounts of data to be transfered will
* also use this buffer to hold a header that describes the large
* command.
*
* These must be the first 6 fields since they are static initialized
* in the dummy context in glxext.c
*/
/*@{*/
GLubyte *buf;
GLubyte *pc;
GLubyte *limit;
GLubyte *bufEnd;
GLint bufSize;
/*@}*/
/**
* The XID of this rendering context. When the context is created a
* new XID is allocated. This is set to None when the context is
* destroyed but is still current to some thread. In this case the
* context will be freed on next MakeCurrent.
*/
XID xid;
/**
* The XID of the \c shareList context.
*/
XID share_xid;
/**
* Visual id.
*
* \deprecated
* This filed has been largely been replaced by the \c mode field, but
* the work is not quite done.
*/
VisualID vid;
/**
* Screen number.
*/
GLint screen;
/**
* \c GL_TRUE if the context was created with ImportContext, which
* means the server-side context was created by another X client.
*/
GLboolean imported;
/**
* The context tag returned by MakeCurrent when this context is made
* current. This tag is used to identify the context that a thread has
* current so that proper server context management can be done. It is
* used for all context specific commands (i.e., \c Render, \c RenderLarge,
* \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old
* context)).
*/
GLXContextTag currentContextTag;
/**
* \name Rendering mode
*
* The rendering mode is kept on the client as well as the server.
* When \c glRenderMode is called, the buffer associated with the
* previous rendering mode (feedback or select) is filled.
*/
/*@{*/
GLenum renderMode;
GLfloat *feedbackBuf;
GLuint *selectBuf;
/*@}*/
/**
* This is \c GL_TRUE if the pixel unpack modes are such that an image
* can be unpacked from the clients memory by just copying. It may
* still be true that the server will have to do some work. This
* just promises that a straight copy will fetch the correct bytes.
*/
GLboolean fastImageUnpack;
/**
* Fill newImage with the unpacked form of \c oldImage getting it
* ready for transport to the server.
*/
void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
GLenum, const GLvoid*, GLubyte*, GLubyte*);
/**
* \name Client side attribs.
*/
/*@{*/
__GLXattributeDEPRECATED stateDEPRECATED;
__GLXattributeMachine attributes;
/*@}*/
/**
* Client side error code. This is set when client side gl API
* routines need to set an error because of a bad enumerant or
* running out of memory, etc.
*/
GLenum error;
/**
* Whether this context does direct rendering.
*/
Bool isDirect;
/**
* \c dpy of current display for this context. Will be \c NULL if not
* current to any display, or if this is the "dummy context".
*/
Display *currentDpy;
/**
* The current drawable for this context. Will be None if this
* context is not current to any drawable. currentReadable is below.
*/
GLXDrawable currentDrawable;
/**
* \name GL Constant Strings
*
* Constant strings that describe the server implementation
* These pertain to GL attributes, not to be confused with
* GLX versioning attributes.
*/
/*@{*/
GLubyte *vendor;
GLubyte *renderer;
GLubyte *version;
GLubyte *extensions;
/*@}*/
/**
* Record the dpy this context was created on for later freeing
*/
Display *createDpy;
/**
* Maximum small render command size. This is the smaller of 64k and
* the size of the above buffer.
*/
GLint maxSmallRenderCommandSize;
/**
* Major opcode for the extension. Copied here so a lookup isn't
* needed.
*/
GLint majorOpcode;
#ifdef GLX_DIRECT_RENDERING
/**
* Per context direct rendering interface functions and data.
*/
__DRIcontext driContext;
#endif
/**
* \c GLXFBConfigID used to create this context. May be \c None. This
* field has been replaced by the \c mode field.
*
* \since Internal API version 20030317.
*
* \deprecated
* This filed has been largely been replaced by the \c mode field, but
* the work is not quite done.
*/
GLXFBConfigID fbconfigID;
/**
* The current read-drawable for this context. Will be None if this
* context is not current to any drawable.
*
* \since Internal API version 20030606.
*/
GLXDrawable currentReadable;
/**
* Pointer to client-state data that is private to libGL. This is only
* used for indirect rendering contexts.
*
* No internal API version change was made for this change. Client-side
* drivers should NEVER use this data or even care that it exists.
*/
void * client_state_private;
/**
* Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE.
*/
int renderType;
/**
* \name Raw server GL version
*
* True core GL version supported by the server. This is the raw value
* returned by the server, and it may not reflect what is actually
* supported (or reported) by the client-side library.
*/
/*@{*/
int server_major; /**< Major version number. */
int server_minor; /**< Minor version number. */
/*@}*/
};
#define __glXSetError(gc,code) \
if (!(gc)->error) { \
(gc)->error = code; \
}
extern void __glFreeAttributeState(__GLXcontext *);
/************************************************************************/
/**
* The size of the largest drawing command known to the implementation
* that will use the GLXRender GLX command. In this case it is
* \c glPolygonStipple.
*/
#define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156
/**
* To keep the implementation fast, the code uses a "limit" pointer
* to determine when the drawing command buffer is too full to hold
* another fixed size command. This constant defines the amount of
* space that must always be available in the drawing command buffer
* at all times for the implementation to work. It is important that
* the number be just large enough, but not so large as to reduce the
* efficacy of the buffer. The "+32" is just to keep the code working
* in case somebody counts wrong.
*/
#define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32)
/**
* This implementation uses a smaller threshold for switching
* to the RenderLarge protocol than the protcol requires so that
* large copies don't occur.
*/
#define __GLX_RENDER_CMD_SIZE_LIMIT 4096
/**
* One of these records exists per screen of the display. It contains
* a pointer to the config data for that screen (if the screen supports GL).
*/
typedef struct __GLXscreenConfigsRec {
/**
* GLX visuals formated as \c __GLXvisualConfig structures.
*/
/*@{*/
__GLXvisualConfig * old_configs;
int numOldConfigs;
/*@}*/
/**
* GLX extension string reported by the X-server.
*/
const char *serverGLXexts;
/**
* GLX extension string to be reported to applications. This is the
* set of extensions that the application can actually use.
*/
char *effectiveGLXexts;
#ifdef GLX_DIRECT_RENDERING
/**
* Per screen direct rendering interface functions and data.
*/
__DRIscreen driScreen;
#endif
/**
* Linked list of configurations for this screen. This is intended to
* be a superset of \c old_configs.
*/
__GLcontextModes *configs;
/**
* Per-screen dynamic GLX extension tracking. The \c direct_support
* field only contains enough bits for 64 extensions. Should libGL
* ever need to track more than 64 GLX extensions, we can safely grow
* this field. The \c __GLXscreenConfigs structure is not used outside
* libGL.
*/
/*@{*/
unsigned char direct_support[8];
GLboolean ext_list_first_time;
/*@}*/
} __GLXscreenConfigs;
/**
* Per display private data. One of these records exists for each display
* that is using the OpenGL (GLX) extension.
*/
struct __GLXdisplayPrivateRec {
/**
* Back pointer to the display
*/
Display *dpy;
/**
* The \c majorOpcode is common to all connections to the same server.
* It is also copied into the context structure.
*/
int majorOpcode;
/**
* \name Server Version
*
* Major and minor version returned by the server during initialization.
*/
/*@{*/
int majorVersion, minorVersion;
/*@}*/
/**
* \name Storage for the servers GLX vendor and versions strings.
*
* These are the same for all screens on this display. These fields will
* be filled in on demand.
*/
/*@{*/
const char *serverGLXvendor;
const char *serverGLXversion;
/*@}*/
/**
* Configurations of visuals for all screens on this display.
* Also, per screen data which now includes the server \c GLX_EXTENSION
* string.
*/
__GLXscreenConfigs *screenConfigs;
#ifdef GLX_DIRECT_RENDERING
/**
* Per display direct rendering interface functions and data.
*/
__DRIdisplay driDisplay;
#endif
};
void __glXFreeContext(__GLXcontext*);
extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*);
extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
GLint totalRequests,
const GLvoid * data, GLint dataLen);
extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint,
const GLvoid *, GLint);
/* Initialize the GLX extension for dpy */
extern __GLXdisplayPrivate *__glXInitialize(Display*);
/************************************************************************/
extern int __glXDebug;
/* This is per-thread storage in an MT environment */
#if defined(GLX_DIRECT_RENDERING) && defined(XTHREADS)
extern __GLXcontext *__glXGetCurrentContext(void);
extern void __glXSetCurrentContext(__GLXcontext *c);
#else
extern __GLXcontext *__glXcurrentContext;
#define __glXGetCurrentContext() __glXcurrentContext
#define __glXSetCurrentContext(gc) __glXcurrentContext = gc
#endif
/*
** Global lock for all threads in this address space using the GLX
** extension
*/
#if defined(GLX_DIRECT_RENDERING) && defined(XTHREADS)
extern xmutex_rec __glXmutex;
#define __glXLock() xmutex_lock(&__glXmutex)
#define __glXUnlock() xmutex_unlock(&__glXmutex)
#else
#define __glXLock()
#define __glXUnlock()
#endif
/*
** Setup for a command. Initialize the extension for dpy if necessary.
*/
extern CARD8 __glXSetupForCommand(Display *dpy);
/************************************************************************/
/*
** Data conversion and packing support.
*/
/* Return the size, in bytes, of some pixel data */
extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum);
/* Return the number of elements per group of a specified format*/
extern GLint __glElementsPerGroup(GLenum format, GLenum type);
/* Return the number of bytes per element, based on the element type (other
** than GL_BITMAP).
*/
extern GLint __glBytesPerElement(GLenum type);
/* Return the k value for a given map target */
extern GLint __glEvalComputeK(GLenum);
/*
** Fill the transport buffer with the data from the users buffer,
** applying some of the pixel store modes (unpack modes) to the data
** first. As a side effect of this call, the "modes" field is
** updated to contain the modes needed by the server to decode the
** sent data.
*/
extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
GLenum, const GLvoid*, GLubyte*, GLubyte*);
/* Copy map data with a stride into a packed buffer */
extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *);
extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *);
extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint,
const GLfloat *, GLfloat *);
extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint,
const GLdouble *, GLdouble *);
/*
** Empty an image out of the reply buffer into the clients memory applying
** the pack modes to pack back into the clients requested format.
*/
extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
GLenum, const GLubyte *, GLvoid *);
/*
** Allocate and Initialize Vertex Array client state
*/
extern void __glXInitVertexArrayState(__GLXcontext*);
/*
** Inform the Server of the major and minor numbers and of the client
** libraries extension string.
*/
extern void __glXClientInfo ( Display *dpy, int opcode );
/************************************************************************/
/*
** Declarations that should be in Xlib
*/
#ifdef __GL_USE_OUR_PROTOTYPES
extern void _XFlush(Display*);
extern Status _XReply(Display*, xReply*, int, Bool);
extern void _XRead(Display*, void*, long);
extern void _XSend(Display*, const void*, long);
#endif
/*
** GLX_BUILT_IN_XMESA controls whether libGL has a built-in verions of
** Mesa that can render to non-GLX displays.
*/
#ifdef GLX_BUILT_IN_XMESA
#define GLX_PREFIX(function) _real_##function
#else
#define GLX_PREFIX(function) function
#endif
extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config,
int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags );
extern char * __glXGetStringFromServer( Display * dpy, int opcode,
CARD32 glxCode, CARD32 for_whom, CARD32 name );
extern char *__glXstrdup(const char *str);
extern const char __glXGLClientVersion[];
extern const char __glXGLClientExtensions[];
/* Determine the internal API version */
extern int __glXGetInternalVersion(void);
/* Get the unadjusted system time */
extern int __glXGetUST( int64_t * ust );
#endif /* !__GLX_client_h__ */

3131
src/glx/x11/glxcmds.c Normal file

File diff suppressed because it is too large Load Diff

1873
src/glx/x11/glxext.c Normal file

File diff suppressed because it is too large Load Diff

706
src/glx/x11/glxextensions.c Normal file
View File

@@ -0,0 +1,706 @@
/*
* (C) Copyright IBM Corporation 2002, 2004
* 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
* THE COPYRIGHT HOLDERS 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 glxextensions.c
*
* \author Ian Romanick <idr@us.ibm.com>
*/
/* $XFree86: xc/lib/GL/glx/glxextensions.c,v 1.1 2003/09/28 20:15:03 alanh Exp $ */
#include "glxclient.h"
#include <extutil.h>
#include <Xext.h>
#include <string.h>
#include "glapi.h"
#include "glxextensions.h"
#include "simple_list.h"
#define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8)))
#define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8)))
#define IS_SET(m,b) ((m[ (b) / 8 ] & (1U << ((b) % 8))) != 0)
#define CONCAT(a,b) a ## b
#define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, CONCAT(n,_bit)
#define GL(n) "GL_" # n, 3 + sizeof( # n ) - 1, GL_ ## n ## _bit
#define VER(a,b) a, b
#define Y 1
#define N 0
#define EXT_ENABLED(bit,supported) (IS_SET( supported, bit ))
struct extension_info {
const char * const name;
unsigned name_len;
unsigned char bit;
/* This is the lowest version of GLX that "requires" this extension.
* For example, GLX 1.3 requires SGIX_fbconfig, SGIX_pbuffer, and
* SGI_make_current_read. If the extension is not required by any known
* version of GLX, use 0, 0.
*/
unsigned char version_major;
unsigned char version_minor;
unsigned char client_support;
unsigned char direct_support;
unsigned char client_only; /** Is the extension client-side only? */
unsigned char direct_only; /** Is the extension for direct
* contexts only?
*/
};
static const struct extension_info known_glx_extensions[] = {
{ GLX(ARB_get_proc_address), VER(1,4), Y, N, Y, N },
{ GLX(ARB_multisample), VER(1,4), Y, Y, N, N },
{ GLX(ARB_render_texture), VER(0,0), N, N, N, N },
{ GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N },
{ GLX(EXT_import_context), VER(0,0), Y, Y, N, N },
{ GLX(EXT_visual_info), VER(0,0), Y, Y, N, N },
{ GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N },
{ GLX(MESA_agp_offset), VER(0,0), N, N, N, Y }, /* Deprecated */
{ GLX(MESA_allocate_memory), VER(0,0), Y, N, N, Y },
{ GLX(MESA_copy_sub_buffer), VER(0,0), N, N, N, N }, /* Deprecated? */
{ GLX(MESA_pixmap_colormap), VER(0,0), N, N, N, N }, /* Deprecated */
{ GLX(MESA_release_buffers), VER(0,0), N, N, N, N }, /* Deprecated */
{ GLX(MESA_set_3dfx_mode), VER(0,0), N, N, N, N }, /* Deprecated */
{ GLX(MESA_swap_control), VER(0,0), Y, N, N, Y },
{ GLX(MESA_swap_frame_usage), VER(0,0), Y, N, N, Y },
{ GLX(NV_float_buffer), VER(0,0), N, N, N, N },
{ GLX(NV_render_depth_texture), VER(0,0), N, N, N, N },
{ GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N },
{ GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */
{ GLX(OML_swap_method), VER(0,0), Y, N, N, N },
{ GLX(OML_sync_control), VER(0,0), Y, N, N, Y },
{ GLX(SGI_cushion), VER(0,0), N, N, N, N },
{ GLX(SGI_make_current_read), VER(1,3), Y, N, N, N },
{ GLX(SGI_swap_control), VER(0,0), Y, N, N, N },
{ GLX(SGI_video_sync), VER(0,0), Y, N, N, Y },
{ GLX(SGIS_blended_overlay), VER(0,0), N, N, N, N },
{ GLX(SGIS_color_range), VER(0,0), N, N, N, N },
{ GLX(SGIS_multisample), VER(0,0), Y, Y, N, N },
{ GLX(SGIX_dm_buffer), VER(0,0), N, N, N, N },
{ GLX(SGIX_fbconfig), VER(1,3), Y, N, N, N },
{ GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N },
{ GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N },
{ GLX(SGIX_swap_group), VER(0,0), N, N, N, N },
{ GLX(SGIX_video_resize), VER(0,0), N, N, N, N },
{ GLX(SGIX_video_source), VER(0,0), N, N, N, N },
{ GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N },
{ GLX(SUN_get_transparent_index), VER(0,0), N, N, N, N },
{ NULL }
};
static const struct extension_info known_gl_extensions[] = {
{ GL(ARB_depth_texture), VER(1,4), Y, N, N, N },
{ GL(ARB_fragment_program), VER(0,0), N, N, N, N },
{ GL(ARB_imaging), VER(0,0), Y, N, N, N },
{ GL(ARB_multisample), VER(1,3), Y, N, N, N },
{ GL(ARB_multitexture), VER(1,3), Y, N, N, N },
{ GL(ARB_occlusion_query), VER(1,5), N, N, N, N },
{ GL(ARB_point_parameters), VER(1,4), Y, N, N, N },
{ GL(ARB_point_sprite), VER(0,0), Y, N, N, N },
{ GL(ARB_shadow), VER(1,4), Y, N, N, N },
{ GL(ARB_shadow_ambient), VER(0,0), Y, N, N, N },
{ GL(ARB_texture_border_clamp), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_compression), VER(1,3), N, N, N, N },
{ GL(ARB_texture_cube_map), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_env_add), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_env_combine), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_env_crossbar), VER(1,4), Y, N, N, N },
{ GL(ARB_texture_env_dot3), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_mirrored_repeat), VER(1,4), Y, N, N, N },
{ GL(ARB_texture_non_power_of_two), VER(1,5), Y, N, N, N },
{ GL(ARB_texture_rectangle), VER(0,0), Y, N, N, N },
{ GL(ARB_transpose_matrix), VER(1,3), Y, N, Y, N },
{ GL(ARB_vertex_buffer_object), VER(1,5), N, N, N, N },
{ GL(ARB_window_pos), VER(1,4), Y, N, N, N },
{ GL(EXT_abgr), VER(0,0), Y, N, N, N },
{ GL(EXT_bgra), VER(1,2), Y, N, N, N },
{ GL(EXT_blend_color), VER(1,4), Y, N, N, N },
{ GL(EXT_blend_equation_separate), VER(0,0), N, N, N, N },
{ GL(EXT_blend_func_separate), VER(1,4), Y, N, N, N },
{ GL(EXT_blend_logic_op), VER(1,4), Y, N, N, N },
{ GL(EXT_blend_minmax), VER(1,4), Y, N, N, N },
{ GL(EXT_blend_subtract), VER(1,4), Y, N, N, N },
{ GL(EXT_clip_volume_hint), VER(0,0), Y, N, N, N },
{ GL(EXT_compiled_vertex_array), VER(0,0), N, N, N, N },
{ GL(EXT_convolution), VER(0,0), N, N, N, N },
{ GL(EXT_copy_texture), VER(1,1), Y, N, N, N },
{ GL(EXT_cull_vertex), VER(0,0), N, N, N, N },
{ GL(EXT_depth_bounds_test), VER(0,0), N, N, N, N },
{ GL(EXT_draw_range_elements), VER(1,2), Y, N, Y, N },
{ GL(EXT_fog_coord), VER(1,4), Y, N, N, N },
{ GL(EXT_multi_draw_arrays), VER(1,4), Y, N, Y, N },
{ GL(EXT_packed_pixels), VER(1,2), Y, N, N, N },
{ GL(EXT_paletted_texture), VER(0,0), Y, N, N, N },
{ GL(EXT_pixel_buffer_object), VER(0,0), N, N, N, N },
{ GL(EXT_point_parameters), VER(1,4), Y, N, N, N },
{ GL(EXT_polygon_offset), VER(1,1), Y, N, N, N },
{ GL(EXT_rescale_normal), VER(1,2), Y, N, N, N },
{ GL(EXT_secondary_color), VER(1,4), Y, N, N, N },
{ GL(EXT_separate_specular_color), VER(1,2), Y, N, N, N },
{ GL(EXT_shadow_funcs), VER(1,5), Y, N, N, N },
{ GL(EXT_shared_texture_palette), VER(0,0), Y, N, N, N },
{ GL(EXT_stencil_two_side), VER(0,0), Y, N, N, N },
{ GL(EXT_stencil_wrap), VER(1,4), Y, N, N, N },
{ GL(EXT_subtexture), VER(1,1), Y, N, N, N },
{ GL(EXT_texture), VER(1,1), Y, N, N, N },
{ GL(EXT_texture3D), VER(1,2), Y, N, N, N },
{ GL(EXT_texture_compression_s3tc), VER(0,0), N, N, N, N },
{ GL(EXT_texture_edge_clamp), VER(1,2), Y, N, N, N },
{ GL(EXT_texture_env_add), VER(1,3), Y, N, N, N },
{ GL(EXT_texture_env_combine), VER(1,3), Y, N, N, N },
{ GL(EXT_texture_env_dot3), VER(0,0), Y, N, N, N },
{ GL(EXT_texture_filter_anisotropic), VER(0,0), Y, N, N, N },
{ GL(EXT_texture_lod), VER(1,2), Y, N, N, N },
{ GL(EXT_texture_lod_bias), VER(1,4), Y, N, N, N },
{ GL(EXT_texture_mirror_clamp), VER(0,0), Y, N, N, N },
{ GL(EXT_texture_object), VER(1,1), Y, N, N, N },
{ GL(EXT_texture_rectangle), VER(0,0), Y, N, N, N },
{ GL(EXT_vertex_array), VER(0,0), Y, N, N, N },
{ GL(3DFX_texture_compression_FXT1), VER(0,0), N, N, N, N },
{ GL(APPLE_packed_pixels), VER(1,2), Y, N, N, N },
{ GL(APPLE_ycbcr_422), VER(0,0), Y, N, N, N },
{ GL(ATI_texture_env_combine3), VER(0,0), Y, N, N, N },
{ GL(ATI_texture_float), VER(0,0), Y, N, N, N },
{ GL(ATI_texture_mirror_once), VER(0,0), Y, N, N, N },
{ GL(ATIX_texture_env_combine3), VER(0,0), Y, N, N, N },
{ GL(HP_convolution_border_modes), VER(0,0), Y, N, N, N },
{ GL(HP_occlusion_test), VER(0,0), Y, N, N, N },
{ GL(IBM_cull_vertex), VER(0,0), Y, N, N, N },
{ GL(IBM_pixel_filter_hint), VER(0,0), Y, N, N, N },
{ GL(IBM_rasterpos_clip), VER(0,0), Y, N, N, N },
{ GL(IBM_texture_clamp_nodraw), VER(0,0), Y, N, N, N },
{ GL(IBM_texture_mirrored_repeat), VER(0,0), Y, N, N, N },
{ GL(INGR_blend_func_separate), VER(0,0), Y, N, N, N },
{ GL(INGR_interlace_read), VER(0,0), Y, N, N, N },
{ GL(MESA_pack_invert), VER(0,0), Y, N, N, N },
{ GL(MESA_ycbcr_texture), VER(0,0), Y, N, N, N },
{ GL(NV_blend_square), VER(1,4), Y, N, N, N },
{ GL(NV_copy_depth_to_color), VER(0,0), Y, N, N, N },
{ GL(NV_depth_clamp), VER(0,0), Y, N, N, N },
{ GL(NV_fog_distance), VER(0,0), Y, N, N, N },
{ GL(NV_light_max_exponent), VER(0,0), Y, N, N, N },
{ GL(NV_multisample_filter_hint), VER(0,0), Y, N, N, N },
{ GL(NV_point_sprite), VER(0,0), Y, N, N, N },
{ GL(NV_texgen_reflection), VER(0,0), Y, N, N, N },
{ GL(NV_texture_compression_vtc), VER(0,0), N, N, N, N },
{ GL(NV_texture_env_combine4), VER(0,0), Y, N, N, N },
{ GL(NV_texture_rectangle), VER(0,0), Y, N, N, N },
{ GL(OES_read_format), VER(0,0), Y, N, N, N },
{ GL(SGIS_generate_mipmap), VER(1,4), Y, N, N, N },
{ GL(SGIS_multisample), VER(0,0), Y, N, N, N },
{ GL(SGIS_texture_border_clamp), VER(1,3), Y, N, N, N },
{ GL(SGIS_texture_edge_clamp), VER(1,2), Y, N, N, N },
{ GL(SGIS_texture_lod), VER(1,2), Y, N, N, N },
{ GL(SGIX_blend_alpha_minmax), VER(0,0), Y, N, N, N },
{ GL(SGIX_clipmap), VER(0,0), Y, N, N, N },
{ GL(SGIX_depth_texture), VER(0,0), Y, N, N, N },
{ GL(SGIX_fog_offset), VER(0,0), Y, N, N, N },
{ GL(SGIX_shadow), VER(0,0), Y, N, N, N },
{ GL(SGIX_shadow_ambient), VER(0,0), Y, N, N, N },
{ GL(SGIX_texture_coordinate_clamp), VER(0,0), Y, N, N, N },
{ GL(SGIX_texture_lod_bias), VER(0,0), Y, N, N, N },
{ GL(SGIX_texture_range), VER(0,0), Y, N, N, N },
{ GL(SGIX_texture_scale_bias), VER(0,0), Y, N, N, N },
{ GL(SGIX_vertex_preclip), VER(0,0), Y, N, N, N },
{ GL(SGIX_vertex_preclip_hint), VER(0,0), Y, N, N, N },
{ GL(SGIX_ycrcb), VER(0,0), Y, N, N, N },
{ GL(SUN_convolution_border_modes), VER(0,0), Y, N, N, N },
{ GL(SUN_multi_draw_arrays), VER(0,0), Y, N, Y, N },
{ GL(SUN_slice_accum), VER(0,0), Y, N, N, N },
{ NULL }
};
#define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8)
/* global bit-fields of available extensions and their characteristics */
static unsigned char client_glx_support[8];
static unsigned char client_glx_only[8];
static unsigned char direct_glx_only[8];
static unsigned char client_gl_support[ __GL_EXT_BYTES ];
static unsigned char client_gl_only[ __GL_EXT_BYTES ];
/**
* Bits representing the set of extensions that are enabled by default in all
* direct rendering drivers.
*/
static unsigned char direct_glx_support[8];
/**
* Highest core GL version that can be supported for indirect rendering.
*/
static unsigned gl_major = 0;
static unsigned gl_minor = 0;
/* client extensions string */
static const char * __glXGLXClientExtensions = NULL;
static void __glXExtensionsCtr( void );
static void __glXExtensionsCtrScreen( __GLXscreenConfigs *psc );
static void __glXProcessServerString( const struct extension_info * ext,
const char * server_string, unsigned char * server_support );
/**
* Set the state of a GLX extension.
*
* \param name Name of the extension.
* \param name_len Length, in characters, of the extension name.
* \param state New state (either enabled or disabled) of the extension.
* \param supported Table in which the state of the extension is to be set.
*/
static void
set_glx_extension( const struct extension_info * ext,
const char * name, unsigned name_len, GLboolean state,
unsigned char * supported )
{
unsigned i;
for ( i = 0 ; ext[i].name != NULL ; i++ ) {
if ( (name_len == ext[i].name_len)
&& (strncmp( ext[i].name, name, name_len ) == 0) ) {
if ( state ) {
SET_BIT( supported, ext[i].bit );
}
else {
CLR_BIT( supported, ext[i].bit );
}
return;
}
}
}
#define NUL '\0'
#define SEPARATOR ' '
/**
* Convert the server's extension string to a bit-field.
*
* \param server_string GLX extension string from the server.
* \param server_support Bit-field of supported extensions.
*/
static void
__glXProcessServerString( const struct extension_info * ext,
const char * server_string,
unsigned char * server_support )
{
unsigned base;
unsigned len;
(void) memset( server_support, 0, sizeof( server_support ) );
for ( base = 0 ; server_string[ base ] != NUL ; /* empty */ ) {
/* Determine the length of the next extension name.
*/
for ( len = 0
; (server_string[ base + len ] != SEPARATOR)
&& (server_string[ base + len ] != NUL)
; len++ ) {
/* empty */
}
/* Set the bit for the extension in the server_support table.
*/
set_glx_extension( ext, & server_string[ base ], len, GL_TRUE,
server_support );
/* Advance to the next extension string. This means that we skip
* over the previous string and any trialing white-space.
*/
for ( base += len ;
(server_string[ base ] == SEPARATOR)
&& (server_string[ base ] != NUL)
; base++ ) {
/* empty */
}
}
}
/**
* Enable a named GLX extension on a given screen.
* Drivers should not call this function directly. They should instead use
* \c glXGetProcAddress to obtain a pointer to the function.
*
* \param psc Pointer to GLX per-screen record.
* \param name Name of the extension to enable.
*
* \sa glXGetProcAddress
*
* \since Internal API version 20030813.
*/
void
__glXScrEnableExtension( __GLXscreenConfigs *psc, const char * name )
{
__glXExtensionsCtr();
__glXExtensionsCtrScreen(psc);
set_glx_extension( known_glx_extensions, name, strlen( name ), GL_TRUE,
psc->direct_support );
}
/**
* Initialize global extension support tables.
*/
static void
__glXExtensionsCtr( void )
{
static const char major_table[32] = { 1, 1, 1, 1, 1, 1, 2, };
static const char minor_table[32] = { 0, 1, 2, 3, 4, 5, 0, };
unsigned i;
static GLboolean ext_list_first_time = GL_TRUE;
unsigned full_support = ~0;
if ( ext_list_first_time ) {
ext_list_first_time = GL_FALSE;
(void) memset( client_glx_support, 0, sizeof( client_glx_support ) );
(void) memset( direct_glx_support, 0, sizeof( direct_glx_support ) );
(void) memset( client_glx_only, 0, sizeof( client_glx_only ) );
(void) memset( direct_glx_only, 0, sizeof( direct_glx_only ) );
(void) memset( client_gl_support, 0, sizeof( client_gl_support ) );
(void) memset( client_gl_only, 0, sizeof( client_gl_only ) );
for ( i = 0 ; known_glx_extensions[i].name != NULL ; i++ ) {
const unsigned bit = known_glx_extensions[i].bit;
if ( known_glx_extensions[i].client_support ) {
SET_BIT( client_glx_support, bit );
}
if ( known_glx_extensions[i].direct_support ) {
SET_BIT( direct_glx_support, bit );
}
if ( known_glx_extensions[i].client_only ) {
SET_BIT( client_glx_only, bit );
}
if ( known_glx_extensions[i].direct_only ) {
SET_BIT( direct_glx_only, bit );
}
}
for ( i = 0 ; known_gl_extensions[i].name != NULL ; i++ ) {
const unsigned bit = known_gl_extensions[i].bit;
if ( known_gl_extensions[i].client_support ) {
SET_BIT( client_gl_support, bit );
}
else if ( known_gl_extensions[i].version_major != 0 ) {
/* If an extension that is required for some core GL version is
* not supported, clear the bit for that core GL version as well.
*/
unsigned ver_bit = (6 * (known_gl_extensions[i].version_major - 1))
+ (known_gl_extensions[i].version_minor);
full_support &= ~(1U << ver_bit);
}
if ( known_gl_extensions[i].client_only ) {
SET_BIT( client_gl_only, bit );
}
}
/* Determine the lowest unsupported core GL version. The version before
* that is, therefore, the highest supported core GL version.
*/
for ( i = 0 ; (full_support & (1 << i)) != 0 ; i++ )
/* empty */ ;
i--;
gl_major = major_table[i];
gl_minor = minor_table[i];
#if 0
fprintf( stderr, "[%s:%u] Maximum client library version: %u.%u\n",
__func__, __LINE__, gl_major, gl_minor );
#endif
}
}
/**
* Make sure that per-screen direct-support table is initialized.
*
* \param psc Pointer to GLX per-screen record.
*/
static void
__glXExtensionsCtrScreen( __GLXscreenConfigs *psc )
{
if (psc->ext_list_first_time) {
psc->ext_list_first_time = GL_FALSE;
(void) memcpy( psc->direct_support, direct_glx_support,
sizeof( direct_glx_support ) );
}
}
/**
* Check if a certain extension is enabled on a given screen.
*
* \param psc Pointer to GLX per-screen record.
* \param bit Bit index in the direct-support table.
* \returns If the extension bit is enabled for the screen, \c GL_TRUE is
* returned. If the extension bit is not enabled or if \c psc is
* \c NULL, then \c GL_FALSE is returned.
*/
GLboolean
__glXExtensionBitIsEnabled( __GLXscreenConfigs *psc, unsigned bit )
{
GLboolean enabled = GL_FALSE;
if ( psc != NULL ) {
__glXExtensionsCtr();
__glXExtensionsCtrScreen( psc );
enabled = EXT_ENABLED( bit, psc->direct_support );
}
return enabled;
}
/**
* Convert a bit-field to a string of supported extensions.
*/
static char *
__glXGetStringFromTable( const struct extension_info * ext,
const unsigned char * supported )
{
unsigned i;
unsigned ext_str_len;
char * ext_str;
char * point;
ext_str_len = 0;
for ( i = 0 ; ext[i].name != NULL ; i++ ) {
if ( EXT_ENABLED( ext[i].bit, supported ) ) {
ext_str_len += ext[i].name_len + 1;
}
}
ext_str = Xmalloc( ext_str_len + 1 );
if ( ext_str != NULL ) {
point = ext_str;
for ( i = 0 ; ext[i].name != NULL ; i++ ) {
if ( EXT_ENABLED( ext[i].bit, supported ) ) {
(void) memcpy( point, ext[i].name, ext[i].name_len );
point += ext[i].name_len;
*point = ' ';
point++;
}
}
*point = '\0';
}
return ext_str;
}
/**
* Get the string of client library supported extensions.
*/
const char *
__glXGetClientExtensions( void )
{
if ( __glXGLXClientExtensions == NULL ) {
__glXExtensionsCtr();
__glXGLXClientExtensions = __glXGetStringFromTable( known_glx_extensions,
client_glx_support );
}
return __glXGLXClientExtensions;
}
/**
* Calculate the list of application usable extensions. The resulting
* string is stored in \c psc->effectiveGLXexts.
*
* \param psc Pointer to GLX per-screen record.
* \param display_is_direct_capable True if the display is capable of
* direct rendering.
* \param minor_version GLX minor version from the server.
*/
void
__glXCalculateUsableExtensions( __GLXscreenConfigs *psc,
GLboolean display_is_direct_capable,
int minor_version )
{
unsigned char server_support[8];
unsigned char usable[8];
unsigned i;
__glXExtensionsCtr();
__glXExtensionsCtrScreen( psc );
__glXProcessServerString( known_glx_extensions,
psc->serverGLXexts, server_support );
/* This is a hack. Some servers support GLX 1.3 but don't export
* all of the extensions implied by GLX 1.3. If the server claims
* support for GLX 1.3, enable support for the extensions that can be
* "emulated" as well.
*/
if ( minor_version >= 3 ) {
SET_BIT( server_support, EXT_visual_info_bit );
SET_BIT( server_support, EXT_visual_rating_bit );
SET_BIT( server_support, SGI_make_current_read_bit );
SET_BIT( server_support, SGIX_fbconfig_bit );
SET_BIT( server_support, SGIX_pbuffer_bit );
/* This one is a little iffy. GLX 1.3 doesn't incorporate all of this
* extension. However, the only part that is not strictly client-side
* is shared. That's the glXQueryContext / glXQueryContextInfoEXT
* function.
*/
SET_BIT( server_support, EXT_import_context_bit );
}
/* An extension is supported if the client-side (i.e., libGL) supports
* it and the "server" supports it. In this case that means that either
* the true server supports it or it is only for direct-rendering and
* the direct rendering driver supports it.
*
* If the display is not capable of direct rendering, then the extension
* is enabled if and only if the client-side library and the server
* support it.
*/
if ( display_is_direct_capable ) {
for ( i = 0 ; i < 8 ; i++ ) {
usable[i] = (client_glx_support[i] & client_glx_only[i])
| (client_glx_support[i] & psc->direct_support[i] & server_support[i])
| (client_glx_support[i] & psc->direct_support[i] & direct_glx_only[i]);
}
}
else {
for ( i = 0 ; i < 8 ; i++ ) {
usable[i] = (client_glx_support[i] & client_glx_only[i])
| (client_glx_support[i] & server_support[i]);
}
}
psc->effectiveGLXexts = __glXGetStringFromTable( known_glx_extensions,
usable );
}
/**
* Calculate the list of application usable extensions. The resulting
* string is stored in \c gc->extensions.
*
* \param gc Pointer to GLX context.
* \param server_string Extension string from the server.
* \param major_version GL major version from the server.
* \param minor_version GL minor version from the server.
*/
void
__glXCalculateUsableGLExtensions( __GLXcontext * gc,
const char * server_string,
int major_version, int minor_version )
{
unsigned char server_support[ __GL_EXT_BYTES ];
unsigned char usable[ __GL_EXT_BYTES ];
unsigned i;
__glXExtensionsCtr();
(void) memset( server_support, 0, sizeof( server_support ) );
__glXProcessServerString( known_gl_extensions, server_string,
server_support );
/* Handle lazy servers that don't export all the extensions strings that
* are part of the GL core version that they support.
*/
for ( i = 0 ; i < __GL_EXT_BYTES ; i++ ) {
if ( (known_gl_extensions[i].version_major != 0)
&& ((major_version > known_gl_extensions[i].version_major)
|| ((major_version == known_gl_extensions[i].version_major)
&& (minor_version >= known_gl_extensions[i].version_minor))) ) {
SET_BIT( server_support, known_gl_extensions[i].bit );
}
}
/* An extension is supported if the client-side (i.e., libGL) supports
* it and the server supports it or the client-side library supports it
* and it only needs client-side support.
*/
for ( i = 0 ; i < __GL_EXT_BYTES ; i++ ) {
usable[i] = (client_gl_support[i] & client_gl_only[i])
| (client_gl_support[i] & server_support[i]);
}
gc->extensions = (unsigned char *)
__glXGetStringFromTable( known_gl_extensions, usable );
}
/**
* Calculates the maximum core GL version that can be supported for indirect
* rendering.
*/
void
__glXGetGLVersion( int * major_version, int * minor_version )
{
__glXExtensionsCtr();
*major_version = gl_major;
*minor_version = gl_minor;
}
/**
* Get a string representing the set of extensions supported by the client
* library. This is currently only used to send the list of extensions
* supported by the client to the server.
*/
char *
__glXGetClientGLExtensionString( void )
{
__glXExtensionsCtr();
return __glXGetStringFromTable( known_gl_extensions, client_gl_support );
}

255
src/glx/x11/glxextensions.h Normal file
View File

@@ -0,0 +1,255 @@
/*
* (C) Copyright IBM Corporation 2002, 2004
* 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
* THE COPYRIGHT HOLDERS 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 glxextensions.h
*
* \author Ian Romanick <idr@us.ibm.com>
*/
/* $XFree86: xc/lib/GL/glx/glxextensions.h,v 1.2tsi Exp $ */
#ifndef GLX_GLXEXTENSIONS_H
#define GLX_GLXEXTENSIONS_H
enum {
ARB_get_proc_address_bit = 0,
ARB_multisample_bit,
ARB_render_texture_bit,
ATI_pixel_format_float_bit,
EXT_visual_info_bit,
EXT_visual_rating_bit,
EXT_import_context_bit,
MESA_agp_offset_bit,
MESA_allocate_memory_bit, /* Replaces MESA_agp_offset & NV_vertex_array_range */
MESA_copy_sub_buffer_bit,
MESA_depth_float_bit,
MESA_pixmap_colormap_bit,
MESA_release_buffers_bit,
MESA_set_3dfx_mode_bit,
MESA_swap_control_bit,
MESA_swap_frame_usage_bit,
NV_float_buffer_bit,
NV_render_depth_texture_bit,
NV_render_texture_rectangle_bit,
NV_vertex_array_range_bit,
OML_swap_method_bit,
OML_sync_control_bit,
SGI_cushion_bit,
SGI_make_current_read_bit,
SGI_swap_control_bit,
SGI_video_sync_bit,
SGIS_blended_overlay_bit,
SGIS_color_range_bit,
SGIS_multisample_bit,
SGIX_dm_buffer_bit,
SGIX_fbconfig_bit,
SGIX_pbuffer_bit,
SGIX_swap_barrier_bit,
SGIX_swap_group_bit,
SGIX_video_resize_bit,
SGIX_video_source_bit,
SGIX_visual_select_group_bit,
SUN_get_transparent_index_bit
};
enum {
GL_ARB_depth_texture_bit = 0,
GL_ARB_fragment_program_bit,
GL_ARB_imaging_bit,
GL_ARB_multisample_bit,
GL_ARB_multitexture_bit,
GL_ARB_occlusion_query_bit,
GL_ARB_point_parameters_bit,
GL_ARB_point_sprite_bit,
GL_ARB_shadow_bit,
GL_ARB_shadow_ambient_bit,
GL_ARB_texture_border_clamp_bit,
GL_ARB_texture_cube_map_bit,
GL_ARB_texture_compression_bit,
GL_ARB_texture_env_add_bit,
GL_ARB_texture_env_combine_bit,
GL_ARB_texture_env_crossbar_bit,
GL_ARB_texture_env_dot3_bit,
GL_ARB_texture_mirrored_repeat_bit,
GL_ARB_texture_non_power_of_two_bit,
GL_ARB_texture_rectangle_bit,
GL_ARB_transpose_matrix_bit,
GL_ARB_vertex_buffer_object_bit,
GL_ARB_vertex_program_bit,
GL_ARB_window_pos_bit,
GL_EXT_abgr_bit,
GL_EXT_bgra_bit,
GL_EXT_blend_color_bit,
GL_EXT_blend_equation_separate_bit,
GL_EXT_blend_func_separate_bit,
GL_EXT_blend_logic_op_bit,
GL_EXT_blend_minmax_bit,
GL_EXT_blend_subtract_bit,
GL_EXT_clip_volume_hint_bit,
GL_EXT_compiled_vertex_array_bit,
GL_EXT_convolution_bit,
GL_EXT_copy_texture_bit,
GL_EXT_cull_vertex_bit,
GL_EXT_depth_bounds_test_bit,
GL_EXT_draw_range_elements_bit,
GL_EXT_fog_coord_bit,
GL_EXT_multi_draw_arrays_bit,
GL_EXT_packed_pixels_bit,
GL_EXT_paletted_texture_bit,
GL_EXT_pixel_buffer_object_bit,
GL_EXT_polygon_offset_bit,
GL_EXT_rescale_normal_bit,
GL_EXT_secondary_color_bit,
GL_EXT_separate_specular_color_bit,
GL_EXT_shadow_funcs_bit,
GL_EXT_shared_texture_palette_bit,
GL_EXT_stencil_two_side_bit,
GL_EXT_stencil_wrap_bit,
GL_EXT_subtexture_bit,
GL_EXT_texture_bit,
GL_EXT_texture3D_bit,
GL_EXT_texture_compression_s3tc_bit,
GL_EXT_texture_edge_clamp_bit,
GL_EXT_texture_env_combine_bit,
GL_EXT_texture_env_dot3_bit,
GL_EXT_texture_filter_anisotropic_bit,
GL_EXT_texture_lod_bit,
GL_EXT_texture_lod_bias_bit,
GL_EXT_texture_mirror_clamp_bit,
GL_EXT_texture_object_bit,
GL_EXT_vertex_array_bit,
GL_3DFX_texture_compression_FXT1_bit,
GL_APPLE_packed_pixels_bit,
GL_APPLE_ycbcr_422_bit,
GL_ATI_texture_env_combine3_bit,
GL_ATI_texture_float_bit,
GL_ATI_texture_mirror_once_bit,
GL_HP_convolution_border_modes_bit,
GL_HP_occlusion_test_bit,
GL_IBM_cull_vertex_bit,
GL_IBM_pixel_filter_hint_bit,
GL_IBM_rasterpos_clip_bit,
GL_IBM_texture_clamp_nodraw_bit,
GL_INGR_interlace_read_bit,
GL_MESA_pack_invert_bit,
GL_MESA_ycbcr_texture_bit,
GL_NV_blend_square_bit,
GL_NV_copy_depth_to_color_bit,
GL_NV_depth_clamp_bit,
GL_NV_fog_distance_bit,
GL_NV_light_max_exponent_bit,
GL_NV_multisample_filter_hint_bit,
GL_NV_point_sprite_bit,
GL_NV_texgen_reflection_bit,
GL_NV_texture_compression_vtc_bit,
GL_NV_texture_env_combine4_bit,
GL_OES_read_format_bit,
GL_SGIS_generate_mipmap_bit,
GL_SGIS_multisample_bit,
GL_SGIS_texture_lod_bit,
GL_SGIX_blend_alpha_minmax_bit,
GL_SGIX_clipmap_bit,
GL_SGIX_depth_texture_bit,
GL_SGIX_fog_offset_bit,
GL_SGIX_shadow_bit,
GL_SGIX_texture_coordinate_clamp_bit,
GL_SGIX_texture_lod_bias_bit,
GL_SGIX_texture_range_bit,
GL_SGIX_texture_scale_bias_bit,
GL_SGIX_vertex_preclip_bit,
GL_SGIX_vertex_preclip_hint_bit,
GL_SGIX_ycrcb_bit,
GL_SUN_convolution_border_modes_bit,
GL_SUN_slice_accum_bit,
/* This *MUST* go here. If it gets put after the duplicate values it will
* get the value after the last duplicate.
*/
__NUM_GL_EXTS,
/* Alias extension bits. These extensions exist in either vendor-specific
* or EXT form and were later promoted to either EXT or ARB form. In all
* cases, the meaning is *exactly* the same. That's why
* EXT_texture_env_combine is *NOT* an alias of ARB_texture_env_combine and
* EXT_texture_env_dot3 is *NOT* an alias of ARB_texture_env_dot3. Be
* careful! When in doubt, src/mesa/main/extensions.c in the Mesa tree
* is a great reference.
*/
GL_ATI_blend_equation_separate_bit = GL_EXT_blend_equation_separate_bit,
GL_ATIX_texture_env_combine3_bit = GL_ATI_texture_env_combine3_bit,
GL_EXT_point_parameters_bit = GL_ARB_point_parameters_bit,
GL_EXT_texture_env_add_bit = GL_ARB_texture_env_add_bit,
GL_EXT_texture_rectangle_bit = GL_ARB_texture_rectangle_bit,
GL_IBM_texture_mirrored_repeat_bit = GL_ARB_texture_mirrored_repeat_bit,
GL_INGR_blend_func_separate_bit = GL_EXT_blend_func_separate_bit,
GL_MESA_window_pos_bit = GL_ARB_window_pos_bit,
GL_NV_texture_rectangle_bit = GL_ARB_texture_rectangle_bit,
GL_SGIS_texture_border_clamp_bit = GL_ARB_texture_border_clamp_bit,
GL_SGIS_texture_edge_clamp_bit = GL_EXT_texture_edge_clamp_bit,
GL_SGIX_shadow_ambient_bit = GL_ARB_shadow_ambient_bit,
GL_SUN_multi_draw_arrays_bit = GL_EXT_multi_draw_arrays_bit
};
extern GLboolean __glXExtensionBitIsEnabled( __GLXscreenConfigs *psc, unsigned bit );
extern const char * __glXGetClientExtensions( void );
extern void __glXCalculateUsableExtensions( __GLXscreenConfigs *psc,
GLboolean display_is_direct_capable, int server_minor_version );
extern void __glXScrEnableExtension( __GLXscreenConfigs *psc, const char * name );
extern void __glXCalculateUsableGLExtensions( __GLXcontext * gc,
const char * server_string, int major_version, int minor_version );
extern void __glXGetGLVersion( int * major_version, int * minor_version );
extern char * __glXGetClientGLExtensionString( void );
/* Source-level backwards compatibility with old drivers. They won't
* find the respective functions, though.
*/
typedef void (* PFNGLXENABLEEXTENSIONPROC) ( const char * name,
GLboolean force_client );
typedef void (* PFNGLXDISABLEEXTENSIONPROC) ( const char * name );
/* GLX_ALIAS should be used for functions with a non-void return type.
GLX_ALIAS_VOID is for functions with a void return type. */
#ifdef GLX_NO_STATIC_EXTENSION_FUNCTIONS
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func)
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func)
#else
# if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
return_type GLX_PREFIX( real_func ) proto_args \
__attribute__ ((alias( # aliased_func ) ));
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
GLX_ALIAS(void, real_func, proto_args, args, aliased_func)
# else
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
return_type GLX_PREFIX( real_func ) proto_args \
{ return aliased_func args ; }
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
void GLX_PREFIX( real_func ) proto_args \
{ aliased_func args ; }
# endif /* __GNUC__ */
#endif /* GLX_NO_STATIC_EXTENSION_FUNCTIONS */
#endif /* GLX_GLXEXTENSIONS_H */

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

File diff suppressed because it is too large Load Diff

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