Compare commits

...

697 Commits

Author SHA1 Message Date
Brian Paul
6d9b25e522 mesa: don't check for GLSL 1.2 to advertise GL 2.1
The GLSL 1.2 features are minor...
2008-08-26 15:50:11 -06:00
Corbin Simpson
31bad23f0f note ATI R500 series support 2008-08-26 12:39:27 -06:00
Timo Jyrinki
29b9b25e72 asst. html doc updates 2008-08-26 12:36:23 -06:00
Brian Paul
e794f496c6 mesa: assorted updates/prep for 7.1 release 2008-08-25 14:09:14 -06:00
Brian Paul
68067c66d3 mesa: glsl: regenerated file 2008-08-25 09:16:21 -06:00
Brian Paul
ad5474e995 mesa: glsl: grab latest fixes from gallium-0.1 branch
Includes:
1. Fixes failed asserting about bad swizzles in src reg emit.
2. Tracks uniform var usage.
3. Emit exp() in terms of EXP2 instruction.
2008-08-25 09:15:16 -06:00
Dave Airlie
7c81124d7c Revert "Merge branch 'drm-gem'"
This reverts commit 53675e5c05.

Conflicts:

	src/mesa/drivers/dri/i965/brw_wm_surface_state.c
2008-08-24 17:52:40 +10:00
Krzysztof Czurylo
a35002c167 965: Fix incorrect backface culling
Fix incorrect backface culling for OGL tunnel in wireframe and
point mode.
2008-08-21 15:01:59 -07:00
Krzysztof Czurylo
6f4fd3a432 Call _ae_update_state when array enable state changes
Basically, the application enables client vertex and color arrays,
renders something, then disables color array, and renders something
else (using vertex array only).  Even though the color array is
disabled (and the pointer is no longer valid), the driver still tries
to read color data from this array (which results in an exception).

This is because enabling/disabling array does not trigger
_ae_update_state() and the list of enabled arrays is not updated.
_ae_update_state() it's called on the first state validation only (as
all the "dirty" flags are set at the beginning). Any further change to
client arrays' state has no effect.
2008-08-21 15:01:59 -07:00
Krzysztof Czurylo
be30fddc7c 965: Fix color clamping issues
Patch is correctly applied this time.
2008-08-21 15:01:59 -07:00
Ian Romanick
1a244cd9e2 Formatting changes to ease application of patches 2008-08-21 15:01:59 -07:00
Eric Anholt
687cd467b3 i965: use dri_bo_subdata in vertex upload to get pwrite used.
Otherwise, we would ping-pong objects to GTT and back as we did pwrite on
indices (flushed and mapped to GTT) and mapped for vertices (moved back to
CPU domain).

Fixes bug #17180.
2008-08-21 12:15:17 -07:00
Eric Anholt
021ce883e6 Flush vertices when updating texObj->GenerateMipmap state.
Caught by texturing/gen-teximage test in piglit.
2008-08-21 11:21:22 -07:00
Peter Hutterer
3a94b25538 Report damage before modifying the area, not after.
If we copy the area before reporting the damage in this area, the server may
restore buffered data over the new data, leading to artefacts on the screen.
Reproducable with two cursors (second of which is SW rendered) and moving
windows around in compiz.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16384 .
2008-08-21 11:22:40 +02:00
Eric Anholt
495c02262e intel: Fix SGIS_generate_mipmap after a miptree had been validated.
Previously, the updated images would be ignored because the miptree in the
image matched the miptree in the object, even though Mesa core had just attached
updated contents in ->Data.  Additionally, Mesa core could have tried to
free inside our miptree if it had already been validated.

Fixes bug #17077.
2008-08-20 23:18:02 -07:00
Brian Paul
8f1d5ca086 use ftransform() 2008-08-20 15:33:03 -06:00
Kristof Ralovich
8434c65bb9 glx: free driScreen in FreeScreenConfigs() 2008-08-20 15:33:03 -06:00
Kristof Ralovich
8b51278134 glx: free context in driDestroyContext() 2008-08-20 15:33:03 -06:00
Kristof Ralovich
e206034863 glx: free vertex array state when context is destroyed 2008-08-20 15:33:03 -06:00
Kristof Ralovich
fb36a54a1c fix mem leak (free psc->visuals) 2008-08-20 15:33:03 -06:00
Mark Anderson
145f5f60f1 mesa: fix float blend bug 2008-08-20 15:33:03 -06:00
Brian Paul
2848b55ed5 mesa: move old/obsolete MESA extensions specs to OLD/ directory 2008-08-20 15:33:03 -06:00
Dave Airlie
9cc13eba3e i965: fixup format for TFP zero copy
(cherry picked from commit 9bc9e0ecb0 which
was lost in a merge)
2008-08-20 11:28:39 -07:00
Dave Airlie
ce61660ab9 i965: make tex offset override work..
should fix fd.o 14441

(cherry-picked from commit d4244683a6 which was
lost in a merge)
2008-08-20 11:28:39 -07:00
Xiang, Haihao
b17b110716 i965: Enable GL_ARB_fragment_program_shadow and fix key->shadowtex_mask. (bug #16852, #16853) 2008-08-20 15:54:41 +08:00
Corbin Simpson
a667d67cd6 r5xx: Final fog option fix.
Is there some kind of git hook we could use to keep me from committing
after like 10PM or so?
2008-08-19 09:24:27 -07:00
Corbin Simpson
7855ea2af2 r5xx: Don't squish GL context when using FogOption 2008-08-19 03:40:27 -07:00
Corbin Simpson
12e84a8b84 r5xx: Enable fog options.
This uses fog HW instead of fragment programs.
If it breaks you, let me know!
2008-08-18 16:38:21 -07:00
Henri Verbeet
e438827dec fix byte vs. pixel offset bug for 3D textures (see bug 17170) 2008-08-18 09:30:52 -06:00
Brian Paul
6a00625fbb mesa: rearrange some code in _mesa_BindTexture() to fix error detection bug 17173
Also, move GL_TEXTURE_RECTANGLE init code into separate function.
2008-08-18 08:55:13 -06:00
Corbin Simpson
c5d25c8509 r5xx: Add DDX and DDY instructions.
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2008-08-17 22:36:17 -07:00
Brian Paul
b7ff70e16a bring in docs from 7.0.4 release/branch 2008-08-16 11:09:49 -06:00
Corbin Simpson
567d87744a added test for ARB GLSL extensions 2008-08-16 11:07:51 -06:00
Brian Paul
5d762e1613 added glu.exports files to tarballs list 2008-08-16 10:09:38 -06:00
Brian Paul
35479fd4b4 fix convolutions test to consistanty use the ARB shader extension functions
Was using a mix of the ARB functions and the OpenGL 2.0 shader functions.
2008-08-16 09:54:07 -06:00
Brian Paul
7970b2a908 prep for 7.1 rc4 2008-08-16 09:39:10 -06:00
Brian Paul
c0dd9122fd remove .txt suffix from shader source files 2008-08-16 09:36:46 -06:00
Brian Paul
ce00d232f3 mesa: added glsl/convolutions test from gallium branch 2008-08-16 09:34:12 -06:00
Brian Paul
db1103ebe8 mesa: turn off 'x' bit misset on a few .h and .syn files 2008-08-16 09:31:27 -06:00
Brian Paul
1f4997c2aa mesa: import latest GLSL code from gallium-0.1 branch 2008-08-16 09:30:14 -06:00
Brian Paul
1b39b92e6d draw a tristrip ring instead of a single quad 2008-08-15 17:02:09 -06:00
Brian Paul
37f452096b don't need to use LOD version of texture2D() funcs 2008-08-15 17:02:09 -06:00
Dave Airlie
2e79b491fc intel: remove unneeded mem type and args 2008-08-14 21:43:34 +10:00
Michel Dänzer
57acb0fad9 r300: Fix 3D texture support. 2008-08-14 10:40:03 +02:00
Brian Paul
505606349e mesa: fix a swrast state validation bug
Fixes progs/glsl/points.c
2008-08-13 10:28:38 -06:00
Brian Paul
b9c6f2b133 mesa: added new glsl/pointcoord.c test 2008-08-13 08:49:39 -06:00
Brian Paul
60b92129b1 mesa: clear the unused upper-left region to black instead of leaving it undefined 2008-08-13 08:46:50 -06:00
Jeremy Huddleston
f911ca0834 Removed broken/unsupported darwin-static configs
Fixed typo in darwin config
2008-08-12 11:04:19 -07:00
Jeremy Huddleston
98e7c1cf38 Fixed 'make install' for darwin 2008-08-12 10:59:40 -07:00
Jeremy Huddleston
c61f4e2cce Apple: More cleanup of the darwin config in 7.1 2008-08-12 09:45:04 -07:00
Brian Paul
8c51e0002a mesa: glsl: add missing sampler types in sizeof_glsl_type(), bug 17079 2008-08-11 15:12:42 -06:00
Brian Paul
7536f39622 version 41 of glext.h 2008-08-11 15:12:42 -06:00
Brian Paul
d80d0bb4d6 version 20 of glxext.h 2008-08-11 15:12:42 -06:00
Brian Paul
3a428aca93 mesa: added comment about gl_PointCoord 2008-08-11 15:12:42 -06:00
Jeremy Huddleston
ac0d19601c Apple: Cleaned up some linking and dylib ids issues 2008-08-11 09:17:06 -07:00
Dave Miller
1724334d7c dri: fix crash in driGetConfigAttribIndex
Accessing a GLboolean via an int pointer on big-endian == bad.
2008-08-09 16:44:10 +10:00
Eric Anholt
53675e5c05 Merge branch 'drm-gem'
Conflicts:

	src/mesa/drivers/dri/intel/intel_span.c
	src/mesa/main/fbobject.c

This converts the i915 driver to use the GEM interfaces for object management.
2008-08-08 15:32:24 -07:00
Eric Anholt
d2796939f1 intel-gem: Update to new check_aperture API for classic mode.
To do this, I had to clean up some of 965 state upload stuff.  We may end
up over-emitting state in the aperture overflow case, but that should be rare,
and I'd rather have the simplification of state management.
2008-08-08 14:00:43 -07:00
Eric Anholt
527e1cf172 965: cleanups to state emission from aperture checking and state ordering. 2008-08-08 10:53:25 -07:00
Brian Paul
501338d70e mesa: fix out-of-bounds memory reads in swizzle_copy() 2008-08-08 09:05:41 -06:00
Jeremy Huddleston
919ec22ecf glx/x11: Added some #ifdef GLX_DIRECT_RENDERING protection 2008-08-08 02:52:10 -07:00
Jeremy Huddleston
ec770150ed glx/x11: Fix missing __GL_EXT_BYTES declaration 2008-08-08 02:37:14 -07:00
Jeremy Huddleston
01ac4540f0 Apple: Some changes to fix compilation problems on OSX 2008-08-08 02:19:52 -07:00
Brian Paul
ee8dfdf4c9 mesa: fix glBindTexture error string (bug 17005) 2008-08-07 07:54:53 -06:00
Brian Paul
523ee3ddbe disable debug code accidentally enabled by prev commit 2008-08-06 09:02:39 -06:00
Haihao Xiang
5f46093938 mesa: glsl: count number of temp regs used 2008-08-06 09:01:34 -06:00
Brian Paul
fb71a48413 mesa: fix comment about texture targets (bug 17005) 2008-08-06 08:52:56 -06:00
Brian Paul
f1e4ca776f fix some FBO/texture queries (bug 15296) 2008-08-06 08:40:25 -06:00
Xiang, Haihao
c20a173656 i965: update TexSrcUnit for OPCODE_TXB 2008-08-06 14:17:08 +08:00
Xiang, Haihao
8e8019b49a dri: Fix write/read depth buffer issue under 16bpp mode. See bug #16646 2008-08-05 11:34:26 +08:00
Xiang, Haihao
a3024caff1 i965: Use program->SamplerUnits[] to get the appropriate texture unit.
inst->TexSrcUnit is used as an index into program->SamplerUnits[] since
the commit ade508312c, and program->SamplerUnits
is a sampler-to-texture-unit mapping.
2008-08-05 10:18:56 +08:00
Adam Jackson
62fb5f7b9a Drop unused 'entries' field from __glxHashTable. 2008-08-04 15:44:34 -04:00
Brian Paul
61b3ce8f97 added null ptr check (fix bug 16959) 2008-08-03 11:13:12 -06:00
Eric Anholt
ded9414024 intel-gem: Always build GEM execbuffer code. 2008-07-31 14:13:30 -07:00
Jesse Barnes
e9bf3e4cc9 intel: sync to vblank by default
Effectively default to vblank_mode=3 on Intel to avoid tearing by default.
Users wanting to go "as fast as possible" (despite not being able to see frames
faster than their refresh rate allows) can still set the vblank_mode manually.
2008-07-31 11:50:37 -07:00
Eric Anholt
c9120a0d19 intel-gem: Use new getparam to detect kernel GEM support. 2008-07-30 14:16:33 -07:00
Guillaume Melquiond
3e8e292db0 Always pass CFLAGS when compiling or linking demos
To ensure that the correct architecture flags are used, always pass the
user's CFLAGS when compiling or linking the demos. Fixes #16860.
2008-07-30 07:56:42 -07:00
Brian Paul
b068ab62a0 updated GLSL bug fixes 2008-07-29 17:50:43 -06:00
Brian Paul
1bdb134570 mesa: glsl: remove old assertion (fixes glsl/bitmap.c) 2008-07-29 17:49:38 -06:00
Brian Paul
40f7e5f674 mesa: disable debug code 2008-07-29 17:47:52 -06:00
Brian Paul
ff916d718a mesa: regenerated files 2008-07-29 17:45:46 -06:00
Brian Paul
016701f686 mesa: Silence compiler warnings on Windows. 2008-07-29 17:43:35 -06:00
Brian Paul
b26a80aa12 mesa: cast to fix warning 2008-07-29 17:37:55 -06:00
Brian Paul
a7dd701421 mesa: fix bug/failure in recursive function inlining
Fixes a failure for cases such as y = f(a, f(a, b))
All the usual tests still pass but regressions are possible...
2008-07-29 17:37:13 -06:00
Brian Paul
6045f17138 mesa: glsl: silence warning (s/int/GLuint) 2008-07-29 17:33:52 -06:00
Brian Paul
a75015ef03 mesa: remove stray debug code 2008-07-29 17:32:35 -06:00
Brian Paul
1638edb325 mesa: glsl: assorted fixes for resolving polymorphic functions
Plus,
- fix some issues in casting function arguments to format param types.
- fix some vec/mat constructor bugs
- find/report more syntax/semantic errors
2008-07-29 17:29:30 -06:00
Brian Paul
6225e51a73 mesa: glsl: re-order some constructors 2008-07-29 17:27:59 -06:00
Brian Paul
d9b6425e00 mesa: glsl: remove unneeded operators 2008-07-29 17:27:54 -06:00
Brian Paul
91e1918f48 mesa: glsl: added null ptr check 2008-07-29 17:27:44 -06:00
Brian Paul
6f1abb9c21 mesa: fix issues causing warnings on Windows 2008-07-29 17:27:22 -06:00
Brian Paul
1b465f287f mesa: glsl: additional error detection
Plus begin some fixes for vec/matrix constructors.
2008-07-29 17:25:44 -06:00
Brian Paul
16dc993d4f mesa: gls: fix broken else clause of conditional break/continue
In the following case:

   for () {
      if (cond)
         break;  // or continue;
      else
         something;
   }

The "something" block didn't get emitted.
2008-07-29 17:23:52 -06:00
Brian Paul
3d500f00d2 mesa: glsl: only try to link shaders defining main() 2008-07-29 17:23:37 -06:00
Michal Krol
56bac7a35c mesa: Silence compiler warning on windows. 2008-07-29 17:23:19 -06:00
Brian Paul
5d9b33095a mesa: glsl: fix/simplify array element handling
Also fix bug in comparing large structs/arrays.
2008-07-29 17:22:58 -06:00
Brian Paul
d4c73c619a mesa: glsl: mark constructor params as const 2008-07-29 17:20:43 -06:00
Brian Paul
01c0558f70 mesa: glsl: rework swizzle storage handling
Build on the heirarchal approach implemented for arrays/structs.
2008-07-29 17:20:30 -06:00
Brian Paul
fb3422a241 mesa: fix uninitialized var 2008-07-29 17:20:22 -06:00
Brian Paul
7af8dddf27 mesa: glsl: implement constructor functions for user-defined types 2008-07-29 17:20:14 -06:00
Brian Paul
a9412ca2e8 mesa: remove stray debug assertion 2008-07-29 17:20:06 -06:00
Brian
b36749d066 mesa: fix glUniform error checking for samplers 2008-07-29 17:19:40 -06:00
Brian Paul
b7eea9a1ce mesa: refactor: move _mesa_Bind/Gen/DeleteProgram() to arbprogram.c
No API-level functions now in program.c.
2008-07-29 17:19:25 -06:00
Brian Paul
ff9b6a0ae2 mesa: initial support for GLSL struct/array comparisons 2008-07-29 17:17:22 -06:00
Brian Paul
65db8c9518 mesa: added null ptr check (error handling case) 2008-07-29 17:17:12 -06:00
Brian Paul
19d44b95fe mesa: fix +=, -=, etc. operators 2008-07-29 17:16:59 -06:00
Brian Paul
be50c48101 mesa: remove an error check for NV_v_p that doesn't apply to ARB_v_p 2008-07-29 17:16:50 -06:00
Brian Paul
bc985b5790 mesa: fix some issues in _mesa_validate_program() 2008-07-29 17:16:33 -06:00
Brian Paul
ffbc66bf61 mesa: assorted glsl uniform/attribute fixes
Fix incorrect uniform/attribute size query results.
Add missing error checking for glUniform, glUniformMatrix params
Fix an array size/allocation error.
2008-07-29 17:16:17 -06:00
Brian Paul
74a19b0abd mesa: glsl: various writemask/swizzle improvements and clean-ups 2008-07-29 17:15:27 -06:00
Brian Paul
38a62ede6c mesa: rework array/struct addressing code.
The slang_ir_storage type now has a pointer to parent storage to represent
storage of an array element within an array, or a field within a struct.
This fixes some problems related to addressing of fields/elements in non-
trivial cases.  More work to follow.
2008-07-29 17:15:08 -06:00
Brian Paul
378017417a mesa: fix some GLSL /= int operators
plus add a few more special constructors to improve code quality.
2008-07-29 17:14:14 -06:00
Brian Paul
f45ed0eb8d mesa: fix set_program_uniform_matrix(): need to loop over matrix count 2008-07-29 17:13:54 -06:00
Brian Paul
5bfbcf7265 mesa: implement grammar/parsing for precision/invariant syntax
Plus, fix some issues with pre-defined preprocessor symbols and version checking.
2008-07-29 17:12:19 -06:00
Brian Paul
c3ad176158 mesa: Silence compiler warnings on Windows. 2008-07-29 17:09:40 -06:00
Brian Paul
153407f72d mesa: fix some function inlining bugs
Need to add local vars of original function to the new scope's variable
list (though the DECLs were already present).
In slang_operation_copy() call slang_replace_scope() for SLANG_OPER_BLOCK_NEW_SCOPE opers.
2008-07-29 17:05:54 -06:00
Brian Paul
527e1357b5 mesa: improved printing 2008-07-29 17:04:53 -06:00
Brian Paul
1a5c99f4b5 document GLSL 1.20 status 2008-07-29 16:46:08 -06:00
Brian Paul
44c7f37b44 disable GL_ARB_shading_language_120 until 1.20 features are complete 2008-07-29 07:47:56 -06:00
Florent Thoumie
b5095ab97f autoconf: disable dri drivers build if being asked
Allow --with-dri-drivers={,no} to disable DRI drivers build.

Signed-off-by: Florent Thoumie <flz@FreeBSD.org>
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-07-28 11:04:41 -04:00
Michel Dänzer
57aea290e1 r300: Fix off-by-one error in calculation of scissor cliprect.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16123 .
2008-07-28 10:49:43 +02:00
Nicolai Haehnle
c1fb448ce8 r300: Fix a crash related to depth textures (triggered by Glest w/ shadowmaps) 2008-07-27 21:40:17 +02:00
Nicolai Haehnle
c117d0efd2 r300: Implement ARB_shadow_ambient; add STATE_SHADOW_AMBIENT 2008-07-27 21:31:49 +02:00
Nicolai Haehnle
e88be7d375 r300: Fix point minmax size
There are 6 subpixel units per pixel, not 16.
2008-07-27 21:18:29 +02:00
Nicolai Haehnle
322677b878 r300: Implement hardware acceleration for ColorLogicOp 2008-07-27 18:18:59 +02:00
Nicolai Haehnle
0973d348d7 r500: Handle non-native swizzles in texture instructions
This fixes piglit's fp-kil and fp-generic/kil-swizzle tests.
2008-07-27 16:48:24 +02:00
Nicolai Haehnle
1bdf5e09a0 r500: Redirect TEX writes to output registers
While R500 fragment program texture instructions appear to support writemasks,
they cannot write to the output FIFO immediately, so we need to insert a MOV
for these instructions.

This fixes piglit's fp-fragment-position and fp-incomplete-tex tests.
2008-07-27 15:14:07 +02:00
Eric Anholt
902e401a38 intel: Don't return a renderbuffer with alpha when just GL_RGB is requested.
Fixes oglconform rbGetterFuncs testcase.  The span code for this mode hasn't
actually been tested.
2008-07-26 17:39:23 -07:00
Nicolai Haehnle
85e44fcd51 r200: Do not set second coordinate clamping for 1D textures
Fixes piglit's tex1d-border test.
2008-07-26 16:16:23 +02:00
Nicolai Haehnle
477fa8fe12 r300: Always emit LOAD_VBPNTR immediately before index-based rendering
This fixes one type of lockup I've been seeing on my test system.
2008-07-26 16:15:33 +02:00
Ian Romanick
1e645b3659 Merge branch 'master' into drm-gem
Conflicts:

	src/mesa/drivers/dri/common/dri_bufmgr.c
	src/mesa/drivers/dri/i965/brw_wm_surface_state.c
2008-07-25 18:31:44 -07:00
Eric Anholt
e5022c3fdf mesa: Return 0 for cube map face of non-cubemap framebuffer attachments.
Fixes some oglconform fbo testcases.
2008-07-25 12:40:49 -07:00
Eric Anholt
ff60e3fa03 intel: If a tex image doesn't fit in the object's tree, make a temporary tree.
Previously, we would just store the data as malloced memory hanging off the
object, which would get memcpyed in at validate time.  This broke an
oglconform render-to-texture test, since validate wasn't called but a miptree
was expected.
2008-07-25 12:19:50 -07:00
Dave Airlie
9bc9e0ecb0 i965: fixup format for TFP zero copy 2008-07-25 20:32:22 +10:00
Dave Airlie
04c98089d1 Revert "intel: disable zero-copy TFP."
This reverts commit 94979950e8.

I've fixed it instead
2008-07-25 19:57:35 +10:00
Dave Airlie
d4244683a6 i965: make tex offset override work..
should fix fd.o 14441
2008-07-25 19:56:56 +10:00
Dave Airlie
94979950e8 intel: disable zero-copy TFP.
patch from Fedora. maybe someone can fix this later but for now
lets try and release Mesa so ajax can live his life and get Xorg 7.4 out.
2008-07-25 16:31:38 +10:00
Brian Paul
948f6e302c mesa: move extensions->version code into separate function 2008-07-24 15:11:11 -06:00
Brian Paul
d8ababdcc2 mesa: don't include Mesa version in GL_SHADING_LANGUAGE_VERSION string 2008-07-24 15:11:11 -06:00
Brian Paul
51bfb6aa99 query/print GLSL version string 2008-07-24 15:11:11 -06:00
Jesse Barnes
9a4be9785f intel: remove buffer swap debug output
Accidentally pushed as part of the last commit.
2008-07-24 11:46:08 -07:00
Ian Romanick
6118d830a6 Revert "965: Fix color clamping issues"
This reverts commit b993d539a7.  The
patch was applied incorrectly.  Actual fix coming soon.  Sorry for the
noise.
2008-07-24 08:40:22 -07:00
Thomas Hellstrom
7c2d7f8cf5 Fix a typo. 2008-07-24 13:35:35 +02:00
Thomas Hellstrom
9dd73d58ae Add new demo "fbo_firecube".
Tests fbo render-to-texture for various internal texture image formats.
2008-07-24 13:32:59 +02:00
Pawel Pieczul
117533759f 965: Fix partially transparent textures in Doom 3 engine games
Numbers of destination depth registers corrected (destination stencil
register was sent as depth register).
2008-07-23 15:43:23 -07:00
Eric Anholt
2e37143800 intel: Add a little span cache to spead up readpixels by cutting syscalls. 2008-07-23 10:21:25 -07:00
Eric Anholt
d2d5abfaeb intel-gem: Use pread/pwrite for span access.
This will avoid clflushing entire buffers for small acesses, such as those
commonly used by regression tests.
2008-07-23 10:21:25 -07:00
Eric Anholt
f0ca917924 intel: improve 2d batchbuffer debug output. 2008-07-23 10:21:25 -07:00
Eric Anholt
1c8791c581 intel: Fix CopyTexSubImage's src tiling arg for the blit.
Didn't hurt 915, but needed for 965.
2008-07-23 10:21:25 -07:00
Eric Anholt
bdaa06ad63 intel: move renderbuffer mapping to separate functions.
This lets us avoid duplicated code for doing so, including the depthstencil
paths that aren't covered by SpanRenderStart/Finish.  Those paths were
missing the span funcs setup, leading to a null dereference in the fbotexture
demo.
2008-07-23 10:21:24 -07:00
Jesse Barnes
97988ccc46 intel: fix buffer swaps and enable page flipping on 965
Some buffer swap intel render buffer fields (pf_num_pages & vbl_pending) are
also used for page flipping, so enable the code that sets & updates them on
965.  This allows buffer swaps and page flips to work on 965 and prevents hangs
in LOCK_HARDWARE in the buffer swap case due to an uninitialized vbl_pending
field.

Fixes FDO #16118.
2008-07-22 09:39:23 -07:00
Pawel Pieczul
b993d539a7 965: Fix color clamping issues 2008-07-21 10:57:20 -07:00
Brian Paul
77497eb73b mesa: revert building glslcompiler by default 2008-07-21 09:01:34 -06:00
Ian Romanick
99fe0c222c intel-gem: Bump driver date
Bump the driver date and insert the string "GEM".  When running tests,
this make it much easier to know that the right driver is being used.
2008-07-18 12:40:04 -07:00
Dan Nicholson
776c60d3c3 autoconf: Support Motif widgets in GLw with --enable-motif
Add an --enable-motif option, which will enable the Motif widgets in
libGLw and link it with libXm. The Motif installation information will
be gathered from the motif-config script (this comes with LessTif) or
fallback to the standard autoconf checks.

To allow the location of the Motif headers to be set from configure, the
default setting of -I/usr/include/Motif1.2 has been moved into
configs/default and then passed to the Makefile through the MOTIF_CFLAGS
variable.
2008-07-18 08:07:07 -07:00
Xiang, Haihao
b4b7326717 intel: fix texture border issue. (bug #16697) 2008-07-18 17:40:11 +08:00
Brian Paul
3bfedb7ed4 mesa: build the stand-alone glslcompiler by default, update the docs 2008-07-17 15:40:10 -06:00
Brian Paul
73b8ee4121 mesa: regenerated file 2008-07-17 10:09:04 -06:00
Brian Paul
d9f4d04111 mesa: fix/improve the atan(y,x) function 2008-07-17 10:08:14 -06:00
Brad Smith
f49d345a51 mesa: added checks for OpenBSD 2008-07-17 08:15:57 -06:00
Brian Paul
0138435643 mesa: regenerated file 2008-07-16 16:27:14 -06:00
Brian Paul
33a25729e8 mesa: fix temp re-use bug in emit_arith() 2008-07-16 16:20:25 -06:00
Brian Paul
082cde143b mesa: fix copy&paste errors in degrees() functions 2008-07-16 16:20:07 -06:00
Ian Romanick
29cb89d0c2 intel: Clean-up ARB_texture_env_crossbar
Enable support for ARB_texture_env_crossbar in the master extension
list instead of in every single device-specific list.
2008-07-16 10:37:49 -07:00
Ian Romanick
442c195c4a Remove redundant initalization of MaxTextureUnits 2008-07-16 09:43:03 -07:00
Brian Paul
7d13dded5c mesa: add GL_POLYGON_OFFSET_POINT/LINE/FILL queries, remove GL_TEXTURE_ENV_COLOR, GL_TEXTURE_ENV_MODE
Issues found by Bob Ellison.
2008-07-16 10:23:28 -06:00
Blair Sadewitz
b7c54945fe additional preprocessor checks for stdint.h, inttypes.h, etc
The patches to glext.h and glxext.h have been sent to Khronos/bugzilla.
2008-07-15 17:21:56 -06:00
Blair Sadewitz
ece7183ff1 mesa: added test for __NetBSD__ 2008-07-15 17:12:23 -06:00
Blair Sadewitz
4c6dcbf091 mesa: added test for __NetBSD__ 2008-07-15 17:11:54 -06:00
Blair Sadewitz
e6218d071d mesa: check for __INTERIX to typedef uintptr_t 2008-07-15 17:06:17 -06:00
Blair Sadewitz
546c7fb221 mesa: extra braces 2008-07-15 17:05:28 -06:00
Brian Paul
461e178806 mesa: regenerated file 2008-07-15 16:55:23 -06:00
Brian Paul
716f70d782 mesa: add missing IR_LOG2 case 2008-07-15 16:41:35 -06:00
Brian Paul
b0d173f405 mesa: fix some broken /= operators 2008-07-15 16:41:19 -06:00
Brian Paul
8c653f6e09 mesa: fix some broken bool, bvec2, bvec3, bvec4 constructors 2008-07-15 16:40:51 -06:00
Brian Paul
7d7d114e59 mesa: fix storage size computation in emit_arith() 2008-07-15 16:40:38 -06:00
Eric Anholt
a5f02368d2 intel-gem: Disable spantmp sse/mmx functions when tile swizzling.
Those functions rely on being able to treat the GET_PTR returned value as an
array indexed by x, but that's not the case for our tiling.

Bug #16387
2008-07-15 13:21:37 -07:00
Ian Romanick
27e3f7f21d glx: Update my e-mail address. :) 2008-07-15 11:06:31 -07:00
Ian Romanick
67108adb48 glx: Trivial clean-ups to __glXSetArrayEnable 2008-07-15 11:06:04 -07:00
Brian Paul
f214a848ab mesa: assemble main() after all other functions
Before, main() had to come after any functions it called.
2008-07-14 15:59:44 -06:00
Eric Anholt
946abd9b5a i915: fix build after previous commit. 2008-07-14 13:55:37 -07:00
Brian Paul
c62cb6be6c mesa: fix stencil state problem when GL_ATI_separate_stencil wasn't enabled
In glStencilFunc/Op/Mask() set both the front and back-face state, unless
GL_EXT_stencil_two_side is enabled.  Before, we only set the front+back state
if GL_ATI_separate_stencil was enabled.

Ultimately, we probably should remove GL_EXT_stencil_two_side since it's
incompatible with GL 2.x.
2008-07-14 09:51:35 -06:00
Guillaume Melquiond
4430597bf6 fix gltrace (bug 16691) 2008-07-14 08:50:36 -06:00
Julien Cristau
0a7df3794c glu: only export public symbols 2008-07-14 08:37:49 -06:00
Julien Cristau
f7eb0cec69 mklib: don't version symbols when using --exports
Use the default version instead of one based on the library SONAME
in the version script created by --exports.
2008-07-14 08:37:38 -06:00
Blair Sadewitz
a63b90712a mesa: also check for __NetBSD__ 2008-07-14 08:15:10 -06:00
Brian Paul
62db707a3d mesa: check for null shader->Source 2008-07-14 08:13:52 -06:00
Chris Rankin
5e600209f4 radeon: SetTexOffset support
This patch is a straightforward duplication of the R200 SetTexOffset code,
except that there is no big-endian tx_table[] array.
2008-07-14 10:11:20 +02:00
Stephane Marchesin
93115c4b23 nouveau: say goodbye to the old DRI driver... 2008-07-14 01:03:07 +02:00
Dave Airlie
4fab47b13c glx/dri: only report DRI2 extensions when DRI2 is enabled.
Fixes bug 15477
2008-07-13 19:00:46 +10:00
Nicolai Haehnle
e81ba58bf4 r300_fragprog: Use nqssa+dce and program_pair for emit
Share almost all code with r500_fragprog now.

This also fixes Piglit's texrect-many test, which means that the compiz
bicubic plugin should work with hardware acceleration now.
2008-07-12 21:16:16 +02:00
Dan Nicholson
3b8081603b Always pass -linker and -ldflags to mklib for shared libraries
This just makes the use of mklib more consistent throughout Mesa where
we always want to pass the linker and LDFLAGS when we might be making a
shared library.
2008-07-12 10:25:40 -07:00
Dan Nicholson
db072baaaf Call mklib with $(SHELL) so the user controls the interpreter
Respect the user's choice of shell when running mklib rather than always
using /bin/sh.
2008-07-12 10:25:40 -07:00
Dan Nicholson
4f5d97ee9e Call minstall with $(SHELL) so the user controls the interpreter
Running minstall directly means that /bin/sh is always used as hte
interpreter. If the user needs or wants to use a different shell fo
minstall, they can use the SHELL make variable.
2008-07-12 10:25:40 -07:00
Dan Nicholson
9eee7f260f Set $(SHELL) for all configs
Most make implementations will use /bin/sh as the interpreter for
commands and only use a different shell when the $(SHELL) make variable
is set. This makes the setting explicit and allows $(SHELL) to be used
in the commands themselves.
2008-07-12 10:25:40 -07:00
Dan Nicholson
bfb27b5fc0 autoconf: Subsitute SHELL for all platforms
Establish the shell that make will use from configure. This is exactly
how autoconf/automake operate, with the environment variable
CONFIG_SHELL respected to override the autoconf checks. In the usual
case where the user just executes `./configure', autoconf will pick a
shell from the current shell, sh, bash, ksh or sh5 that meets its base
criteria.

The special Solaris case of looking for a POSIX shell has been changed
to just set the SHELL variable since autoconf substitutes this already.
The EXTRA_CONFIG_LINES substitution is dropped as it should no longer be
needed.
2008-07-12 10:25:40 -07:00
Nicolai Haehnle
2d766923c4 r300: Fix saturate mode handling in radeon_program_alu 2008-07-12 12:20:28 +02:00
Nicolai Haehnle
cf0ae102db r500: Set Saturate correctly in radeon_program_pair 2008-07-12 12:04:28 +02:00
Nicolai Haehnle
8774fcd89a r300: Fix input register allocation in radeon_program_pair
When an input is marked in gl_program.InputsRead but is not actually read
in the final program (due to dead-code elimination or whatever), the order
of input registers must still match gl_program.InputsRead. This is done
even more explicitly now.
2008-07-12 11:11:59 +02:00
Nicolai Haehnle
11d711df36 r300: Explicitly set absolute value for the argument of RSQ
This fixes the last r500 bug related to glean/fragProg1.
2008-07-12 09:36:02 +02:00
Nicolai Haehnle
b6765c3499 r500_fragprog: Major refactoring of final emit
Use an abstracted instruction scheduling and register allocation algorithm
that we will be able to share with r300_fragprog.

Unlike the original emit code, this code tries to pair instructions that
only use the RGB part of the ALU with instructions that only use the alpha
part. However, the pairing algorithm still has some shortcomings;
for example, it doesn't generate optimal code for the emulation of LIT.
2008-07-12 09:36:02 +02:00
Nicolai Haehnle
d8d086c20b r500: Add "Not quite SSA" and dead code elimination pass
In addition, this pass fixes non-native swizzles.
2008-07-12 09:36:02 +02:00
Nicolai Haehnle
7904c9fad4 r500_fragprog: Transform trigonometric functions in first pass 2008-07-12 09:36:02 +02:00
Eric Anholt
2e841880cf drm-gem: Use new GEM ioctls for tiling state, and support new swizzle modes. 2008-07-11 18:58:19 -07:00
Alex Deucher
b0ef353b46 R300: update vap_cntl values for NUM_FPUS
based on info from hw team
2008-07-11 19:23:06 -04:00
Dan Nicholson
6c44c6d020 Remove generated pkg-config files on `make clean' 2008-07-11 10:43:29 -07:00
Dan Nicholson
99803a4ec9 autoconf: Add information about the --x-* options to --help output
Try to tell the user that the --x-* options are only used when the X
libraries can't be found by pkg-config.
2008-07-11 10:04:46 -07:00
Dan Nicholson
e97ab72b59 autoconf: Tell the user about docs/autoconf.html in --help output
The documentation in autoconf.html is much more explicit about how the
different configure options control the build. This adds a notice at the
end of the `./configure --help' output to tell the user about it.
2008-07-11 10:04:46 -07:00
Dave Airlie
b52398571b intel: fix batch flushing problem with cliprects handling.
pointed out and debugged by stringfellow on #dri-devel
2008-07-11 07:28:55 +10:00
Brian Paul
ac05da56ec mesa: return -1, not GL_FALSE if _glapi_add_dispatch() fails name sanity check 2008-07-09 15:06:36 -06:00
Brian Paul
4ca0af1882 mesa: fix state.clip[n].plane parsing bug (bug 16611) 2008-07-09 08:39:25 -06:00
Brian Paul
a2e435054c mesa: check for OpenBSD (bug 15604) 2008-07-09 08:39:25 -06:00
Xiang, Haihao
75e4db1804 i915: fall back to software rendering when shadow comparison is
enabled for 1D texture. fix #12176
2008-07-09 13:10:46 +08:00
Brian Paul
2f1b5ffcda mesa: remove debug code 2008-07-08 16:52:45 -06:00
Brian Paul
e4d9cc94b8 add yet another Makefile 2008-07-08 16:28:33 -06:00
Brian Paul
ee2a101123 bump version to rc3 2008-07-08 16:26:28 -06:00
Brian Paul
7d3feef9d6 added more Makefiles to file list 2008-07-08 16:26:06 -06:00
Brian Paul
2be54a8e8c mesa: implement glGetUniformiv() with new ctx->Driver function
The old implementation could overwrite the caller's param buffer.
2008-07-08 16:17:04 -06:00
Brian Paul
44029f15a8 added src/mesa/drivers/Makefile to file list 2008-07-08 16:16:57 -06:00
Brian Paul
6fe7857629 mesa: bump version to rc2 2008-07-08 15:12:48 -06:00
Brian Paul
c71fa34728 added null texObj ptr check (bug 15567) 2008-07-08 15:11:53 -06:00
Brian Paul
fd6cb1b11d mesa: more debug output 2008-07-08 15:11:53 -06:00
Brian Paul
d14b7890a4 mesa: compute global var size before doing codegen 2008-07-08 15:11:53 -06:00
Brian Paul
477d597df6 mesa: add missing VARYING case to storage_string() 2008-07-08 15:11:53 -06:00
Xiang, Haihao
92c075eeb7 i965: official name for GM45 chipset 2008-07-08 14:14:04 +08:00
George Sapountzis
a36bf890e8 glx: add LIBGL_ALWAYS_SOFTWARE
this disables accelerated DRI and fallbacks to client-side software rendering.

compile-tested only.
2008-07-07 18:34:17 +03:00
Dan Nicholson
e6e4f25aa5 autoconf: Allow commas or spaces to separate DRI drivers
Explicitly allow the argument to --with-dri-drivers to contain
comma-separated or space-separated drivers. A space-separated driver
list worked by chance before.
2008-07-06 14:17:54 -07:00
Dan Nicholson
11ac5b2456 Set library and header installation directories from configuration
Currently the installation directories for libraries and headers are
resolved within the install commands. For instance, the libraries will
be installed to $(INSTALL_DIR)/$(LIB_DIR). This limits the flexibility
of the installation, such as when the libraries should be installed to a
subdirectory like /usr/lib/tls.

This adds the make variables $(INSTALL_LIB_DIR) and $(INSTALL_INC_DIR)
to define the locations that the libraries and headers are installed.
For the static configs, this resolves exactly as before to
$(INSTALL_DIR)/include and $(INSTALL_DIR)/$(LIB_DIR). For autoconf, they
are derived directly from the --libdir and --includedir settings.
2008-07-06 14:15:40 -07:00
Nicolai Haehnle
056689d457 r500_fragprog: Fix RSQ with negative parameters 2008-07-06 16:39:31 +02:00
Nicolai Haehnle
2b2cb56656 r300_fragprog: Emulate trigonometric functions in radeon_program_alu 2008-07-06 10:00:35 +02:00
Nicolai Haehnle
4746752f16 r300: Translate fragment program DST in radeon_program_alu 2008-07-06 10:00:35 +02:00
Nicolai Haehnle
03abd021f2 r300: Translate fragment program LRP in radeon_program_alu.c 2008-07-06 10:00:35 +02:00
Nicolai Haehnle
62bccd6df0 r300: Allow adding parameters during fragprog transform, share LIT code 2008-07-06 09:59:43 +02:00
Nicolai Haehnle
77fdfaa23a r300: Correctly scan for used temporary registers
This fixes a regression introduced by dea8719f0...
2008-07-05 20:01:20 +02:00
Nicolai Haehnle
364d45a3e1 r500: Major refactoring of fragment program emit
Use the common facilities to convert non-native instructions into native ones.
Worked hard to make the code easier to read (hopefully), by using helper
functions instead of direct manipulation of the machine code.
Fixes two bugs related to FLR and XPD.
2008-07-05 18:04:10 +02:00
Nicolai Haehnle
dea8719f00 r300: Remove clause stuff for now in favour of a cloned generic gl_program 2008-07-05 18:04:10 +02:00
Nicolai Haehnle
85b46fbe9c r500_fragprog: Cleanup some unused variables and code. 2008-07-05 18:04:10 +02:00
Nicolai Haehnle
13c44679ad r500: Fix a mixup in fragment program LRP instruction emit 2008-07-05 18:04:10 +02:00
Nicolai Haehnle
09e587fcf3 r500: Fix blend color. 2008-07-05 18:04:09 +02:00
Nicolai Haehnle
82635aad42 _mesa_clone_program: Copy ShadowSamplers 2008-07-05 18:04:04 +02:00
Nicolai Haehnle
e187627c1d r300: Fix depth texture in compare mode
Missed the homogenous divide of R by Q before...
2008-07-04 18:22:16 +02:00
Nicolai Haehnle
845e3f701d Enable TexGen based on InputsRead when a fragment program is active
The old behaviour depended on which texture images the fragment program
reads from, which seems to contradict the shader specifications.

Note: Piglit's general/texgen test checks for this problem.
2008-07-04 18:22:15 +02:00
Brian Paul
1f4d0748ba GLSL-related bug fixes 2008-07-04 10:05:39 -06:00
Brian Paul
e06565b103 mesa: generate GL_INVALID_OPERATION in _mesa_get_uniform_location() if program isn't linked 2008-07-04 10:04:03 -06:00
Brian Paul
b931a0c1d9 mesa: remove incorrect assertion 2008-07-04 10:04:03 -06:00
Alan Hourihane
9157b1e09a glcontextmodes.c is required remove the reference in .gitignore 2008-07-04 13:54:49 +01:00
Xiang, Haihao
0c1e96e6d3 mesa: fix polygon offset issue (bug #12061) 2008-07-04 09:53:51 +08:00
Brian Paul
530df581dd mesa: fix various error codes 2008-07-03 16:21:11 -06:00
Brian Paul
011185396b mesa: fix some error codes in _mesa_ShaderSourceARB() 2008-07-03 16:02:05 -06:00
Brian Paul
3dc6591a7c mesa: fix problem freeing framebuffer/renderbuffer objects
Basically, set up no-op Delete() methods for the DummyFrame/Renderbuffer objects.
2008-07-03 15:40:38 -06:00
Brian Paul
7acb7c1ac0 mesa: additional error checking, fix error codes 2008-07-03 13:49:48 -06:00
Brian Paul
d866cb3712 mesa: regenerated file 2008-07-03 13:24:28 -06:00
Brian Paul
7f4f2ac39d mesa: additional vec4 constructor 2008-07-03 13:24:19 -06:00
Brian Paul
6e46c121f9 mesa: fix array storage allocation bug 2008-07-03 13:05:28 -06:00
Brian Paul
1dc20c7916 mesa: fix incorrect array size, added assertion 2008-07-03 13:03:35 -06:00
Brian Paul
b3e1f9bd52 mesa: fix vertex array validation test for attribute 0 (vert pos)
We don't actually need vertex array[0] enabled when using a vertex
program/shader.
2008-07-02 19:17:11 -06:00
Brian Paul
1726b7d1d3 mesa: when linking a shader program, make sure all the shaders compiled OK 2008-07-02 16:51:49 -06:00
Brian Paul
cb79c5c7c6 mesa: added some debug code (disabled) 2008-07-02 16:50:52 -06:00
Brian Paul
36a5826411 mesa: fix error codes in _mesa_shader_source(), _mesa_get_shader_source()
If the 'shader' parameter is wrong, need to either generate GL_INVALID_VALUE
or GL_INVALID_OPERATION.  It depends on whether 'shader' actually names a
'program' or is a totally unknown ID.
There might be other cases to fix...
2008-07-02 16:40:24 -06:00
Brian Paul
a405d69063 mesa: regenerated 2008-07-02 16:39:48 -06:00
Brian Paul
a2cddf58d2 mesa: added some missing equal() notEqual() intrinsics 2008-07-02 16:39:26 -06:00
Eric Anholt
def6e4f420 intel: span rendering requires just a flush before starting, not finish.
The dri_bo_map()s that follow will take care of idling the hardware as needed.
2008-07-02 11:49:10 -07:00
Brian Paul
918f3b17e5 mesa: regenerated files 2008-07-02 12:38:48 -06:00
Brian Paul
18adc71822 mesa: fix all(bvec2) function typo, add missing bvec2/3/4() constuctors 2008-07-02 12:38:48 -06:00
Roland Scheidegger
5ef4e4ffb8 mesa: fix issues around multisample enable
multisample enable is enabled by default, however gl mandates multisample
rendering rules only apply if there's also a multisampled buffer.
2008-07-02 20:21:06 +02:00
Eric Anholt
a995bdced2 intel-gem: Emit an MI_FLUSH at glFlush() so frontbuffer rendering is flushed.
We have something similar in the X Server that covers X Server rendering, this
is the equivalent here for rendering to the front buffer.  If we cared about
avoiding this at glFlush time, we could only do this when some actual
frontbuffer rendering had occurred.

Bug #16392.
2008-07-02 11:16:30 -07:00
Eric Anholt
4b3ed4d2d1 intel-gem: Fix y-tile swizzling for our G965 with swizzle_mode=1.
Apparently in Y mode we get bit 6 ^ bit 9.  The reflect demo in 'd' mode now
displays correctly.
2008-07-02 10:21:44 -07:00
Eric Anholt
19f585a3cf intel-gem: Fix Y-tiling span setup.
The boolean that the server gives us for whether the region is tiled was
getting used as the enum for what tiling mode.  Instead, guess the correct
tiling in screen setup.

Also, fix the Y-tiling pitch setup.  The pitch to the next tile in Y is
32 scanlines, not 8.
2008-07-02 09:10:21 -07:00
Brian Paul
6befdca6a3 generate a link error if the vertex shader references too many textures 2008-07-02 09:16:10 -06:00
Brian Paul
43346fb1fb set ctx->Const.MaxVertexTextureImageUnits = 0
This disallows vertex shader texture sampling.  See bugs 16157, 13838.
2008-07-02 09:14:53 -06:00
Ian Romanick
ea190fe050 VBO: Regenerate files based on recent changes to gl_API.xml
Since GL_ARB_vertex_buffer_object protocol isn't supported yet, these
changes are innocuous.
2008-07-02 06:26:11 -07:00
Paulo Cesar Pereira de Andrade
abd71144f0 Bring over commit 8d4d0b47a07a298a20ffae9fefe96c8c7ca9dccc from xserver tree 2008-07-02 06:22:47 -07:00
Ian Romanick
21e0d47514 VBO: Add missing functions related to VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 2008-07-01 19:30:32 -07:00
Ian Romanick
c52d6ad465 VBO: add GLX related annotations 2008-07-01 18:20:21 -07:00
Brian Paul
028739faed mesa: fix a GLSL vector subscript/writemask bug
This fixes a failure for cases like:
   vec4 v;
   v[1] *= 2.0;

The v[1] actually acts like a writemask, equivalent to v.y
The fix is a bit convoluted, but will do for now.
2008-07-01 17:59:07 -06:00
Brian Paul
e19af171cf mesa: move some functions 2008-07-01 17:52:31 -06:00
Brian Paul
9ae4d778d8 mesa: make _slang_swizzle_swizzle() non-private 2008-07-01 17:50:14 -06:00
Eric Anholt
e74f54793e intel-gem: Move bit 6 x tiling swizzle to a driconf option, and add new mode.
It turns out that it's not just deviceID dependent, and there's some additional
undefined factor that determines the bit 6 swizzling.  It's now controllable
with swizzle_mode=[012] until we get a response on how to automatically detect.
2008-07-01 16:14:08 -07:00
Brian Paul
32a5c40336 mesa: better function inlining in the presence of 'return' statements
Before, the presence of a 'return' statement always prevented inlining
a function.  This was because we didn't want to accidentally return from
the _calling_ function.  We still need the semantic of 'return' when inlining
but we can't always use unconditional branches/jumps (GPUs don't always
support arbitrary branching).

Now, we allow inlining functions w/ return if the return is the last
statement in the function.  This fixes the common case of a function
that returns a value, such as:

vec4 square(const in vec4 x)
{
   return x * x;
}

which effectively compiles into:

vec4 square(const in vec4 x)
{
   __retVal = x * x;
   return;
}

The 'return' can be no-op'd now and we can inline the function.
2008-07-01 11:41:21 -06:00
Brian Paul
b2247c7d29 mesa: add/fix some IrInfo entries for debugging purposes 2008-07-01 11:41:02 -06:00
Brian Paul
011b0e51e4 link to DRM 2.3.1 2008-07-01 09:02:10 -06:00
Brian Paul
2ce4b985a5 press 'm' to toggle multisample enable/disable 2008-07-01 08:49:12 -06:00
Brian Paul
634d2af2b0 init machine->Samplers (fixes vertex program texture fetches) 2008-07-01 08:49:12 -06:00
Dave Airlie
d3f7b463c3 dri: drop asserts to make build against stable libdrm
These asserts are of questionable use at the moment with things in flux.
2008-07-01 18:22:12 +10:00
Xiang, Haihao
bcc2a3d7e3 dri: Take the base image size into account when computing
first level of the mipmap.  fix #16210
2008-07-01 11:50:50 +08:00
Dan Nicholson
5cae1b747b autoconf: Improve the visibility of the swrast DRI driver
Improve the --with-dri-drivers help text so that users are aware that
they should install the swrast DRI driver.
2008-06-30 11:16:09 -07:00
Corbin Simpson
bb1744970d r3xx/r5xx: Enable ARB_point_parameters.
This isn't complete yet. It does cover the two most common usage cases,
though, and at least the third one (POINT_DISTANCE_ATTENUATION) is possible,
so I'll do that later.
2008-06-30 11:12:51 -07:00
Nicolai Haehnle
23e9b43ce4 r300: Fix dumb mistake in LOD bias translation 2008-06-30 08:37:37 +02:00
Nicolai Haehnle
4002b75e62 r300: Cleanup LodBias support
. There is both a per-texture unit and a per-texture object (at least for
OpenGL 1.4); this should now be supported properly.
. The LOD bias calculation in r300_state has been simplified and corrected
  (need to multiply by 32 instead of 31, and ensure clamping)
. do not clamp LOD bias in TexEnv, as that behaviour conflicts with what
  the spec says
. set Const.MaxTextureLodBias properly
. remove the no_neg_lod_bias property; if somebody can explain what
  it's good for, we can add it back in, but according to Google, nobody
  seems to use it
. removed some dead code and unused variables
2008-06-30 00:49:00 +02:00
Corbin Simpson
a74d22ba71 r300: Change LOD bias emission to more closely follow per-tex rules.
Okay, this time it's for real, and for good. This should be a perma-fix.
2008-06-29 10:32:19 -07:00
Corbin Simpson
543893eefd Revert accidental edit to progs/demos/lodbias.
*puts yet another paper bag over head*
2008-06-29 10:32:19 -07:00
Nicolai Haehnle
0918023c28 demos/shadowtex: Don't set TEXTURE_WRAP_T for 1D texture
The operation doesn't really make sense. It triggered a bug in the r300 DRI
driver (and possibly other drivers that simulate 1D textures via 2D textures).
I've added an isolated test case for this bug to Piglit, so everybody wins.
2008-06-29 17:34:14 +02:00
Nicolai Haehnle
bc775066aa r300: Fix wrap mode for 1D textures 2008-06-29 17:28:13 +02:00
Brian Paul
6cb1270491 s/GL_INVALID_VALUE/GL_INVALID_OPERATION/ in _mesa_get_uniformfv() 2008-06-28 16:48:58 -06:00
Brian Paul
b429e9b2d7 mesa: added null ptr checks 2008-06-28 16:48:58 -06:00
Dan Nicholson
f6da1453c5 DRI-specific pkg-config file
Since the gl pkg-config file doesn't convey any specifics about the
backend in use, this adds a new pkg-config file for when DRI is in use.
This can be used by the xserver build to determine if the DRI and/or
GLX extensions are appropriate.
2008-06-27 16:25:28 -07:00
Dan Nicholson
985e1cdfe8 autoconf: Check for posix_memalign
Rather than just defining HAVE_POSIX_MEMALIGN on Linux, check whether
the function exists on all platforms and define the macro if it is.
2008-06-27 16:24:42 -07:00
Eric Anholt
f059a33022 intel: Fix locking when doing intel_region_cow().
This was broken in the merge of 965 blit support.  It tried to lock only
when things were already locked.
2008-06-26 15:34:27 -07:00
Eric Anholt
93f701bc36 intel: Replace sprinkled intel_batchbuffer_flush with MI_FLUSH or nothing.
Most of these were to ensure that caches got synchronized between 2d (or meta)
rendering and later use of the target as a source, such as for texture
miptree setup.  Those are replaced with intel_batchbuffer_emit_mi_flush(),
which just drops an MI_FLUSH.  Most of the remainder were to ensure that
REFERENCES_CLIPRECTS batchbuffers got flushed before the lock was dropped.
Those are now replaced by automatically flushing those when dropping the lock.
2008-06-26 15:29:28 -07:00
Alan Hourihane
3b132b297f Check in SwapBuffers for any new pending dri2 events 2008-06-26 22:53:29 +01:00
Eric Anholt
f6abe8f0f2 Merge commit 'origin/master' into drm-gem 2008-06-24 14:08:08 -07:00
Eric Anholt
5174b85a0c intel: Fix glCopyPixels when x or y are < 0 in hw coordinates.
Nothing would get drawn as the negative coordinates broke the rectangle
intersection code that used unsigned ints.  Tested with copypix demo and
sliding the copy to the upper left.
2008-06-24 14:04:11 -07:00
Eric Anholt
9a0d773116 i965: Use the shared intel_pixel_copy.c.
This disables the textured copy implementation on 965, which didn't appear
to work (mesa copypix demo, disable the blit path, move so that regions don't
overlap and textured is used, and you get garbage).  If we resurrect this for
i965, I'd rather it used the 915-style metaops instead.  Current metaops code
left in place so that whoever picks it up has a reference.
2008-06-24 13:18:40 -07:00
Eric Anholt
744357e29c intel: Same pixel function init for everyone now. 2008-06-24 11:49:21 -07:00
Eric Anholt
f5eb62a116 intel: Avoid glBitmap software fallback for blending when no blending occurs.
Mesa demos tend to leave blending on but in GL_ONE/GL_ZERO, or
GL_SRC_ALPHA/GL_ONE_MINUS_SRC_ALPHA with a source alpha of 1.0.
2008-06-24 11:44:42 -07:00
Eric Anholt
f23adc504d intel: Merge check_blit_fragment_ops between i915/i965.
Both had some useful bits for the other.
2008-06-24 11:34:42 -07:00
Eric Anholt
90d33edf37 intel: Note reasons for blit pixel op fallbacks under INTEL_DEBUG=pix. 2008-06-24 10:50:10 -07:00
Eric Anholt
eda68cccc0 i915: Add support for accelerated glBitmap, shared from 965. 2008-06-24 10:26:57 -07:00
Eric Anholt
5989098779 i915: Fix read != draw drawable for glCopyPixels.
Taken from commit bad6e175cf.
2008-06-24 10:25:19 -07:00
Eric Anholt
98fa0aec36 i915: Allow accelerated pixel ops to be disabled with INTEL_NO_BLIT.
This matches 965.
2008-06-24 10:24:32 -07:00
Eric Anholt
a42dac1879 i915: Accumulate the VB into a local buffer and subdata it in.
This lets GEM use pwrite, for an additional 4% or so speedup.
2008-06-23 15:44:10 -07:00
Eric Anholt
62d66caeba i915: Convert to using VBs instead of inline prims. 2008-06-23 14:45:13 -07:00
Dan Nicholson
fe3b62b5b1 Ensure all objects are built when installing DRI 2008-06-22 20:29:45 -07:00
Dan Nicholson
5aa4d5a87d Don't make libmesa.a or libglapi.a depend on asm_subdirs
Since the asm_subdirs target does not actually create a file, make will
always consider that it needs to be rebuilt. If libmesa.a and libglapi.a
have asm_subdirs as a prerequisite, then they will always need to be
rebuilt, too. The correct order will be preserved by the default target,
though.

This should fix #16358.
2008-06-22 20:27:00 -07:00
Dan Nicholson
7ec5e6a032 Create $(TOP)/$(LIB_DIR) for install, too
If `make install' is run without running `make' first, the $(LIB_DIR)
will not be created. This also changes the mkdir a little bit so that it
isn't run if necessary and added `-p' so that it is immune to races.
2008-06-22 20:19:35 -07:00
Brian Paul
71d2578ac5 replace __inline and __inline__ with INLINE macro 2008-06-21 10:55:24 -06:00
Brian Paul
ba97ed2b74 replace __inline and __inline__ with INLINE macro 2008-06-21 10:52:40 -06:00
Brian Paul
cc96d54920 replace __inline and __inline__ with INLINE macro 2008-06-21 10:52:32 -06:00
Brian Paul
37f19b94ac replace __inline and __inline__ with INLINE macro 2008-06-21 10:49:45 -06:00
Brian Paul
402e7f76b1 #undef DEBUG to silence warnings 2008-06-21 10:49:40 -06:00
Brian Paul
5ee7b7912c replace __inline and __inline__ with INLINE macro 2008-06-21 10:34:38 -06:00
Brian Paul
055ab81920 replace __inline and __inline__ with INLINE macro 2008-06-21 10:34:00 -06:00
Brian Paul
24197b4901 replace __inline and __inline__ with INLINE macro 2008-06-21 10:30:01 -06:00
Brian Paul
7899270b9f replace __inline and __inline__ with INLINE macro 2008-06-21 10:27:36 -06:00
Brian Paul
2e922b0e35 replace __inline and __inline__ with INLINE macro 2008-06-21 10:24:43 -06:00
Brian Paul
2c1bead069 s/inline/INLINE 2008-06-21 10:20:54 -06:00
Brian Paul
77d917a74a remove old comments 2008-06-21 10:20:31 -06:00
Alan Coopersmith
e1f9adc274 Solaris port of Mesa 7.1 with autoconf support
Signed-off-by: Brian Paul <brian.paul@tungstengraphics.com>
2008-06-21 10:19:45 -06:00
Daniel Zhu
f30e4af734 Rename quad function to quadr to avoid clash with Solaris quad typedef
Signed-off-by: Brian Paul <brian.paul@tungstengraphics.com>
2008-06-21 10:19:45 -06:00
Alan Coopersmith
1043a7c71a Make minstall work with Solaris /bin/sh
Solaris /bin/sh doesn't set $PWD for you

Signed-off-by: Brian Paul <brian.paul@tungstengraphics.com>
2008-06-21 10:19:45 -06:00
Alan Coopersmith
4ba39c40ae Fix builds with compilers other than gcc 3.0 & newer
Add #include "glheader.h" for definition of __builtin_expect for compilers
that don't support it.

Signed-off-by: Brian Paul <brian.paul@tungstengraphics.com>
2008-06-21 10:19:45 -06:00
Brian Paul
3491cbea88 added pointer to beta/release candidates 2008-06-21 10:19:45 -06:00
Alex Deucher
dc25661099 R300: 1002:5657 is actually RV410
See bug 14289
2008-06-21 10:52:49 -04:00
Roland Scheidegger
b3f1aac95e r200: fix typo in r200TryDrawPixels parameter validation (bug 16406) 2008-06-21 02:54:14 +02:00
Brian Paul
21177c8764 mesa: tweak mipmap level selection for cube maps
This is just a hack.  After we convert the 3D texcoord into a face plus 2D
texcoord we need to recompute the partial derivatives and mipmap LOD.
But we don't have the info to do that.  Adjusting the original mipmap
level by -1 seems to give somewhat better results than before though.
2008-06-19 14:37:50 -06:00
Eric Anholt
0da9bc6a69 i915: Note the non-PBO fallback for textured drawpixels under DEBUG_PIXEL. 2008-06-18 14:35:59 -07:00
Eric Anholt
bbe80af457 i915: Restore the accelerated PBO pixel path functions after GEM changes.
The fencing code is not required, and waiting on the fences defeated one of
the purposes of the extension, which is to allow asynchronous readpixels.
2008-06-18 14:19:18 -07:00
Eric Anholt
654258a4fe Merge commit 'origin/master' into drm-gem 2008-06-18 14:07:38 -07:00
Eric Anholt
cf29ab3ba0 i915: Bug #14313: Fix accelerated (PBO) ReadPixels.
Refactoring of mine in 02d5ba8491 broke it
by failing to understand that the masking was about sign extension.
2008-06-18 13:50:49 -07:00
Xiang, Haihao
3e8aadee8b i965: add support for Intel 4 series chipsets 2008-06-18 15:33:33 +08:00
Brian Paul
3064069540 mesa: fix inconsistent use of GL_UNSIGNED_INT vs. GL_UNSIGNED_INT_24_8_EXT for Z unpacking 2008-06-17 16:44:04 -06:00
Eric Anholt
64adeb163d [intel] Fix no_rast option on non-965.
The no_rast fallback was getting partially overwritten by later TNL init,
resulting in a segfault when things were in a mixed-up state.
2008-06-17 14:14:02 -07:00
Eric Anholt
e2baf564d1 [intel-gem] Bug #16326: Fix X tile unswizzling on 965.
Apparently a bit gets flipped in the addressing for some rows of each tile.
2008-06-17 11:18:02 -07:00
Wilfried Holzke
5b5bf21874 assorted glide driver fixes 2008-06-17 10:08:22 -06:00
Brian Paul
51ad6e3425 glu: silence warnings 2008-06-17 10:08:22 -06:00
Dave Airlie
a1523c61ea mesa: make mm.c use unsigned ints for offsets.
If you have a GPU using this code and it has the offsets up in this space,
this fails.
2008-06-17 16:29:45 +10:00
Corbin Simpson
27b7f896d4 r300: Make LOD bias a persistent environment variable.
Per airlied's suggestion.
2008-06-16 11:40:34 -07:00
H. Verbeet
e9d1889891 Compute/setup fog coordinates even if vertex program is enabled.
Only when fog's enabled, of course.
In the usual case, this is just a pass-through operation.
2008-06-16 10:40:32 -06:00
Brian Paul
ec2d0decbd mesa: allocate pixel zoom arrays on heap, not stack
Fixes stack overflow on Windows.
2008-06-16 10:03:05 -06:00
H. Verbeet
bbce58802d Don't compute vertex fog when fragment program is active. 2008-06-16 09:41:08 -06:00
Corbin Simpson
588abd6696 r300: Fix new incarnation of bug 3195.
tests/bug_3195 doesn't render right, but at least it doesn't segfault this way.
2008-06-16 01:21:42 -07:00
Corbin Simpson
1738a9a535 r300: Forgot to clear old state before writing new state.
Oooops. Hehe.
2008-06-16 01:02:16 -07:00
Corbin Simpson
776580a6af r300: Enable LOD bias state emission.
Properly set t->filter_1 for r300_state to emit.
Expect buggies as people see LOD bias enabled for the first time...
2008-06-15 23:54:32 -07:00
Corbin Simpson
f7b8a13d65 Oops, misordered a few instructions.
Not like it matters, though, since it's not taking effect yet.
2008-06-15 17:30:07 -07:00
Corbin Simpson
6e6ca40f29 r300: Unbreak LOD biasing, a bit.
Needs a bit more work on submission.
2008-06-15 17:14:07 -07:00
Dan Nicholson
4fc66be296 No more drivers/xorg
Don't try to clean in xorg since GLcore is gone.
2008-06-15 09:06:27 -07:00
Corbin Simpson
f1ae5d4b44 r5xx: Enable fragment.position, partial ARB_shadow.
I don't like PROGRAM_BUILTIN; could we either patch Mesa or just use a different constant?
2008-06-14 19:32:33 -07:00
Corbin Simpson
7413c55d93 r5xx: Detangle FP fallback and translation switches.
r5xx should fallback if it encounters a bad FP.
TODO: Re-enable the dumb shader so we don't have to completely fallback.
2008-06-14 17:59:10 -07:00
Nicolai Haehnle
43da118961 r300: Add radeonTransformALU and fix a bug in r300_fragprog DPH
This new generic transform replaces "special" instructions by more generic
variants. Hopefully, we will be able to share this code between r300 and r500.
2008-06-14 23:09:15 +02:00
Nicolai Haehnle
825fdfd0c1 r300_fragprog: Use less complex instructions
MOV, ADD and MUL do not fit the hardware as well as MAD, but they are less
complex and thus leave more room for future optimizations.
2008-06-14 20:26:10 +02:00
Corbin Simpson
b97e48ffe3 r5xx: More FP rewriting; fix texrect FP insts. 2008-06-14 08:56:03 -07:00
Corbin Simpson
69004fb758 r5xx: New FP code, take two.
Add the code emission source file, and comment out unneeded tex de-swizzling.
2008-06-14 07:21:40 -07:00
Corbin Simpson
0a341ef296 r5xx: FP refactor, take one.
Yes, I know it's massive. Imagine how I felt, auditing 3000 lines of code.
2008-06-14 07:03:08 -07:00
Corbin Simpson
9704414d13 r3xx/r5xx: Don't force aniso.
*Pulls paper bag down over head*
2008-06-14 04:37:09 -07:00
Nicolai Haehnle
a1c0c56d70 r300: Implement GL_ARB_shadow and GL_EXT_shadow_funcs 2008-06-14 04:15:42 +02:00
Nicolai Haehnle
83ad2a756e texenvprogram: Mark textures using ARB_shadow as ShadowSamplers
Since ARB_fragment_program and friends are defined to ignore the setting of
the GL_TEXTURE_COMPARE_FUNC parameter, we have to explicitly enable the
shadow comparison by marking the texture unit in ShadowSamplers when
appropriate.
2008-06-14 04:15:31 +02:00
Nicolai Haehnle
2882e51625 r300: Add radeonCompilerDump for debugging 2008-06-14 04:15:20 +02:00
Nicolai Haehnle
e34dc8227c r300_fragprog: Refactor TEX transformation
Streamlining source and destination registers, as well as texcoord scaling for
RECT textures is now done in a radeon_program based transformation.

The idea is that this will allow us to optimize away unnecessary indirections
more easily.
2008-06-14 04:14:56 +02:00
Nicolai Haehnle
b5170bc9d3 r300: Add radeon_program and trivial refactoring of r300_fragprog to use it
The idea/hope is that radeon_program will serve as an intermediate
representation for r3xx up to r6xx fragment and vertex programs.
Right now, it is nothing more than a simplistic wrapper around Mesa's
prog_instruction, together with the notion of clauses, taken from r6xx docs.

The clauses will eventually be used to represent the nodes that are used in
r300 family fragment programs.
2008-06-14 04:14:05 +02:00
Nicolai Haehnle
e2aa45c2f9 r300: Do not include r300_fragprog.h from r300_context.h and other cleanups 2008-06-14 04:11:21 +02:00
Nicolai Haehnle
caeabb1ebe r300_fragprog: Remove dead declarations, move NOP declarations into source 2008-06-14 04:11:13 +02:00
Nicolai Haehnle
4ba1c7d848 r300_fragprog: Refactoring and cleanup
Refactor so that r300_pfs_compile_state "owns"/holds a pointer to
r300_fragment_program instead of the other way round. This is more natural from
an object orientation point of view.

Move the compiled hardware state into r300_fragment_program_code, in
anticipation of on-the-fly program recompilation based on external OpenGL
state.
2008-06-14 04:11:05 +02:00
Nicolai Haehnle
defadd9c03 r300_fragprog: Remove dead code 2008-06-14 04:10:52 +02:00
Nicolai Haehnle
b7669e4a86 r300/r500: Separate fragprog compiler structures
r500 code still used r300_pfs_compile_state, which contains some fields that
really only make sense on r3xx type hardware. In order to allow both fragprog
implementations to go forward without disturbing each other, I've pushed this
structure down into the respective r[3|5]00_fragprog.c
2008-06-13 20:51:20 +02:00
Nicolai Haehnle
4919cc3a2c r300: Fix depth texture GL_LUMINANCE vs. GL_INTENSITY mixup 2008-06-13 19:36:03 +02:00
Nicolai Haehnle
b1056b6127 r300: Reenable t->filter_1 (though currently not used) 2008-06-13 19:36:02 +02:00
George Sapountzis
1087cc61b3 glx: load swrast_dri.so
caveats:

- does not work with old (i.e. libGLcore) xserver:

- made unbindContext a noop

- extensions:

  GLX_SGI_make_current_read
  GLX_EXT_texture_from_pixmap
  GLX_MESA_copy_sub_buffer
2008-06-13 15:54:08 +03:00
George Sapountzis
7ffb1230b3 dri/swrast: make unbind a noop
This is for loading swrast_dri.so from libGL.

MakeContextCurrent() seems to unbind the context right after binding it and
DRI drivers also have a noop DriverAPI.UnbindContext ...
2008-06-13 15:52:32 +03:00
George Sapountzis
341987f688 dri/swrast: add OpenGL 2.1 functions 2008-06-13 15:48:34 +03:00
George Sapountzis
4297413656 glx: use ErrorMessageF 2008-06-13 15:48:06 +03:00
Zack Rusin
95b34baa8f silly bug: it's PROGRAM_VARYING 2008-06-12 19:43:10 -04:00
Zack Rusin
928ec5cd3b glsl: make sure we replace all output reads with temporaries
test in if.glsl
2008-06-12 19:39:20 -04:00
Zack Rusin
53f5b9741a glsl: allow uniforms 2008-06-12 19:37:26 -04:00
Zack Rusin
effb73befa glsl: fix array size initialiazers using const variables
e.g.
const int kernelSize = 9;
uniform vec2 kernel[kernelSize];
2008-06-12 15:15:34 -04:00
Zack Rusin
19659a50f9 almost forgot - RelAddr is a boolean so use it here 2008-06-12 15:08:58 -04:00
Zack Rusin
2542c59c55 shaders: fix allocation of arrays of parameters 2008-06-12 15:08:27 -04:00
Zack Rusin
74964ff04d glsl: implement variable array indexes 2008-06-12 15:08:12 -04:00
Dan Nicholson
0440f5a187 Update .gitignore for progs/glsl 2008-06-12 06:37:45 -07:00
Dave Airlie
41bdb88f27 sparc: add swrast to dri drivers 2008-06-12 16:26:46 +10:00
Dave Airlie
2b0e75ea7a sparc: add DRI drivers for sparc patch from Fedora 2008-06-12 12:06:50 +10:00
Brian Paul
3f3e4f645d remove obsoleted doxygen \param comments
Someone changed the function parameters but didn't bother to update the
comments.

Also, whitespace changes, clean-ups.
2008-06-11 19:33:30 -06:00
Brian Paul
8d976aedc4 comments 2008-06-11 19:33:14 -06:00
Eric Anholt
407ce3da3c [intel-gem] Chase domain flag renaming in the DRM.
This is an API breakage only.
2008-06-11 14:44:48 -07:00
Eric Anholt
0227d91a9e [gem] Enable bo_reuse by default.
The objects are swappable, so we're less concerned by excessive object
allocation now, and it's about a 20% performance improvement.  If we get
concerns about the memory consumption from others, we can look into a
compromise position later.
2008-06-11 11:46:29 -07:00
Brian Paul
9563449c14 remove unnecessary swrast, tnl includes 2008-06-10 12:08:30 -06:00
Brian Paul
c233b4245f add some missing rule dependencies 2008-06-10 10:10:12 -06:00
Roland Scheidegger
17ec0dbd75 copy msaa visuals capability 2008-06-10 15:45:20 +02:00
Dan Nicholson
fbb96a0301 Distribute version.mk in case autoconf needs to be run again
Users may need to rebuild the configure script, so we need to distribute
version.mk so autoconf can run successfully.
2008-06-10 06:06:40 -07:00
Xiang, Haihao
a742bed99a i965: apply commit 6c1a98e97a to glsl 2008-06-10 16:31:36 +08:00
Brian Paul
72f87b6947 fix Xlib libGL.so build problem.
Also, build driverfuncs.c into libmesa.a since it's always needed.
2008-06-09 16:06:44 -06:00
Brian Paul
f6246f85d7 s/SOLO/MESA/ 2008-06-09 14:09:09 -06:00
Brian Paul
910b3bfaeb Makefile clean-ups 2008-06-09 13:52:22 -06:00
Brian Paul
a80ccaadc7 more old stuff, rename SOLO->MESA, etc 2008-06-09 13:52:22 -06:00
Brian Paul
08c07b60be Makefile clean-ups 2008-06-09 13:52:22 -06:00
Brian Paul
376203cff8 document makefile changes 2008-06-09 13:52:22 -06:00
Alan Hourihane
5cf69fe511 Check for NULL pointer 2008-06-09 16:25:01 +01:00
George Sapountzis
906e189bd3 glx: use goto's vs. nested if's ala xserver
compile tested only
2008-06-09 17:47:49 +03:00
George Sapountzis
0793457039 glx: add dri_common.c ala xserver
also drop driFilterModes which is unused

in preparation of loading swrast_dri.so
2008-06-09 17:47:09 +03:00
George Sapountzis
4c7e02298f dri/swrast: minor cosmetic 2008-06-09 17:46:39 +03:00
Nicolai Haehnle
0009973119 r300: Workaround hardware readcache problem
This workaround is similar to the one found in r200_span.c.
It seems like some part of the read hardware doesn't realize that
VRAM has changed. By reading from an arbitrary position, this is fixed.

The piglit test bugs/r300-readcache is a regression test for this bug.
2008-06-08 22:38:58 +02:00
Brian
f440b0ddd9 remove realglx.[ch] from build 2008-06-08 11:25:30 -06:00
Roland Scheidegger
28c28f72fd i965: fix OPCODE_TEX when additional ops are needed 2008-06-08 14:05:07 +02:00
Corbin Simpson
21f50818b0 r300: Allow driconf to set a default anisotropy.
If an app does not use GL_EXT_tex_filter_aniso, this lets driconf set it instead.
2008-06-07 12:37:31 -07:00
Nicolai Haehnle
cb16876608 r300: Some cleanups in depth and stencil state handling
This also fixes a bug with Zfunc set to GL_NEVER in glean/paths.
2008-06-07 21:08:43 +02:00
Nicolai Haehnle
7cb63a25de r300: Apply writemask when clearing stencil buffer
This fixes the glean/maskedClear test.
2008-06-07 20:34:06 +02:00
Nicolai Haehnle
731686b713 r300: Fix stencil buffer clear
The glean/readPixSanity test passes now.
2008-06-07 20:28:04 +02:00
Nicolai Haehnle
75bfe630ff r300: Further anisotropic filtering fixes
Thanks to Corbin for the initial cut today. Fixed some minor stuff (in
particular, make sure we still use a MIP_LINEAR filtering mode; anisotropy
without MIP_LINEAR filtering is not the truly pleasing anisotropy).
2008-06-07 18:56:55 +02:00
Nicolai Haehnle
bf1a7c884d r300: Update LOD_BIAS register constants 2008-06-07 18:34:44 +02:00
Corbin Simpson
5e58e5d777 r5xx: Unbreak anisotropic filtering?
Not quite finished, maybe? Not sure.
2008-06-07 01:37:35 -07:00
Corbin Simpson
f39780242e r5xx: Fix speedy LIT once and for all.
To do: Add a slightly more accurate LIT. Will do later.
2008-06-06 22:07:18 -07:00
Jose Fonseca
ae18cbcfc5 Fix CRLF line endings. 2008-06-07 12:34:45 +09:00
Jose Fonseca
9286a14fbe Fix CRLF line endings. 2008-06-07 12:33:47 +09:00
Nicolai Haehnle
fa1bc0d7d6 r300: Improve texture layout calculations
The texture layout calculations for mipmapped cubemaps used to be completely
wrong, since the GPU expects images to be grouped by miplevel instead of by
face number.

This has been fixed now, though the memory layout is still slightly incorrect
for the smaller miplevels. Unfortunately, the docs are lacking in that area.
2008-06-06 23:47:46 +02:00
Keith Packard
f5d03af109 [intel-gem] Call the new throttle ioctl from swap buffers
Swap buffers is a fairly reasonable time to wait for the hardware for a
while; this keeps us from overrunning the ring.
2008-06-06 13:05:46 -07:00
Nicolai Haehnle
03a1144cd1 r300: Cleanup TX_MIN_FILTER defines
This commit should not affect the functionality at all, just cleanup
some of the original texture filter guesswork using information from
the register documentation.
2008-06-06 21:34:34 +02:00
Nicolai Haehnle
665605234d r300: Remove unused variable r300_tex_obj::dirty_state and related defines
This variable was only ever written to, but nobody used its value.
2008-06-06 21:34:34 +02:00
Brian Paul
0b72fada6a s/subdirs/asm_subdirs/ 2008-06-06 12:27:55 -06:00
Brian Paul
1d5b51abc8 move the install rules 2008-06-06 12:27:14 -06:00
Brian Paul
bde6b57e48 remove stray semicolon 2008-06-06 12:25:24 -06:00
Brian Paul
847f54e2fa move a beos-ism down into drivers/beos/Makefile 2008-06-06 12:24:44 -06:00
Brian Paul
dd750e0763 Remove the old, complicated default build rule; use the new driver_subdirs rule
Also, all the old driver-specific rules are now gone.
2008-06-06 12:18:40 -06:00
Brian Paul
358dcd7178 remove more old stuff, insert new driver_subdir build rules (but not enabled yet) 2008-06-06 12:12:59 -06:00
Brian Paul
04c6ca99dd new drivers/Makefile with simple default/clean/install rules 2008-06-06 12:09:55 -06:00
Brian Paul
c9739b2055 move directfb-libgl into drivers/directfb/Makefile 2008-06-06 12:09:01 -06:00
Brian Paul
f8563ddddb Move fbdev driver construction into src/mesa/drivers/fbdev/Makefile 2008-06-05 16:44:11 -06:00
Brian Paul
b55694512a reorder some lines, more make clean cmds 2008-06-05 16:28:00 -06:00
Brian Paul
4a68b62b86 remove X11, Glide, OSMesa sources 2008-06-05 16:27:43 -06:00
Brian Paul
e89e94e01a added dependencies 2008-06-05 16:26:15 -06:00
Brian Paul
2b84b22bad Move building of stand-alone Mesa into drivers/x11/Makefile
Also, some re-org, renaming, and general clean-up.
We're just a few steps away from removing the all the special case rules
for building drivers.
2008-06-05 16:08:42 -06:00
Brian Paul
ea7eb9a374 new Makefile for building "stand-alone", Xlib-based libGL 2008-06-05 16:06:17 -06:00
Brian Paul
bf5e573926 prefix some includes with mesa/ or glapi/ 2008-06-05 16:05:02 -06:00
Brian Paul
f8c6b6628d minor changes 2008-06-05 15:37:17 -06:00
Brian Paul
18906b7904 Move construction of libOSMesa.so into src/mesa/drivers/osmesa/Makefile
This removes some cruft from src/mesa/Makefile.
Something similar could be done for stand-alone / Xlib-Mesa libGL...
2008-06-05 15:36:07 -06:00
Brian Paul
91b491debe insert mesa/ before include files 2008-06-05 15:26:11 -06:00
Alan Hourihane
b2a9788ec6 Silence warning 2008-06-05 11:47:20 +01:00
Brian Paul
4c7a17c251 fix event handling issues (such as when resizing when not animating) 2008-06-04 16:11:24 -06:00
Brian Paul
6d9c3fa0c2 press 'a' to toggle animation 2008-06-04 16:04:04 -06:00
Brian Paul
c35e021f37 code refactoring (draw_frame(0, handle_event()) 2008-06-04 16:01:47 -06:00
Brian Paul
c5342ad0d0 remove references to incorrect -winwidth/-winheight, replace with -geometry 2008-06-04 15:56:30 -06:00
Brian Paul
028fd5594c Set the attribute as used.
cherry-picked from gallium-0.1
2008-06-04 14:41:33 -06:00
Dan Nicholson
871125a68d autoconf: Collect arch/platform settings in one location
The architecture- and platorm-specific settings were scattered
throughout the configure script. This moves them near the beginning
before any of the driver-specific settings.
2008-06-04 13:00:35 -07:00
Brian Paul
0d8676822d remove old/unused foomesa.h example header 2008-06-04 09:33:02 -06:00
Brian Paul
f34767f04c call glutDestroyWindow() before exit 2008-06-04 09:30:32 -06:00
Xiang, Haihao
9e95fad02e i915: Fix GL_DEPTH_TEXTURE_MODE issue. (bug #16221) 2008-06-04 15:44:38 +08:00
Keith Packard
dbf3c5247c Merge commit 'origin/master' into drm-gem
Conflicts:

	src/mesa/drivers/dri/common/dri_bufmgr.h
	src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c
	src/mesa/drivers/dri/intel/intel_bufmgr_ttm.h
	src/mesa/drivers/dri/intel/intel_ioctl.c
2008-06-03 22:56:25 -07:00
Dave Airlie
0b734bd7cf mesa/drm/ttm: allow build against non-TTM aware libdrm
I'll release a libdrm 2.3.1 without TTM apis included from a special
drm branch that should allow mesa 7.1 to build against it.

I've had to turn off DRI2 stuff.
2008-06-04 14:08:27 +10:00
Eric Anholt
4b5b008d54 [intel] Convert drivers to using libdrm bufmgr code. 2008-06-03 14:43:48 -07:00
Ian Romanick
f688827ebd bug #16503: use INSTALL macro instead of hard-coding to bin/minstall
This is only part of the fix.  Someone with more autoconf-fu will have
to fix the rest
2008-06-02 11:19:35 -07:00
Nicolai Haehnle
96adcc2e21 [t_vp_build] Fix refcounting-related memory leak
This memory leak is identical to the earlier one in texenvprogram.
Fixed by not creating an additional reference to new programs in cache_item.

On top of that, remove some duplicated state setting.
2008-06-02 18:42:52 +02:00
Nicolai Haehnle
934a53eb44 [texenvprogram] Fix refcounting-related memory leak.
All newly created programs have RefCount == 1, but the fragment program cache
added an additional reference in cache_item, with the result being that none
of the programs were ever freed.

Solve the problem by not creating the additional reference in cache_item.
2008-06-02 18:42:49 +02:00
Dave Airlie
7ead1c5d06 r500: add missing brackets around depth testing 2008-06-02 07:18:21 +10:00
Corbin Simpson
915e49e0fd r5xx: Enable depth write emission.
Thanks to nh for the r3xx version.
2008-06-01 11:45:30 -07:00
Nicolai Haehnle
c9ea62444c r300: Writing to result.depth in fragment programs (R3xx; only stub for R5xx)
Setup fg_depth_src for depth writing programs and change early Z (ztop)
semantics.

Piglit's version of glean/fragprog test passes now (unlike Glean, its
dependency on EXT_fog_coord, which we don't support, is optional).

R3xx only at the moment, but should be straightforward to adapt to R5xx
(I don't own an R5xx, and I don't want to break anything.)
2008-06-01 19:59:42 +02:00
Nicolai Haehnle
d9c7c5f071 [r300] Fix KIL instruction and swizzling of texture coordinates
The KIL instruction only works if at least one texture unit is enabled
in hardware.

Texture instructions do not support swizzles, negations etc. natively,
so we now emit an explicit swizzling etc. operation when the texture coordinate
requires it.

This fixes the Piglit fp-kil test.
2008-06-01 13:23:53 +02:00
Corbin Simpson
3225e2cdb6 r5xx: Add OPCODE_FLR.
Why didn't anybody tell me we were missing this one? I thought I committed it ages ago!
2008-06-01 03:23:00 -07:00
Corbin Simpson
9a34c68faf r5xx: Last emit_sop() for now.
This should also clean up LIT later on.
2008-05-31 22:41:54 -07:00
Corbin Simpson
bffa0909cb r5xx: More emit_sop(), stage 2.
SIN/COS.
2008-05-31 22:23:11 -07:00
Corbin Simpson
ea58dceb1c r5xx: Cleanup SOP with emit_sop().
I wish I had a snarky commit message, but I'll save that for after I get the
trig working with this.
2008-05-31 22:09:38 -07:00
Corbin Simpson
c9679ce1d2 r5xx: Dump shader constants when dumping program assembly. 2008-05-31 20:48:15 -07:00
Dave Airlie
7013eecf28 r300: disable the lowimpact fallbacks by default.
because really we should be able to just fix the driver.
2008-06-01 09:32:55 +10:00
Markus Amsler
a947c1a3fe r500: Use 8bit fog alpha compare value.
This fixes transparency issues on r500 by enabling
backwards compatibility with the r300 alpha compare value.
2008-05-31 03:10:21 +02:00
Eric Anholt
fccc427aac [intel-gem] Remember last offset of reused BOs to avoid more kernel relocs.
This is good for about 5% on ipers on 965, and should help any cpu-bound app.
2008-05-30 15:12:48 -07:00
Luc Verhaegen
4a69c4173d Fix segfault on exit in unichrome driver (bug 16150) 2008-05-29 11:00:06 -06:00
Brian Paul
ef56a563a1 undo prev change to this VC7 project file
Meant to update the VC8 project file.
2008-05-29 10:46:39 -06:00
Karl Schultz
1190261c47 added prog_uniform.[ch] 2008-05-29 10:43:48 -06:00
Brian Paul
645c131264 Assorted Windows fixes (Karl Schultz) 2008-05-29 10:42:02 -06:00
Brian Paul
a1a0e51043 Use the GLuint64EXT type defined by GL_EXT_timer_query
Removes some compiler #ifdef stuff.
2008-05-29 10:42:02 -06:00
Dennis Kasprzyk
328621509f R1/2/3/4/5xx: fixed calculation of cliprects in CopyBuffer. 2008-05-29 11:25:21 +02:00
Dennis Kasprzyk
377016d728 Report correct damage rectangle in CopySubBuffer. 2008-05-29 11:24:16 +02:00
Keith Packard
d8395f9d9e [intel-gem] Once mapped, leave buffers mapped.
Mapping and unmapping buffers is expensive, and having the map around isn't
harmful (other than consuming address space). So, once mapped, just leave
buffers mapped in case they get re-used.
2008-05-28 23:28:46 -07:00
Markus Amsler
74a217fbcd r300: fix R300_FG_ALPHA_FUNC_VAL_MASK 2008-05-29 02:14:26 +02:00
Brian Paul
5adc763898 updated function list 2008-05-28 09:06:28 -06:00
Brian Paul
5429d4a04a replace make with $(MAKE) (bug 16133) 2008-05-28 08:53:53 -06:00
Dave Airlie
3e6c791390 r300: disable cmdbuf debug again 2008-05-28 10:23:25 +10:00
Dave Airlie
261a15cf63 Merge branch 'r500-support'
Bring in all the r500 3D code into master should be as stable as the r300
code it is landing on top off.

Conflicts:

	src/mesa/drivers/dri/r300/r300_reg.h
	src/mesa/drivers/dri/r300/r300_state.c
	src/mesa/drivers/dri/radeon/radeon_screen.c
2008-05-28 10:20:14 +10:00
Dave Airlie
85af4fde7f r500: remove warnings and only start on newer drms.
This removes lots of warnings to the user, and only allows the driver
to run on > .29 drms for r500 cards.
2008-05-28 10:11:41 +10:00
Alex Deucher
867f5aac53 R3/4/5xx: update to use drm get_param for num gb pipes 2008-05-28 10:11:14 +10:00
Dave Airlie
5552500cdf r500: cleanup warnings and include files 2008-05-28 10:03:10 +10:00
Corbin Simpson
8c39e24ec3 r5xx: Add OPCODE_XPD. In working condition, I might add.
And we're officially finished with the ARB_fragment_program
instruction set. It's worth noting that LIT is still not reliable.
SIN and COS were fixed a few commits ago. We're finished with stage 1!
Whoohoo!
2008-05-27 02:12:10 -07:00
Corbin Simpson
a242b331c6 r5xx: Just a few small LIT fixes.
Still broken; will fix tomorrow.
2008-05-27 01:36:25 -07:00
Corbin Simpson
9412aee4dc r5xx: Fix emit_mov() regression.
Specifically, fix improper swizzling.
2008-05-27 01:36:25 -07:00
Dave Airlie
eee53dfb22 r500: the cs is shared per context - doh so don't use for program upload.
Also remove some unused bits of the r500 fragprog struct
2008-05-27 18:15:14 +10:00
Dave Airlie
7278266612 r500: need to re-setup inst offset/end for translated programs
this fixes texenv
2008-05-27 17:39:35 +10:00
Dave Airlie
774b3bc5a5 r500: reset fp/fp_const counts 2008-05-27 17:11:04 +10:00
Dave Airlie
4af22c9076 r300/r500: emit flush inside vap_cntl state atom
Not sure if this is a good or bad plan, it certainly doesn't make things worse here.
2008-05-27 17:08:03 +10:00
Dave Airlie
8eb7df6302 r500: hopefully fix 4096 texture harder 2008-05-27 15:29:39 +10:00
Corbin Simpson
b5372746ff r5xx: Fix FP temp counting.
One of the ref counters wasn't being added to the temp counter.
Yet another product of late-night coding...
2008-05-26 22:12:24 -07:00
Dave Airlie
9f03e93de9 r500: remove debugging 2008-05-27 12:46:44 +10:00
Dave Airlie
7b88f40116 r300/r500: fix r500 fragment program texture unit references 2008-05-27 12:45:15 +10:00
Dave Airlie
5a5ba35069 r500: initial support for tmu mappings 2008-05-27 10:59:42 +10:00
Corbin Simpson
b57ba7c5b0 r5xx: Enhance emit_mov().
Now we can add arbitrary sources and swizzles. Will make many things smoother.
2008-05-26 16:00:05 -07:00
Corbin Simpson
5499685931 r5xx: Moar LIT.
Still not working, but getting closer.
2008-05-26 15:18:41 -07:00
Corbin Simpson
a2db33219d r5xx: First stab at LIT. 2008-05-26 12:35:39 -07:00
Keith Packard
924eaa2f95 [intel] all flushing in intelEmitCopyBlit
Add both MI_FLUSH and intel_batchbuffer_flush to intelEmitCopyBlit.
This ensures that the data are flushed *and* the gem kernel driver sees the
various memory domain transitions.
2008-05-26 00:19:20 -07:00
Corbin Simpson
21b352bb14 Replace copyright on r500_fragprog.c
Huh, could have sworn I already did this once before...
Maybe I forgot to commit it?
2008-05-25 22:50:00 -07:00
Keith Packard
8ba91b4636 [intel] Enable buffer re-use for gem
Use the new DRM_IOCTL_I915_GEM_BUSY ioctl to detect
idle buffers for re-use.
2008-05-25 20:50:01 -07:00
Corbin Simpson
27d8fcd506 r5xx: Unbreak texture swizzling. 2008-05-25 19:53:48 -07:00
Corbin Simpson
f776f693c0 r5xx: Massive MAD cleanup.
Common uses of MAD now use emit_mad(), the two common negation masks work,
and fixed a few off-by-one errors.
2008-05-25 11:46:16 -07:00
Corbin Simpson
594760148c r5xx: Negation masks for every inst except SWZ.
Yay?
2008-05-25 11:35:54 -07:00
Corbin Simpson
bd74d2aa26 r5xx: More emit_alu().
Converted ADD.
2008-05-25 11:35:20 -07:00
Corbin Simpson
810270ad11 r5xx: Add emit_mad() for FP.
If it uses MAD, emit it with emit_mad()!
(Now available at your local grocer's. Multiply and add responsibly.)
2008-05-25 11:07:51 -07:00
Corbin Simpson
f1d04cd766 r5xx: Consolidate FP tex insts.
They're all the same, really.
2008-05-24 11:30:57 -07:00
Corbin Simpson
b6b5190682 r5xx: Fix SGE/SLT. 2008-05-24 10:25:22 -07:00
Corbin Simpson
6f918a9fda r5xx: Remove some debugging cruft. 2008-05-24 10:25:22 -07:00
Dave Airlie
af77de66d9 r500: missed a couple of inst4s. 2008-05-24 18:18:18 +10:00
Dave Airlie
e9031d6f63 r500: add depth output write
Not sure how well this works yet, but we need to set the alpha to w_omask
2008-05-24 18:12:26 +10:00
Eric Anholt
200fd13d4a Remove stale comment about glFlush().
We don't need an MI_FLUSH there, because everything that's been flushed in the
batch will eventually hit the hardware.
2008-05-23 12:43:05 -07:00
Eric Anholt
a74bf4ef34 Emit a flush after the swapbuffers blit, so contents end up on the screen.
Otherwise, since the MI_FLUSH at the end of every batch had been removed,
non-automatic-flushing chips (965) wouldn't get flushed and apps with static
rendering would get partial screen contents until the server's blockhandler
flush kicked in.
2008-05-23 12:18:50 -07:00
Corbin Simpson
9ab7a2df03 r5xx: Clean up some compiler warnings. 2008-05-23 00:18:14 -07:00
Corbin Simpson
30e61500e1 r5xx: Move dumb_shader.
Was getting ticked having to scroll around it, lawl.
2008-05-23 00:18:14 -07:00
Corbin Simpson
34010bcc91 r5xx: Add OPCODE_DST.
Works completely, swizzles and everything.
2008-05-23 00:18:14 -07:00
Corbin Simpson
d4e93864b8 r5xx: More trig work.
SCS now works. COS/SIN have slight issues still.
2008-05-23 00:18:14 -07:00
Eric Anholt
6cefae5354 Add back a mostly-correct glFinish for GEM and fake.
The right solution would probably be keeping a list of regions which have been
rendered to.
2008-05-22 10:46:58 -07:00
Keith Packard
76286bc76c [intel-gem] Make sure set_domain is called often enough.
The write_domain needs to be set after any batch buffer uses an object,
track when that happens in the new 'cpu_domain_set' field.
2008-05-22 10:44:47 -07:00
Dave Airlie
a01816da59 r500: bump state atom size up for fp and fp constants 2008-05-22 17:09:58 +10:00
Corbin Simpson
4f9dcdc35b r5xx: Fixed LRP.
Works perfectly. It's a complex one, though, so it might fail in weird ways...
2008-05-21 23:35:43 -07:00
Corbin Simpson
0dfbe9cdd7 r5xx: Change debug info for readability.
It's weird seeing the compiled program before the assembly, that's all.
2008-05-21 23:33:13 -07:00
Corbin Simpson
d06f4edb14 r5xx: Initial (broken) OPCODE_LRP.
Will compile, run, and not eat your kids, but the math is wrong.
2008-05-21 13:51:32 -07:00
Corbin Simpson
1e2907f170 r5xx: Add OPCODE_POW.
Necessary for Google Earth, among other things.
2008-05-21 08:24:28 -07:00
Dave Airlie
bb57c30a53 r500: print out opcode string 2008-05-21 16:00:18 +10:00
Dave Airlie
b453b0e2e1 r500: set the RS unit register for R500 not R300 dangnammit..
So this appears to be my BUG. damn it to hell.

also fix sec color to be more like spec says.
2008-05-21 12:14:42 +10:00
Dave Airlie
9ec2b1c83f r500: finish main texture instruction decoding 2008-05-21 10:49:26 +10:00
Corbin Simpson
2bda1a9502 r5xx: Count refs so we don't have to guess on temp reg allocation.
As a bonus, we can now have multiple temp temps, by slot.
2008-05-20 09:47:50 -07:00
Corbin Simpson
94994b13c5 r5xx: Fixup SOP insts.
Use the correct swizzle for alpha/SOP stuff.
2008-05-19 23:56:53 -07:00
Corbin Simpson
78fa506059 r5xx: New fix for COS/SIN/SCS.
Not perfect yet, but getting better.
2008-05-19 23:56:53 -07:00
Dave Airlie
f0d76d526b r300/r500: fixup some of the register write sizes 2008-05-20 16:30:36 +10:00
Dave Airlie
2005de48f9 r300: some ctrl-m's wierd. 2008-05-20 16:02:19 +10:00
Dave Airlie
282cdc8b5c r300/r500: fix RS col fmt bits 2008-05-20 15:59:56 +10:00
Corbin Simpson
476248befe r5xx: Fixup emit_tex, add debugging info, enable temp temps.
emit_tex now chases itself with an OUT if needed.
Added airlied's dump_program, with some fixes.
2008-05-19 11:06:41 -07:00
Dave Airlie
03b3fed8f1 r500: add more input srcs 2008-05-19 21:58:28 +10:00
Dave Airlie
ac315792bf r500: fix swz gets and some returns 2008-05-19 21:40:40 +10:00
Dave Airlie
60b8e1f524 r500: add mask debugging 2008-05-19 21:11:55 +10:00
Dave Airlie
cddab021e3 r500: add fragment program debug dumper 2008-05-19 20:24:09 +10:00
Corbin Simpson
c60bdcf8a8 r5xx: Fix magic offsets for output fifo write masks.
Well, this sure explains a lot.
2008-05-19 00:00:08 -07:00
Corbin Simpson
2708d7f700 r5xx: Swap sources for CMP.
Follows the same pattern as the op on r3xx/r4xx. Thanks airlied.
2008-05-18 23:52:54 -07:00
Corbin Simpson
a6c38f2f64 r5xx: Fix typo of epic proportions. 2008-05-18 23:35:07 -07:00
Corbin Simpson
2225b9bdb0 r5xx: ALU/OUT fixups.
Lots of small changes. Intentionally breaks some tex stuffs.
2008-05-18 22:38:28 -07:00
Dave Airlie
bdfd5d95c5 r300: fixup US_OUT_FMT bits 2008-05-18 17:58:29 +10:00
Keith Packard
8b49cc104d [intel-gem] Don't calloc reloc buffers
Only a few relocations are typically used, so don't clear the
whole thing.
2008-05-17 23:34:47 -07:00
Dave Airlie
126673261d r500: you can have a single texcoord 2008-05-18 15:25:08 +10:00
Corbin Simpson
0910d9d4d6 r5xx: Add OPCODE_KIL. 2008-05-17 13:38:35 -07:00
Corbin Simpson
c57b3b1d2c r5xx: Added OPCODE_DPH.
Like DP4, but with one swizzle change.
2008-05-17 12:45:46 -07:00
Corbin Simpson
6dd3c0ed96 r5xx: Fix FRC.
This makes tri-frc work.
(Remind me again why I'm allowed near a compiler, lawl.)
2008-05-17 09:27:35 -07:00
Corbin Simpson
16cc362f0b r5xx: Fix SCS.
Output instructions need to be marked OUT so they can write to the fifo.
Also, negation doesn't work with SWZ yet.
2008-05-17 07:12:38 -07:00
Corbin Simpson
c11a33fe76 r5xx: Add OPCODE_SWZ.
It's so easy!
2008-05-17 07:12:37 -07:00
Corbin Simpson
d5aa421661 r5xx: Add OPCODE_SCS.
It's disabled, though, because it doesn't work. I'll figure it out later...
2008-05-17 07:12:37 -07:00
Corbin Simpson
405ee871c5 r5xx: Adding more opcodes.
EX2, FRC, LG2, SIN, RCP, and RSQ, if you care.
All of these except FRC are like COS. This pretty much rounds out the set of
opcodes which can be done in one ALU inst.
2008-05-17 07:12:37 -07:00
Corbin Simpson
0de02f1716 r5xx: First swing at OPCODE_COS. 2008-05-17 07:12:37 -07:00
Corbin Simpson
d8529d9b00 r5xx: Unbreak MAX and MIN.
Both of them had faulty copypasta.
2008-05-17 07:12:37 -07:00
Dave Airlie
5e075fb809 r500: set fragprog end to correct place 2008-05-17 13:31:14 +10:00
Alex Deucher
ba50c3fed3 r300: SC register naming cleanup 2008-05-17 10:40:47 +10:00
Alex Deucher
791c95230c r500: write out the correct FP registers 2008-05-17 10:29:52 +10:00
Dave Airlie
d6333af7e9 r500: default rsunit swizzle like fglrx 2008-05-15 20:38:41 +10:00
Dave Airlie
9aa62c7238 r500: shift tex src properly 2008-05-15 18:40:07 +10:00
Dave Airlie
76f32499d2 r500: fixup r500 rs unit texture coordinate counting 2008-05-15 18:40:07 +10:00
Dave Airlie
a0bc6d2fb2 r500: remove some debugging 2008-05-15 18:40:07 +10:00
Dave Airlie
73af48fff5 r500: split output/pixel masks and emit in the correct places 2008-05-15 18:40:07 +10:00
Dave Airlie
c9d5d11d2d r3/500: emit RS state before VAP 2008-05-15 18:40:07 +10:00
Dave Airlie
412c850eab r500: fixup the program allocations to be the correct sizes 2008-05-15 18:40:07 +10:00
Dave Airlie
350c80fa99 r300: set screen so that context init can find out chip ids 2008-05-15 18:40:07 +10:00
Dave Airlie
e1bffd0318 r500: add cmp support in theory 2008-05-15 18:40:07 +10:00
Dave Airlie
10e0a36a49 r500: some trivial fixups to get tri working.
the counter was being used one instruction over the end
2008-05-15 18:40:07 +10:00
Dave Airlie
375656440b r500: we just need to emit a colour for clear drop tex instruction 2008-05-15 18:40:07 +10:00
Alex Deucher
f86baae1a7 R300: clean up GA registers 2008-05-13 16:12:57 -04:00
Alex Deucher
de3fc8b1c4 R3xx: clean up ZB registers 2008-05-13 15:46:23 -04:00
Alex Deucher
c5b7a1ee3c R300: clean up CB registers 2008-05-13 14:32:30 -04:00
Eric Anholt
cba90d4a77 [GEM] Actually include the presumed offset in initial relocations.
This avoids kernel relocations for most batchbuffer relocs.
2008-05-13 11:30:18 -07:00
Alex Deucher
8d70181b03 R300: clean up Fog registers 2008-05-13 14:02:29 -04:00
Alex Deucher
d09aa2138b R500: fixup r300EmitClearState() FP for r5xx 2008-05-13 13:38:30 -04:00
Alex Deucher
9ef4126d48 R300: cleanup FS code and fill in missing details 2008-05-13 08:37:58 -04:00
Alex Deucher
0cc8ed5ccc R3xx: more PVS cleanup 2008-05-13 06:09:55 -04:00
Alex Deucher
e000f2ab6e Merge branch 'r500-support' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa into r500-support 2008-05-12 11:58:35 -04:00
Alex Deucher
2a4d1085cb R500: add support for 4k textures 2008-05-12 11:57:08 -04:00
Keith Packard
145523ba3a [intel] update GEM api. Add bo_subdata and bo_get_subdata driver hooks.
Track DRM GEM name changes.
Add driver hooks for bo_subdata and bo_get_subdata so that GEM can use pread
and pwrite.
2008-05-11 00:16:25 -07:00
Keith Packard
0cb006c1fd [intel-gem] move domains to relocations. add set_domain to bo_map.
Fix the kernel API to place the read/write domain information in the
relocation instead of the buffer.
2008-05-08 10:38:55 -07:00
Keith Packard
fda5687241 [intel] intel_batchbuffer_flush using uninit 'used' to check for buffer empty
Make sure 'used' tracks the right value through the whole function.
Also, use GLint for intel_batchbuffer_space in case we do bad things
in the future.
2008-05-08 10:37:23 -07:00
Keith Packard
68a9161832 Merge commit 'anholt/drm-gem' into drm-gem 2008-05-07 20:20:26 -07:00
Eric Anholt
ead798eb10 GEM: Remove already-disabled PIPE_CONTROL command.
This existed to get the icache flushed.  However, GEM handles this for us
now for sure, and we had disabled it prematurely anyway.
2008-05-07 14:01:18 -07:00
Eric Anholt
ab50ddaa91 GEM: Make dri_emit_reloc take GEM domain flags instead of TTM flags.
The GEM flags are much more descriptive for what we need.  Since this makes
bufmgr_fake rather device-specific, move it to the intel common directory.
We've wanted to do device-specific stuff to it before.
2008-05-07 13:51:29 -07:00
Eric Anholt
8b2a7f08bc GEM: Don't emit an extra MI_FLUSH in the batch since GEM handles it. 2008-05-07 10:01:14 -07:00
Dave Airlie
3d15280278 r500: cleanup r500 RS setup 2008-05-07 17:48:17 +10:00
Dave Airlie
53a7ccc08b r500: for rectangular textures set to unscaled coordinates. 2008-05-07 17:48:17 +10:00
Corbin Simpson
1da094c9ad r5xx: Fix FP inputs. (For good?)
FP inputs are now counted and mapped correctly, and temps
are allocated tightly and correctly.
2008-05-07 00:06:26 -07:00
Corbin Simpson
49c30ce958 r5xx: Fix false error with DP3/DP4.
DP3/DP4 only takes two arguments, but tried to load three, causing
a false fallback to the dumb shader.
2008-05-06 23:36:50 -07:00
Corbin Simpson
dc24fb51a3 r5xx: Index inputs and temps.
This is not the same as r3xx indexing. It only tries to protect inputs on
the pixel stack from getting clobbered by temps or texs.

Texs don't need special treatment since they read from special input regs
and write to the same temp regs as ALU/FC instructions.
2008-05-06 22:18:28 -07:00
Keith Packard
c75b2d74d8 Merge commit 'anholt/drm-gem' into drm-gem 2008-05-06 22:07:58 -07:00
Keith Packard
a2ec8570ae [intel-GEM] partial support for memory domains.
Doesn't deal with local modifications yet (need new kernel set_domain ioctl
for that to work). Also, guesses what domains are affected based on the
read/write bits set in the flags. Works for 915, probably not so much for
965.
2008-05-06 22:06:41 -07:00
Corbin Simpson
40db59038c r5xx: FP: Add OPCODE_TXB.
Tex lookup with biased LOD. Should magically work.
2008-05-06 18:14:21 -07:00
Corbin Simpson
20baf128ef r5xx: FP: Make MOV/ABS look pretty.
We can't really do anything like emit_alu, so we're doing emit_mov instead.
2008-05-06 17:21:30 -07:00
Eric Anholt
42d4f89264 GEM: Fix previous commit to avoid asserting when we run into reserved space.
These are the dwords that the reserved space is for.
2008-05-06 15:25:51 -07:00
Eric Anholt
96f52f089f GEM: Don't emit an extra MI_FLUSH in the batch since GEM handles it. 2008-05-06 13:57:08 -07:00
Corbin Simpson
1562dd2c26 r5xx: Emit an OUT instruction at the end of execution.
This should make TEX/TXP work right. (Note: "Should" is not "does.")
2008-05-06 12:44:53 -07:00
Corbin Simpson
fa465fb2b1 r5xx: We update max_temp_idx now, so no need to hard-code it.
This roughly doubles the speed of glxgears (GINAB) by allowing
more pixels to run concurrently.
2008-05-06 12:42:40 -07:00
Corbin Simpson
171ba1d0d1 r5xx: Fix typo.
Gotta be more careful with my cut'n'paste, lawl.
2008-05-06 12:18:07 -07:00
Corbin Simpson
06e2e1b87c r5xx: Use max_temp_idx. 2008-05-06 12:03:28 -07:00
Keith Packard
537bbe6dec [intel-GEM] Add tiling support to swrast.
Accessing tiled surfaces without using the fence registers requires that
software deal with the address swizzling itself.
2008-05-06 10:51:08 -07:00
Keith Packard
df4b49c2ce Dump buffer tiled status from intelPrintSAREA 2008-05-05 22:08:05 -07:00
Eric Anholt
e9a2a67745 GEM: Allocate the right number of relocs, avoiding heap smashing. 2008-05-05 15:45:15 -07:00
Eric Anholt
1decab06d1 GEM: Include target buffer handle in relocation debug. 2008-05-05 15:44:49 -07:00
Eric Anholt
01d1a292bf GEM: Set validate index to keep the same buffer from being duped on the list. 2008-05-05 14:20:18 -07:00
Eric Anholt
be59d52ca0 Print GEM handles instead of BO pointers in debugging.
small integers are much prettier, and let me correlate to DRM debug output.
2008-05-05 14:15:40 -07:00
Eric Anholt
5290ec4756 Initialize bufmgr_gem->validate_array[i].offset.
This is just cosmetic, to produce less scary values when the ioctl fails and
doesn't return values there.
2008-05-05 13:45:45 -07:00
Eric Anholt
1f810b85b1 Make intel_{batch,exec}_ioctl return an error code so we can recover better. 2008-05-05 13:40:50 -07:00
Keith Packard
87ccc03736 Add intel_bufmgr_gem.c to i915 2008-05-05 10:46:27 -07:00
Keith Packard
367b1e35dc Temporarily disable intel pixel ops on i915 for GEM
Instead of attempting to fix these for GEM, just disable until GEM is
working.
2008-05-05 10:45:30 -07:00
Dave Airlie
66a49df9cb r500: consolidate tex instructions
you cannot change a tex into an output so this means we have to actually
do another instruction after this one to mov if its an output
2008-05-05 18:42:27 +10:00
Dave Airlie
697680d687 r500: mov cleanup macros 2008-05-05 18:15:40 +10:00
Dave Airlie
3816ae9ce8 r500: make tri-param work
This makes constant work which are 32-bit on r500 unlike r300.

Switch MOV to using MAD no idea if we might have negative things MAX 0,-5 is
likely to do the wrong thing..
2008-05-05 18:05:59 +10:00
Dave Airlie
1f420b008b r500: make sure we emit max temp atom.
We don't appear to update max_temp_idx yet anywhere though
2008-05-05 16:41:07 +10:00
Dave Airlie
66a5562ce2 r300: fix swtcl texrect path properly.
We really need to update the shader state so the texrect parameters work.

This should fix compiz looking crappy on rs480 and rs690
2008-05-05 23:49:50 +10:00
Markus Amsler
63503f2848 r300: Set correct VAP_CNTL per vertex program.
adapted from Markus' patch on bug 15386 with updates for non-TCL
and R500.
2008-05-03 12:55:45 -04:00
Corbin Simpson
b79a769b2d r5xx: Fix for loops.
Thanks to dli in IRC for pointing this out.
2008-05-03 09:09:57 -07:00
Corbin Simpson
4ef195a369 r5xx: Fix dumb shader.
For some reason, FGLRX doesn't actually set R500_US_INST_TEX.
Let us not make that same mistake.
2008-05-03 09:08:07 -07:00
Corbin Simpson
0f07e0aea3 Merge branch 'r500test' of git://people.freedesktop.org/~csimpson/mesa into r500-support 2008-05-03 08:39:15 -07:00
Dave Airlie
a03e261193 r300: remove debugging code 2008-05-04 04:17:15 +10:00
Dave Airlie
d3eb5df259 r300: setup vte according to inputs 2008-05-04 04:13:56 +10:00
Dave Airlie
37924cf175 r300: update r300 rs unit for swtcl need to fix r500 most likely 2008-05-03 22:08:11 +10:00
Dave Airlie
cea4f1464b r300: recombine the vap input route 0 code and clean
This gets non-tcl cards working again on this branch..

at least texrect and glxgears
2008-05-03 21:31:47 +10:00
Dave Airlie
026ef8111a r300: add R300_NO_TCL to allow testing of non-tcl on tcl cards 2008-05-03 21:31:22 +10:00
Corbin Simpson
e081603850 Merge branch 'r500-support' into r500test
Bringing the FPS code up-to-date.
Conflicts:

	src/mesa/drivers/dri/r300/r300_emit.c
	src/mesa/drivers/dri/r300/r300_ioctl.c
	src/mesa/drivers/dri/r300/r300_state.c
	src/mesa/drivers/dri/r300/r300_swtcl.c
	src/mesa/drivers/dri/r300/r500_fragprog.c
	src/mesa/drivers/dri/r300/r500_fragprog.h
2008-05-02 20:49:13 -07:00
Eric Anholt
81ec0545c9 Don't forget to set handle of shared buffers.
(And fix a nearby whitespace nit)
2008-05-02 18:25:00 -07:00
Eric Anholt
3d19a095cd Fix GEM execbuf ioctl argument. 2008-05-02 18:24:13 -07:00
Eric Anholt
7349f218b4 Fix to use GEM execbuf instead of TTM. 2008-05-02 17:13:45 -07:00
Eric Anholt
ef33e76ceb Minor fixups to get GEM to the point of execbuf ioctl. 2008-05-02 17:00:47 -07:00
Corbin Simpson
568d369d77 Merge branch 'r345-cleanup' of git://people.freedesktop.org/~agd5f/mesa into r500test
Adding Alex's cleanup patches. This adds r5xx TCL! Whoo-hoo!
Conflicts:

	src/mesa/drivers/dri/r300/r300_state.c
	src/mesa/drivers/dri/radeon/radeon_chipset.h
	src/mesa/drivers/dri/radeon/radeon_screen.c
2008-05-02 15:57:57 -07:00
Corbin Simpson
92a0e93ac3 Make radeon stuff build again.
Yet more evidence that I am incompetent with git.
2008-05-02 15:33:02 -07:00
Eric Anholt
eb10cdc838 [intel] Fix build for GEM. TTM is now disabled, and fencing is gone.
Fencing was used in two places: ensuring that we didn't get too many frames
ahead of ourselves, and glFinish.  glFinish will be satisfied by waiting on
buffers like we would do for CPU access on them.  The "don't get too far ahead"
is now the responsibility of the execution manager (kernel).
2008-05-02 14:11:19 -07:00
Eric Anholt
89bba44e96 Add intel_bufmgr_gem for new graphics execution manager. 2008-05-02 12:58:25 -07:00
Alex Deucher
ae09292a6e R300: fix rebase conflicts 2008-05-02 15:20:28 -04:00
Corbin Simpson
9a82fde43a Merge branch 'r500test' of git://people.freedesktop.org/~airlied/mesa into r500test
Conflicts:

	src/mesa/drivers/dri/r300/r300_cmdbuf.c
	src/mesa/drivers/dri/r300/r300_ioctl.c
	src/mesa/drivers/dri/r300/r300_state.c
	src/mesa/drivers/dri/r300/r500_fragprog.c
	src/mesa/drivers/dri/r300/r500_fragprog.h
	src/mesa/drivers/dri/radeon/radeon_chipset.h
	src/mesa/drivers/dri/radeon/radeon_screen.c
2008-05-02 12:15:44 -07:00
Alex Deucher
9e7ae34da5 R3/4/5: fix TCL on r5xx, cleanup PVS code 2008-05-02 15:13:49 -04:00
Alex Deucher
a94cd0d774 R300: fix VAP_OUTPUT_VTX_FMT_1 defines 2008-05-02 15:13:49 -04:00
Alex Deucher
d5448ceb95 R300: cleanup VAP_CLIP_CNTL 2008-05-02 15:13:49 -04:00
Alex Deucher
e61dadf3de R300: clean up VAP_PROG_STREAM_CNTL* register usage 2008-05-02 15:13:49 -04:00
Alex Deucher
2bd26f4afa Update comment 2008-05-02 15:13:49 -04:00
Alex Deucher
e3721a3b3f R5xx: various updates
- fixup VAP_CNTL setup
- remove extra instruction in r5xx passthrough shader
- add notes about pipe config
2008-05-02 15:13:48 -04:00
Alex Deucher
831fc138c1 R5xx: Add R5xx pci ids 2008-05-02 15:13:48 -04:00
Dave Airlie
28904e54d2 fixup r500 bits for renaming 2008-05-02 15:13:48 -04:00
Dave Airlie
de9c1c3627 r500: fixup fake shader to keep gears going 2008-05-02 15:13:48 -04:00
Dave Airlie
fbab11e9b0 r500: enable gb tiling for r5xx 2008-05-02 15:13:48 -04:00
Dave Airlie
6864220c28 r500: fixup support for emitting fragment program to hardware.
Also fixup the constant emission

this breaks glxgears from what I can see but its another step to correctness
2008-05-02 15:13:48 -04:00
Dave Airlie
3b7c5bfb98 r500: setup fragment program constant emission atom 2008-05-02 15:13:48 -04:00
Dave Airlie
6443da0865 r300: add rv530 pci id for the t60p laptop 2008-05-02 15:13:48 -04:00
Dave Airlie
c07534dc71 r300: this code really shouldn't be here.
For R500 just ignore it for now while I do something interesting like
run glxgears.
2008-05-02 15:13:48 -04:00
Dave Airlie
c0cb9bc84c mesa: cleanup state emission and rs for r500
trivial clear app now renders
2008-05-02 15:13:48 -04:00
Dave Airlie
a453b3154e r500 RS unit setup 2008-05-02 15:13:47 -04:00
Dave Airlie
ed1584aed8 more r500 vs r300 kickin 2008-05-02 15:13:47 -04:00
Dave Airlie
5a143e91dc some basic r500 portage 2008-05-02 15:12:37 -04:00
Dave Airlie
8aa98a409b r500: fragprog 2008-05-02 15:11:03 -04:00
Corbin Simpson
b15c49e59b r5xx: Fragprog shader now handles TEX/TXP correctly. 2008-05-02 12:06:21 -07:00
Corbin Simpson
029cb1fd0f Start of TEX/TXP support.
Still having problems with temps and consts, though...
2008-05-02 12:06:21 -07:00
Corbin Simpson
b5246de562 Added OPCODE_ABS, slightly fixed ADD/SUB 2008-05-02 12:06:21 -07:00
Corbin Simpson
6e96ea535a Initial r5xx fragment program compiler support.
Includes fallback shader and a handful of working opcodes.
2008-05-02 12:06:21 -07:00
Corbin Simpson
c02d1863d1 Add chip id 71D5 (RV530 M66) to radeon_chipset.h 2008-05-02 12:06:21 -07:00
Dave Airlie
d06e61aa80 fixup r500 bits for renaming 2008-05-02 12:06:21 -07:00
Dave Airlie
a3996ba2d1 r500: fixup fake shader to keep gears going 2008-05-02 12:06:21 -07:00
Dave Airlie
8e33a83b68 r500: enable gb tiling for r5xx 2008-05-02 12:06:21 -07:00
Dave Airlie
70335540c6 r500: fixup support for emitting fragment program to hardware.
Also fixup the constant emission

this breaks glxgears from what I can see but its another step to correctness
2008-05-02 12:06:21 -07:00
Dave Airlie
14c3bdb3f7 r500: setup fragment program constant emission atom 2008-05-02 12:06:21 -07:00
Dave Airlie
e46c3d7bcf r300: add rv530 pci id for the t60p laptop 2008-05-02 12:06:21 -07:00
Dave Airlie
99e75135ee r300: this code really shouldn't be here.
For R500 just ignore it for now while I do something interesting like
run glxgears.
2008-05-02 12:06:21 -07:00
Dave Airlie
9d9f66cc8d mesa: cleanup state emission and rs for r500
trivial clear app now renders
2008-05-02 12:06:21 -07:00
Dave Airlie
a87914993d r500 RS unit setup 2008-05-02 12:06:21 -07:00
Dave Airlie
55418dc87d more r500 vs r300 kickin 2008-05-02 12:06:21 -07:00
Dave Airlie
2ffa112ed3 some basic r500 portage 2008-05-02 12:05:28 -07:00
Dave Airlie
cd66f0e2d9 r500: fragprog 2008-05-02 12:04:04 -07:00
Alex Deucher
1226aba119 R3/4/5: fix TCL on r5xx, cleanup PVS code 2008-05-02 13:56:56 -04:00
Alex Deucher
25d9f2dd24 R300: fix VAP_OUTPUT_VTX_FMT_1 defines 2008-05-02 13:03:48 -04:00
Alex Deucher
734ef96d5f R300: cleanup VAP_CLIP_CNTL 2008-05-02 12:48:39 -04:00
Alex Deucher
db1fc51ccc R300: clean up VAP_PROG_STREAM_CNTL* register usage 2008-05-02 12:29:40 -04:00
Alex Deucher
45077fc323 Update comment 2008-05-02 10:54:20 -04:00
Alex Deucher
279ea105d8 R5xx: various updates
- fixup VAP_CNTL setup
- remove extra instruction in r5xx passthrough shader
- add notes about pipe config
2008-05-02 10:51:40 -04:00
Alex Deucher
f25b37c1da R5xx: Add R5xx pci ids 2008-05-01 16:02:58 -04:00
Alex Deucher
44791e2d78 Merge branch 'r500test' of git://people.freedesktop.org/~airlied/mesa into r345-cleanup 2008-05-01 14:51:26 -04:00
Dave Airlie
eff6f12032 fixup r500 bits for renaming 2008-04-16 20:42:15 +10:00
Dave Airlie
09df5eaff2 Merge branch 'master' into r500test
Conflicts:

	src/mesa/drivers/dri/r300/r300_cmdbuf.c
	src/mesa/drivers/dri/r300/r300_ioctl.c
2008-04-16 20:25:08 +10:00
Dave Airlie
9566cf0e2f r500: fixup fake shader to keep gears going 2008-03-22 11:00:25 +10:00
Dave Airlie
4feac4e40e r500: enable gb tiling for r5xx 2008-03-22 10:56:48 +10:00
Dave Airlie
583ed4bde3 r500: fixup support for emitting fragment program to hardware.
Also fixup the constant emission

this breaks glxgears from what I can see but its another step to correctness
2008-03-22 10:55:32 +10:00
Dave Airlie
3eb8e5871f r500: setup fragment program constant emission atom 2008-03-21 17:05:29 +10:00
Dave Airlie
ed18005a99 r300: add rv530 pci id for the t60p laptop 2008-03-20 14:34:04 +10:00
Dave Airlie
d019f101e8 r300: this code really shouldn't be here.
For R500 just ignore it for now while I do something interesting like
run glxgears.
2008-03-20 14:30:59 +10:00
Dave Airlie
2b8e422b31 mesa: cleanup state emission and rs for r500
trivial clear app now renders
2008-03-20 14:21:10 +10:00
Dave Airlie
9e6e4ae49a r500 RS unit setup 2008-03-20 13:57:22 +10:00
Dave Airlie
57028236c8 more r500 vs r300 kickin 2008-03-19 16:29:11 +10:00
Dave Airlie
1c71ec4d45 some basic r500 portage 2008-03-17 21:09:49 +10:00
Dave Airlie
5da8289e9c r500: fragprog 2008-03-17 19:05:44 +10:00
488 changed files with 28776 additions and 41076 deletions

View File

@@ -174,10 +174,10 @@ ultrix-gcc:
# Rules for making release tarballs
DIRECTORY = Mesa-7.1-rc1
LIB_NAME = MesaLib-7.1-rc1
DEMO_NAME = MesaDemos-7.1-rc1
GLUT_NAME = MesaGLUT-7.1-rc1
DIRECTORY = Mesa-7.1
LIB_NAME = MesaLib-7.1
DEMO_NAME = MesaDemos-7.1
GLUT_NAME = MesaGLUT-7.1
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
@@ -192,6 +192,7 @@ MAIN_FILES = \
$(DIRECTORY)/bin/install-sh \
$(DIRECTORY)/bin/mklib \
$(DIRECTORY)/bin/minstall \
$(DIRECTORY)/bin/version.mk \
$(DIRECTORY)/configs/[a-z]* \
$(DIRECTORY)/docs/*.html \
$(DIRECTORY)/docs/COPYING \
@@ -257,6 +258,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \
$(DIRECTORY)/src/mesa/drivers/Makefile \
$(DIRECTORY)/src/mesa/drivers/beos/*.cpp \
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \
$(DIRECTORY)/src/mesa/drivers/common/*.[ch] \
@@ -264,6 +266,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/directfb/Makefile \
$(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \
$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
$(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \
@@ -273,6 +276,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/ggi/display/*.c \
$(DIRECTORY)/src/mesa/drivers/ggi/display/fbdev.conf.in \
$(DIRECTORY)/src/mesa/drivers/ggi/include/ggi/mesa/*.h \
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile \
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
@@ -280,6 +284,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/drivers/svga/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
@@ -316,6 +321,7 @@ DRI_FILES = \
$(DIRECTORY)/src/glx/x11/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
@@ -334,6 +340,8 @@ SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/sgi/glu.def \
$(DIRECTORY)/src/glu/sgi/dummy.cc \
$(DIRECTORY)/src/glu/sgi/descrip.mms \
$(DIRECTORY)/src/glu/sgi/glu.exports \
$(DIRECTORY)/src/glu/sgi/glu.exports.darwin \
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
@@ -389,7 +397,8 @@ DEMO_FILES = \
$(DIRECTORY)/progs/samples/*.c \
$(DIRECTORY)/progs/glsl/Makefile* \
$(DIRECTORY)/progs/glsl/*.c \
$(DIRECTORY)/progs/glsl/*.txt \
$(DIRECTORY)/progs/glsl/*.frag \
$(DIRECTORY)/progs/glsl/*.vert \
$(DIRECTORY)/progs/windml/Makefile.ugl \
$(DIRECTORY)/progs/windml/*.c \
$(DIRECTORY)/progs/windml/*.bmp \

View File

@@ -42,6 +42,8 @@ if [ $# -ge 2 ] ; then
exit 0
fi
PWDSAVE=`pwd`
# determine file's type
if [ -h "$FILE" ] ; then
#echo $FILE is a symlink
@@ -57,7 +59,6 @@ if [ $# -ge 2 ] ; then
FILE=`basename "$FILE"`
# Go to $DEST and make the link
PWDSAVE="$PWD"
cd "$DEST" # pushd
$RM "$FILE"
$SYMLINK "$TARGET" "$FILE"

View File

@@ -43,7 +43,7 @@ ARCH="auto"
ARCHOPT=""
NOPREFIX=0
EXPORTS=""
ID=""
#
# Parse arguments
@@ -61,7 +61,8 @@ do
echo ' -minor N specifies minor version number (default is 0)'
echo ' -patch N specifies patch version number (default is 0)'
echo ' -lLIBRARY specifies a dependency on LIBRARY'
echo ' -LDIR search in DIR for library dependencies'
echo ' -LDIR search in DIR for library dependencies at build time'
echo ' -RDIR search in DIR for library dependencies at run time'
echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)'
echo ' Not observed on all systems at this time.'
echo ' -ldflags OPT specify any additional linker flags in OPT'
@@ -74,6 +75,7 @@ do
echo ' -altopts OPTS alternate options to override all others'
echo " -noprefix don't prefix library name with 'lib' nor add any suffix"
echo ' -exports FILE only export the symbols listed in FILE'
echo ' -id NAME Sets the id of the dylib (Darwin)'
echo ' -h, --help display this information and exit'
exit 1
;;
@@ -107,6 +109,9 @@ do
-L*)
DEPS="$DEPS $1"
;;
-R*)
DEPS="$DEPS $1"
;;
-Wl*)
DEPS="$DEPS $1"
;;
@@ -149,6 +154,10 @@ do
shift 1;
EXPORTS=$1
;;
'-id')
shift 1;
ID=$1
;;
-*)
echo "mklib: Unknown option: " $1 ;
exit 1
@@ -192,6 +201,7 @@ if [ ] ; then
echo PATCH is $PATCH
echo DEPS are $DEPS
echo "EXPORTS in" $EXPORTS
echo ID is $ID
echo "-----------------"
fi
@@ -267,7 +277,7 @@ case $ARCH in
if [ $EXPORTS ] ; then
#OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}"
# Make the 'exptmp' file for --version-script option
echo "VERSION_${MAJOR}.${MINOR} {" > exptmp
echo "{" > exptmp
echo "global:" >> exptmp
sed 's/$/;/' ${EXPORTS} >> exptmp
echo "local:" >> exptmp
@@ -336,7 +346,7 @@ case $ARCH in
# use g++
LINK="g++"
else
echo "mklib: warning: can't find C++ comiler, trying CC."
echo "mklib: warning: can't find C++ compiler, trying CC."
LINK="CC"
fi
else
@@ -365,9 +375,11 @@ case $ARCH in
# Check if objects are SPARC v9
# file says: ELF 64-bit MSB relocatable SPARCV9 Version 1
set ${OBJECTS}
SPARCV9=`file $1 | grep SPARCV9`
if [ "${SPARCV9}" ] ; then
OPTS="${OPTS} -xarch=v9"
if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then
SPARCV9=`file $1 | grep SPARCV9`
if [ "${SPARCV9}" ] ; then
OPTS="${OPTS} -xarch=v9"
fi
fi
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
@@ -379,7 +391,7 @@ case $ARCH in
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
else
rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} -h ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
fi
FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
@@ -624,13 +636,19 @@ case $ARCH in
LIBSUFFIX="bundle"
OPTS="${ARCHOPT} -bundle -multiply_defined suppress"
else
LIBSUFFIX="dylib"
OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
LIBSUFFIX="dylib"
if [ -z "$ID" ] ; then
ID="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
fi
OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name ${ID}"
fi
if [ ${EXPORTS} ] ; then
if [ -f ${EXPORTS}".darwin" ] ; then
EXPORTS=$EXPORTS".darwin"
fi
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
fi
fi
LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"

View File

@@ -27,10 +27,10 @@ ASM_API = @ASM_API@
# Misc tools and flags
MAKE = @MAKE@
SHELL = @SHELL@
MKLIB_OPTIONS = @MKLIB_OPTIONS@
MKDEP = @MKDEP@
MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = $(TOP)/bin/minstall
# Python and flags (generally only needed by the developers)
PYTHON2 = python
@@ -66,6 +66,10 @@ USING_EGL = @USING_EGL@
# Dependencies
X11_INCLUDES = @X11_INCLUDES@
# GLw motif setup
GLW_SOURCES = @GLW_SOURCES@
MOTIF_CFLAGS = @MOTIF_CFLAGS@
# Library/program dependencies
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
@@ -89,9 +93,12 @@ EXPAT_INCLUDES = @EXPAT_INCLUDES@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
# Installation directories (for make install)
INSTALL_DIR = $(prefix)
INSTALL_LIB_DIR = $(libdir)
INSTALL_INC_DIR = $(includedir)
# DRI installation directories
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@

View File

@@ -4,22 +4,26 @@ include $(TOP)/configs/default
CONFIG_NAME = darwin
DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
-D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
INSTALL_DIR = /usr/X11
# Compiler and flags
CC = gcc
CXX = gcc
CFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES)
CXXFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES)
PIC_FLAGS = -fPIC
DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
-D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS \
-DGLX_INDIRECT_RENDERING \
-DGLX_ALIAS_UNSUPPORTED
CFLAGS += $(RC_CFLAGS)
CXXFLAGS += $(RC_CFLAGS)
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx/x11
# -DIN_DRI_DRIVER
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
-I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -g -O2 -Wall -fno-strict-aliasing \
-I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
@@ -28,13 +32,24 @@ GLUT_LIB_NAME = libglut.dylib
GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
GL_LIB_DEPS = -L/usr/X11/lib -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11/lib -lX11 -lXmu -lXt -lXi -lm
# globs used to install the lib and all symlinks
GL_LIB_GLOB = libGL.*dylib
GLU_LIB_GLOB = libGLU.*dylib
GLUT_LIB_GLOB = libglut.*dylib
GLW_LIB_GLOB = libGLw.*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXt
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glx/x11 glu glut/glx mesa
SRC_DIRS = glx/x11 mesa glu glw glut/glx
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
PROGRAM_DIRS = xdemos

View File

@@ -1,28 +0,0 @@
# Configuration for Darwin / MacOS X, making static libs
include $(TOP)/configs/darwin
CONFIG_NAME = darwin-static
# Compiler and flags
CFLAGS = -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
CXXFLAGS = -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
MKLIB_OPTIONS = -static
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# 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 =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -Wl,-search_paths_first -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lstdc++ -lgcc_s.1 -lm

View File

@@ -1,30 +0,0 @@
# Configuration for Darwin / MacOS X, making static libs
include $(TOP)/configs/darwin
CONFIG_NAME = darwin-static
# Compiler and flags
CFLAGS = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
CXXFLAGS = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
MKLIB_OPTIONS = -static -archopt "-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# 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 =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -Wl,-search_paths_first -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lstdc++ -lgcc_s.1 -lm

View File

@@ -25,11 +25,13 @@ LDFLAGS =
GLU_CFLAGS =
# Misc tools and flags
SHELL = /bin/sh
MKLIB = $(SHELL) $(TOP)/bin/mklib
MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
INSTALL = $(TOP)/bin/minstall
INSTALL = $(SHELL) $(TOP)/bin/minstall
# Tools for regenerating glapi (generally only needed by the developers)
PYTHON2 = python
@@ -52,6 +54,12 @@ GLUT_LIB_NAME = lib$(GLUT_LIB).so
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
# Optional assembly language optimization files for libGL
ASM_SOURCES =
@@ -59,6 +67,7 @@ ASM_SOURCES =
# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
# order to build the Motif widget too)
GLW_SOURCES = GLwDrawA.c
MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
@@ -84,7 +93,9 @@ APP_LIB_DEPS = -lm
# Installation directories (for make install)
INSTALL_DIR = /usr/local
DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/$(LIB_DIR)/dri
INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR)
INSTALL_INC_DIR = $(INSTALL_DIR)/include
DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)

View File

@@ -70,4 +70,4 @@ WINDOW_SYSTEM=dri
# gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb nouveau
savage sis tdfx trident unichrome ffb

View File

@@ -12,6 +12,10 @@ m4_ifval(mesa_version,[],[
m4_exit([1])
])
dnl Tell the user about autoconf.html in the --help output
m4_divert_once([HELP_END], [
See docs/autoconf.html for more details on the options for Mesa.])
AC_INIT([Mesa],[mesa_version],
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
AC_CONFIG_AUX_DIR([bin])
@@ -29,6 +33,16 @@ AC_CHECK_PROGS([MAKE], [gmake make])
AC_PATH_PROG([MKDEP], [makedepend])
AC_PATH_PROG([SED], [sed])
dnl We need a POSIX shell for parts of the build. Assume we have one
dnl in most cases.
case "$host_os" in
solaris*)
# Solaris /bin/sh is too old/non-POSIX compliant
AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
SHELL="$POSIX_SHELL"
;;
esac
MKDEP_OPTIONS=-fdepend
dnl Ask gcc where it's keeping its secret headers
if test "x$GCC" = xyes; then
@@ -39,11 +53,6 @@ if test "x$GCC" = xyes; then
fi
AC_SUBST([MKDEP_OPTIONS])
dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [],
[AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
dnl Make sure the pkg-config macros are defined
m4_ifdef([PKG_PROG_PKG_CONFIG],[],[
m4_errprint([Error: Could not locate the pkg-config autoconf macros.
@@ -78,7 +87,10 @@ linux*)
if test "x$GCC" = xyes; then
DEFINES="$DEFINES -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE"
fi
DEFINES="$DEFINES -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN"
DEFINES="$DEFINES -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS"
;;
solaris*)
DEFINES="$DEFINES -DPTHREADS -DSVR4"
;;
esac
@@ -230,6 +242,120 @@ AC_SUBST([GLUT_LIB_NAME])
AC_SUBST([GLW_LIB_NAME])
AC_SUBST([OSMESA_LIB_NAME])
dnl
dnl Arch/platform-specific settings
dnl
AC_ARG_ENABLE([asm],
[AS_HELP_STRING([--disable-asm],
[disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
[enable_asm="$enableval"],
[enable_asm=yes]
)
asm_arch=""
ASM_FLAGS=""
ASM_SOURCES=""
ASM_API=""
AC_MSG_CHECKING([whether to enable assembly])
test "x$enable_asm" = xno && AC_MSG_RESULT([no])
# disable if cross compiling on x86/x86_64 since we must run gen_matypes
if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
case "$host_cpu" in
i?86 | x86_64)
enable_asm=no
AC_MSG_RESULT([no, cross compiling])
;;
esac
fi
# check for supported arches
if test "x$enable_asm" = xyes; then
case "$host_cpu" in
i?86)
case "$host_os" in
linux* | freebsd* | dragonfly*)
test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
;;
esac
;;
x86_64)
case "$host_os" in
linux* | freebsd* | dragonfly*)
test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
;;
esac
;;
powerpc)
case "$host_os" in
linux*)
asm_arch=ppc
;;
esac
;;
esac
case "$asm_arch" in
x86)
ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
ASM_SOURCES='$(X86_SOURCES)'
ASM_API='$(X86_API)'
AC_MSG_RESULT([yes, x86])
;;
x86_64)
ASM_FLAGS="-DUSE_X86_64_ASM"
ASM_SOURCES='$(X86-64_SOURCES)'
ASM_API='$(X86-64_API)'
AC_MSG_RESULT([yes, x86_64])
;;
ppc)
ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
ASM_SOURCES='$(PPC_SOURCES)'
AC_MSG_RESULT([yes, ppc])
;;
*)
AC_MSG_RESULT([no, platform not supported])
;;
esac
fi
AC_SUBST([ASM_FLAGS])
AC_SUBST([ASM_SOURCES])
AC_SUBST([ASM_API])
dnl PIC code macro
MESA_PIC_FLAGS
dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [],
[AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
dnl See if posix_memalign is available
AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
dnl SELinux awareness.
AC_ARG_ENABLE([selinux],
[AS_HELP_STRING([--enable-selinux],
[Build SELinux-aware Mesa @<:@default=disabled@:>@])],
[MESA_SELINUX="$enableval"],
[MESA_SELINUX=no])
if test "x$enable_selinux" = "xyes"; then
AC_CHECK_HEADER([selinux/selinux.h],[],
[AC_MSG_ERROR([SELinux headers not found])])
AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
[AC_MSG_ERROR([SELinux library not found])])
SELINUX_LIBS="-lselinux"
DEFINES="$DEFINES -DMESA_SELINUX"
fi
dnl OS-specific libraries
OS_LIBS=""
case "$host_os" in
solaris*)
OS_LIBS="-lc"
if test "x$GXX" != xyes; then
OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS"
fi
;;
esac
dnl
dnl Driver configuration. Options are xlib, dri and osmesa right now.
dnl More later: directfb, fbdev, ...
@@ -328,7 +454,7 @@ esac
dnl
dnl Find out if X is available. The variable have_x is set if libX11 is
dnl to mimic AC_PATH_XTRA.
dnl found to mimic AC_PATH_XTRA.
dnl
if test -n "$PKG_CONFIG"; then
AC_MSG_CHECKING([pkg-config files for X11 are available])
@@ -347,6 +473,12 @@ if test "$x11_pkgconfig" = no; then
AC_PATH_XTRA
fi
dnl Try to tell the user that the --x-* options are only used when
dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
m4_divert_once([HELP_BEGIN],
[These options are only used when the X libraries cannot be found by the
pkg-config utility.])
dnl We need X for xlib and dri, so bomb now if it's not found
case "$mesa_driver" in
xlib|dri)
@@ -368,21 +500,6 @@ else
enable_xcb=no
fi
# SELinux awareness.
AC_ARG_ENABLE([selinux],
[AS_HELP_STRING([--enable-selinux],
[Build SELinux-aware Mesa (default: disabled)])],
[MESA_SELINUX="$enableval"],
[MESA_SELINUX=no])
if test "x$enable_selinux" = "xyes"; then
AC_CHECK_HEADER([selinux/selinux.h],[],
[AC_MSG_ERROR([SELinux headers not found])])
AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
[AC_MSG_ERROR([SELinux library not found])])
SELINUX_LIBS="-lselinux"
DEFINES="$DEFINES -DMESA_SELINUX"
fi
dnl
dnl libGL configuration per driver
dnl
@@ -397,7 +514,7 @@ xlib)
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS"
# if static, move the external libraries to the programs
# and empty the libraries for libGL
@@ -441,11 +558,11 @@ dri)
fi
# need DRM libs, -lpthread, etc.
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS"
;;
osmesa)
# No libGL for osmesa
GL_LIB_DEPS=""
GL_LIB_DEPS="$OS_LIBS"
;;
esac
AC_SUBST([GL_LIB_DEPS])
@@ -478,11 +595,25 @@ AC_ARG_ENABLE([driglx-direct],
[enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
[driglx_direct="$enableval"],
[driglx_direct="yes"])
dnl ttm support
AC_ARG_ENABLE([ttm-api],
[AS_HELP_STRING([--enable-ttm-api],
[enable TTM API users @<:@default=disabled@:>@])],
[ttmapi="$enableval"],
[ttmapi="no"])
if test "x$ttmapi" = "xyes"; then
save_CFLAGS=$CFLAGS
CFLAGS=$LIBDRM_CFLAGS
AC_CHECK_HEADERS([xf86mm.h],[],[AC_MSG_ERROR([xf86mm.h required for TTM.])],[#include "stdint.h"\n#include "drm.h"])
CFLAGS=$save_CFLAGS
fi
dnl Which drivers to build - default is chosen by platform
AC_ARG_WITH([dri-drivers],
[AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
[comma delimited DRI drivers, e.g. "i965,radeon,nouveau" @<:@default=auto@:>@])],
[comma delimited DRI drivers list, e.g.
"swrast,i965,radeon,nouveau" @<:@default=auto@:>@])],
[with_dri_drivers="$withval"],
[with_dri_drivers=yes])
if test "x$with_dri_drivers" = x; then
@@ -493,10 +624,13 @@ dnl If $with_dri_drivers is yes, directories will be added through
dnl platform checks
DRI_DIRS=""
case "$with_dri_drivers" in
no|yes) ;;
no) ;;
yes)
DRI_DIRS="yes"
;;
*)
# verify the requested driver directories exist
dri_drivers=`IFS=,; echo $with_dri_drivers`
dri_drivers=`IFS=', '; echo $with_dri_drivers`
for driver in $dri_drivers; do
test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
@@ -516,6 +650,10 @@ if test "$mesa_driver" = dri; then
DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
fi
if test "x$ttmapi" = xyes; then
DEFINES="$DEFINES -DTTM_API"
fi
if test "x$USING_EGL" = x1; then
PROGRAM_DIRS="egl"
fi
@@ -535,7 +673,7 @@ if test "$mesa_driver" = dri; then
# converted to use the new interface. i810 are missing
# because there is no x86-64 system where they could *ever*
# be used.
if test "x$DRI_DIRS" = x; then
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
savage tdfx unichrome swrast"
fi
@@ -543,10 +681,16 @@ if test "$mesa_driver" = dri; then
powerpc*)
# Build only the drivers for cards that exist on PowerPC.
# At some point MGA will be added, but not yet.
if test "x$DRI_DIRS" = x; then
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast"
fi
;;
sparc*)
# Build only the drivers for cards that exist on sparc`
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="mach64 r128 r200 r300 radeon ffb swrast"
fi
;;
esac
;;
freebsd* | dragonfly*)
@@ -562,15 +706,22 @@ if test "$mesa_driver" = dri; then
# ffb and gamma are missing because they have not been converted
# to use the new interface.
if test "x$DRI_DIRS" = x; then
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
unichrome savage sis swrast"
fi
;;
solaris*)
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
if test "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
;;
esac
# default drivers
if test "x$DRI_DIRS" = x; then
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb swrast"
fi
@@ -646,7 +797,7 @@ AC_SUBST([OSMESA_LIB])
case "$mesa_driver" in
osmesa)
# only link librararies with osmesa if shared
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
else
@@ -657,7 +808,7 @@ osmesa)
*)
# Link OSMesa to libGL otherwise
OSMESA_LIB_DEPS=""
# only link librararies with osmesa if shared
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_MESA_DEPS='-l$(GL_LIB)'
else
@@ -665,6 +816,9 @@ osmesa)
fi
;;
esac
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS"
fi
AC_SUBST([OSMESA_LIB_DEPS])
AC_SUBST([OSMESA_MESA_DEPS])
@@ -708,6 +862,9 @@ if test "x$enable_glu" = xyes; then
;;
esac
fi
if test "$enable_static" = no; then
GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
fi
AC_SUBST([GLU_LIB_DEPS])
AC_SUBST([GLU_MESA_DEPS])
@@ -724,6 +881,12 @@ if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
enable_glw=no
fi
AC_ARG_ENABLE([motif],
[AS_HELP_STRING([--enable-motif],
[use Motif widgets in GLw @<:@default=disabled@:>@])],
[enable_motif="$enableval"],
[enable_motif=no])
if test "x$enable_glw" = xyes; then
SRC_DIRS="$SRC_DIRS glw"
if test "$x11_pkgconfig" = yes; then
@@ -731,12 +894,31 @@ if test "x$enable_glw" = xyes; then
GLW_LIB_DEPS="$GLW_LIBS"
else
# should check these...
GLW_LIB_DEPS="$X_LIBS -lX11 -lXt"
GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
fi
GLW_SOURCES="GLwDrawA.c"
MOTIF_CFLAGS=
if test "x$enable_motif" = xyes; then
GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
if test "x$MOTIF_CONFIG" != xno; then
MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
MOTIF_LIBS=`$MOTIF_CONFIG --libs`
else
AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
[AC_MSG_ERROR([Can't locate Motif headers])])
AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
[AC_MSG_ERROR([Can't locate Motif Xm library])])
fi
# MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
fi
# If static, empty GLW_LIB_DEPS and add libs for programs to link
if test "$enable_static" = no; then
GLW_MESA_DEPS='-l$(GL_LIB)'
GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS"
else
APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
GLW_LIB_DEPS=""
@@ -745,6 +927,8 @@ if test "x$enable_glw" = xyes; then
fi
AC_SUBST([GLW_LIB_DEPS])
AC_SUBST([GLW_MESA_DEPS])
AC_SUBST([GLW_SOURCES])
AC_SUBST([MOTIF_CFLAGS])
dnl
dnl GLUT configuration
@@ -784,7 +968,7 @@ if test "x$enable_glut" = xyes; then
# should check these...
GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
fi
GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS"
# If glut is available, we can build most programs
if test "$with_demos" = yes; then
@@ -810,91 +994,18 @@ dnl Only libm is added here if necessary as the libraries should
dnl be pulled in by the linker
dnl
if test "x$APP_LIB_DEPS" = x; then
APP_LIB_DEPS="-lm"
case "$host_os" in
solaris*)
APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
;;
*)
APP_LIB_DEPS="-lm"
;;
esac
fi
AC_SUBST([APP_LIB_DEPS])
AC_SUBST([PROGRAM_DIRS])
dnl
dnl Arch/platform-specific settings
dnl
AC_ARG_ENABLE([asm],
[AS_HELP_STRING([--disable-asm],
[disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
[enable_asm="$enableval"],
[enable_asm=yes]
)
asm_arch=""
ASM_FLAGS=""
ASM_SOURCES=""
ASM_API=""
AC_MSG_CHECKING([whether to enable assembly])
test "x$enable_asm" = xno && AC_MSG_RESULT([no])
# disable if cross compiling on x86/x86_64 since we must run gen_matypes
if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
case "$host_cpu" in
i?86 | x86_64)
enable_asm=no
AC_MSG_RESULT([no, cross compiling])
;;
esac
fi
# check for supported arches
if test "x$enable_asm" = xyes; then
case "$host_cpu" in
i?86)
case "$host_os" in
linux* | freebsd* | dragonfly*)
test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
;;
esac
;;
x86_64)
case "$host_os" in
linux* | freebsd* | dragonfly*)
test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
;;
esac
;;
powerpc)
case "$host_os" in
linux*)
asm_arch=ppc
;;
esac
;;
esac
case "$asm_arch" in
x86)
ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
ASM_SOURCES='$(X86_SOURCES)'
ASM_API='$(X86_API)'
AC_MSG_RESULT([yes, x86])
;;
x86_64)
ASM_FLAGS="-DUSE_X86_64_ASM"
ASM_SOURCES='$(X86-64_SOURCES)'
ASM_API='$(X86-64_API)'
AC_MSG_RESULT([yes, x86_64])
;;
ppc)
ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
ASM_SOURCES='$(PPC_SOURCES)'
AC_MSG_RESULT([yes, ppc])
;;
*)
AC_MSG_RESULT([no, platform not supported])
;;
esac
fi
AC_SUBST([ASM_FLAGS])
AC_SUBST([ASM_SOURCES])
AC_SUBST([ASM_API])
dnl PIC code macro
MESA_PIC_FLAGS
dnl Restore LDFLAGS and CPPFLAGS
LDFLAGS="$_SAVE_LDFLAGS"
@@ -920,6 +1031,7 @@ echo ""
echo " prefix: $prefix"
echo " exec_prefix: $exec_prefix"
echo " libdir: $libdir"
echo " includedir: $includedir"
dnl Driver info
echo ""
@@ -932,8 +1044,13 @@ fi
if test "$mesa_driver" = dri; then
# cleanup the drivers var
dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
if test "x$DRI_DIRS" = x; then
echo " DRI drivers: no"
else
echo " DRI drivers: $dri_dirs"
fi
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
echo " TTM API support: $ttmapi"
fi
dnl Libraries
@@ -941,7 +1058,7 @@ echo ""
echo " Shared libs: $enable_shared"
echo " Static libs: $enable_static"
echo " GLU: $enable_glu"
echo " GLw: $enable_glw"
echo " GLw: $enable_glw (Motif: $enable_motif)"
echo " glut: $enable_glut"
dnl Programs

View File

@@ -182,11 +182,12 @@ will search for DRI drivers. The default is <code>${libdir}/dri</code>.
</li>
<li><code>--with-dri-drivers=DRIVER,DRIVER,...</code> - This option
allows a specific set of DRI drivers to be built. For example,
<code>--with-dri-drivers="i965,radeon,nouveau"</code>. By default,
the drivers will be chosen depending on the target platform. See the
directory <code>src/mesa/drivers/dri</code> in the source tree for
available drivers.
</li>
<code>--with-dri-drivers="swrast,i965,radeon,nouveau"</code>. By
default, the drivers will be chosen depending on the target platform.
See the directory <code>src/mesa/drivers/dri</code> in the source tree
for available drivers. Beware that the swrast DRI driver is used by both
libGL and the X.Org xserver GLX module to do software rendering, so you
may run into problems if it is not available.</li>
<!-- This explanation might be totally bogus. Kristian? -->
<li><code>--disable-driglx-direct</code> - Disable direct rendering in
GLX. Normally, direct hardware rendering through the DRI drivers and

View File

@@ -48,6 +48,7 @@ a:visited {
<li><a href="lists.html" target="MainFrame">Mailing Lists</a>
<li><a href="bugs.html" target="MainFrame">Bug Database</a>
<li><a href="webmaster.html" target="MainFrame">Webmaster</a>
<li><a href="http://dri.freedesktop.org/" target="MainFrame">Wiki</a>
</ul>
<b>User Topics</b>

View File

@@ -9,7 +9,9 @@
<H1>Downloading</H1>
<p>
Last stable release: <b>7.0.3</b>
Current development release: <b>7.1</b>
<br>
Last stable release: <b>7.0.4</b>
</p>
<p>
@@ -18,6 +20,11 @@ Primary download site:
target="_parent">SourceForge</a>
</p>
<p>
When a new release is coming, release candidates (betas) can be found
<a href="http://www.mesa3d.org/beta/">here</a>.
</p>
<p>
Mesa is distributed in several parts:

View File

@@ -25,23 +25,12 @@
<h3>1.1 Prerequisites for DRI and Hardware Acceleration</h3>
<p>
To build Mesa with DRI-based hardware acceleration you must first have
the right version of DRM.
To build Mesa 7.1 with DRI-based hardware acceleration you must first have
the <a href="http://dri.freedesktop.org/libdrm/" target="_parent">DRM version 2.3.1</a>.
</p>
<p>
For Mesa 7.1 a particular snapshot of
<a href="http://dri.freedesktop.org/libdrm/">DRM</a> from git is required:
</p>
<pre>
git-clone git://anongit.freedesktop.org/git/mesa/drm
git-checkout (XXXX HASH ID TBD)
</pre>
</li>
<p>
You should also be using Xorg server version 1.4
You should also be using the Xorg server version 1.4 or 1.5.
</p>

View File

@@ -22,9 +22,10 @@ for modern GPUs.
<p>
Mesa ties into several other open-source projects: the
<a href="http://dri.sf.net/" target="_parent">Direct Rendering Infrastructure</a>
and <a href="http://x.org" target="_parent">X.org</a> to provide OpenGL
support to users of X on Linux, FreeBSD and other operating systems.
<a href="http://dri.freedesktop.org/" target="_parent">Direct Rendering
Infrastructure</a> and <a href="http://x.org" target="_parent">X.org</a> to
provide OpenGL support to users of X on Linux, FreeBSD and other operating
systems.
</p>

View File

@@ -9,7 +9,7 @@
<H1>Mailing Lists</H1>
<p>There are four Mesa mailing lists:
<p>There are four Mesa 3D / DRI mailing lists:
</p>
<ul>
@@ -19,14 +19,14 @@ versions are sent to this list.
</li>
<br>
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-users"
target="_parent">mesa3d-users</a> - intended for users of the Mesa library.
target="_parent">mesa3d-users</a> - intended for users of the Mesa and DRI.
Newbie questions are appropriate, but please try the general OpenGL
resources and Mesa documentation first.
resources and Mesa/DRI documentation first.
</li>
<br>
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-dev"
target="_parent">mesa3d-dev</a> - for discussion of Mesa development.
Not for beginners.
target="_parent">mesa3d-dev</a> - for discussion of Mesa and Direct Rendering
Infrastructure development. Not for beginners.
</li>
<br>
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-commit"
@@ -37,6 +37,9 @@ Note: the old mesa3d-cvs list is no longer in use.
</li>
</ul>
<p>For mailing lists about Direct Rendering Modules (drm) in Linux/BSD
kernels, see <a href="http://dri.freedesktop.org/wiki/MailingLists">wiki</a>.
<p>
<b>Notice</b>: non-member posts to any of these lists will be automatically
rejected.

View File

@@ -11,6 +11,23 @@
<H1>News</H1>
<h2>August 26, 2008</h2>
<p>
<a href="relnotes-7.1.html">Mesa 7.1</a> is released.
This is a new development release.
It should be relatively stable, but those especially concerned about
stability should wait for the 7.2 release or use Mesa 7.0.4 (the
previous stable release).
</p>
<h2>August 16, 2008</h2>
<p>
<a href="relnotes-7.0.4.html">Mesa 7.0.4</a> is released.
This is a bug-fix release.
</p>
<h2>April 4, 2008</h2>
<p>
<a href="relnotes-7.0.3.html">Mesa 7.0.3</a> is released.

80
docs/relnotes-7.0.4.html Normal file
View File

@@ -0,0 +1,80 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.0.4 Release Notes / August 16, 2008</H1>
<p>
Mesa 7.0.4 is a stable release with bug fixes since version 7.0.3.
</p>
<h2>MD5 checksums</h2>
<pre>
909afa3a01ae31478d363837681415ac MesaLib-7.0.4.tar.gz
8d7bacbe0234742a5d08c8088c4619e9 MesaLib-7.0.4.tar.bz2
5e44261ef85b049a868e1785d9adc276 MesaLib-7.0.4.zip
53dcd77d37a819feaf50b5fcdd0a6e0f MesaDemos-7.0.4.tar.gz
c1215b31c5f7b85f81eed3bfba07d556 MesaDemos-7.0.4.tar.bz2
b1825a7361f116b28d82d328077630b4 MesaDemos-7.0.4.zip
d7677d015f52602d1bf8b837fb717848 MesaGLUT-7.0.4.tar.gz
f5f8b46f7e763d9f7b7d1d115c1c44ee MesaGLUT-7.0.4.tar.bz2
a786775271a02c62a3370b13b26bf48d MesaGLUT-7.0.4.zip
</pre>
<h2>Bug fixes</h2>
<ul>
<li>define #extension GL_ARB_texture_rectangle in shading language
<li>fixed WIN32 compile problem in libGLU
<li>Fixed a per-vertex glMaterial bug which could cause bad lighting
<li>Fixed potential crash in AA/smoothed triangle rendering when using a fragment shader
<li>Fixed glDrawElement + VBO segfault (bug 16156)
<li>Fixed GLSL linker bug causing generic vertex attributes to get aliased
<li>Fixed stack overflow when using glPixelZoom on Windows
<li>Fixed broken all(bvec2) GLSL function, added misc missing bvec constructors
<li>ARB program "state.clip[n].plane" didn't parse correctly
<li>Fixed broken glGetUniformiv() (bug 13774)
</ul>
<h2>Changes</h2>
<ul>
<li>Including the latest glext.h and glxext.h header files from Khronos
<li>Added support for DragonFly OS
<li>Added a build config for FreeBSD static libs (Anatolij Shkodin)
<li>Enabled GL_EXT_multi_draw_arrays extension in R200/R300 drivers
<li>Enabled GL_ARB_point_sprite extension in I965 driver
<li>Enabled GL_EXT_texture_sRGB extension in I965 driver
<li>Added support for GL shading language in I965 driver
</ul>
<h2>Driver Status</h2>
<pre>
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa/GLX (on Xlib) implements OpenGL 2.1
OSMesa (off-screen) implements OpenGL 2.1
Windows/Win32 implements OpenGL 2.1
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA unsupported
Wind River UGL unsupported
DJGPP unsupported
GGI unsupported
BeOS unsupported
Allegro unsupported
D3D unsupported
</pre>
</body>
</html>

View File

@@ -8,13 +8,21 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.1 Release Notes / May XX, 2008</H1>
<H1>Mesa 7.1 Release Notes / August 26, 2008</H1>
<p>
Mesa 7.1 is a new development release.
There have been many internal code changes since Mesa 7.0.x.
It should be relatively stable, but those who are especially concerned about
stability should wait for Mesa 7.2.
stability should wait for Mesa 7.2 or use Mesa 7.0.4 (the previous stable
release).
</p>
</>
Note that this version of Mesa does not use the GEM memory manager.
The master branch of git uses GEM.
</p>
<p>
DRM version 2.3.1 should be used with Mesa 7.1
</p>
@@ -26,10 +34,20 @@ TBD
<h2>New features</h2>
<ul>
<li>autoconf-based configuration
<li>autoconf-based configuration (and clean-up of Makefiles)
<li>Assorted DRI driver enhancements
<li>Reduced dependencies between X server and Mesa
<li>GL_EXT_texture_from_pixmap extension for Xlib driver
<li>Support for the GL shading language with i965 driver (implemented by Intel)
<li>ATI R500 series support (Radeon X1300&#8211;X1950) in r300 DRI driver
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Numerous GLSL fixes
<li>Fixed some error code/detection bugs in the GLSL-related API functions
<li>Lots of DRI driver fixes.
</ul>

View File

@@ -21,6 +21,7 @@ The release notes summarize what's new or changed in each Mesa release.
<UL>
<LI><A HREF="relnotes-7.1.html">7.1 release notes</A>
<LI><A HREF="relnotes-7.0.4.html">7.0.4 release notes</A>
<LI><A HREF="relnotes-7.0.3.html">7.0.3 release notes</A>
<LI><A HREF="relnotes-7.0.2.html">7.0.2 release notes</A>
<LI><A HREF="relnotes-7.0.1.html">7.0.1 release notes</A>

View File

@@ -25,9 +25,10 @@ Contents
<li><a href="#unsup">Unsupported Features</a>
<li><a href="#notes">Implementation Notes</a>
<li><a href="#hints">Programming Hints</a>
<li><a href="#standalone">Stand-alone Compiler</a>
<li><a href="#standalone">Stand-alone GLSL Compiler</a>
<li><a href="#implementation">Compiler Implementation</a>
<li><a href="#validation">Compiler Validation</a>
<li><a href="#120">GLSL 1.20 support</a>
</ul>
@@ -133,7 +134,7 @@ These issues will be addressed/resolved in the future.
<a name="standalone">
<h2>Stand-alone Compiler</h2>
<h2>Stand-alone GLSL Compiler</h2>
<p>
A unique stand-alone GLSL compiler driver has been added to Mesa.
@@ -155,12 +156,10 @@ This tool is useful for:
</ul>
<p>
To build the glslcompiler program (this will be improved someday):
After building Mesa, the glslcompiler can be built by manually running:
</p>
<pre>
cd src/mesa
make libmesa.a
cd drivers/glslcompiler
cd src/mesa/drivers/glslcompiler
make
</pre>
@@ -170,20 +169,31 @@ Here's an example of using the compiler to compile a vertex shader and
emit GL_ARB_vertex_program-style instructions:
</p>
<pre>
glslcompiler --arb --linenumbers --vs vertshader.txt
bin/glslcompiler --debug --numbers --fs progs/glsl/CH06-brick.frag.txt
</pre>
<p>
The output may look similar to this:
results in:
</p>
<pre>
!!ARBvp1.0
0: MOV result.texcoord[0], vertex.texcoord[0];
1: DP4 temp0.x, state.matrix.mvp.row[0], vertex.position;
2: DP4 temp0.y, state.matrix.mvp.row[1], vertex.position;
3: DP4 temp0.z, state.matrix.mvp.row[2], vertex.position;
4: DP4 temp0.w, state.matrix.mvp.row[3], vertex.position;
5: MOV result.position, temp0;
6: END
# Fragment Program/Shader
0: RCP TEMP[4].x, UNIFORM[2].xxxx;
1: RCP TEMP[4].y, UNIFORM[2].yyyy;
2: MUL TEMP[3].xy, VARYING[0], TEMP[4];
3: MOV TEMP[1], TEMP[3];
4: MUL TEMP[0].w, TEMP[1].yyyy, CONST[4].xxxx;
5: FRC TEMP[1].z, TEMP[0].wwww;
6: SGT.C TEMP[0].w, TEMP[1].zzzz, CONST[4].xxxx;
7: IF (NE.wwww); # (if false, goto 9);
8: ADD TEMP[1].x, TEMP[1].xxxx, CONST[4].xxxx;
9: ENDIF;
10: FRC TEMP[1].xy, TEMP[1];
11: SGT TEMP[2].xy, UNIFORM[3], TEMP[1];
12: MUL TEMP[1].z, TEMP[2].xxxx, TEMP[2].yyyy;
13: LRP TEMP[0], TEMP[1].zzzz, UNIFORM[0], UNIFORM[1];
14: MUL TEMP[0].xyz, TEMP[0], VARYING[1].xxxx;
15: MOV OUTPUT[0].xyz, TEMP[0];
16: MOV OUTPUT[0].w, CONST[4].yyyy;
17: END
</pre>
<p>
@@ -309,5 +319,39 @@ should be added.
</p>
<a name="120">
<h2>GLSL 1.20 support</h2>
<p>
Support for GLSL version 1.20 is underway. Status as follows.
</p>
<h3>Supported</h3>
<ul>
<li><code>mat2x3, mat2x4</code>, etc. types and functions
<li><code>transpose(), outerProduct(), matrixCompMult()</code> functions
(but untested)
<li>precision qualifiers (lowp, mediump, highp)
</ul>
<h3>Partially Complete</h3>
<ul>
<li><code>invariant</code> qualifier
</ul>
<h3>Not Completed</h3>
<ul>
<li><code>array.length()</code> method
<li><code>float[5] a;</code> array syntax
<li><code>centroid</code> qualifier
<li>unsized array constructors
<li>initializers for uniforms
<li>const initializers calling built-in functions
</ul>
</BODY>
</HTML>

View File

@@ -1,17 +1,17 @@
<html>
<head>
<title>Mesa Source Code Documentation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="qindex">
<a class="qindex" href="../main/index.html">core</a> |
<a class="qindex" href="../glapi/index.html">glapi</a> |
<a class="qindex" href="../vbo/index.html">vbo</a> |
<a class="qindex" href="../math/index.html">math</a> |
<a class="qindex" href="../shader/index.html">shader</a> |
<a class="qindex" href="../swrast/index.html">swrast</a> |
<a class="qindex" href="../swrast_setup/index.html">swrast_setup</a> |
<a class="qindex" href="../tnl/index.html">tnl</a> |
<a class="qindex" href="../tnl_dd/index.html">tnl_dd</a>
</div>
<html>
<head>
<title>Mesa Source Code Documentation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="qindex">
<a class="qindex" href="../main/index.html">core</a> |
<a class="qindex" href="../glapi/index.html">glapi</a> |
<a class="qindex" href="../vbo/index.html">vbo</a> |
<a class="qindex" href="../math/index.html">math</a> |
<a class="qindex" href="../shader/index.html">shader</a> |
<a class="qindex" href="../swrast/index.html">swrast</a> |
<a class="qindex" href="../swrast_setup/index.html">swrast_setup</a> |
<a class="qindex" href="../tnl/index.html">tnl</a> |
<a class="qindex" href="../tnl_dd/index.html">tnl_dd</a>
</div>

View File

@@ -1,11 +1,11 @@
<html>
<head><title>Mesa Source Code Documentation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="qindex">
<a class="qindex" href="../core_subset/index.html">Mesa Core</a> |
<a class="qindex" href="../math_subset/index.html">math</a> |
<a class="qindex" href="../miniglx/index.html">MiniGLX</a> |
<a class="qindex" href="../radeon_subset/index.html">radeon_subset</a>
</div>
<html>
<head><title>Mesa Source Code Documentation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="qindex">
<a class="qindex" href="../core_subset/index.html">Mesa Core</a> |
<a class="qindex" href="../math_subset/index.html">math</a> |
<a class="qindex" href="../miniglx/index.html">MiniGLX</a> |
<a class="qindex" href="../radeon_subset/index.html">radeon_subset</a>
</div>

View File

@@ -1,76 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.0
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Example Foo/Mesa interface. See src/ddsample.c for more info.
*/
#ifndef FOOMESA_H
#define FOOMESA_H
typedef struct foo_mesa_visual *FooMesaVisual;
typedef struct foo_mesa_buffer *FooMesaBuffer;
typedef struct foo_mesa_context *FooMesaContext;
#ifdef BEOS
#pragma export on
#endif
extern FooMesaVisual FooMesaChooseVisual( /* your params */ );
extern void FooMesaDestroyVisual( FooMesaVisual visual );
extern FooMesaBuffer FooMesaCreateBuffer( FooMesaVisual visual,
void *your_window_id );
extern void FooMesaDestroyBuffer( FooMesaBuffer buffer );
extern FooMesaContext FooMesaCreateContext( FooMesaVisual visual,
FooMesaContext sharelist );
extern void FooMesaDestroyContext( FooMesaContext context );
extern void FooMesaMakeCurrent( FooMesaContext context, FooMesaBuffer buffer );
extern void FooMesaSwapBuffers( FooMesaBuffer buffer );
/* Probably some more functions... */
#ifdef BEOS
#pragma export off
#endif
#endif

View File

@@ -46,9 +46,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated 2008/03/24 */
/* glext.h last updated 2008/08/10 */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 40
#define GL_GLEXT_VERSION 41
#ifndef GL_VERSION_1_2
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
@@ -479,6 +479,117 @@ extern "C" {
#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
#endif
#ifndef GL_VERSION_3_0
#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB
#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0
#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1
#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2
#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3
#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4
#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5
#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES
#define GL_MAJOR_VERSION 0x821B
#define GL_MINOR_VERSION 0x821C
#define GL_NUM_EXTENSIONS 0x821D
#define GL_CONTEXT_FLAGS 0x821E
#define GL_DEPTH_BUFFER 0x8223
#define GL_STENCIL_BUFFER 0x8224
#define GL_COMPRESSED_RED 0x8225
#define GL_COMPRESSED_RG 0x8226
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
#define GL_RGBA32F 0x8814
#define GL_RGB32F 0x8815
#define GL_RGBA16F 0x881A
#define GL_RGB16F 0x881B
#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
#define GL_CLAMP_VERTEX_COLOR 0x891A
#define GL_CLAMP_FRAGMENT_COLOR 0x891B
#define GL_CLAMP_READ_COLOR 0x891C
#define GL_FIXED_ONLY 0x891D
#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS
#define GL_TEXTURE_RED_TYPE 0x8C10
#define GL_TEXTURE_GREEN_TYPE 0x8C11
#define GL_TEXTURE_BLUE_TYPE 0x8C12
#define GL_TEXTURE_ALPHA_TYPE 0x8C13
#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
#define GL_UNSIGNED_NORMALIZED 0x8C17
#define GL_TEXTURE_1D_ARRAY 0x8C18
#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
#define GL_TEXTURE_2D_ARRAY 0x8C1A
#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
#define GL_R11F_G11F_B10F 0x8C3A
#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
#define GL_RGB9_E5 0x8C3D
#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
#define GL_TEXTURE_SHARED_SIZE 0x8C3F
#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
#define GL_PRIMITIVES_GENERATED 0x8C87
#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
#define GL_RASTERIZER_DISCARD 0x8C89
#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
#define GL_INTERLEAVED_ATTRIBS 0x8C8C
#define GL_SEPARATE_ATTRIBS 0x8C8D
#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
#define GL_RGBA32UI 0x8D70
#define GL_RGB32UI 0x8D71
#define GL_RGBA16UI 0x8D76
#define GL_RGB16UI 0x8D77
#define GL_RGBA8UI 0x8D7C
#define GL_RGB8UI 0x8D7D
#define GL_RGBA32I 0x8D82
#define GL_RGB32I 0x8D83
#define GL_RGBA16I 0x8D88
#define GL_RGB16I 0x8D89
#define GL_RGBA8I 0x8D8E
#define GL_RGB8I 0x8D8F
#define GL_RED_INTEGER 0x8D94
#define GL_GREEN_INTEGER 0x8D95
#define GL_BLUE_INTEGER 0x8D96
#define GL_ALPHA_INTEGER 0x8D97
#define GL_RGB_INTEGER 0x8D98
#define GL_RGBA_INTEGER 0x8D99
#define GL_BGR_INTEGER 0x8D9A
#define GL_BGRA_INTEGER 0x8D9B
#define GL_SAMPLER_1D_ARRAY 0x8DC0
#define GL_SAMPLER_2D_ARRAY 0x8DC1
#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
#define GL_UNSIGNED_INT_VEC2 0x8DC6
#define GL_UNSIGNED_INT_VEC3 0x8DC7
#define GL_UNSIGNED_INT_VEC4 0x8DC8
#define GL_INT_SAMPLER_1D 0x8DC9
#define GL_INT_SAMPLER_2D 0x8DCA
#define GL_INT_SAMPLER_3D 0x8DCB
#define GL_INT_SAMPLER_CUBE 0x8DCC
#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
#define GL_QUERY_WAIT 0x8E13
#define GL_QUERY_NO_WAIT 0x8E14
#define GL_QUERY_BY_REGION_WAIT 0x8E15
#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
#endif
#ifndef GL_ARB_multitexture
#define GL_TEXTURE0_ARB 0x84C0
#define GL_TEXTURE1_ARB 0x84C1
@@ -974,6 +1085,175 @@ extern "C" {
#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
#endif
#ifndef GL_ARB_depth_buffer_float
#define GL_DEPTH_COMPONENT32F 0x8CAC
#define GL_DEPTH32F_STENCIL8 0x8CAD
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
#endif
#ifndef GL_ARB_draw_instanced
#endif
#ifndef GL_ARB_framebuffer_object
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
#define GL_FRAMEBUFFER_DEFAULT 0x8218
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
#define GL_INDEX 0x8222
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GL_DEPTH_STENCIL 0x84F9
#define GL_UNSIGNED_INT_24_8 0x84FA
#define GL_DEPTH24_STENCIL8 0x88F0
#define GL_TEXTURE_STENCIL_SIZE 0x88F1
#define GL_FRAMEBUFFER_BINDING 0x8CA6
#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_READ_FRAMEBUFFER 0x8CA8
#define GL_DRAW_FRAMEBUFFER 0x8CA9
#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
#define GL_RENDERBUFFER_SAMPLES 0x8CAB
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_COLOR_ATTACHMENT1 0x8CE1
#define GL_COLOR_ATTACHMENT2 0x8CE2
#define GL_COLOR_ATTACHMENT3 0x8CE3
#define GL_COLOR_ATTACHMENT4 0x8CE4
#define GL_COLOR_ATTACHMENT5 0x8CE5
#define GL_COLOR_ATTACHMENT6 0x8CE6
#define GL_COLOR_ATTACHMENT7 0x8CE7
#define GL_COLOR_ATTACHMENT8 0x8CE8
#define GL_COLOR_ATTACHMENT9 0x8CE9
#define GL_COLOR_ATTACHMENT10 0x8CEA
#define GL_COLOR_ATTACHMENT11 0x8CEB
#define GL_COLOR_ATTACHMENT12 0x8CEC
#define GL_COLOR_ATTACHMENT13 0x8CED
#define GL_COLOR_ATTACHMENT14 0x8CEE
#define GL_COLOR_ATTACHMENT15 0x8CEF
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_FRAMEBUFFER 0x8D40
#define GL_RENDERBUFFER 0x8D41
#define GL_RENDERBUFFER_WIDTH 0x8D42
#define GL_RENDERBUFFER_HEIGHT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
#define GL_STENCIL_INDEX1 0x8D46
#define GL_STENCIL_INDEX4 0x8D47
#define GL_STENCIL_INDEX8 0x8D48
#define GL_STENCIL_INDEX16 0x8D49
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
#define GL_MAX_SAMPLES 0x8D57
#endif
#ifndef GL_ARB_framebuffer_sRGB
#define GL_FRAMEBUFFER_SRGB 0x8DB9
#endif
#ifndef GL_ARB_geometry_shader4
#define GL_LINES_ADJACENCY_ARB 0x000A
#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B
#define GL_TRIANGLES_ADJACENCY_ARB 0x000C
#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D
#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
#define GL_GEOMETRY_SHADER_ARB 0x8DD9
#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
#endif
#ifndef GL_ARB_half_float_vertex
#define GL_HALF_FLOAT 0x140B
#endif
#ifndef GL_ARB_instanced_arrays
#endif
#ifndef GL_ARB_map_buffer_range
#define GL_MAP_READ_BIT 0x0001
#define GL_MAP_WRITE_BIT 0x0002
#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
#endif
#ifndef GL_ARB_texture_buffer_object
#define GL_TEXTURE_BUFFER_ARB 0x8C2A
#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
#endif
#ifndef GL_ARB_texture_compression_rgtc
#define GL_COMPRESSED_RED_RGTC1 0x8DBB
#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
#define GL_COMPRESSED_RG_RGTC2 0x8DBD
#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
#endif
#ifndef GL_ARB_texture_rg
#define GL_RG 0x8227
#define GL_RG_INTEGER 0x8228
#define GL_R8 0x8229
#define GL_R16 0x822A
#define GL_RG8 0x822B
#define GL_RG16 0x822C
#define GL_R16F 0x822D
#define GL_R32F 0x822E
#define GL_RG16F 0x822F
#define GL_RG32F 0x8230
#define GL_R8I 0x8231
#define GL_R8UI 0x8232
#define GL_R16I 0x8233
#define GL_R16UI 0x8234
#define GL_R32I 0x8235
#define GL_R32UI 0x8236
#define GL_RG8I 0x8237
#define GL_RG8UI 0x8238
#define GL_RG16I 0x8239
#define GL_RG16UI 0x823A
#define GL_RG32I 0x823B
#define GL_RG32UI 0x823C
#endif
#ifndef GL_ARB_vertex_array_object
#define GL_VERTEX_ARRAY_BINDING 0x85B5
#endif
#ifndef GL_EXT_abgr
#define GL_ABGR_EXT 0x8000
#endif
@@ -3382,6 +3662,40 @@ extern "C" {
#ifndef GL_GREMEDY_frame_terminator
#endif
#ifndef GL_NV_conditional_render
#define GL_QUERY_WAIT_NV 0x8E13
#define GL_QUERY_NO_WAIT_NV 0x8E14
#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
#endif
#ifndef GL_NV_present_video
#define GL_FRAME_NV 0x8E26
#define GL_FIELDS_NV 0x8E27
#define GL_CURRENT_TIME_NV 0x8E28
#define GL_NUM_FILL_STREAMS_NV 0x8E29
#define GL_PRESENT_TIME_NV 0x8E2A
#define GL_PRESENT_DURATION_NV 0x8E2B
#endif
#ifndef GL_EXT_transform_feedback
#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
#define GL_RASTERIZER_DISCARD_EXT 0x8C89
#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
#endif
/*************************************************************/
@@ -3419,16 +3733,16 @@ typedef unsigned short GLhalfNV;
#endif
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glext.h, so must be protected */
/* This code block is duplicated in glxext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GL_EXT_timer_query extension). */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(__sun__)
#elif defined(__sun__) || defined(__digital__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__)
#if defined(__arch64__) || defined(_LP64)
typedef long int int64_t;
typedef unsigned long int uint64_t;
#else
@@ -3436,7 +3750,7 @@ typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
#elif defined( __VMS )
#elif defined( __VMS ) || defined(__sgi)
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
@@ -3990,6 +4304,10 @@ typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei co
typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
#endif
#ifndef GL_VERSION_3_0
#define GL_VERSION_3_0 1
#endif
#ifndef GL_ARB_multitexture
#define GL_ARB_multitexture 1
#ifdef GL_GLEXT_PROTOTYPES
@@ -4569,6 +4887,54 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
#define GL_ARB_pixel_buffer_object 1
#endif
#ifndef GL_ARB_depth_buffer_float
#define GL_ARB_depth_buffer_float 1
#endif
#ifndef GL_ARB_draw_instanced
#define GL_ARB_draw_instanced 1
#endif
#ifndef GL_ARB_framebuffer_object
#define GL_ARB_framebuffer_object 1
#endif
#ifndef GL_ARB_framebuffer_sRGB
#define GL_ARB_framebuffer_sRGB 1
#endif
#ifndef GL_ARB_geometry_shader4
#define GL_ARB_geometry_shader4 1
#endif
#ifndef GL_ARB_half_float_vertex
#define GL_ARB_half_float_vertex 1
#endif
#ifndef GL_ARB_instanced_arrays
#define GL_ARB_instanced_arrays 1
#endif
#ifndef GL_ARB_map_buffer_range
#define GL_ARB_map_buffer_range 1
#endif
#ifndef GL_ARB_texture_buffer_object
#define GL_ARB_texture_buffer_object 1
#endif
#ifndef GL_ARB_texture_compression_rgtc
#define GL_ARB_texture_compression_rgtc 1
#endif
#ifndef GL_ARB_texture_rg
#define GL_ARB_texture_rg 1
#endif
#ifndef GL_ARB_vertex_array_object
#define GL_ARB_vertex_array_object 1
#endif
#ifndef GL_EXT_abgr
#define GL_EXT_abgr 1
#endif
@@ -7263,6 +7629,18 @@ GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
#endif
#ifndef GL_NV_conditional_render
#define GL_NV_conditional_render 1
#endif
#ifndef GL_NV_present_video
#define GL_NV_present_video 1
#endif
#ifndef GL_EXT_transform_feedback
#define GL_EXT_transform_feedback 1
#endif
#ifdef __cplusplus
}

View File

@@ -46,9 +46,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glxext.h last updated 2007/04/21 */
/* glxext.h last updated 2008/08/10 */
/* Current version at http://www.opengl.org/registry/ */
#define GLX_GLXEXT_VERSION 19
#define GLX_GLXEXT_VERSION 20
#ifndef GLX_VERSION_1_3
#define GLX_WINDOW_BIT 0x00000001
@@ -346,6 +346,26 @@ extern "C" {
#define GLX_AUX9_EXT 0x20EB
#endif
#ifndef GLX_NV_present_video
#define GLX_GLX_NUM_VIDEO_SLOTS_NV 0x20F0
#endif
#ifndef GLX_NV_video_out
#define GLX_GLX_VIDEO_OUT_COLOR_NV 0x20C3
#define GLX_GLX_VIDEO_OUT_ALPHA_NV 0x20C4
#define GLX_GLX_VIDEO_OUT_DEPTH_NV 0x20C5
#define GLX_GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
#define GLX_GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
#define GLX_GLX_VIDEO_OUT_FRAME_NV 0x20C8
#define GLX_GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
#define GLX_GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
#endif
#ifndef GLX_NV_swap_group
#endif
/*************************************************************/
@@ -380,7 +400,7 @@ typedef struct {
#endif
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glxext.h, so must be protected */
/* This code block is duplicated in glext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GLX_OML_sync_control extension). */
@@ -389,7 +409,7 @@ typedef struct {
#elif defined(__sun__) || defined(__digital__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__)
#if defined(__arch64__) || defined(_LP64)
typedef long int int64_t;
typedef unsigned long int uint64_t;
#else
@@ -397,7 +417,7 @@ typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
#elif defined( __VMS )
#elif defined( __VMS ) || defined(__sgi)
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
@@ -777,6 +797,18 @@ typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable,
typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
#endif
#ifndef GLX_NV_present_video
#define GLX_NV_present_video 1
#endif
#ifndef GLX_NV_video_out
#define GLX_NV_video_out 1
#endif
#ifndef GLX_NV_swap_group
#define GLX_NV_swap_group 1
#endif
#ifdef __cplusplus
}

View File

@@ -40,7 +40,14 @@
#ifndef DRI_INTERFACE_H
#define DRI_INTERFACE_H
/* Make this something other than __APPLE__ for other arcs with no drm.h */
#ifndef __APPLE__
#include <drm.h>
#else
typedef unsigned int drm_context_t;
typedef unsigned int drm_drawable_t;
typedef struct drm_clip_rect drm_clip_rect_t;
#endif
/**
* \name DRI interface structures

View File

@@ -130,7 +130,7 @@ extern void WMesaPaletteChange(HPALETTE Pal);
extern void WMesaMove(void);
void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx);
#ifdef __cplusplus
}

View File

@@ -27,6 +27,7 @@ PROGS = \
cubemap \
drawpix \
engine \
fbo_firecube \
fire \
fogcoord \
fplight \
@@ -124,41 +125,41 @@ extfuncs.h: $(TOP)/progs/util/extfuncs.h
reflect: reflect.o showbuffer.o readtex.o
$(CC) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@
reflect.o: reflect.c showbuffer.h
$(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
shadowtex: shadowtex.o showbuffer.o
$(CC) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@
shadowtex.o: shadowtex.c showbuffer.h
$(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
gloss: gloss.o trackball.o readtex.o
$(CC) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@
gloss.o: gloss.c trackball.h
$(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
engine: engine.o trackball.o readtex.o
$(CC) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -o $@
engine.o: engine.c trackball.h
$(CC) -c -I$(INCDIR) $(CFLAGS) engine.c
fslight: fslight.o
$(CC) $(LDFLAGS) fslight.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) fslight.o $(LIBS) -o $@
fslight.o: fslight.c extfuncs.h
$(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
rain: particles.o rain.o readtex.o
$(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
rain.o: rain.cxx readtex.h
$(CXX) -c -I$(INCDIR) $(CXXFLAGS) $<

1041
progs/demos/fbo_firecube.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -264,38 +264,44 @@ draw(void)
glLoadIdentity();
glTranslatef(0.0, 0.0, -40.0);
/* clear whole depth buffer */
glDisable(GL_SCISSOR_TEST);
glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_SCISSOR_TEST);
/* draw gears */
/* clear upper-left corner of color buffer (unused space) */
glScissor(0, TexHeight, TexWidth, WinHeight - TexHeight);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
/* clear lower-left corner of color buffer */
glViewport(0, 0, TexWidth, TexHeight);
glScissor(0, 0, TexWidth, TexHeight);
glClearColor(0.5, 0.5, 0.8, 0.0);
glClearColor(1, 1, 1, 0);
glClear(GL_COLOR_BUFFER_BIT);
/* draw gears in lower-left corner */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
DrawGears();
/* copy color buffer to texture */
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, TexWidth, TexHeight);
/* draw textured cube */
/* clear right half of color buffer */
glViewport(TexWidth, 0, WinWidth - TexWidth, WinHeight);
glScissor(TexWidth, 0, WinWidth - TexWidth, WinHeight);
glClearColor(0.5, 0.5, 0.8, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
/* draw textured cube in right half of window */
ar = (float) (WinWidth - TexWidth) / WinHeight;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
DrawCube();
/* finish up */

View File

@@ -955,7 +955,6 @@ Init(void)
glGenTextures(1, &GrayTexture);
glBindTexture(GL_TEXTURE_1D, GrayTexture);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
{

View File

@@ -76,6 +76,7 @@ int textureWidth = 64;
int textureHeight = 64;
int winWidth = 580, winHeight = 720;
int win;
struct formatInfo {
GLenum baseFormat;
@@ -288,6 +289,7 @@ static void keyboard( unsigned char c, int x, int y )
displayLevelInfo = !displayLevelInfo;
break;
case 27: /* Escape key should force exit. */
glutDestroyWindow(win);
exit(0);
break;
default:
@@ -785,7 +787,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( winWidth, winHeight );
glutInitWindowPosition( 0, 0 );
glutCreateWindow( "Texture Environment Test" );
win = glutCreateWindow( "Texture Environment Test" );
initialize();
instructions();

View File

@@ -72,7 +72,7 @@ UTIL_FILES = readtex.h readtex.c
.SUFFIXES: .c
.c:
$(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
@@ -99,13 +99,13 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.
texrect: texrect.o readtex.o
$(CC) texrect.o readtex.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
texrect.o: texrect.c readtex.h
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
invert: invert.o readtex.o
$(CC) invert.o readtex.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
invert.o: invert.c readtex.h
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@

View File

@@ -4,10 +4,13 @@ bump
deriv
extfuncs.h
mandelbrot
multitex
noise
points
readtex.c
readtex.h
shaderutil.c
shaderutil.h
texdemo1
toyball
trirast

View File

@@ -13,11 +13,13 @@ PROGS = \
bitmap \
brick \
bump \
convolutions \
deriv \
mandelbrot \
multitex \
noise \
points \
pointcoord \
texdemo1 \
toyball \
twoside \
@@ -89,6 +91,13 @@ bump: bump.o shaderutil.o
$(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
convolutions.o: convolutions.c readtex.h
$(CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
convolutions: convolutions.o readtex.o
$(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
deriv.o: deriv.c extfuncs.h shaderutil.h
$(CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
@@ -124,6 +133,13 @@ points: points.o shaderutil.o
$(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
$(CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
pointcoord: pointcoord.o readtex.o shaderutil.o
$(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
$(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c

View File

@@ -16,8 +16,8 @@
#include "shaderutil.h"
static char *FragProgFile = "CH06-brick.frag.txt";
static char *VertProgFile = "CH06-brick.vert.txt";
static char *FragProgFile = "CH06-brick.frag";
static char *VertProgFile = "CH06-brick.vert";
/* program/shader objects */
static GLuint fragShader;

View File

@@ -16,8 +16,8 @@
#include "shaderutil.h"
static char *FragProgFile = "CH11-bumpmap.frag.txt";
static char *VertProgFile = "CH11-bumpmap.vert.txt";
static char *FragProgFile = "CH11-bumpmap.frag";
static char *VertProgFile = "CH11-bumpmap.vert";
/* program/shader objects */
static GLuint fragShader;

View File

@@ -0,0 +1,21 @@
const int KernelSize = 9;
//texture offsets
uniform vec2 Offset[KernelSize];
//convolution kernel
uniform vec4 KernelValue[KernelSize];
uniform sampler2D srcTex;
uniform vec4 ScaleFactor;
uniform vec4 BaseColor;
void main(void)
{
int i;
vec4 sum = vec4(0.0);
for (i = 0; i < KernelSize; ++i) {
vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]);
sum += tmp * KernelValue[i];
}
gl_FragColor = sum * ScaleFactor + BaseColor;
}

View File

@@ -0,0 +1,5 @@
void main() {
gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

469
progs/glsl/convolutions.c Normal file
View File

@@ -0,0 +1,469 @@
/**
* Convolution with GLSL.
* Note: uses GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_fragment_shader,
* not the OpenGL 2.0 shader API.
* Author: Zack Rusin
*/
#define GL_GLEXT_PROTOTYPES
#include "readtex.h"
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
enum Filter {
GAUSSIAN_BLUR,
SHARPEN,
MEAN_REMOVAL,
EMBOSS,
EDGE_DETECT,
NO_FILTER,
LAST
};
#define QUIT LAST
struct BoundingBox {
float minx, miny, minz;
float maxx, maxy, maxz;
};
struct Texture {
GLuint id;
GLfloat x;
GLfloat y;
GLint width;
GLint height;
GLenum format;
};
static const char *textureLocation = "../images/girl2.rgb";
static GLfloat viewRotx = 0.0, viewRoty = 0.0, viewRotz = 0.0;
static struct BoundingBox box;
static struct Texture texture;
static GLuint program;
static GLint menuId;
static enum Filter filter = GAUSSIAN_BLUR;
static void checkError(int line)
{
GLenum err = glGetError();
if (err) {
printf("GL Error %s (0x%x) at line %d\n",
gluErrorString(err), (int) err, line);
}
}
static void loadAndCompileShader(GLuint shader, const char *text)
{
GLint stat;
glShaderSourceARB(shader, 1, (const GLchar **) &text, NULL);
glCompileShaderARB(shader);
glGetObjectParameterivARB(shader, GL_COMPILE_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
glGetInfoLogARB(shader, 1000, &len, log);
fprintf(stderr, "Problem compiling shader: %s\n", log);
exit(1);
}
else {
printf("Shader compiled OK\n");
}
}
static void readShader(GLuint shader, const char *filename)
{
const int max = 100*1000;
int n;
char *buffer = (char*) malloc(max);
FILE *f = fopen(filename, "r");
if (!f) {
fprintf(stderr, "Unable to open shader file %s\n", filename);
exit(1);
}
n = fread(buffer, 1, max, f);
printf("Read %d bytes from shader file %s\n", n, filename);
if (n > 0) {
buffer[n] = 0;
loadAndCompileShader(shader, buffer);
}
fclose(f);
free(buffer);
}
static void
checkLink(GLuint prog)
{
GLint stat;
glGetObjectParameterivARB(prog, GL_LINK_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
glGetInfoLogARB(prog, 1000, &len, log);
fprintf(stderr, "Linker error:\n%s\n", log);
}
else {
fprintf(stderr, "Link success!\n");
}
}
static void fillConvolution(GLint *k,
GLfloat *scale,
GLfloat *color)
{
switch(filter) {
case GAUSSIAN_BLUR:
k[0] = 1; k[1] = 2; k[2] = 1;
k[3] = 2; k[4] = 4; k[5] = 2;
k[6] = 1; k[7] = 2; k[8] = 1;
*scale = 1./16.;
break;
case SHARPEN:
k[0] = 0; k[1] = -2; k[2] = 0;
k[3] = -2; k[4] = 11; k[5] = -2;
k[6] = 0; k[7] = -2; k[8] = 0;
*scale = 1./3.;
break;
case MEAN_REMOVAL:
k[0] = -1; k[1] = -1; k[2] = -1;
k[3] = -1; k[4] = 9; k[5] = -1;
k[6] = -1; k[7] = -1; k[8] = -1;
*scale = 1./1.;
break;
case EMBOSS:
k[0] = -1; k[1] = 0; k[2] = -1;
k[3] = 0; k[4] = 4; k[5] = 0;
k[6] = -1; k[7] = 0; k[8] = -1;
*scale = 1./1.;
color[0] = 0.5;
color[1] = 0.5;
color[2] = 0.5;
color[3] = 0.5;
break;
case EDGE_DETECT:
k[0] = 1; k[1] = 1; k[2] = 1;
k[3] = 0; k[4] = 0; k[5] = 0;
k[6] = -1; k[7] = -1; k[8] = -1;
*scale = 1.;
color[0] = 0.5;
color[1] = 0.5;
color[2] = 0.5;
color[3] = 0.5;
break;
case NO_FILTER:
k[0] = 0; k[1] = 0; k[2] = 0;
k[3] = 0; k[4] = 1; k[5] = 0;
k[6] = 0; k[7] = 0; k[8] = 0;
*scale = 1.;
break;
default:
assert(!"Unhandled switch value");
}
}
static void setupConvolution()
{
GLint *kernel = (GLint*)malloc(sizeof(GLint) * 9);
GLfloat scale;
GLfloat *vecKer = (GLfloat*)malloc(sizeof(GLfloat) * 9 * 4);
GLuint loc;
GLuint i;
GLfloat baseColor[4];
baseColor[0] = 0;
baseColor[1] = 0;
baseColor[2] = 0;
baseColor[3] = 0;
fillConvolution(kernel, &scale, baseColor);
/*vector of 4*/
for (i = 0; i < 9; ++i) {
vecKer[i*4 + 0] = kernel[i];
vecKer[i*4 + 1] = kernel[i];
vecKer[i*4 + 2] = kernel[i];
vecKer[i*4 + 3] = kernel[i];
}
loc = glGetUniformLocationARB(program, "KernelValue");
glUniform4fvARB(loc, 9, vecKer);
loc = glGetUniformLocationARB(program, "ScaleFactor");
glUniform4fARB(loc, scale, scale, scale, scale);
loc = glGetUniformLocationARB(program, "BaseColor");
glUniform4fARB(loc, baseColor[0], baseColor[1],
baseColor[2], baseColor[3]);
free(vecKer);
free(kernel);
}
static void createProgram(const char *vertProgFile,
const char *fragProgFile)
{
GLuint fragShader = 0, vertShader = 0;
program = glCreateProgram();
if (vertProgFile) {
vertShader = glCreateShader(GL_VERTEX_SHADER);
readShader(vertShader, vertProgFile);
glAttachShader(program, vertShader);
}
if (fragProgFile) {
fragShader = glCreateShader(GL_FRAGMENT_SHADER);
readShader(fragShader, fragProgFile);
glAttachShader(program, fragShader);
}
glLinkProgramARB(program);
checkLink(program);
glUseProgramObjectARB(program);
/*
assert(glIsProgram(program));
assert(glIsShader(fragShader));
assert(glIsShader(vertShader));
*/
checkError(__LINE__);
{/*texture*/
GLuint texLoc = glGetUniformLocationARB(program, "srcTex");
glUniform1iARB(texLoc, 0);
}
{/*setup offsets */
float offsets[] = { 1.0 / texture.width, 1.0 / texture.height,
0.0 , 1.0 / texture.height,
-1.0 / texture.width, 1.0 / texture.height,
1.0 / texture.width, 0.0,
0.0 , 0.0,
-1.0 / texture.width, 0.0,
1.0 / texture.width, -1.0 / texture.height,
0.0 , -1.0 / texture.height,
-1.0 / texture.width, -1.0 / texture.height };
GLuint offsetLoc = glGetUniformLocationARB(program, "Offset");
glUniform2fvARB(offsetLoc, 9, offsets);
}
setupConvolution();
checkError(__LINE__);
}
static void readTexture(const char *filename)
{
GLubyte *data;
texture.x = 0;
texture.y = 0;
glGenTextures(1, &texture.id);
glBindTexture(GL_TEXTURE_2D, texture.id);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
data = LoadRGBImage(filename, &texture.width, &texture.height,
&texture.format);
if (!data) {
printf("Error: couldn't load texture image '%s'\n", filename);
exit(1);
}
printf("Texture %s (%d x %d)\n",
filename, texture.width, texture.height);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
texture.width, texture.height, 0, texture.format,
GL_UNSIGNED_BYTE, data);
}
static void menuSelected(int entry)
{
switch (entry) {
case QUIT:
exit(0);
break;
default:
filter = (enum Filter)entry;
}
setupConvolution();
glutPostRedisplay();
}
static void menuInit()
{
menuId = glutCreateMenu(menuSelected);
glutAddMenuEntry("Gaussian blur", GAUSSIAN_BLUR);
glutAddMenuEntry("Sharpen", SHARPEN);
glutAddMenuEntry("Mean removal", MEAN_REMOVAL);
glutAddMenuEntry("Emboss", EMBOSS);
glutAddMenuEntry("Edge detect", EDGE_DETECT);
glutAddMenuEntry("None", NO_FILTER);
glutAddMenuEntry("Quit", QUIT);
glutAttachMenu(GLUT_RIGHT_BUTTON);
}
static void init()
{
if (!glutExtensionSupported("GL_ARB_shader_objects") ||
!glutExtensionSupported("GL_ARB_vertex_shader") ||
!glutExtensionSupported("GL_ARB_fragment_shader")) {
fprintf(stderr, "Sorry, this program requires GL_ARB_shader_objects, GL_ARB_vertex_shader, and GL_ARB_fragment_shader\n");
exit(1);
}
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
menuInit();
readTexture(textureLocation);
createProgram("convolution.vert", "convolution.frag");
glEnable(GL_TEXTURE_2D);
glClearColor(1.0, 1.0, 1.0, 1.0);
/*glShadeModel(GL_SMOOTH);*/
glShadeModel(GL_FLAT);
}
static void reshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
box.minx = 0;
box.maxx = width;
box.miny = 0;
box.maxy = height;
box.minz = 0;
box.maxz = 1;
glOrtho(box.minx, box.maxx, box.miny, box.maxy, -999999, 999999);
glMatrixMode(GL_MODELVIEW);
}
static void keyPress(unsigned char key, int x, int y)
{
switch(key) {
case 27:
exit(0);
default:
return;
}
glutPostRedisplay();
}
static void
special(int k, int x, int y)
{
switch (k) {
case GLUT_KEY_UP:
viewRotx += 2.0;
break;
case GLUT_KEY_DOWN:
viewRotx -= 2.0;
break;
case GLUT_KEY_LEFT:
viewRoty += 2.0;
break;
case GLUT_KEY_RIGHT:
viewRoty -= 2.0;
break;
default:
return;
}
glutPostRedisplay();
}
static void draw()
{
GLfloat center[2];
GLfloat anchor[2];
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glPushMatrix();
center[0] = box.maxx/2;
center[1] = box.maxy/2;
anchor[0] = center[0] - texture.width/2;
anchor[1] = center[1] - texture.height/2;
glTranslatef(center[0], center[1], 0);
glRotatef(viewRotx, 1.0, 0.0, 0.0);
glRotatef(viewRoty, 0.0, 1.0, 0.0);
glRotatef(viewRotz, 0.0, 0.0, 1.0);
glTranslatef(-center[0], -center[1], 0);
glTranslatef(anchor[0], anchor[1], 0);
glBegin(GL_TRIANGLE_STRIP);
{
glColor3f(1., 0., 0.);
glTexCoord2f(0, 0);
glVertex3f(0, 0, 0);
glColor3f(0., 1., 0.);
glTexCoord2f(0, 1.0);
glVertex3f(0, texture.height, 0);
glColor3f(1., 0., 0.);
glTexCoord2f(1.0, 0);
glVertex3f(texture.width, 0, 0);
glColor3f(0., 1., 0.);
glTexCoord2f(1, 1);
glVertex3f(texture.width, texture.height, 0);
}
glEnd();
glPopMatrix();
glFlush();
glutSwapBuffers();
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE);
if (!glutCreateWindow("Image Convolutions")) {
fprintf(stderr, "Couldn't create window!\n");
exit(1);
}
init();
glutReshapeFunc(reshape);
glutKeyboardFunc(keyPress);
glutSpecialFunc(special);
glutDisplayFunc(draw);
glutMainLoop();
return 0;
}

View File

@@ -16,8 +16,8 @@
#include "shaderutil.h"
static char *FragProgFile = "CH18-mandel.frag.txt";
static char *VertProgFile = "CH18-mandel.vert.txt";
static char *FragProgFile = "CH18-mandel.frag";
static char *VertProgFile = "CH18-mandel.vert";
/* program/shader objects */
static GLuint fragShader;

View File

@@ -35,8 +35,8 @@
static const char *Demo = "multitex";
static const char *VertFile = "multitex.vert.txt";
static const char *FragFile = "multitex.frag.txt";
static const char *VertFile = "multitex.vert";
static const char *FragFile = "multitex.frag";
static const char *TexFiles[2] =
{

View File

@@ -9,7 +9,7 @@ uniform sampler2D tex2;
void main()
{
vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy, 0.0);
vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy, 0.0);
vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
gl_FragColor = mix(t1, t2, t2.w);
}

205
progs/glsl/pointcoord.c Normal file
View File

@@ -0,0 +1,205 @@
/**
* Test GLSL 1.20 gl_PointCoord fragment program attribute.
* Brian Paul
* 11 Aug 2007
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
#include "extfuncs.h"
#include "shaderutil.h"
static GLint WinWidth = 300, WinHeight = 300;
static char *FragProgFile = NULL;
static char *VertProgFile = NULL;
static GLuint fragShader;
static GLuint vertShader;
static GLuint program;
static GLint win = 0;
static GLint tex0;
static GLenum Filter = GL_NEAREST;
static void
Redisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
/* draw one point/sprite */
glPushMatrix();
glPointSize(60);
glBegin(GL_POINTS);
glVertex2f(WinWidth / 2.0f, WinHeight / 2.0f);
glEnd();
glPopMatrix();
glutSwapBuffers();
}
static void
Reshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, width, 0, height, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
WinWidth = width;
WinHeight = height;
}
static void
CleanUp(void)
{
glDeleteShader_func(fragShader);
glDeleteShader_func(vertShader);
glDeleteProgram_func(program);
glutDestroyWindow(win);
}
static void
Key(unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch(key) {
case 27:
CleanUp();
exit(0);
break;
}
glutPostRedisplay();
}
static void
MakeTexture(void)
{
#define SZ 16
GLubyte image[SZ][SZ][4];
GLuint i, j;
for (i = 0; i < SZ; i++) {
for (j = 0; j < SZ; j++) {
if ((i + j) & 1) {
image[i][j][0] = 0;
image[i][j][1] = 0;
image[i][j][2] = 0;
image[i][j][3] = 255;
}
else {
image[i][j][0] = j * 255 / (SZ-1);
image[i][j][1] = i * 255 / (SZ-1);
image[i][j][2] = 0;
image[i][j][3] = 255;
}
}
}
glActiveTexture(GL_TEXTURE0); /* unit 0 */
glBindTexture(GL_TEXTURE_2D, 42);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SZ, SZ, 0,
GL_RGBA, GL_UNSIGNED_BYTE, image);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
#undef SZ
}
static void
Init(void)
{
static const char *fragShaderText =
"#version 120 \n"
"uniform sampler2D tex0; \n"
"void main() { \n"
" gl_FragColor = texture2D(tex0, gl_PointCoord.xy, 0.0); \n"
"}\n";
static const char *vertShaderText =
"void main() {\n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
"}\n";
if (!ShadersSupported())
exit(1);
GetExtensionFuncs();
vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText);
fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText);
program = LinkShaders(vertShader, fragShader);
glUseProgram_func(program);
tex0 = glGetUniformLocation_func(program, "tex0");
printf("Uniforms: tex0: %d\n", tex0);
glUniform1i_func(tex0, 0); /* tex unit 0 */
/*assert(glGetError() == 0);*/
glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
assert(glIsProgram_func(program));
assert(glIsShader_func(fragShader));
assert(glIsShader_func(vertShader));
MakeTexture();
glEnable(GL_POINT_SPRITE);
glColor3f(1, 0, 0);
}
static void
ParseOptions(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-fs") == 0) {
FragProgFile = argv[i+1];
}
else if (strcmp(argv[i], "-vs") == 0) {
VertProgFile = argv[i+1];
}
}
}
int
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowPosition( 0, 0);
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
ParseOptions(argc, argv);
Init();
glutMainLoop();
return 0;
}

View File

@@ -35,11 +35,11 @@
static const char *Demo = "texdemo1";
static const char *ReflectVertFile = "reflect.vert.txt";
static const char *CubeFragFile = "cubemap.frag.txt";
static const char *ReflectVertFile = "reflect.vert";
static const char *CubeFragFile = "cubemap.frag";
static const char *SimpleVertFile = "simple.vert.txt";
static const char *SimpleTexFragFile = "shadowtex.frag.txt";
static const char *SimpleVertFile = "simple.vert";
static const char *SimpleTexFragFile = "shadowtex.frag";
static const char *GroundImage = "../images/tile.rgb";

View File

@@ -16,8 +16,8 @@
#include "shaderutil.h"
static char *FragProgFile = "CH11-toyball.frag.txt";
static char *VertProgFile = "CH11-toyball.vert.txt";
static char *FragProgFile = "CH11-toyball.frag";
static char *VertProgFile = "CH11-toyball.vert";
/* program/shader objects */
static GLuint fragShader;

View File

@@ -190,7 +190,7 @@ Init(void)
"}\n";
static const char *vertShaderText =
"void main() {\n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
" gl_Position = ftransform(); \n"
"}\n";
if (!ShadersSupported())

View File

@@ -28,7 +28,7 @@ static GLuint program;
static GLint win = 0;
static GLboolean anim = 0*GL_TRUE;
static GLboolean DetermineInFragProg = GL_TRUE;
static GLfloat Yrot = 0.0f;
static GLfloat Xrot = 30.0f;
static GLint u_fragface;
static GLenum FrontWinding = GL_CCW;
static int prevTime = 0;
@@ -41,7 +41,8 @@ static const GLfloat Green[4] = {0, 1, 0, 0};
static void
Redisplay(void)
{
float xmin = -1, xmax = 1, ymin = -1, ymax = 1;
int i;
float radius = 2;
glFrontFace(FrontWinding);
@@ -54,18 +55,22 @@ Redisplay(void)
glEnable(GL_VERTEX_PROGRAM_TWO_SIDE);
}
glClear(GL_COLOR_BUFFER_BIT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glPushMatrix();
glRotatef(Yrot, 0, 1, 0);
glRotatef(Xrot, 1, 0, 0);
glBegin(GL_POLYGON);
/* Draw a tristrip ring */
glBegin(GL_TRIANGLE_STRIP);
glColor4fv(Red);
glSecondaryColor3fv_func(Green);
glVertex2f(xmin, ymin);
glVertex2f(xmax, ymin);
glVertex2f(xmax, ymax);
glVertex2f(xmin, ymax);
for (i = 0; i < 20; i++) {
float a = i / 19.0 * M_PI * 2.0;
float x = radius * cos(a);
float y = radius * sin(a);
glVertex3f(x, -1, y);
glVertex3f(x, +1, y);
}
glEnd();
glPopMatrix();
@@ -86,7 +91,7 @@ Idle(void)
}
prevTime = curTime;
Yrot += dt * 0.1;
Xrot += dt * 0.1;
glutPostRedisplay();
}
@@ -98,7 +103,7 @@ Reshape(int width, int height)
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1, 1, 5, 15);
glFrustum(-ar, ar, -1, 1, 3, 25);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0, 0, -10);
@@ -141,12 +146,16 @@ Key(unsigned char key, int x, int y)
DetermineInFragProg = GL_FALSE;
break;
case 'r':
Yrot = 0;
/* reset */
Xrot = 30;
anim = 0;
glutIdleFunc(NULL);
break;
case 's':
Yrot += 5;
Xrot += 5;
break;
case 'S':
Xrot -= 5;
break;
case 'w':
if (FrontWinding == GL_CCW) {
@@ -173,12 +182,24 @@ Init(void)
static const char *fragShaderText =
"uniform bool fragface; \n"
"void main() { \n"
#if 0
" if (!fragface || gl_FrontFacing) { \n"
" gl_FragColor = gl_Color; \n"
" } \n"
" else { \n"
" gl_FragColor = 0.8 * gl_SecondaryColor; \n"
" } \n"
#else
" bool f = gl_FrontFacing; \n"
" if (f) { \n"
" gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); \n"
" } \n"
" else { \n"
" gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0); \n"
" } \n"
" //float g = float(gl_FrontFacing) * 0.5 + 0.5; \n"
" //gl_FragColor = vec4(g); \n"
#endif
"} \n";
static const char *vertShaderText =
"uniform bool fragface; \n"
@@ -218,6 +239,8 @@ Init(void)
assert(glIsProgram_func(program));
assert(glIsShader_func(fragShader));
assert(glIsShader_func(vertShader));
glEnable(GL_DEPTH_TEST);
}
@@ -246,6 +269,7 @@ Usage(void)
printf(" a - toggle animation\n");
printf(" s - step rotation\n");
printf(" w - toggle CW, CCW front-face winding\n");
printf("NOTE: red = front face, green = back face.\n");
}
@@ -255,7 +279,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitWindowPosition( 0, 0);
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);

View File

@@ -407,7 +407,10 @@ test(GLenum type, GLint bits, const char *filename)
glGetIntegerv(GL_ALPHA_BITS, &cBits);
assert(cBits == bits);
printf("Rendering %d bit/channel image: %s\n", bits, filename);
if (WriteFiles)
printf("Rendering %d bit/channel image: %s\n", bits, filename);
else
printf("Rendering %d bit/channel image\n", bits);
OSMesaColorClamp(GL_TRUE);
@@ -458,6 +461,8 @@ main( int argc, char *argv[] )
{
int i;
printf("Use -f to write image files\n");
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-f") == 0)
WriteFiles = GL_TRUE;

View File

@@ -31,27 +31,27 @@ clean:
#
cltest: cltest.o framework.o $(LIB_DEP)
$(CC) $(LDFLAGS) cltest.o framework.o $(LIBS) -o cltest
$(CC) $(CFLAGS) $(LDFLAGS) cltest.o framework.o $(LIBS) -o cltest
sotest: sotest.o framework.o $(LIB_DEP)
$(CC) $(LDFLAGS) sotest.o framework.o $(LIBS) -o sotest
$(CC) $(CFLAGS) $(LDFLAGS) sotest.o framework.o $(LIBS) -o sotest
vstest: vstest.o framework.o $(LIB_DEP)
$(CC) $(LDFLAGS) vstest.o framework.o $(LIBS) -o vstest
$(CC) $(CFLAGS) $(LDFLAGS) vstest.o framework.o $(LIBS) -o vstest
#
# objects
#
framework.o: framework.c framework.h
$(CC) -c -I$(INCDIR) framework.c -o framework.o
$(CC) -c -I$(INCDIR) $(CFLAGS) framework.c -o framework.o
cltest.o: cltest.c framework.h
$(CC) -c -I$(INCDIR) cltest.c -o cltest.o
$(CC) -c -I$(INCDIR) $(CFLAGS) cltest.c -o cltest.o
sotest.o: sotest.c framework.h
$(CC) -c -I$(INCDIR) sotest.c -o sotest.o
$(CC) -c -I$(INCDIR) $(CFLAGS) sotest.c -o sotest.o
vstest.o: vstest.c framework.h
$(CC) -c -I$(INCDIR) vstest.c -o vstest.o
$(CC) -c -I$(INCDIR) $(CFLAGS) vstest.c -o vstest.o

View File

@@ -16,6 +16,7 @@
static GLfloat Zrot = 0;
static GLboolean Anim = GL_TRUE;
static GLboolean HaveMultisample = GL_TRUE;
static GLboolean DoMultisample = GL_TRUE;
static void
@@ -86,7 +87,10 @@ Display( void )
glColor3f(1, 1, 1);
if (HaveMultisample) {
glRasterPos2f(-3.1, -1.6);
PrintString("MULTISAMPLE");
if (DoMultisample)
PrintString("MULTISAMPLE");
else
PrintString("MULTISAMPLE (off)");
}
glRasterPos2f(-0.8, -1.6);
PrintString("No antialiasing");
@@ -96,7 +100,8 @@ Display( void )
/* multisample */
if (HaveMultisample) {
glEnable(GL_DEPTH_TEST);
glEnable(GL_MULTISAMPLE_ARB);
if (DoMultisample)
glEnable(GL_MULTISAMPLE_ARB);
glPushMatrix();
glTranslatef(-2.5, 0, 0);
glPushMatrix();
@@ -173,6 +178,9 @@ Key( unsigned char key, int x, int y )
else
glutIdleFunc(NULL);
break;
case 'm':
DoMultisample = !DoMultisample;
break;
case 'z':
Zrot = (int) (Zrot - step);
break;

View File

@@ -16,7 +16,7 @@ TRACER = gltrace.so
default: $(TRACER)
$(TRACER): $(OBJECTS)
$(TOP)/bin/mklib -o $(TRACER) -noprefix -cplusplus \
$(MKLIB) -o $(TRACER) -noprefix -cplusplus -linker '$(CXX)' \
-ldflags '$(LDFLAGS)' $(MKLIB_OPTIONS) $(OBJECTS)
gltrace.cc: gltrace.py

View File

@@ -20,6 +20,8 @@
*/
#include "gltrace_support.h"
#include <cstdlib>
#include <cstring>
#include <assert.h>
#include <sstream>
#include <fstream>
@@ -136,7 +138,7 @@ namespace gltrace {
struct timeval now;
struct tm t;
static char *months[12] =
static char const *months[12] =
{
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"

View File

@@ -115,13 +115,13 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.
texrect: texrect.o readtex.o
$(CC) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
texrect.o: texrect.c readtex.h
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
invert: invert.o readtex.o
$(CC) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
invert.o: invert.c readtex.h
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@

View File

@@ -27,12 +27,15 @@ Init(void)
GLboolean
ShadersSupported(void)
{
const char *version;
version = (const char *) glGetString(GL_VERSION);
if (version[0] != '2' || version[1] != '.') {
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
return GL_FALSE;
const char *version = (const char *) glGetString(GL_VERSION);
if (version[0] == '2' && version[1] == '.') {
return GL_TRUE;
}
else if (glutExtensionSupported("GL_ARB_vertex_shader")
&& glutExtensionSupported("GL_ARB_fragment_shader")
&& glutExtensionSupported("GL_ARB_shader_objects")) {
fprintf(stderr, "Warning: Trying ARB GLSL instead of OpenGL 2.x. This may not work.\n");
return GL_TRUE;
}
return GL_TRUE;
}

View File

@@ -67,10 +67,10 @@ clean:
# special cases
pbinfo: pbinfo.o pbutil.o
$(CC) $(LDFLAGS) pbinfo.o pbutil.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) pbinfo.o pbutil.o $(LIBS) -o $@
pbdemo: pbdemo.o pbutil.o
$(CC) $(LDFLAGS) pbdemo.o pbutil.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) pbdemo.o pbutil.o $(LIBS) -o $@
pbinfo.o: pbinfo.c pbutil.h
$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbinfo.c
@@ -82,13 +82,13 @@ pbutil.o: pbutil.c pbutil.h
$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbutil.c
glxgears_fbconfig: glxgears_fbconfig.o pbutil.o
$(CC) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(LIBS) -o $@
glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h
$(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
xrotfontdemo: xrotfontdemo.o xuserotfont.o
$(CC) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
$(CC) $(CFLAGS) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
xuserotfont.o: xuserotfont.c xuserotfont.h
$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xuserotfont.c

View File

@@ -88,12 +88,18 @@ current_time(void)
#endif
/** Event handler results: */
#define NOP 0
#define EXIT 1
#define DRAW 2
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 GLboolean animate = GL_TRUE; /* Animation */
static GLfloat eyesep = 5.0; /* Eye separation. */
static GLfloat fix_point = 40.0; /* Fixation point distance. */
static GLfloat left, right, asp; /* Stereo frustum params. */
@@ -239,7 +245,7 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
static void
do_draw(void)
draw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -269,8 +275,9 @@ do_draw(void)
glPopMatrix();
}
static void
draw(void)
draw_gears(void)
{
if (stereo) {
/* First left eye. */
@@ -284,7 +291,7 @@ draw(void)
glPushMatrix();
glTranslated(+0.5 * eyesep, 0.0, 0.0);
do_draw();
draw();
glPopMatrix();
/* Then right eye. */
@@ -298,10 +305,50 @@ draw(void)
glPushMatrix();
glTranslated(-0.5 * eyesep, 0.0, 0.0);
do_draw();
draw();
glPopMatrix();
} else
do_draw();
}
else {
draw();
}
}
/** Draw single frame, do SwapBuffers, compute FPS */
static void
draw_frame(Display *dpy, Window win)
{
static int frames = 0;
static double tRot0 = -1.0, tRate0 = -1.0;
double dt, t = current_time();
if (tRot0 < 0.0)
tRot0 = t;
dt = t - tRot0;
tRot0 = t;
if (animate) {
/* advance rotation for next frame */
angle += 70.0 * dt; /* 70 degrees per second */
if (angle > 3600.0)
angle -= 3600.0;
}
draw_gears();
glXSwapBuffers(dpy, win);
frames++;
if (tRate0 < 0.0)
tRate0 = t;
if (t - tRate0 >= 5.0) {
GLfloat seconds = t - tRate0;
GLfloat fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds,
fps);
tRate0 = t;
frames = 0;
}
}
@@ -319,7 +366,8 @@ reshape(int width, int height)
left = -5.0 * ((w - 0.5 * eyesep) / fix_point);
right = 5.0 * ((w + 0.5 * eyesep) / fix_point);
} else {
}
else {
GLfloat h = (GLfloat) height / (GLfloat) width;
glMatrixMode(GL_PROJECTION);
@@ -430,6 +478,7 @@ 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;
/* XXX this is a bad way to get a borderless window! */
attr.override_redirect = fullscreen;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
@@ -463,79 +512,70 @@ make_window( Display *dpy, const char *name,
}
/**
* Handle one X event.
* \return NOP, EXIT or DRAW
*/
static int
handle_event(Display *dpy, Window win, XEvent *event)
{
switch (event->type) {
case Expose:
return DRAW;
case ConfigureNotify:
reshape(event->xconfigure.width, event->xconfigure.height);
break;
case KeyPress:
{
char buffer[10];
int r, code;
code = XLookupKeysym(&event->xkey, 0);
if (code == XK_Left) {
view_roty += 5.0;
}
else if (code == XK_Right) {
view_roty -= 5.0;
}
else if (code == XK_Up) {
view_rotx += 5.0;
}
else if (code == XK_Down) {
view_rotx -= 5.0;
}
else {
r = XLookupString(&event->xkey, buffer, sizeof(buffer),
NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return EXIT;
}
else if (buffer[0] == 'a' || buffer[0] == 'A') {
animate = !animate;
}
}
return DRAW;
}
}
return NOP;
}
static void
event_loop(Display *dpy, Window win)
{
while (1) {
while (XPending(dpy) > 0) {
int op;
while (!animate || XPending(dpy) > 0) {
XEvent event;
XNextEvent(dpy, &event);
switch (event.type) {
case Expose:
/* we'll redraw below */
break;
case ConfigureNotify:
reshape(event.xconfigure.width, event.xconfigure.height);
break;
case KeyPress:
{
char buffer[10];
int r, code;
code = XLookupKeysym(&event.xkey, 0);
if (code == XK_Left) {
view_roty += 5.0;
}
else if (code == XK_Right) {
view_roty -= 5.0;
}
else if (code == XK_Up) {
view_rotx += 5.0;
}
else if (code == XK_Down) {
view_rotx -= 5.0;
}
else {
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return;
}
}
}
}
op = handle_event(dpy, win, &event);
if (op == EXIT)
return;
else if (op == DRAW)
break;
}
{
static int frames = 0;
static double tRot0 = -1.0, tRate0 = -1.0;
double dt, t = current_time();
if (tRot0 < 0.0)
tRot0 = t;
dt = t - tRot0;
tRot0 = t;
/* advance rotation for next frame */
angle += 70.0 * dt; /* 70 degrees per second */
if (angle > 3600.0)
angle -= 3600.0;
draw();
glXSwapBuffers(dpy, win);
frames++;
if (tRate0 < 0.0)
tRate0 = t;
if (t - tRate0 >= 5.0) {
GLfloat seconds = t - tRate0;
GLfloat fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds,
fps);
tRate0 = t;
frames = 0;
}
}
draw_frame(dpy, win);
}
}
@@ -548,8 +588,7 @@ usage(void)
printf(" -stereo run in stereo mode\n");
printf(" -fullscreen run in fullscreen mode\n");
printf(" -info display OpenGL renderer info\n");
printf(" -winwidth <width> window width (default: 300)\n");
printf(" -winheight <height> window height (default: 300)\n");
printf(" -geometry WxH+X+Y window geometry\n");
}

View File

@@ -523,6 +523,13 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
printf("OpenGL vendor string: %s\n", glVendor);
printf("OpenGL renderer string: %s\n", glRenderer);
printf("OpenGL version string: %s\n", glVersion);
#ifdef GL_VERSION_2_0
if (glVersion[0] >= '2' && glVersion[1] == '.') {
char *v = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
printf("OpenGL shading language version string: %s\n", v);
}
#endif
printf("OpenGL extensions:\n");
print_extension_list(glExtensions);
if (limits)

View File

@@ -21,7 +21,7 @@ subdirs:
fi \
done
install:
install: $(TOP)/$(LIB_DIR)
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
@@ -29,7 +29,7 @@ install:
done
$(TOP)/$(LIB_DIR):
-mkdir $(TOP)/$(LIB_DIR)
-@test -d $(TOP)/$(LIB_DIR) || mkdir -p $(TOP)/$(LIB_DIR)
clean:

View File

@@ -21,8 +21,9 @@ default: $(TOP)/$(LIB_DIR)/demodriver.so
$(TOP)/$(LIB_DIR)/demodriver.so: $(OBJECTS)
$(TOP)/bin/mklib -o demodriver.so -noprefix -ldflags '$(LDFLAGS)' \
-install $(TOP)/$(LIB_DIR) $(OBJECTS)
$(MKLIB) -o demodriver.so -noprefix -linker '$(CC)' \
-ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \
$(OBJECTS)

View File

@@ -42,7 +42,8 @@ default: depend library Makefile
library: $(TOP)/$(LIB_DIR)/libEGLdri.so
$(TOP)/$(LIB_DIR)/libEGLdri.so: $(OBJECTS)
$(TOP)/bin/mklib -o EGLdri -ldflags '$(LDFLAGS)' -major 1 -minor 0 \
$(MKLIB) -o EGLdri -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major 1 -minor 0 \
-install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS)

View File

@@ -46,7 +46,8 @@ default: depend library
library: $(TOP)/$(LIB_DIR)/libEGL.so
$(TOP)/$(LIB_DIR)/libEGL.so: $(OBJECTS)
$(TOP)/bin/mklib -o EGL -ldflags '$(LDFLAGS)' -major 1 -minor 0 \
$(MKLIB) -o EGL -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major 1 -minor 0 \
-install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS)

View File

@@ -16,18 +16,20 @@ default: $(TOP)/configs/current
# GLU pkg-config file
pcedit = sed \
-e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's,@LIB_DIR@,$(LIB_DIR),' \
-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
-e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),'
glu.pc: glu.pc.in
$(pcedit) $< > $@
install: glu.pc
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
$(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
$(INSTALL) $(TOP)/$(LIB_DIR)/$(GLU_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR)
$(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
clean:
-@for dir in $(SUBDIRS) ; do \
(cd $$dir && $(MAKE) clean) ; \
done
-rm -f *.pc

View File

@@ -1,7 +1,7 @@
prefix=@INSTALL_DIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/@LIB_DIR@
includedir=${prefix}/include
libdir=@INSTALL_LIB_DIR@
includedir=@INSTALL_INC_DIR@
Name: glu
Description: Mesa OpenGL Utility library

View File

@@ -45,7 +45,7 @@ $(TOP)/$(LIB_DIR):
# Make the library:
$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
@ $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
@ $(MKLIB) -o $(GLU_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
$(GLU_LIB_DEPS) $(OBJECTS)

View File

@@ -136,9 +136,10 @@ $(TOP)/$(LIB_DIR):
# Make the library:
$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
$(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
$(MKLIB) -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
-major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
-cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
-exports glu.exports -id $(INSTALL_LIB_DIR)/lib$(GLU_LIB).$(GLU_MAJOR).dylib \
$(GLU_LIB_DEPS) $(OBJECTS)

59
src/glu/sgi/glu.exports Normal file
View File

@@ -0,0 +1,59 @@
gluBeginCurve
gluBeginPolygon
gluBeginSurface
gluBeginTrim
gluBuild1DMipmapLevels
gluBuild1DMipmaps
gluBuild2DMipmapLevels
gluBuild2DMipmaps
gluBuild3DMipmapLevels
gluBuild3DMipmaps
gluCheckExtension
gluCylinder
gluDeleteNurbsRenderer
gluDeleteQuadric
gluDeleteTess
gluDisk
gluEndCurve
gluEndPolygon
gluEndSurface
gluEndTrim
gluErrorString
gluGetNurbsProperty
gluGetString
gluGetTessProperty
gluLoadSamplingMatrices
gluLookAt
gluNewNurbsRenderer
gluNewQuadric
gluNewTess
gluNextContour
gluNurbsCallback
gluNurbsCallbackData
gluNurbsCallbackDataEXT
gluNurbsCurve
gluNurbsProperty
gluNurbsSurface
gluOrtho2D
gluPartialDisk
gluPerspective
gluPickMatrix
gluProject
gluPwlCurve
gluQuadricCallback
gluQuadricDrawStyle
gluQuadricNormals
gluQuadricOrientation
gluQuadricTexture
gluScaleImage
gluSphere
gluTessBeginContour
gluTessBeginPolygon
gluTessCallback
gluTessEndContour
gluTessEndPolygon
gluTessNormal
gluTessProperty
gluTessVertex
gluUnProject
gluUnProject4

View File

@@ -0,0 +1,59 @@
_gluBeginCurve
_gluBeginPolygon
_gluBeginSurface
_gluBeginTrim
_gluBuild1DMipmapLevels
_gluBuild1DMipmaps
_gluBuild2DMipmapLevels
_gluBuild2DMipmaps
_gluBuild3DMipmapLevels
_gluBuild3DMipmaps
_gluCheckExtension
_gluCylinder
_gluDeleteNurbsRenderer
_gluDeleteQuadric
_gluDeleteTess
_gluDisk
_gluEndCurve
_gluEndPolygon
_gluEndSurface
_gluEndTrim
_gluErrorString
_gluGetNurbsProperty
_gluGetString
_gluGetTessProperty
_gluLoadSamplingMatrices
_gluLookAt
_gluNewNurbsRenderer
_gluNewQuadric
_gluNewTess
_gluNextContour
_gluNurbsCallback
_gluNurbsCallbackData
_gluNurbsCallbackDataEXT
_gluNurbsCurve
_gluNurbsProperty
_gluNurbsSurface
_gluOrtho2D
_gluPartialDisk
_gluPerspective
_gluPickMatrix
_gluProject
_gluPwlCurve
_gluQuadricCallback
_gluQuadricDrawStyle
_gluQuadricNormals
_gluQuadricOrientation
_gluQuadricTexture
_gluScaleImage
_gluSphere
_gluTessBeginContour
_gluTessBeginPolygon
_gluTessCallback
_gluTessEndContour
_gluTessEndPolygon
_gluTessNormal
_gluTessProperty
_gluTessVertex
_gluUnProject
_gluUnProject4

View File

@@ -713,8 +713,8 @@ gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks)
GLfloat cosCache3b[CACHE_SIZE];
GLfloat angle;
GLfloat zLow, zHigh;
GLfloat sintemp1, sintemp2, sintemp3 = 0.0, sintemp4 = 0.0;
GLfloat costemp1, costemp2 = 0.0, costemp3 = 0.0, costemp4 = 0.0;
GLfloat sintemp1 = 0.0, sintemp2 = 0.0, sintemp3 = 0.0, sintemp4 = 0.0;
GLfloat costemp1 = 0.0, costemp2 = 0.0, costemp3 = 0.0, costemp4 = 0.0;
GLboolean needCache2, needCache3;
GLint start, finish;

View File

@@ -83,10 +83,10 @@ $(TOP)/$(LIB_DIR):
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
@$(TOP)/bin/mklib -o $(GLUT_LIB) -ldflags '$(LDFLAGS)' \
@$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(GLUT_LIB_DEPS) \
$(OBJECTS)
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
$(GLUT_LIB_DEPS) $(OBJECTS)
clean:
-rm -f *.o

View File

@@ -61,7 +61,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
$(MKLIB_OPTIONS) $(OBJECTS)

View File

@@ -63,16 +63,16 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
$(MKLIB_OPTIONS) $(OBJECTS)
install:
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL
$(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR)
# Run 'make -f Makefile.solo dep' to update the dependencies if you change
# what's included by any source file.

View File

@@ -32,7 +32,7 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \
-patch $(GLUT_TINY) $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
$(GLUT_LIB_DEPS) $(OBJECTS)

View File

@@ -91,33 +91,36 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
-id $(INSTALL_LIB_DIR)/lib$(GLUT_LIB).$(GLUT_MAJOR).dylib \
$(GLUT_LIB_DEPS) $(OBJECTS)
# glut pkgconfig file
pcedit = sed \
-e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's,@LIB_DIR@,$(LIB_DIR),' \
-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
-e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),'
glut.pc: glut.pc.in
$(pcedit) $< > $@
install: glut.pc
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL
$(INSTALL) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR)
$(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
clean:
-rm -f *.o *~
-rm -f *.lo
-rm -f *.la
-rm -f *.pc
-rm -rf .libs
-rm -f depend depend.bak

View File

@@ -1,7 +1,7 @@
prefix=@INSTALL_DIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/@LIB_DIR@
includedir=${prefix}/include
libdir=@INSTALL_LIB_DIR@
includedir=@INSTALL_INC_DIR@
Name: glut
Description: Mesa OpenGL Utility Toolkit library

View File

@@ -55,7 +55,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
$(MKLIB_OPTIONS) $(OBJECTS)
@@ -75,23 +75,24 @@ tags:
# glut pkgconfig file
pcedit = sed \
-e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's,@LIB_DIR@,$(LIB_DIR),' \
-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
-e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),'
glut.pc: glut.pc.in
$(pcedit) $< > $@
install: glut.pc
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
$(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
$(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL
$(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR)
$(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
# Remove .o and backup files
clean: depend
-rm -f depend depend.bak
-rm -f *.o *~ *.o *~ *.so libglut.so.3.7
-rm -f *.o *~ *.o *~ *.so *.pc libglut.so.3.7
include depend

View File

@@ -1,7 +1,7 @@
prefix=@INSTALL_DIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/@LIB_DIR@
includedir=${prefix}/include
libdir=@INSTALL_LIB_DIR@
includedir=@INSTALL_INC_DIR@
Name: glut
Description: Mesa OpenGL Utility Toolkit library

View File

@@ -1,420 +1,420 @@
/* WarpWin.c */
/* glut for Warp */
#include <stdio.h>
#include <string.h>
#include "WarpWin.h"
#include "WarpGL.h"
#define POKA 0
/* global variables that must be set for some functions to operate
correctly. */
HDC XHDC;
HWND XHWND;
void
XStoreColor(Display* display, Colormap colormap, XColor* color)
{
/* KLUDGE: set XHDC to 0 if the palette should NOT be realized after
setting the color. set XHDC to the correct HDC if it should. */
LONG pe;
ULONG cclr;
int r,g,b;
/* X11 stores color from 0-65535, Win32 expects them to be 0-256, so
twiddle the bits ( / 256). */
r = color->red / 256;
g = color->green / 256;
b = color->blue / 256;
pe = LONGFromRGB(r,g,b);
/* make sure we use this flag, otherwise the colors might get mapped
to another place in the colormap, and when we glIndex() that
color, it may have moved (argh!!) */
pe |= (PC_NOCOLLAPSE<<24);
/* This function changes the entries in a palette. */
#if POKA
OS2:
rc = GpiSetPaletteEntries(colormap,LCOLF_CONSECRGB, color->pixel, 1, &pe);
GpiSelectPalette(hps,colormap);
WinRealizePalette(hwnd,hps,&cclr);
source Win:
if (XHDC) {
UnrealizeObject(colormap);
SelectPalette(XHDC, colormap, FALSE);
RealizePalette(XHDC);
}
#endif
}
void
XSetWindowColormap(Display* display, Window window, Colormap colormap)
{
#if POKA
HDC hdc = GetDC(window);
/* if the third parameter is FALSE, the logical colormap is copied
into the device palette when the application is in the
foreground, if it is TRUE, the colors are mapped into the current
palette in the best possible way. */
SelectPalette(hdc, colormap, FALSE);
RealizePalette(hdc);
/* note that we don't have to release the DC, since our window class
uses the WC_OWNDC flag! */
#endif
}
/* display, root and visual - don't used at all */
Colormap
XCreateColormap(Display* display, Window root, Visual* visual, int alloc)
{
/* KLUDGE: this function needs XHDC to be set to the HDC currently
being operated on before it is invoked! */
HPAL palette;
int n;
#if POKA
PIXELFORMATDESCRIPTOR pfd;
LOGPALETTE *logical;
/* grab the pixel format */
memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
DescribePixelFormat(XHDC, GetPixelFormat(XHDC),
sizeof(PIXELFORMATDESCRIPTOR), &pfd);
if (!(pfd.dwFlags & PFD_NEED_PALETTE ||
pfd.iPixelType == PFD_TYPE_COLORINDEX))
{
return 0;
}
n = 1 << pfd.cColorBits;
/* allocate a bunch of memory for the logical palette (assume 256
colors in a Win32 palette */
logical = (LOGPALETTE*)malloc(sizeof(LOGPALETTE) +
sizeof(PALETTEENTRY) * n);
memset(logical, 0, sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * n);
/* set the entries in the logical palette */
logical->palVersion = 0x300;
logical->palNumEntries = n;
/* start with a copy of the current system palette */
GetSystemPaletteEntries(XHDC, 0, 256, &logical->palPalEntry[0]);
if (pfd.iPixelType == PFD_TYPE_RGBA) {
int redMask = (1 << pfd.cRedBits) - 1;
int greenMask = (1 << pfd.cGreenBits) - 1;
int blueMask = (1 << pfd.cBlueBits) - 1;
int i;
/* fill in an RGBA color palette */
for (i = 0; i < n; ++i) {
logical->palPalEntry[i].peRed =
(((i >> pfd.cRedShift) & redMask) * 255) / redMask;
logical->palPalEntry[i].peGreen =
(((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask;
logical->palPalEntry[i].peBlue =
(((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask;
logical->palPalEntry[i].peFlags = 0;
}
}
palette = CreatePalette(logical);
free(logical);
SelectPalette(XHDC, palette, FALSE);
RealizePalette(XHDC);
#endif /* POKA */
return palette;
}
int GetSystemMetrics( int mode)
{ RECTL rect;
switch(mode)
{ case SM_CXSCREEN:
WinQueryWindowRect(HWND_DESKTOP,&rect);
return (rect.xRight-rect.xLeft);
break;
case SM_CYSCREEN:
WinQueryWindowRect(HWND_DESKTOP,&rect);
return (rect.yTop-rect.yBottom);
break;
default: ;
}
return 0;
}
/*
* XParseGeometry parses strings of the form
* "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
* width, height, xoffset, and yoffset are unsigned integers.
* Example: "=80x24+300-49"
* The equal sign is optional.
* It returns a bitmask that indicates which of the four values
* were actually found in the string. For each value found,
* the corresponding argument is updated; for each value
* not found, the corresponding argument is left unchanged.
*/
static int
ReadInteger(char *string, char **NextString)
{
register int Result = 0;
int Sign = 1;
if (*string == '+')
string++;
else if (*string == '-')
{
string++;
Sign = -1;
}
for (; (*string >= '0') && (*string <= '9'); string++)
{
Result = (Result * 10) + (*string - '0');
}
*NextString = string;
if (Sign >= 0)
return (Result);
else
return (-Result);
}
int XParseGeometry(char *string, int *x, int *y, unsigned int *width, unsigned int *height)
{
int mask = NoValue;
register char *strind;
unsigned int tempWidth, tempHeight;
int tempX, tempY;
char *nextCharacter;
if ( (string == NULL) || (*string == '\0')) return(mask);
if (*string == '=')
string++; /* ignore possible '=' at beg of geometry spec */
strind = (char *)string;
if (*strind != '+' && *strind != '-' && *strind != 'x') {
tempWidth = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= WidthValue;
}
if (*strind == 'x' || *strind == 'X') {
strind++;
tempHeight = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= HeightValue;
}
if ((*strind == '+') || (*strind == '-')) {
if (*strind == '-') {
strind++;
tempX = -ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= XNegative;
}
else
{ strind++;
tempX = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
}
mask |= XValue;
if ((*strind == '+') || (*strind == '-')) {
if (*strind == '-') {
strind++;
tempY = -ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
mask |= YNegative;
}
else
{
strind++;
tempY = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
}
mask |= YValue;
}
}
/* If strind isn't at the end of the string the it's an invalid
geometry specification. */
if (*strind != '\0') return (0);
if (mask & XValue)
*x = tempX;
if (mask & YValue)
*y = tempY;
if (mask & WidthValue)
*width = tempWidth;
if (mask & HeightValue)
*height = tempHeight;
return (mask);
}
int gettimeofday(struct timeval* tp, void* tzp)
{
DATETIME DateTime;
APIRET ulrc; /* Return Code. */
ulrc = DosGetDateTime(&DateTime);
tp->tv_sec = 60 * (60*DateTime.hours + DateTime.minutes) + DateTime.seconds;
tp->tv_usec = DateTime.hundredths * 10000;
return 0;
}
int
XPending(Display* display)
{
/* similar functionality...I don't think that it is exact, but this
will have to do. */
QMSG msg;
extern HAB hab; /* PM anchor block handle */
//?? WinPeekMsg(hab
return WinPeekMsg(hab, &msg, NULLHANDLE, 0, 0, PM_NOREMOVE);
}
void
__glutAdjustCoords(Window parent, int* x, int* y, int* width, int* height)
{
RECTL rect;
/* adjust the window rectangle because Win32 thinks that the x, y,
width & height are the WHOLE window (including decorations),
whereas GLUT treats the x, y, width & height as only the CLIENT
area of the window. */
rect.xLeft = *x; rect.yTop = *y;
rect.xRight = *x + *width; rect.yBottom = *y + *height;
/* must adjust the coordinates according to the correct style
because depending on the style, there may or may not be
borders. */
//?? AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
//?? (parent ? WS_CHILD : WS_OVERLAPPEDWINDOW),
//?? FALSE);
/* FALSE in the third parameter = window has no menu bar */
/* readjust if the x and y are offscreen */
if(rect.xLeft < 0) {
*x = 0;
} else {
*x = rect.xLeft;
}
if(rect.yTop < 0) {
*y = 0;
} else {
*y = rect.yTop;
}
*width = rect.xRight - rect.xLeft; /* adjusted width */
*height = -(rect.yBottom - rect.yTop); /* adjusted height */
}
int
__glutGetTransparentPixel(Display * dpy, XVisualInfo * vinfo)
{
/* the transparent pixel on Win32 is always index number 0. So if
we put this routine in this file, we can avoid compiling the
whole of layerutil.c which is where this routine normally comes
from. */
return 0;
}
/* Translate point coordinates src_x and src_y from src to dst */
Bool
XTranslateCoordinates(Display *display, Window src, Window dst,
int src_x, int src_y,
int* dest_x_return, int* dest_y_return,
Window* child_return)
{
SWP swp_src,swp_dst;
WinQueryWindowPos(src,&swp_src);
WinQueryWindowPos(dst,&swp_dst);
*dest_x_return = src_x + swp_src.x - swp_dst.x;
*dest_y_return = src_y + swp_src.y - swp_dst.y;
/* just to make compilers happy...we don't use the return value. */
return True;
}
Status
XGetGeometry(Display* display, Window window, Window* root_return,
int* x_return, int* y_return,
unsigned int* width_return, unsigned int* height_return,
unsigned int *border_width_return, unsigned int* depth_return)
{
/* KLUDGE: doesn't return the border_width or depth or root, x & y
are in screen coordinates. */
SWP swp_src;
WinQueryWindowPos(window,&swp_src);
*x_return = swp_src.x;
*y_return = swp_src.y;
*width_return = swp_src.cx;
*height_return = swp_src.cy;
/* just to make compilers happy...we don't use the return value. */
return 1;
}
/* Get Display Width in millimeters */
int
DisplayWidthMM(Display* display, int screen)
{
int width;
LONG *pVC_Caps;
pVC_Caps = GetVideoConfig(NULLHANDLE);
width = (int)( 0.001 * pVC_Caps[CAPS_WIDTH] / pVC_Caps[CAPS_HORIZONTAL_RESOLUTION]);/* mm */
return width;
}
/* Get Display Height in millimeters */
int
DisplayHeightMM(Display* display, int screen)
{
int height;
LONG *pVC_Caps;
pVC_Caps = GetVideoConfig(NULLHANDLE);
height = (int)( 0.001 * pVC_Caps[CAPS_HEIGHT] / pVC_Caps[CAPS_VERTICAL_RESOLUTION]); /* mm */
return height;
}
void ScreenToClient( HWND hwnd, POINTL *point)
{
SWP swp_src;
WinQueryWindowPos(hwnd,&swp_src);
point->x -= swp_src.x;
point->y -= swp_src.y;
}
/* WarpWin.c */
/* glut for Warp */
#include <stdio.h>
#include <string.h>
#include "WarpWin.h"
#include "WarpGL.h"
#define POKA 0
/* global variables that must be set for some functions to operate
correctly. */
HDC XHDC;
HWND XHWND;
void
XStoreColor(Display* display, Colormap colormap, XColor* color)
{
/* KLUDGE: set XHDC to 0 if the palette should NOT be realized after
setting the color. set XHDC to the correct HDC if it should. */
LONG pe;
ULONG cclr;
int r,g,b;
/* X11 stores color from 0-65535, Win32 expects them to be 0-256, so
twiddle the bits ( / 256). */
r = color->red / 256;
g = color->green / 256;
b = color->blue / 256;
pe = LONGFromRGB(r,g,b);
/* make sure we use this flag, otherwise the colors might get mapped
to another place in the colormap, and when we glIndex() that
color, it may have moved (argh!!) */
pe |= (PC_NOCOLLAPSE<<24);
/* This function changes the entries in a palette. */
#if POKA
OS2:
rc = GpiSetPaletteEntries(colormap,LCOLF_CONSECRGB, color->pixel, 1, &pe);
GpiSelectPalette(hps,colormap);
WinRealizePalette(hwnd,hps,&cclr);
source Win:
if (XHDC) {
UnrealizeObject(colormap);
SelectPalette(XHDC, colormap, FALSE);
RealizePalette(XHDC);
}
#endif
}
void
XSetWindowColormap(Display* display, Window window, Colormap colormap)
{
#if POKA
HDC hdc = GetDC(window);
/* if the third parameter is FALSE, the logical colormap is copied
into the device palette when the application is in the
foreground, if it is TRUE, the colors are mapped into the current
palette in the best possible way. */
SelectPalette(hdc, colormap, FALSE);
RealizePalette(hdc);
/* note that we don't have to release the DC, since our window class
uses the WC_OWNDC flag! */
#endif
}
/* display, root and visual - don't used at all */
Colormap
XCreateColormap(Display* display, Window root, Visual* visual, int alloc)
{
/* KLUDGE: this function needs XHDC to be set to the HDC currently
being operated on before it is invoked! */
HPAL palette;
int n;
#if POKA
PIXELFORMATDESCRIPTOR pfd;
LOGPALETTE *logical;
/* grab the pixel format */
memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
DescribePixelFormat(XHDC, GetPixelFormat(XHDC),
sizeof(PIXELFORMATDESCRIPTOR), &pfd);
if (!(pfd.dwFlags & PFD_NEED_PALETTE ||
pfd.iPixelType == PFD_TYPE_COLORINDEX))
{
return 0;
}
n = 1 << pfd.cColorBits;
/* allocate a bunch of memory for the logical palette (assume 256
colors in a Win32 palette */
logical = (LOGPALETTE*)malloc(sizeof(LOGPALETTE) +
sizeof(PALETTEENTRY) * n);
memset(logical, 0, sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * n);
/* set the entries in the logical palette */
logical->palVersion = 0x300;
logical->palNumEntries = n;
/* start with a copy of the current system palette */
GetSystemPaletteEntries(XHDC, 0, 256, &logical->palPalEntry[0]);
if (pfd.iPixelType == PFD_TYPE_RGBA) {
int redMask = (1 << pfd.cRedBits) - 1;
int greenMask = (1 << pfd.cGreenBits) - 1;
int blueMask = (1 << pfd.cBlueBits) - 1;
int i;
/* fill in an RGBA color palette */
for (i = 0; i < n; ++i) {
logical->palPalEntry[i].peRed =
(((i >> pfd.cRedShift) & redMask) * 255) / redMask;
logical->palPalEntry[i].peGreen =
(((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask;
logical->palPalEntry[i].peBlue =
(((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask;
logical->palPalEntry[i].peFlags = 0;
}
}
palette = CreatePalette(logical);
free(logical);
SelectPalette(XHDC, palette, FALSE);
RealizePalette(XHDC);
#endif /* POKA */
return palette;
}
int GetSystemMetrics( int mode)
{ RECTL rect;
switch(mode)
{ case SM_CXSCREEN:
WinQueryWindowRect(HWND_DESKTOP,&rect);
return (rect.xRight-rect.xLeft);
break;
case SM_CYSCREEN:
WinQueryWindowRect(HWND_DESKTOP,&rect);
return (rect.yTop-rect.yBottom);
break;
default: ;
}
return 0;
}
/*
* XParseGeometry parses strings of the form
* "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
* width, height, xoffset, and yoffset are unsigned integers.
* Example: "=80x24+300-49"
* The equal sign is optional.
* It returns a bitmask that indicates which of the four values
* were actually found in the string. For each value found,
* the corresponding argument is updated; for each value
* not found, the corresponding argument is left unchanged.
*/
static int
ReadInteger(char *string, char **NextString)
{
register int Result = 0;
int Sign = 1;
if (*string == '+')
string++;
else if (*string == '-')
{
string++;
Sign = -1;
}
for (; (*string >= '0') && (*string <= '9'); string++)
{
Result = (Result * 10) + (*string - '0');
}
*NextString = string;
if (Sign >= 0)
return (Result);
else
return (-Result);
}
int XParseGeometry(char *string, int *x, int *y, unsigned int *width, unsigned int *height)
{
int mask = NoValue;
register char *strind;
unsigned int tempWidth, tempHeight;
int tempX, tempY;
char *nextCharacter;
if ( (string == NULL) || (*string == '\0')) return(mask);
if (*string == '=')
string++; /* ignore possible '=' at beg of geometry spec */
strind = (char *)string;
if (*strind != '+' && *strind != '-' && *strind != 'x') {
tempWidth = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= WidthValue;
}
if (*strind == 'x' || *strind == 'X') {
strind++;
tempHeight = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= HeightValue;
}
if ((*strind == '+') || (*strind == '-')) {
if (*strind == '-') {
strind++;
tempX = -ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= XNegative;
}
else
{ strind++;
tempX = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
}
mask |= XValue;
if ((*strind == '+') || (*strind == '-')) {
if (*strind == '-') {
strind++;
tempY = -ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
mask |= YNegative;
}
else
{
strind++;
tempY = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
}
mask |= YValue;
}
}
/* If strind isn't at the end of the string the it's an invalid
geometry specification. */
if (*strind != '\0') return (0);
if (mask & XValue)
*x = tempX;
if (mask & YValue)
*y = tempY;
if (mask & WidthValue)
*width = tempWidth;
if (mask & HeightValue)
*height = tempHeight;
return (mask);
}
int gettimeofday(struct timeval* tp, void* tzp)
{
DATETIME DateTime;
APIRET ulrc; /* Return Code. */
ulrc = DosGetDateTime(&DateTime);
tp->tv_sec = 60 * (60*DateTime.hours + DateTime.minutes) + DateTime.seconds;
tp->tv_usec = DateTime.hundredths * 10000;
return 0;
}
int
XPending(Display* display)
{
/* similar functionality...I don't think that it is exact, but this
will have to do. */
QMSG msg;
extern HAB hab; /* PM anchor block handle */
//?? WinPeekMsg(hab
return WinPeekMsg(hab, &msg, NULLHANDLE, 0, 0, PM_NOREMOVE);
}
void
__glutAdjustCoords(Window parent, int* x, int* y, int* width, int* height)
{
RECTL rect;
/* adjust the window rectangle because Win32 thinks that the x, y,
width & height are the WHOLE window (including decorations),
whereas GLUT treats the x, y, width & height as only the CLIENT
area of the window. */
rect.xLeft = *x; rect.yTop = *y;
rect.xRight = *x + *width; rect.yBottom = *y + *height;
/* must adjust the coordinates according to the correct style
because depending on the style, there may or may not be
borders. */
//?? AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
//?? (parent ? WS_CHILD : WS_OVERLAPPEDWINDOW),
//?? FALSE);
/* FALSE in the third parameter = window has no menu bar */
/* readjust if the x and y are offscreen */
if(rect.xLeft < 0) {
*x = 0;
} else {
*x = rect.xLeft;
}
if(rect.yTop < 0) {
*y = 0;
} else {
*y = rect.yTop;
}
*width = rect.xRight - rect.xLeft; /* adjusted width */
*height = -(rect.yBottom - rect.yTop); /* adjusted height */
}
int
__glutGetTransparentPixel(Display * dpy, XVisualInfo * vinfo)
{
/* the transparent pixel on Win32 is always index number 0. So if
we put this routine in this file, we can avoid compiling the
whole of layerutil.c which is where this routine normally comes
from. */
return 0;
}
/* Translate point coordinates src_x and src_y from src to dst */
Bool
XTranslateCoordinates(Display *display, Window src, Window dst,
int src_x, int src_y,
int* dest_x_return, int* dest_y_return,
Window* child_return)
{
SWP swp_src,swp_dst;
WinQueryWindowPos(src,&swp_src);
WinQueryWindowPos(dst,&swp_dst);
*dest_x_return = src_x + swp_src.x - swp_dst.x;
*dest_y_return = src_y + swp_src.y - swp_dst.y;
/* just to make compilers happy...we don't use the return value. */
return True;
}
Status
XGetGeometry(Display* display, Window window, Window* root_return,
int* x_return, int* y_return,
unsigned int* width_return, unsigned int* height_return,
unsigned int *border_width_return, unsigned int* depth_return)
{
/* KLUDGE: doesn't return the border_width or depth or root, x & y
are in screen coordinates. */
SWP swp_src;
WinQueryWindowPos(window,&swp_src);
*x_return = swp_src.x;
*y_return = swp_src.y;
*width_return = swp_src.cx;
*height_return = swp_src.cy;
/* just to make compilers happy...we don't use the return value. */
return 1;
}
/* Get Display Width in millimeters */
int
DisplayWidthMM(Display* display, int screen)
{
int width;
LONG *pVC_Caps;
pVC_Caps = GetVideoConfig(NULLHANDLE);
width = (int)( 0.001 * pVC_Caps[CAPS_WIDTH] / pVC_Caps[CAPS_HORIZONTAL_RESOLUTION]);/* mm */
return width;
}
/* Get Display Height in millimeters */
int
DisplayHeightMM(Display* display, int screen)
{
int height;
LONG *pVC_Caps;
pVC_Caps = GetVideoConfig(NULLHANDLE);
height = (int)( 0.001 * pVC_Caps[CAPS_HEIGHT] / pVC_Caps[CAPS_VERTICAL_RESOLUTION]); /* mm */
return height;
}
void ScreenToClient( HWND hwnd, POINTL *point)
{
SWP swp_src;
WinQueryWindowPos(hwnd,&swp_src);
point->x -= swp_src.x;
point->y -= swp_src.y;
}


View File

@@ -1,259 +1,259 @@
/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
#include <stdlib.h>
#include "glutint.h"
#if defined(__OS2PM__)
#define IsWindowVisible WinIsWindowVisible
#endif
#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i)))
/* CENTRY */
void GLUTAPIENTRY
glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue)
{
GLUTcolormap *cmap, *newcmap;
XVisualInfo *vis;
XColor color;
int i;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
cmap = __glutCurrentWindow->colormap;
vis = __glutCurrentWindow->vis;
} else {
cmap = __glutCurrentWindow->overlay->colormap;
vis = __glutCurrentWindow->overlay->vis;
if (ndx == __glutCurrentWindow->overlay->transparentPixel) {
__glutWarning(
"glutSetColor: cannot set color of overlay transparent index %d\n",
ndx);
return;
}
}
if (!cmap) {
__glutWarning("glutSetColor: current window is RGBA");
return;
}
#if defined(_WIN32) || defined(__OS2PM__)
if (ndx >= 256 || /* always assume 256 colors on Win32 */
#else
if (ndx >= vis->visual->map_entries ||
#endif
ndx < 0) {
__glutWarning("glutSetColor: index %d out of range", ndx);
return;
}
if (cmap->refcnt > 1) {
newcmap = __glutAssociateNewColormap(vis);
cmap->refcnt--;
/* Wouldn't it be nice if XCopyColormapAndFree could be
told not to free the old colormap's entries! */
for (i = cmap->size - 1; i >= 0; i--) {
if (i == ndx) {
/* We are going to set this cell shortly! */
continue;
}
if (cmap->cells[i].component[GLUT_RED] >= 0.0) {
color.pixel = i;
newcmap->cells[i].component[GLUT_RED] =
cmap->cells[i].component[GLUT_RED];
color.red = (GLfloat) 0xffff *
cmap->cells[i].component[GLUT_RED];
newcmap->cells[i].component[GLUT_GREEN] =
cmap->cells[i].component[GLUT_GREEN];
color.green = (GLfloat) 0xffff *
cmap->cells[i].component[GLUT_GREEN];
newcmap->cells[i].component[GLUT_BLUE] =
cmap->cells[i].component[GLUT_BLUE];
color.blue = (GLfloat) 0xffff *
cmap->cells[i].component[GLUT_BLUE];
color.flags = DoRed | DoGreen | DoBlue;
#if defined(_WIN32) || defined(__OS2PM__)
if (IsWindowVisible(__glutCurrentWindow->win)) {
XHDC = __glutCurrentWindow->hdc;
} else {
XHDC = 0;
}
#endif
XStoreColor(__glutDisplay, newcmap->cmap, &color);
} else {
/* Leave unallocated entries unallocated. */
}
}
cmap = newcmap;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
__glutCurrentWindow->colormap = cmap;
__glutCurrentWindow->cmap = cmap->cmap;
} else {
__glutCurrentWindow->overlay->colormap = cmap;
__glutCurrentWindow->overlay->cmap = cmap->cmap;
}
XSetWindowColormap(__glutDisplay,
__glutCurrentWindow->renderWin, cmap->cmap);
#if !defined(_WIN32) && !defined(__OS2PM__)
{
GLUTwindow *toplevel;
toplevel = __glutToplevelOf(__glutCurrentWindow);
if (toplevel->cmap != cmap->cmap) {
__glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK);
}
}
#endif
}
color.pixel = ndx;
red = CLAMP(red);
cmap->cells[ndx].component[GLUT_RED] = red;
color.red = (GLfloat) 0xffff *red;
green = CLAMP(green);
cmap->cells[ndx].component[GLUT_GREEN] = green;
color.green = (GLfloat) 0xffff *green;
blue = CLAMP(blue);
cmap->cells[ndx].component[GLUT_BLUE] = blue;
color.blue = (GLfloat) 0xffff *blue;
color.flags = DoRed | DoGreen | DoBlue;
#if defined(_WIN32) || defined(__OS2PM__)
if (IsWindowVisible(__glutCurrentWindow->win)) {
XHDC = __glutCurrentWindow->hdc;
} else {
XHDC = 0;
}
#endif
XStoreColor(__glutDisplay, cmap->cmap, &color);
}
GLfloat GLUTAPIENTRY
glutGetColor(int ndx, int comp)
{
GLUTcolormap *colormap;
XVisualInfo *vis;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
colormap = __glutCurrentWindow->colormap;
vis = __glutCurrentWindow->vis;
} else {
colormap = __glutCurrentWindow->overlay->colormap;
vis = __glutCurrentWindow->overlay->vis;
if (ndx == __glutCurrentWindow->overlay->transparentPixel) {
__glutWarning("glutGetColor: requesting overlay transparent index %d\n",
ndx);
return -1.0;
}
}
if (!colormap) {
__glutWarning("glutGetColor: current window is RGBA");
return -1.0;
}
#if defined(_WIN32) || defined(__OS2PM__)
#define OUT_OF_RANGE_NDX(ndx) (ndx >= 256 || ndx < 0)
#else
#define OUT_OF_RANGE_NDX(ndx) (ndx >= vis->visual->map_entries || ndx < 0)
#endif
if (OUT_OF_RANGE_NDX(ndx)) {
__glutWarning("glutGetColor: index %d out of range", ndx);
return -1.0;
}
return colormap->cells[ndx].component[comp];
}
void GLUTAPIENTRY
glutCopyColormap(int winnum)
{
GLUTwindow *window = __glutWindowList[winnum - 1];
GLUTcolormap *oldcmap, *newcmap;
XVisualInfo *dstvis;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
oldcmap = __glutCurrentWindow->colormap;
dstvis = __glutCurrentWindow->vis;
newcmap = window->colormap;
} else {
oldcmap = __glutCurrentWindow->overlay->colormap;
dstvis = __glutCurrentWindow->overlay->vis;
if (!window->overlay) {
__glutWarning("glutCopyColormap: window %d has no overlay", winnum);
return;
}
newcmap = window->overlay->colormap;
}
if (!oldcmap) {
__glutWarning("glutCopyColormap: destination colormap must be color index");
return;
}
if (!newcmap) {
__glutWarning(
"glutCopyColormap: source colormap of window %d must be color index",
winnum);
return;
}
if (newcmap == oldcmap) {
/* Source and destination are the same; now copy needed. */
return;
}
#if !defined(_WIN32) && !defined(__OS2PM__)
/* Play safe: compare visual IDs, not Visual*'s. */
if (newcmap->visual->visualid == oldcmap->visual->visualid) {
#endif
/* Visuals match! "Copy" by reference... */
__glutFreeColormap(oldcmap);
newcmap->refcnt++;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
__glutCurrentWindow->colormap = newcmap;
__glutCurrentWindow->cmap = newcmap->cmap;
} else {
__glutCurrentWindow->overlay->colormap = newcmap;
__glutCurrentWindow->overlay->cmap = newcmap->cmap;
}
XSetWindowColormap(__glutDisplay, __glutCurrentWindow->renderWin,
newcmap->cmap);
#if !defined(_WIN32) && !defined(__OS2PM__)
__glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK);
bla bla bla
} else {
GLUTcolormap *copycmap;
XColor color;
int i, last;
/* Visuals different - need a distinct X colormap! */
copycmap = __glutAssociateNewColormap(dstvis);
/* Wouldn't it be nice if XCopyColormapAndFree could be
told not to free the old colormap's entries! */
last = newcmap->size;
if (last > copycmap->size) {
last = copycmap->size;
}
for (i = last - 1; i >= 0; i--) {
if (newcmap->cells[i].component[GLUT_RED] >= 0.0) {
color.pixel = i;
copycmap->cells[i].component[GLUT_RED] =
newcmap->cells[i].component[GLUT_RED];
color.red = (GLfloat) 0xffff *
newcmap->cells[i].component[GLUT_RED];
copycmap->cells[i].component[GLUT_GREEN] =
newcmap->cells[i].component[GLUT_GREEN];
color.green = (GLfloat) 0xffff *
newcmap->cells[i].component[GLUT_GREEN];
copycmap->cells[i].component[GLUT_BLUE] =
newcmap->cells[i].component[GLUT_BLUE];
color.blue = (GLfloat) 0xffff *
newcmap->cells[i].component[GLUT_BLUE];
color.flags = DoRed | DoGreen | DoBlue;
XStoreColor(__glutDisplay, copycmap->cmap, &color);
}
}
}
#endif
}
/* ENDCENTRY */
/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
#include <stdlib.h>
#include "glutint.h"
#if defined(__OS2PM__)
#define IsWindowVisible WinIsWindowVisible
#endif
#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i)))
/* CENTRY */
void GLUTAPIENTRY
glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue)
{
GLUTcolormap *cmap, *newcmap;
XVisualInfo *vis;
XColor color;
int i;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
cmap = __glutCurrentWindow->colormap;
vis = __glutCurrentWindow->vis;
} else {
cmap = __glutCurrentWindow->overlay->colormap;
vis = __glutCurrentWindow->overlay->vis;
if (ndx == __glutCurrentWindow->overlay->transparentPixel) {
__glutWarning(
"glutSetColor: cannot set color of overlay transparent index %d\n",
ndx);
return;
}
}
if (!cmap) {
__glutWarning("glutSetColor: current window is RGBA");
return;
}
#if defined(_WIN32) || defined(__OS2PM__)
if (ndx >= 256 || /* always assume 256 colors on Win32 */
#else
if (ndx >= vis->visual->map_entries ||
#endif
ndx < 0) {
__glutWarning("glutSetColor: index %d out of range", ndx);
return;
}
if (cmap->refcnt > 1) {
newcmap = __glutAssociateNewColormap(vis);
cmap->refcnt--;
/* Wouldn't it be nice if XCopyColormapAndFree could be
told not to free the old colormap's entries! */
for (i = cmap->size - 1; i >= 0; i--) {
if (i == ndx) {
/* We are going to set this cell shortly! */
continue;
}
if (cmap->cells[i].component[GLUT_RED] >= 0.0) {
color.pixel = i;
newcmap->cells[i].component[GLUT_RED] =
cmap->cells[i].component[GLUT_RED];
color.red = (GLfloat) 0xffff *
cmap->cells[i].component[GLUT_RED];
newcmap->cells[i].component[GLUT_GREEN] =
cmap->cells[i].component[GLUT_GREEN];
color.green = (GLfloat) 0xffff *
cmap->cells[i].component[GLUT_GREEN];
newcmap->cells[i].component[GLUT_BLUE] =
cmap->cells[i].component[GLUT_BLUE];
color.blue = (GLfloat) 0xffff *
cmap->cells[i].component[GLUT_BLUE];
color.flags = DoRed | DoGreen | DoBlue;
#if defined(_WIN32) || defined(__OS2PM__)
if (IsWindowVisible(__glutCurrentWindow->win)) {
XHDC = __glutCurrentWindow->hdc;
} else {
XHDC = 0;
}
#endif
XStoreColor(__glutDisplay, newcmap->cmap, &color);
} else {
/* Leave unallocated entries unallocated. */
}
}
cmap = newcmap;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
__glutCurrentWindow->colormap = cmap;
__glutCurrentWindow->cmap = cmap->cmap;
} else {
__glutCurrentWindow->overlay->colormap = cmap;
__glutCurrentWindow->overlay->cmap = cmap->cmap;
}
XSetWindowColormap(__glutDisplay,
__glutCurrentWindow->renderWin, cmap->cmap);
#if !defined(_WIN32) && !defined(__OS2PM__)
{
GLUTwindow *toplevel;
toplevel = __glutToplevelOf(__glutCurrentWindow);
if (toplevel->cmap != cmap->cmap) {
__glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK);
}
}
#endif
}
color.pixel = ndx;
red = CLAMP(red);
cmap->cells[ndx].component[GLUT_RED] = red;
color.red = (GLfloat) 0xffff *red;
green = CLAMP(green);
cmap->cells[ndx].component[GLUT_GREEN] = green;
color.green = (GLfloat) 0xffff *green;
blue = CLAMP(blue);
cmap->cells[ndx].component[GLUT_BLUE] = blue;
color.blue = (GLfloat) 0xffff *blue;
color.flags = DoRed | DoGreen | DoBlue;
#if defined(_WIN32) || defined(__OS2PM__)
if (IsWindowVisible(__glutCurrentWindow->win)) {
XHDC = __glutCurrentWindow->hdc;
} else {
XHDC = 0;
}
#endif
XStoreColor(__glutDisplay, cmap->cmap, &color);
}
GLfloat GLUTAPIENTRY
glutGetColor(int ndx, int comp)
{
GLUTcolormap *colormap;
XVisualInfo *vis;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
colormap = __glutCurrentWindow->colormap;
vis = __glutCurrentWindow->vis;
} else {
colormap = __glutCurrentWindow->overlay->colormap;
vis = __glutCurrentWindow->overlay->vis;
if (ndx == __glutCurrentWindow->overlay->transparentPixel) {
__glutWarning("glutGetColor: requesting overlay transparent index %d\n",
ndx);
return -1.0;
}
}
if (!colormap) {
__glutWarning("glutGetColor: current window is RGBA");
return -1.0;
}
#if defined(_WIN32) || defined(__OS2PM__)
#define OUT_OF_RANGE_NDX(ndx) (ndx >= 256 || ndx < 0)
#else
#define OUT_OF_RANGE_NDX(ndx) (ndx >= vis->visual->map_entries || ndx < 0)
#endif
if (OUT_OF_RANGE_NDX(ndx)) {
__glutWarning("glutGetColor: index %d out of range", ndx);
return -1.0;
}
return colormap->cells[ndx].component[comp];
}
void GLUTAPIENTRY
glutCopyColormap(int winnum)
{
GLUTwindow *window = __glutWindowList[winnum - 1];
GLUTcolormap *oldcmap, *newcmap;
XVisualInfo *dstvis;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
oldcmap = __glutCurrentWindow->colormap;
dstvis = __glutCurrentWindow->vis;
newcmap = window->colormap;
} else {
oldcmap = __glutCurrentWindow->overlay->colormap;
dstvis = __glutCurrentWindow->overlay->vis;
if (!window->overlay) {
__glutWarning("glutCopyColormap: window %d has no overlay", winnum);
return;
}
newcmap = window->overlay->colormap;
}
if (!oldcmap) {
__glutWarning("glutCopyColormap: destination colormap must be color index");
return;
}
if (!newcmap) {
__glutWarning(
"glutCopyColormap: source colormap of window %d must be color index",
winnum);
return;
}
if (newcmap == oldcmap) {
/* Source and destination are the same; now copy needed. */
return;
}
#if !defined(_WIN32) && !defined(__OS2PM__)
/* Play safe: compare visual IDs, not Visual*'s. */
if (newcmap->visual->visualid == oldcmap->visual->visualid) {
#endif
/* Visuals match! "Copy" by reference... */
__glutFreeColormap(oldcmap);
newcmap->refcnt++;
if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) {
__glutCurrentWindow->colormap = newcmap;
__glutCurrentWindow->cmap = newcmap->cmap;
} else {
__glutCurrentWindow->overlay->colormap = newcmap;
__glutCurrentWindow->overlay->cmap = newcmap->cmap;
}
XSetWindowColormap(__glutDisplay, __glutCurrentWindow->renderWin,
newcmap->cmap);
#if !defined(_WIN32) && !defined(__OS2PM__)
__glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK);
bla bla bla
} else {
GLUTcolormap *copycmap;
XColor color;
int i, last;
/* Visuals different - need a distinct X colormap! */
copycmap = __glutAssociateNewColormap(dstvis);
/* Wouldn't it be nice if XCopyColormapAndFree could be
told not to free the old colormap's entries! */
last = newcmap->size;
if (last > copycmap->size) {
last = copycmap->size;
}
for (i = last - 1; i >= 0; i--) {
if (newcmap->cells[i].component[GLUT_RED] >= 0.0) {
color.pixel = i;
copycmap->cells[i].component[GLUT_RED] =
newcmap->cells[i].component[GLUT_RED];
color.red = (GLfloat) 0xffff *
newcmap->cells[i].component[GLUT_RED];
copycmap->cells[i].component[GLUT_GREEN] =
newcmap->cells[i].component[GLUT_GREEN];
color.green = (GLfloat) 0xffff *
newcmap->cells[i].component[GLUT_GREEN];
copycmap->cells[i].component[GLUT_BLUE] =
newcmap->cells[i].component[GLUT_BLUE];
color.blue = (GLfloat) 0xffff *
newcmap->cells[i].component[GLUT_BLUE];
color.flags = DoRed | DoGreen | DoBlue;
XStoreColor(__glutDisplay, copycmap->cmap, &color);
}
}
}
#endif
}
/* ENDCENTRY */


File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,127 +1,127 @@
/* Copyright (c) Mark J. Kilgard, 1994. */
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
glutSetWindowTitle(const char *title)
{
#if defined(__OS2PM__)
__glutSetWindowText(__glutCurrentWindow->win, (char *)title);
#else
XTextProperty textprop;
assert(!__glutCurrentWindow->parent);
IGNORE_IN_GAME_MODE();
textprop.value = (unsigned char *) title;
textprop.encoding = XA_STRING;
textprop.format = 8;
textprop.nitems = strlen(title);
XSetWMName(__glutDisplay,
__glutCurrentWindow->win, &textprop);
XFlush(__glutDisplay);
#endif
}
void GLUTAPIENTRY
glutSetIconTitle(const char *title)
{
#if defined(__OS2PM__)
//todo ?
#else
XTextProperty textprop;
assert(!__glutCurrentWindow->parent);
IGNORE_IN_GAME_MODE();
textprop.value = (unsigned char *) title;
textprop.encoding = XA_STRING;
textprop.format = 8;
textprop.nitems = strlen(title);
XSetWMIconName(__glutDisplay,
__glutCurrentWindow->win, &textprop);
XFlush(__glutDisplay);
#endif
}
void GLUTAPIENTRY
glutPositionWindow(int x, int y)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredX = x;
__glutCurrentWindow->desiredY = y;
__glutCurrentWindow->desiredConfMask |= CWX | CWY;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
glutReshapeWindow(int w, int h)
{
IGNORE_IN_GAME_MODE();
if (w <= 0 || h <= 0)
__glutWarning("glutReshapeWindow: non-positive width or height not allowed");
__glutCurrentWindow->desiredWidth = w;
__glutCurrentWindow->desiredHeight = h;
__glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
glutPopWindow(void)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredStack = Above;
__glutCurrentWindow->desiredConfMask |= CWStackMode;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
glutPushWindow(void)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredStack = Below;
__glutCurrentWindow->desiredConfMask |= CWStackMode;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
glutIconifyWindow(void)
{
IGNORE_IN_GAME_MODE();
assert(!__glutCurrentWindow->parent);
__glutCurrentWindow->desiredMapState = IconicState;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
}
void GLUTAPIENTRY
glutShowWindow(void)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredMapState = NormalState;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
}
void GLUTAPIENTRY
glutHideWindow(void)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredMapState = WithdrawnState;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
}
/* ENDCENTRY */
/* Copyright (c) Mark J. Kilgard, 1994. */
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
glutSetWindowTitle(const char *title)
{
#if defined(__OS2PM__)
__glutSetWindowText(__glutCurrentWindow->win, (char *)title);
#else
XTextProperty textprop;
assert(!__glutCurrentWindow->parent);
IGNORE_IN_GAME_MODE();
textprop.value = (unsigned char *) title;
textprop.encoding = XA_STRING;
textprop.format = 8;
textprop.nitems = strlen(title);
XSetWMName(__glutDisplay,
__glutCurrentWindow->win, &textprop);
XFlush(__glutDisplay);
#endif
}
void GLUTAPIENTRY
glutSetIconTitle(const char *title)
{
#if defined(__OS2PM__)
//todo ?
#else
XTextProperty textprop;
assert(!__glutCurrentWindow->parent);
IGNORE_IN_GAME_MODE();
textprop.value = (unsigned char *) title;
textprop.encoding = XA_STRING;
textprop.format = 8;
textprop.nitems = strlen(title);
XSetWMIconName(__glutDisplay,
__glutCurrentWindow->win, &textprop);
XFlush(__glutDisplay);
#endif
}
void GLUTAPIENTRY
glutPositionWindow(int x, int y)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredX = x;
__glutCurrentWindow->desiredY = y;
__glutCurrentWindow->desiredConfMask |= CWX | CWY;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
glutReshapeWindow(int w, int h)
{
IGNORE_IN_GAME_MODE();
if (w <= 0 || h <= 0)
__glutWarning("glutReshapeWindow: non-positive width or height not allowed");
__glutCurrentWindow->desiredWidth = w;
__glutCurrentWindow->desiredHeight = h;
__glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
glutPopWindow(void)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredStack = Above;
__glutCurrentWindow->desiredConfMask |= CWStackMode;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
glutPushWindow(void)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredStack = Below;
__glutCurrentWindow->desiredConfMask |= CWStackMode;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
glutIconifyWindow(void)
{
IGNORE_IN_GAME_MODE();
assert(!__glutCurrentWindow->parent);
__glutCurrentWindow->desiredMapState = IconicState;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
}
void GLUTAPIENTRY
glutShowWindow(void)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredMapState = NormalState;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
}
void GLUTAPIENTRY
glutHideWindow(void)
{
IGNORE_IN_GAME_MODE();
__glutCurrentWindow->desiredMapState = WithdrawnState;
__glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
}
/* ENDCENTRY */


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