Compare commits

..

562 Commits

Author SHA1 Message Date
Brian
131baefac3 fix date for 7.0 release 2007-06-22 16:41:36 -06:00
Brian
a450078b67 update version 2007-06-22 16:40:17 -06:00
Brian
f6b041bf6c bring in Eric's FreeBSD fixes for -pthread 2007-06-22 15:40:46 -06:00
Brian
4f340d181a set tentative 7.0 release date 2007-06-20 19:59:15 -06:00
Brian
b58e38e936 fix TEXTREL problem (bug 7459) 2007-06-12 09:52:05 -06:00
Brian
8713cb48a8 Fix TEXREL issues when using GLX_USE_TLS (see bug 7459). 2007-06-12 09:46:12 -06:00
Brian
277c5e57ed fix GLX_USE_TLS breakage 2007-06-12 08:57:39 -06:00
Brian
b3d62d5af5 disable depthBits check in check_compatible(), see bug 11161 2007-06-08 12:36:00 -06:00
Brian
9c0f0c8d81 remove old comment about DEFAULT_SOFTWARE_DEPTH_BITS 2007-06-08 12:35:37 -06:00
Brian
18a0a2a7ac document bug 11049 fix 2007-05-23 16:50:22 -06:00
Brian
8b99d9e33c restore GL_TEXTURE_LOD_BIAS in _mesa_PopAttrib(), bug 11049 2007-05-23 16:49:19 -06:00
Brian
01e7e153e3 document point attentuation fix 2007-05-23 08:59:02 -06:00
Brian
0ad4ca24d2 Fix point attentuation problem (bug 11042)
ctx->Point._Attentuation was computed in wrong place and the VB->Eye coord Z
array wasn't indexed correctly in run_point_stage().
2007-05-23 08:56:45 -06:00
Brian
724a155552 if light position is local, treat it as a homogeneous coord and divide by W (see bug 11009) 2007-05-21 10:55:15 -06:00
Roland Scheidegger
d38b74a316 fix miptree layout (i915) for small compressed mipmaps
This seems to work now. Also fix i945 set_level_info, need to match i915
behaviour for storing mip height, as it's assumed to be the mip width
(in texels) elsewhere and the division by 4 is done later (untested).
2007-05-19 04:43:50 +02:00
Roland Scheidegger
54cab4b47b fix copy & paste bug of previous commit, breaking dxt5 formats 2007-05-19 03:56:06 +02:00
Roland Scheidegger
c093666bc5 fix miptree comparison with compressed textures
TexelBytes is always 0 with compressed textures, thus would never match
mt->cpp. This caused constant blitting around of textures, and it fixes at
least the horrible performance of Q3 if compressed textures are enabled.
2007-05-19 01:39:54 +02:00
Roland Scheidegger
04972f6761 fix small s3tc mipmaps (#10968)
make sure that always whole blocks are uploaded.
(May still not work correctly if the top mip map is not at least a full block,
that is 4 pixels wide - not sure, but probably doesn't happen in real world)
2007-05-19 01:39:16 +02:00
Brian
67f8234622 set version to 7.0 2007-05-18 09:41:34 -06:00
Brian
201d6dbd9c fix STATE_HALF_VECTOR value (bug 10987) 2007-05-18 09:35:18 -06:00
Ian Romanick
fbcac5aa83 Refactor determining whether a texture target can use compressed format 2007-05-17 14:45:25 -07:00
Brian
2b72ab8f8f document glXDestroyPbuffer fix 2007-05-17 15:30:39 -06:00
Brian
0ea97b9408 In DestroyPbuffer(), use GetReq() intead of GetReqExtra(). See bug 10983. 2007-05-17 15:26:39 -06:00
Brian
28683ac7c0 version 7.0, not 7.1 2007-05-17 09:07:25 -06:00
Brian
c72e3e210f version should be 7.0 2007-05-17 09:04:19 -06:00
Ian Romanick
b0fe0d8a55 Bring framebuffer_texture's error checking more in-line with the spec. 2007-05-15 13:42:25 -07:00
Brian
c128c3ce8c master/trunk is now for Mesa 7.1 devel: bump versions 2007-05-14 14:30:36 -06:00
Bruce Merry
6efdf648f5 in __glXGetArrayType() return type, not enabled (bug 10938) 2007-05-14 09:38:23 -06:00
Brian
6a587c0124 comment about fixing uniform structs 2007-05-14 09:38:23 -06:00
Oliver McFadden
524c3336c4 r300: Enable the non-user-buffers code to compile. 2007-05-13 13:38:38 +00:00
Oliver McFadden
0e7e211055 r300: Use e32(0x0) rather than e32(0); makes greping for hex values easier. 2007-05-13 12:59:41 +00:00
Oliver McFadden
4e641bf3e9 r300: Use the defined values when writing to R300_RS_ROUTE_0. 2007-05-13 12:56:59 +00:00
Oliver McFadden
2189ff5e51 r300: Use the defined values when writing to R300_SE_VTE_CNTL.
You can verify this is correct with the following code.

  assert (0x043f ==
	  (R300_VTX_W0_FMT | R300_VPORT_X_SCALE_ENA | R300_VPORT_X_OFFSET_ENA
	   | R300_VPORT_Y_SCALE_ENA | R300_VPORT_Y_OFFSET_ENA |
	   R300_VPORT_Z_SCALE_ENA | R300_VPORT_Z_OFFSET_ENA));
2007-05-13 12:43:40 +00:00
Oliver McFadden
33a73466ae r300: Added a TODO comment for the R300_VAP_INPUT_ROUTE_[01]_0 values. 2007-05-13 12:36:27 +00:00
Oliver McFadden
13c0abd8a7 r300: Changed some more functions to static functions.
This required reordering some of the functions which is why the diff is a little
larger.
2007-05-13 09:09:30 +00:00
Oliver McFadden
82de92c0fb r300: Changed a couple of functions in r300_state.c to static functions. 2007-05-13 08:59:54 +00:00
Oliver McFadden
e4b8481f39 r300: Removed the unused r300_aos_rec (replaced by r300_dma_region) structure. 2007-05-13 08:43:30 +00:00
Oliver McFadden
b5990cec90 r300: Use #if 0 for disabled code, rather than commenting it out. 2007-05-13 08:28:51 +00:00
Oliver McFadden
d93642251e r300: Removed a couple of obsolete/commented out includes. 2007-05-13 08:21:50 +00:00
Oliver McFadden
c66fd808ac r300: A few very minor indenting corrections. 2007-05-13 07:51:41 +00:00
Oliver McFadden
73449270bb r300: Use the defined values for the interpolater (interp_magic) magic values. 2007-05-13 07:44:20 +00:00
Oliver McFadden
6f56e68ee3 r300: Use the defined values when writing to R300_VAP_INPUT_CNTL_[01].
You can verify this is correct with the following code.

  assert (0x00000001 == R300_INPUT_CNTL_0_COLOR);

  assert (0x00000405 ==
	  (R300_INPUT_CNTL_POS | R300_INPUT_CNTL_COLOR |
	   R300_INPUT_CNTL_TC0));
2007-05-13 06:39:24 +00:00
Oliver McFadden
65fae19383 Revert "r300: Perform the locking closer to the DRM texture upload call."
This reverts commit 93881edb46.
2007-05-12 17:18:57 +00:00
Roland Scheidegger
b78aec5767 bring over recent radeonMakeCurrent fixes for r300 to radeon/r200 2007-05-12 11:20:24 +02:00
Oliver McFadden
6bae7d40f7 r300: Removed the name argument to ALLOC_STATE; do the name via the macro. 2007-05-12 01:53:56 +00:00
Oliver McFadden
5f1f1f5704 r300: Renamed r300DoEmitState to r300EmitAtoms. 2007-05-12 01:13:54 +00:00
Oliver McFadden
93881edb46 r300: Perform the locking closer to the DRM texture upload call.
This might help if with attaching GDB if the driver gets into a -EAGAIN loop.
2007-05-12 00:14:33 +00:00
Oliver McFadden
56b99ace19 r300: Removed unused FORCE_32BITS_ELTS define. 2007-05-11 23:35:37 +00:00
Oliver McFadden
3aad47679e r300: Removed the unused CPT macro. 2007-05-11 23:33:47 +00:00
Oliver McFadden
dac5303692 r300: Moved r300PackFloat24 near r300PackFloat32. 2007-05-11 23:32:03 +00:00
Oliver McFadden
64b03f33ee r300: Added insert_at_tail to the ALLOC_STATE macro. 2007-05-11 23:13:08 +00:00
Oliver McFadden
b8b0dd1e20 Revert "r300: Merged radeon_span.c."
This reverts commit 0aa998b2ab.
2007-05-11 23:03:40 +00:00
Oliver McFadden
93f9e61f43 r300: Corrected another error; regexp replaced something it shouldn't have. 2007-05-11 22:26:47 +00:00
Oliver McFadden
f405fbb36d r300: Corrected some macro errors from the previous commit. 2007-05-11 22:23:31 +00:00
Oliver McFadden
5a09ea01e0 r300: Reduced the diff on radeon_lock.[ch]. 2007-05-11 22:21:19 +00:00
Oliver McFadden
98d25a5a28 r300: Initial work on merging radeon_lock.[ch]. 2007-05-11 22:02:52 +00:00
Oliver McFadden
0aa998b2ab r300: Merged radeon_span.c. 2007-05-11 21:56:10 +00:00
Oliver McFadden
b6087270a0 r300: Cleaned up function names in r300_texstate.c. 2007-05-11 21:45:14 +00:00
Oliver McFadden
3f709f16ef r300: Enable hardware 3D texture support. Fixes the stex3d demo. 2007-05-11 21:41:16 +00:00
Oliver McFadden
67363327e5 r300: Corrected a small error from 37cbf38c344012f9d6e938937dac3697b73721a8. 2007-05-11 21:41:16 +00:00
Oliver McFadden
bcaf8fc7b1 r300: Cleaned up the blend factor function. 2007-05-11 21:41:16 +00:00
Oliver McFadden
ef29d6af6c r300: Removed the r300BindProgram function; mesa default does better checking. 2007-05-11 21:41:16 +00:00
Oliver McFadden
6a69bb5864 r300: Removed deprecated/disabled VBO code from r300_mem.c
Also removed a couple of unused fields from the r300_memory_manager structure.
2007-05-11 21:41:16 +00:00
Oliver McFadden
cbd29adbc8 r300: Indented r300_mem.c; I forgot this because it used to be radeon_mm.c. 2007-05-11 21:41:16 +00:00
Oliver McFadden
c729e67321 r300: Use __FUNCTION__ not __func__.
Just for consistency; most of the code already uses __FUNCTION__.
2007-05-11 21:41:16 +00:00
Oliver McFadden
5b23d36613 r300: Assert if the primitive type is unknown; this can't really happen. 2007-05-11 21:41:16 +00:00
Oliver McFadden
a87390504f r300: Moved some code around in r300_render.c and general clean up. 2007-05-11 21:41:16 +00:00
Brian
cc358d861d user-declared uniform structs not supported yet (see bug 10908) 2007-05-11 15:35:12 -06:00
Brian
749e093e33 don't ignore return value of _slang_codegen_global_variable() 2007-05-11 15:34:29 -06:00
Brian
eab6e16522 remove some unneeded code in init_machine() 2007-05-11 15:12:40 -06:00
Oliver McFadden
1b39be3790 r300: Removed some checking in r300NumVerts that is not needed.
According to Aapo Tahkola the OpenGL specification defines the behaviour when
there are not enough vertices for the primitive type, thus DRI drivers do not
need to perform verification on the number of vertices per primitive.
2007-05-11 19:45:28 +00:00
Oliver McFadden
69ff5a3dbc r300: Function naming correction in r300_texmem.c. 2007-05-11 19:45:28 +00:00
Oliver McFadden
01ec508c7f r300: Cleaned up function names in r300_state.c. 2007-05-11 19:45:28 +00:00
Oliver McFadden
d4e3b0b2c2 r300: Cleaned up function naming in r300_emit.c. 2007-05-11 19:45:28 +00:00
Oliver McFadden
b63c70666f r300: Renamed r300_maos.c to r300_emit.c; it contains mostly emit code now. 2007-05-11 19:45:28 +00:00
Brian
c33c00764c Remove unused FB_* tokens, re-indent code. 2007-05-11 08:41:34 -06:00
Brian
6c342ad859 When feeding back texcoords, don't divide by W. See bug 10913. 2007-05-11 08:39:18 -06:00
Patrick Baggett
86e4f52f3c Fix some bugs related to loop counters and conditional branching. 2007-05-11 08:19:33 -06:00
Brian
f0707c789a more indentation fixes, remove 'register' keywords 2007-05-10 17:33:14 -06:00
Brian
aed53ba525 re-indent some code 2007-05-10 17:30:44 -06:00
Brian
3dec7c57b0 document exp(), mod() fixes 2007-05-10 16:14:16 -06:00
Brian
544e441f53 regenerated 2007-05-10 16:14:16 -06:00
Brian
fa546c367d Implement exp() in terms of __asm float_power. Fix typo in mod(vec4) function.
exp() was using __asm float_exp (OPCODE_EXP) but that computes base two, not e.
See bug 10907.
2007-05-10 16:14:15 -06:00
Ian Romanick
64a6a50155 Fix reversed enable logic in enable_texture
Fix bug inserted in commit c9e723e501.
Discovered by Oliver McFadden (z3ro).
2007-05-10 15:01:52 -07:00
Oliver McFadden
c103453d4f r300: Added TODO comment regarding texture tiling; I'm not sure about this. 2007-05-10 22:01:41 +00:00
Oliver McFadden
d7e3d1dc42 r300: Corrected a compile error introduced by one of the previous commits. 2007-05-10 21:40:20 +00:00
Oliver McFadden
02e44e41c8 r300: Removed obsolete start_index16_packet/start_index32_packet.
It's all in r300_render.c now.
2007-05-10 21:28:04 +00:00
Oliver McFadden
eed67a6e3e r300: Moved some more emit code into r300_render.c. 2007-05-10 19:24:16 +00:00
Oliver McFadden
e856edb279 r300: Moved some more of the emit code into r300_render.c. 2007-05-10 19:24:16 +00:00
Brian
58239d2ae3 document tex sampler bug fix, code changes 2007-05-10 10:52:19 -06:00
Brian
2f6a0840c4 Replace pkg-config --cflags libdrm with LIBDRM_CFLAGS, remove disabled lines, remove obsolete comments. 2007-05-10 10:51:54 -06:00
Ian Romanick
c9e723e501 Convert "bit" parameters to GLbitfield. Fix cut-and-paste bug in _mesa_IsEnabled
These changes are based on patch review comments from Brian Paul, Alan
Hourihane, and vehemens.
2007-05-10 08:20:42 -07:00
Ian Romanick
87a980a795 Refactor the loop in unbind_texobj_from_texunits.
Common code was pulled out of the per-target if-statment and put at the end
of the for-loop.  The common code is guarded by a new variable, curr, that
is set to point to the unit's current target in each if-statement.
2007-05-10 08:20:41 -07:00
Ian Romanick
e282f89a38 Refactor queries of GL_(SOURCE|OPERAND)[012]_(ALPHA|RGB).
Most switch-statements that have cases for these enums already use code like:

    const GLuint idx = pname - GL_SOURCE0_RGB;
    ... texUnit->Combine.SourceRGB[idx] ...

This patch just brings the remaining bits up to speed.
2007-05-10 08:20:41 -07:00
Ian Romanick
e2e4b60c7d Refactor the way TestProxyTexImage is called in texture_error_check. 2007-05-10 08:20:41 -07:00
Ian Romanick
58dacc8df1 Refactor Enable / Disable and IsEnabled bits related to texture targets. 2007-05-10 08:20:41 -07:00
Oliver McFadden
b470189378 r300: Name the render functions in r300_render.c consistently. 2007-05-09 22:43:01 +00:00
Oliver McFadden
574bf4d346 r300: Return -1 for error. 2007-05-09 22:43:01 +00:00
Oliver McFadden
795ebb1a3b r300: Probably a good idea to always check the vertices; it's a WARN_ONCE so the
performance impact is extremely minimal.
2007-05-09 22:43:01 +00:00
Oliver McFadden
d0be8b959a r300: Added some more Doxygen documentation and made some functions static. 2007-05-09 22:43:01 +00:00
Oliver McFadden
672ecba175 r300: Removed the "texmicrotile" variable; the tiling code is disabled via a
compiler conditional anyway; probably broken?
2007-05-09 22:43:01 +00:00
Oliver McFadden
0dcea4bf8e r300: Converted a few "if (0)" into "if (RADEON_DEBUG & DEBUG_TEXTURE)". 2007-05-09 22:43:01 +00:00
Brian
16c503f39a Tweak the shell scripting for descending into and building subdirs.
In general, use this:
	@for dir in $(SUBDIRS) ; do \
		if [ -d $$dir ] ; then \
			(cd $$dir && $(MAKE)) || exit 1; \
		fi \
	done

Basically, silently skip missing subdirs but generate an error and stop if
there's a compilation or install problem.
This was done inconsistantly before.  In once case, a missing subdir was
causing us to go into an infinte loop!
2007-05-09 16:23:11 -06:00
Oliver McFadden
4d5d4e1f97 r300: Cleaned up radeon_context.h slightly; mostly Indent. 2007-05-09 21:06:28 +00:00
Oliver McFadden
a9ab36b8f2 r300: radeon_span.h is now common code; radeon_span.c still needs some work. 2007-05-09 20:52:09 +00:00
Oliver McFadden
88288b614e r300: Renamed the R300 memory manager from "radeon" to "r300"; it's R300
specific.
2007-05-09 20:49:49 +00:00
Oliver McFadden
a154706061 r300: Indented radeon_span.h 2007-05-09 20:41:27 +00:00
Oliver McFadden
6fe41a4c01 r300: Further reduced the radeon_span.c diff. 2007-05-09 20:36:48 +00:00
Oliver McFadden
f4a2b9f83d r300: I have no idea why this was forced on, but it seems to work fine when
restored to the previous behaviour.
2007-05-09 19:30:59 +00:00
Oliver McFadden
56c2f7bb42 r300: Removed the dangerous R300_SPAN_DISABLE_LOCKING flag.
Enabling R300_SPAN_DISABLE_LOCKING would probably cause more lockups; I think
there are a couple of other little bugs in this code, too. It's best to remove
it.
2007-05-09 19:24:59 +00:00
Oliver McFadden
df747eb354 r300: Removed a bit of disabled code. 2007-05-09 18:44:56 +00:00
Oliver McFadden
ff7a41a159 r300: Don't need to include the deprecated r300_program.h in some files.
The only file that still requires r300_program.h is r300_ioctl.c; and it should
use the new defines in r300_reg.h!
2007-05-09 18:37:46 +00:00
Oliver McFadden
01fdb34b39 r300; Indent would destroy r300_reg.h, so add *INDENT-OFF*. 2007-05-09 18:31:04 +00:00
Christoph Bill
3c9e5cb0bd r300: Added a few more Doxygen comments. 2007-05-09 18:25:12 +00:00
Christoph Bill
a6aa1f8016 r300: Added some Doxygen comments. 2007-05-09 18:24:06 +00:00
Oliver McFadden
967c2d220d r300: Converted "rp" variables (r300_fragment_program) to "fp". 2007-05-09 18:14:42 +00:00
Oliver McFadden
0e6b7eb9c0 r300: Don't need to sleep here; might cause performance problems the first time. 2007-05-09 18:11:38 +00:00
Oliver McFadden
ed42bd6e20 r300: Removed the obsolete GLX_DIRECT_RENDERING define. 2007-05-09 18:07:16 +00:00
Oliver McFadden
2db667290a r300: Further reduced the diff between radeon_span.[ch]. 2007-05-09 18:06:10 +00:00
Oliver McFadden
cea0c2b144 r300: Indented both copies of radeon_span.[ch] in preparation for merging. 2007-05-09 18:01:43 +00:00
Oliver McFadden
2b5ef29a7b r300: Removed the deprecated VTXFMT code.
This was okayed by Jerome Glisse and Keith Whitwell on the dri-devel IRC channel
and list, respectively.
2007-05-09 16:10:08 +00:00
Oliver McFadden
4ed59c6012 r300: The empty check_space doesn't and never has done anything; removed it. 2007-05-09 15:57:30 +00:00
Oliver McFadden
7e7b1f7c4d r300: Fix a couple of static errors. 2007-05-09 15:38:18 +00:00
Oliver McFadden
c48e4c6f09 r300: Fixed indenting from previous commit
d28f6d9176.
2007-05-09 15:28:38 +00:00
Oliver McFadden
4f20fe8a93 r300: Added R300_PRIM_NUM_VERTICES_MASK suggested by Jerome Glisse. 2007-05-09 15:21:13 +00:00
Oliver McFadden
d28f6d9176 r300: Fixed some more function names.
Note there might be some calls to the old function names in conditionally
disabled code, but I think I've got them all.
2007-05-09 15:19:05 +00:00
Oliver McFadden
fe6a2c4295 r300: Changed r300_run_vb_render calls to r300RunRender in some conditionally
disabled code.
2007-05-09 15:07:34 +00:00
Oliver McFadden
faf47d9f84 r300: Added a "not implemented yet" comment back. 2007-05-09 14:45:42 +00:00
Oliver McFadden
f9828f5c4f Merge branch 'master' of git://anongit.freedesktop.org/git/mesa/mesa 2007-05-09 14:23:22 +00:00
Oliver McFadden
7b165de5f8 r300: Last of the indent changes. :) 2007-05-09 14:19:45 +00:00
Brian
62ef001de7 add pointers to git repo for drm/libpciaccess, replace & with & 2007-05-09 08:17:57 -06:00
Oliver McFadden
76d7b62cd2 r300: Indented r300_cmdbuf.[ch]. 2007-05-09 14:17:16 +00:00
Oliver McFadden
901fc0de18 r300: Indented r300_state.[ch]. 2007-05-09 14:12:34 +00:00
Oliver McFadden
c970811dab r300: Indented r300_texmem.[ch]. 2007-05-09 14:11:17 +00:00
Oliver McFadden
bb97694fad r300: Indented r300_texstate.[ch] 2007-05-09 14:09:35 +00:00
Brian
516259d609 Clean-up in I830AllocVidMem(), s/int/unsigned long/ for ret variable. 2007-05-09 08:07:15 -06:00
Brian
3e4302fe3b Check that texture units/samplers specified with glUniform1i() are legal. 2007-05-09 08:07:15 -06:00
Oliver McFadden
dcc8e5f4c1 r300: Indented r300_tex.[ch]. 2007-05-09 13:59:28 +00:00
Oliver McFadden
32c8d002d0 r300: Indented r300_context.[ch]. 2007-05-09 13:55:14 +00:00
Oliver McFadden
c9b87b8ad8 r300: Removed the unused immediate vertices mode macro.
Immediate vertices mode hasn't been supported since early CVS versions of the
R300 driver.
2007-05-09 04:30:16 +00:00
Oliver McFadden
5d61cfd1fd r300: Removed a disabled/obsolete e32 in the AOS function. 2007-05-09 04:27:31 +00:00
Oliver McFadden
93e957cc65 r300: Removed some disabled R200 code from the R300 driver. 2007-05-09 04:25:27 +00:00
Oliver McFadden
3eae496deb r300: Don't indent the tables in r300_texstate.c. 2007-05-09 04:20:35 +00:00
Oliver McFadden
81c6516af1 r300: Indented r300_vertprog.[ch]. 2007-05-09 04:12:04 +00:00
Oliver McFadden
9e91351826 r300: Indented r300_fragprog.[ch]. 2007-05-09 04:08:27 +00:00
Oliver McFadden
328b307e2f r300: Cleaned up the R300 Makefile. 2007-05-09 03:44:40 +00:00
Oliver McFadden
d316b4dc22 r300: Corrected a couple of "control reaches end of non-void function" warnings. 2007-05-09 03:40:06 +00:00
Oliver McFadden
f0126a76ac r300: Corrected an error in r300_vertprog.c.
Cannot use _mesa_warning here because we don't have a context pointer; perhaps
R300 specific warning and error functions are needed.
2007-05-09 03:38:45 +00:00
Oliver McFadden
b8640db021 r300: Corrected the exit codes for consistency; they are all -1 for error now.
The one exception is 300FlushCmdBuf.
2007-05-09 03:36:28 +00:00
Oliver McFadden
28b47110b6 r300: Converted exit calls to _mesa_exit calls.
Note that the exit codes are inconsistent and should be fixed.
2007-05-09 03:32:15 +00:00
Oliver McFadden
fe2c58d2d5 r300: Converted a few fprintf calls to _mesa_warning calls. 2007-05-09 03:25:33 +00:00
Oliver McFadden
4917955205 r300: Added a warning when texture state update fails. 2007-05-09 03:22:37 +00:00
Oliver McFadden
eca50a27e1 r300: Removed some obsolete code from r300_tex.c. 2007-05-09 03:18:14 +00:00
Oliver McFadden
0950e9727e mesa: Added Vim swap files to .gitignore. 2007-05-09 03:14:08 +00:00
Oliver McFadden
504fafe389 r300: Updated .gitignore. 2007-05-09 03:12:51 +00:00
Oliver McFadden
72608aedc3 r300: Added the Linux Kernel indent script. 2007-05-09 03:12:22 +00:00
Oliver McFadden
be56660ba0 r300: Indented r300_state.[ch]. 2007-05-09 02:59:11 +00:00
Oliver McFadden
36c8bc6141 r300: Indented r300_emit.h. 2007-05-09 02:52:37 +00:00
Oliver McFadden
5c8296a6ab r300: Indented r300_cmdbuf.[ch]. 2007-05-09 02:51:13 +00:00
Oliver McFadden
6665658a56 r300: Indented r300_shader.[ch]. 2007-05-09 02:50:13 +00:00
Oliver McFadden
204bc4e441 r300: Indented r300_maos.[ch]. 2007-05-09 02:49:14 +00:00
Oliver McFadden
e90ad3dbbb r300: Indented r300_ioctl.[ch]. 2007-05-09 02:46:57 +00:00
Oliver McFadden
8d62afdb6a r300: Removed the obsolete pfs_reg_t type from r300_fragprog.h. 2007-05-09 02:41:38 +00:00
Oliver McFadden
59494bafb4 r300: Use an array for the vertex program sources and corrected an error from
4960af08ad.
2007-05-09 02:35:07 +00:00
Oliver McFadden
33939fd29b r300: Removed the ugly CARD32 type. 2007-05-09 02:27:08 +00:00
Oliver McFadden
4960af08ad r300: Renamed vertex_shader.h to r300_vertprog.h 2007-05-09 02:24:59 +00:00
Oliver McFadden
f5b0cafbb1 r300: Removed obsolete pixel_shader.h header file. 2007-05-09 02:18:29 +00:00
Oliver McFadden
c578354642 r300: Renamed the VBO functions to the R300 name format. 2007-05-08 21:04:57 +00:00
Brian
da37ac5ee7 remove some debug code 2007-05-08 14:08:45 -06:00
Brian
ed2fddc98e special case for -pthread (bug 10876) 2007-05-08 14:03:04 -06:00
Brian
58eaf0acca a somewhat nicer demo w/ command line options 2007-05-08 13:48:52 -06:00
Oliver McFadden
d132f7245d r300: Removed some deprecated code from r300_context.c and corrected an unused
variable warning in r300_render.c.
2007-05-08 19:46:25 +00:00
Oliver McFadden
73bc8b63ac r300: Last few r300_render.c clean up. 2007-05-08 19:38:44 +00:00
Oliver McFadden
377ce9e074 r300: Merged some comments into the Doxygen documentation. 2007-05-08 19:35:36 +00:00
Oliver McFadden
f1d785188b r300: Cleaned up r300_render.c using Indent with appropriate options.
This corrects the mess of space and tab indenting that existed in this file, and
probably others. The diff is actually very small if you use an external diff
program and ignore whitespace.
2007-05-08 19:31:30 +00:00
Oliver McFadden
313c4c2643 r300: General render clean up; added some Doxygen documentation, too. 2007-05-08 19:22:15 +00:00
Oliver McFadden
fbeae4f70c r300: Moved the pipeline stages together for readability. 2007-05-08 18:47:26 +00:00
Oliver McFadden
9301a6a325 r300: Print the OpenGL define instead of a 2-digit char code in the warning. 2007-05-08 18:43:56 +00:00
Oliver McFadden
6c036812be r300: Clean up the vertex buffer emission code and reduced code duplication.
I tested both the unoptimized and optimized versions with Quake 3 Arena; there
are no problems.
2007-05-08 18:28:04 +00:00
Oliver McFadden
c6abbbfd02 r300: Cleaned up a lot of cruft in r300_render.c. 2007-05-08 18:05:10 +00:00
Dave Airlie
8a7f474c69 i915/miniglx: remove unused code 2007-05-08 10:53:43 +10:00
Dave Airlie
47e33a27df miniglx: fixup use of create windows x and y coordinates
This makes miniglx take not of the x and y from XCreateWindow
2007-05-08 10:51:44 +10:00
Dave Airlie
401629c721 miniglx/glut: should use the x/y pos to create window
This allows moving miniglx glut windows around the framebuffer
2007-05-08 10:49:31 +10:00
Brian
f1770c3210 better comments for _mesa_debug(), _mesa_warning(), etc 2007-05-07 14:13:23 -06:00
Dave Airlie
8130a4fe98 radeon: enable xpress chipsets
glxgears and googleearth now run so that seems like a good start

Thanks to Aapo Tahkola for doing the 3D work on this so far, I got lost
after the GART changes.
2007-05-07 07:06:08 +10:00
Aapo Tahkola
8f1c63b263 rs480: fix secondary color for real this time 2007-05-06 19:25:45 +03:00
Aapo Tahkola
857ebc6d47 Merge branch 'master' of git+ssh://aapot@git.freedesktop.org/git/mesa/mesa 2007-05-06 19:19:16 +03:00
Aapo Tahkola
660bdc616b rs480: fix textures and secondary color(?). clipping is still busted. tested on r480 2007-05-06 19:18:10 +03:00
Aapo Tahkola
88ae491bd2 r300: fix broken vbos 2007-05-06 19:10:39 +03:00
Oliver McFadden
8445960d9f r300: Added R300_AA_DISABLE for R300_GB_AA_CONFIG. 2007-05-06 12:09:42 +00:00
Oliver McFadden
74cae00c0e r300: Removed more deprecated state code that is now set in separate functions. 2007-05-06 11:56:36 +00:00
Oliver McFadden
56d9663574 r300: R300_ZS_... is now set in separate functions; removed the deprecated code. 2007-05-06 11:54:00 +00:00
Oliver McFadden
81d1a04e04 r300: Point size is now set in a separate function; removed the deprecated code. 2007-05-06 11:52:03 +00:00
Oliver McFadden
62cbe6c3f3 r300: Use the defined values for R300_VAP_CNTL_STATUS. 2007-05-06 11:36:24 +00:00
Aapo Tahkola
16cec9f767 r300: fix primary color on rs480 2007-05-06 14:28:23 +03:00
Aapo Tahkola
5e2a66466d don't use hw to perform vertex transform etc. when using swtcl. This for compatibility with vertex programs and the fact that swtcl very rarely gets hit with tcl capable hw. 2007-05-05 17:07:46 +03:00
Dave Airlie
b3378f6cc5 nouveau: disable nouveau build by default
Until this is API/ABI stable building it by default isn't a good idea.
2007-05-05 15:43:01 +10:00
Brian
91948f99dd add </ol> tag 2007-05-04 18:32:02 -06:00
Brian
ae5f67575d Makefile clean-ups for miniglx. 2007-05-04 18:27:12 -06:00
Brian
e75fbd3f91 Assorted miniglx updates. 2007-05-04 18:26:41 -06:00
Brian
a6dad578b5 document R300 bug fix 10848 2007-05-03 13:52:33 -06:00
Brian
c6443eb1a3 fix some matrix/state token indexing bugs (see bug 10848) 2007-05-03 12:33:25 -06:00
Brian
121533defb add some #includes to silence warnings 2007-05-03 09:50:08 -06:00
Brian
3cddba688d get rid of normal vector 2007-05-02 18:55:45 -06:00
Brian
dc881e1909 get rid of OSMESA stuff 2007-05-02 18:54:57 -06:00
Brian
2dfb03beb2 New test of the dFdx(), dFdy() functions. 2007-05-02 18:48:51 -06:00
Brian
18cfe0c801 document recent GLSL, R300 fixes 2007-05-02 18:46:45 -06:00
Brian
60d136f63c changes to get DDX/DDY working again 2007-05-02 18:45:44 -06:00
Brian
62da6a1b3e Resuscitate some of the DDX,DDY code.
Only works for program input registers at this time.
Good enough for the common case of texcoords, though.
2007-05-02 18:44:34 -06:00
Brian
77e7535c0f fix some DDX,DDY mix-ups 2007-05-02 18:42:57 -06:00
Brian
5c1b53d58d Document a deficiency in the _swrast_Translate() function with regard to point size. 2007-05-02 12:06:43 -06:00
Brian
b2f1d6422b fix some renderbuffer/wrapper bugs 2007-05-02 08:48:43 -06:00
Brian
99f24c8d17 fix some StepX/StepY mix-ups in alpha interpolation 2007-05-02 08:48:20 -06:00
Brian
04c401c91e add *gc, *syn files to tarballs 2007-05-02 08:29:14 -06:00
Brian
03f201d935 regenerated 2007-05-01 14:03:16 -06:00
Brian
594b5ad87d implement acos(), asin(), atan() 2007-05-01 14:02:49 -06:00
Brian
bfd5cf72c4 fog, mix() bug fixes 2007-05-01 10:23:15 -06:00
Brian
7559364027 Rewrite of slang_inline_asm_function() to do full parameter/argument substitution.
We had been taking a short-cut w/ asm inlines by just using parameters in order
rather than doing full formal parameter -> actual argument substitution like
ordinary inlined function calls.  This worked in all cases but one: mix() in
which the parameters were used in a different order.
This fixes bug 10821.
2007-05-01 10:22:08 -06:00
Michel Dänzer
65faf02367 r300: Don't crash in radeonUpdatePageFlipping when !radeon->glCtx->DrawBuffer.
This feels like a kludge, maybe there's a better solution.
2007-04-30 18:28:24 +02:00
Michel Dänzer
c409dbcae3 r300: Page flipping fixes.
Mostly making sure the page flipping state is respected when necessary.
2007-04-29 13:52:48 +02:00
Michel Dänzer
cbf280dc26 r300: radeonMakeCurrent cleanups.
r300UpdateWindow is superfluous or even possibly wrong here; _mesa_make_current
will set the viewport when necessary. So the conditional _mesa_set_viewport call
can go as well.
2007-04-29 13:52:11 +02:00
Brian
af0ae93863 only load front/back face attrib if using a shader (bug 10788) 2007-04-28 08:51:23 -06:00
Brian
bcc3baadba use EMIT_1F or EMIT_4F for fog depending on fragment program (bug 10788) 2007-04-28 08:50:07 -06:00
Brian
4ca7c804db fix GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB bug (10787) 2007-04-28 08:01:18 -06:00
Keith Packard
bfaf6156fb additional checks that attr is a texcoord 2007-04-28 07:50:06 -06:00
Brian
d741b10be6 7.0 blurb 2007-04-27 17:05:29 -06:00
Brian
e371a5f084 Version bumps for 7.0 2007-04-27 17:01:23 -06:00
Brian
af846712fd updates for 7.0 2007-04-27 17:00:13 -06:00
Brian
c4615abb11 added 7.0 relnotes link 2007-04-27 16:54:05 -06:00
Brian
430e036413 added 6.5.3 MD5 sums 2007-04-27 16:53:42 -06:00
Brian
502ebe90e8 7.0 release notes (template) 2007-04-27 16:53:26 -06:00
Brian
02e958a1e4 added glGetActiveAttrib 2007-04-27 16:27:36 -06:00
Brian
cce5084941 "Fix" for bug 9170. May need more attention. 2007-04-27 15:41:07 -06:00
Brian
4b1d1b7b18 document perspective correction issues 2007-04-27 15:25:00 -06:00
Brian
7ff72a7659 document broken inverse trig functions 2007-04-27 15:23:19 -06:00
Brian
c4b3b8dece asin(), acos(), atan() just return 0.5 for now to avoid crashing. Fix someday. 2007-04-27 15:22:58 -06:00
Brian
65bab0dad8 remove rc4 suffix 2007-04-27 08:00:51 -06:00
Brian
74edc663a6 set 6.5.3 release date 2007-04-27 08:00:37 -06:00
Brian
54d59cfb70 Added error check that all varying vars needed by the fragment shader are produced by vertex shader. 2007-04-26 12:20:53 -06:00
Brian
b7f5b8af65 Unconditionally update _TriangleCaps bits. Fixes software fallback bugs, such as #10687. 2007-04-26 10:45:44 -06:00
Brian
4099531a0a bump Windows to OpenGL 2.1, set release date 2007-04-26 07:50:26 -06:00
Brian
1606f2c123 enable 2.1 extensions 2007-04-26 07:49:33 -06:00
Brian
1dd7c00214 Windows updates 2007-04-26 07:48:35 -06:00
Brian
f42d4ab41e move #include <GL/glut.h> after other #includes for Windows 2007-04-26 07:46:59 -06:00
Brian
4a28548cbf use sqrt(), not sqrtf() for Windows 2007-04-26 07:46:38 -06:00
Karl Schultz
5814922d25 updates for 6.5.3 w/ VC8 2007-04-25 10:28:37 -06:00
Brian
3de20aead2 RC4 2007-04-25 10:01:30 -06:00
Brian
6d27194dff fix attribsMask (re-fixes depth peeling algorithm) 2007-04-25 09:58:15 -06:00
Brian
c233aa2768 s/fog/attrib[FRAG_ATTRIB_FOGC][0]/ 2007-04-24 22:32:41 -06:00
Brian
c93b2a1cb7 s/fog/attrib[FRAG_ATTRIB_FOGC][0]/ 2007-04-24 22:22:14 -06:00
Brian
eca456b63d s/DO_TEXVAR/DO_ATTRIBS/ 2007-04-24 16:57:38 -06:00
Brian
4003bde6ff get rid of an extra textured triangle function 2007-04-24 16:47:33 -06:00
Brian
ddcf819906 s/TEXTURE/ATTRIBS/ 2007-04-24 16:47:07 -06:00
Brian
9ede048127 trim down the number of line drawing functions, special cases 2007-04-24 16:40:54 -06:00
Brian
97693436a5 only need one CI-mode triangle function 2007-04-24 16:20:50 -06:00
Brian
8a8a5bd104 s/INTERP_TEX/INTERP_ATTRIBS/ 2007-04-24 16:16:25 -06:00
Brian
3e5eda9ee9 fix typo 2007-04-24 10:21:10 -06:00
Brian
f38dcc8a6a added missing VC8 .sln files 2007-04-24 10:19:19 -06:00
Brian
b1b154c498 added new VC* files, bump version to rc3 2007-04-24 08:58:12 -06:00
Karl Schultz
286faac68e assorted fixes for Windows/VC8 2007-04-24 08:53:28 -06:00
Brian
3b0bd0ce17 new VC8 project files 2007-04-24 08:52:34 -06:00
Karl Schultze
208ea84524 fix double const, move an assertion 2007-04-24 08:19:07 -06:00
Matthias Hopf
7868ab6617 add missing semicolon 2007-04-24 07:48:35 -06:00
Sean D'Epagnier
47ad443c55 Added proper cleanup code 2007-04-23 21:17:30 -07:00
Brian
3db3dc58bc disable some errant code 2007-04-23 22:04:03 -06:00
Brian
c27adc52ce remove SWvertex->fog field, use attrib field 2007-04-23 22:03:11 -06:00
Brian
afc132e7a9 remove SWvertex->fog field, use attrib field 2007-04-23 22:01:34 -06:00
Brian
335769a875 some re-org, clean-up 2007-04-23 21:27:13 -06:00
Brian
0bdf216dd0 Improve the code for interpolating fragment attributes a little. More to come... 2007-04-23 21:21:52 -06:00
Brian
d59e6f233b import glxext.h version 19 2007-04-22 15:32:10 -06:00
Sean D'Epagnier
ad02042db2 Fixed fallout, glfbdev driver was calling a nop function that was removed. 2007-04-21 20:18:42 -07:00
Brian
f793e90e82 Fix color sum bug 10688. 2007-04-21 15:58:37 -06:00
Brian
112e1f2b5a specularColor.alpha should default to 1, not 0 2007-04-21 15:56:10 -06:00
Brian
e5cf37c178 fix SkipPixels bugs in _mesa_pack_bitmap(), bug 10690 2007-04-21 14:12:57 -06:00
Brian
b5e9b0e562 Remove the !rb->Data check that was added a few months ago.
Was changed while debugging #7205.  Broke the shadowtext demo.  Revisit this
if the problem w/ bug 7205 returns...
2007-04-21 13:18:06 -06:00
Brian
b1502588c4 s/occlude.h/queryobj.h/ 2007-04-21 12:54:23 -06:00
Brian
74afcabd85 Rename occlude.[ch] to queryobj.[ch] 2007-04-21 12:42:54 -06:00
Brian
b3ab925e91 Rename occlude.[ch] to queryobj.[ch] to better reflect contents. 2007-04-21 12:36:39 -06:00
Brian
2d2c6a622d prep for 6.5.3 rc2 2007-04-21 12:31:51 -06:00
Brian
fc3d6bd351 memory leaks fixed 2007-04-21 12:30:58 -06:00
Brian
e261d66d81 Remove all the USE_MEMPOOL debug code. 2007-04-21 12:30:58 -06:00
Brian
cd3e39340f Use new memory pool allocator. Lots of debug code still in place... 2007-04-21 12:30:58 -06:00
Ian Romanick
ad3cc95485 Fix FBO completeness bug in shadowtex. 2007-04-21 10:48:24 -07:00
Brian
4e0a64675c added MemPool field 2007-04-21 10:18:49 -06:00
Brian
d5e7234ba8 call grammar_alloc_free() to fix memleaks 2007-04-21 10:05:05 -06:00
Brian
bc74cb4c0a destroy window upon exit 2007-04-21 10:05:05 -06:00
Brian
257f799849 remove more unused vars, assertions 2007-04-21 10:05:05 -06:00
Brian
81c4fee160 remove unused vars, assertions 2007-04-21 10:05:05 -06:00
Brian
1fbdd9d794 added slang_mem.c 2007-04-21 10:05:05 -06:00
Brian
82839e8430 Memory pool manager.
Instead of doing intricate malloc/free tracking during compiling, allocate
everything (which would be discarded after compiling) from a pool that can
be freed en masse when done.
2007-04-21 10:05:05 -06:00
Brian
ced6f76404 undo a test/debug change 2007-04-21 10:05:05 -06:00
Brian
4cc2674aee fix instruction comment code 2007-04-21 10:05:05 -06:00
Brian
a7f7366d38 another bit of debug code 2007-04-21 10:05:05 -06:00
Brian
11e3f733ba free subroutine array (fix mem leak) 2007-04-21 10:05:05 -06:00
Brian
98ef18909a new varnames in slang_operation_insert() 2007-04-21 10:05:05 -06:00
Brian
f2346498aa fix memleak in slang_operation_insert() 2007-04-21 10:05:05 -06:00
Brian
4b7c6fc5a6 free shProg->Attributes in _mesa_free_shader_program_data() 2007-04-21 10:05:05 -06:00
Brian
fe16b9f663 move allocation of shProg->Attributes earlier in function 2007-04-21 10:05:05 -06:00
Brian
c9855a60f4 Call _mesa_warning() instead of _mesa_problem() when external s3tc lib not found.
The later incorrectly encourages filing a bug (10703, for example).
2007-04-21 09:47:36 -06:00
Jeremy Kolb
838a2a2633 Make xcb backend compile.
Add nouveau to match linux-dri config.
2007-04-20 21:53:38 -04:00
Brian
e7e5279fc0 Remove unused Imakefiles. 2007-04-20 19:18:13 -06:00
Brian
7fd3a6c521 Long obsolete. 2007-04-20 19:01:21 -06:00
Brian
720cf3aa13 added new xm_glide.c file 2007-04-20 18:55:13 -06:00
George Sapountzis
5491c8194c xmesa: call _glapi_set_dispatch() for all xserver DDXes.
This is to unify the xmesa code across xserver DDX'es. The call is intented for
XGL, but it does not hurt to call for other DDX'es. In fact it was not guarded
against XGL when it was first added in xserver.
2007-04-20 21:09:00 +03:00
George Sapountzis
e4e2068ac9 xmesa: minor cosmetic
mainly drop 'client' argument from initialize_visual_and_buffer().
2007-04-20 21:08:58 +03:00
George Sapountzis
6346a753c6 xmesa: split FX functions to separate file, part 2. 2007-04-20 21:08:57 +03:00
George Sapountzis
4d944b502f xmesa: split FX functions to separate file, part 1. 2007-04-20 21:08:56 +03:00
George Sapountzis
6aa5668871 xmesa: spilt FX code to separate functions. 2007-04-20 21:08:55 +03:00
George Sapountzis
d60009bd6d Revert "xmesa: drop glide (FX) backend."
This reverts commit 2a2f8d806f.
2007-04-20 21:08:53 +03:00
Brian
535c37e85d Notes about shared lib version. Document depth-peel fixes. 2007-04-19 14:24:58 -06:00
Brian
ba3d384e94 dFdx(), etc. don't work yet 2007-04-19 14:24:29 -06:00
Brian
8b5fce6bcc Put gl_program_machine into swrast structure rather than using a local variable.
Basically an easy way to make sure the memory gets initialized once (to zero)
to avoid lots of valgrind warnings.
2007-04-19 14:24:10 -06:00
Brian
020cdb47cf Fix valgrind problem caused by reading text[-1]. 2007-04-19 14:15:11 -06:00
Brian
121f2212cc remove invalid assertion (span->facing may be set because of polygonmode) 2007-04-19 14:07:16 -06:00
Brian
24a93dd6a4 remove invalid assertion 2007-04-19 14:06:43 -06:00
Brian
00da9afb84 fix crash when program has invalid structure field 2007-04-19 14:06:27 -06:00
Brian
4abcaf3949 init A.curFuncEndLabel = NULL 2007-04-19 14:04:30 -06:00
Brian
6bde08815f In _mesa_unpack_depth_span() look for special cases of GLuint->GLushort and GLushort->GLuint conversion.
This improves performance and avoids int/float/int conversion problems that
can introduce errors during glCopyTexImage().  Another fix for the depth peeling
algorithm.
2007-04-19 11:23:26 -06:00
Brian
8e6207396c Don't allow deferredTexture if using occlusion query and a frag shader.
Occlusion query might depend on the shader killing/discarding fragments.
Helps fix depth peeling technique.
Also, minor tweaks in interpolate_wpos().
2007-04-19 11:21:14 -06:00
Brian
5ca8d4ccf2 fix an uninitialized variable and a warning 2007-04-18 18:05:33 -06:00
Brian
6b3027e291 comments, assertions 2007-04-18 17:14:14 -06:00
Brian
8d370fb2ee new comments 2007-04-18 17:14:14 -06:00
Brian
36a6a59972 record proper datatypes for uniforms/samplers 2007-04-18 17:14:14 -06:00
Brian
addd03da2e added _slang_gltype_from_specifier() 2007-04-18 17:14:13 -06:00
Brian
c93e883b20 Start fixing some issues with uniform variables and their types. 2007-04-18 17:14:13 -06:00
Brian
274ac7a801 Fix some bugs related to querying active uniforms. 2007-04-18 17:14:13 -06:00
Brian
aaa57412c1 fix error strings, add a sanity check 2007-04-18 17:14:13 -06:00
George Sapountzis
2a2f8d806f xmesa: drop glide (FX) backend.
glide is no longer compiled with stand-alone libGL, so this will not link.
There are still the glide config files. some code in demos and the
GLX_MESA_set_3dfx_mode code which could be removed.
2007-04-19 00:01:45 +03:00
Brian
bac15c8db8 Remove bad assertions, decrement NumShaders in _mesa_detach_shader().
Fixes crashes w/ Brad King's depth peeling test.
2007-04-18 14:55:18 -06:00
Brian
f3e8c32376 s/GL_SHADER_PROGRAM/GL_SHADER_PROGRAM_MESA/ (a Mesa-specific token) 2007-04-18 14:53:23 -06:00
Brian
6d3d9c1c6d Replace _mesa_parameter_longest_name() with _mesa_longest_parameter_name().
The later takes a type parameter so we can match uniforms or attributes/inputs.
Used by the GL_ACTIVE_ATTRIBUTE_MAX_LENGTH and GL_ACTIVE_UNIFORM_MAX_LENGTH
queries.  Fixes problem reported by Brad King in VTK.
2007-04-18 14:19:17 -06:00
Brian
e57e752eee call ProgramStringNotify() after linking 2007-04-18 12:41:16 -06:00
Brian
884af40864 check _PreferPixelFog in _swrast_span_default_fog(), see bug 10669 2007-04-18 12:09:40 -06:00
Brian
30a79f76fc improved fog comment 2007-04-18 12:08:18 -06:00
Brian
8598f55091 glean glsl test now does over 150 tests 2007-04-18 09:30:07 -06:00
Brian
6d01f3f1ec added href to shading language info 2007-04-18 09:28:38 -06:00
Brian
e3caa5f891 prep for 6.5.3 release 2007-04-18 09:07:56 -06:00
Brian
d9443c2494 add progs/glsl/ to DEMO_FILES, s/pre/rc1/ 2007-04-18 08:52:18 -06:00
Xiang, Haihao
565cd49b5f fig segment fault issue in TAG(triangle), (see bug 10589)
Bit SS_TWOSIDE_BIT is set if  gl_FrontFacing lives in
fragment input (see commit 10b5895597).
However, VB->ColorPtr[1] isn't assigned after that.
2007-04-18 12:37:09 +08:00
Brian
a4b2b88337 omit the glide/svga sources from stand-alone libGL (anyone using them?) 2007-04-17 16:00:17 -06:00
Brian
04bda46739 Enable texture sampling for vertex programs/shaders.
This is a bit of a hack for now because the tnl module is using the swrast
module to fetch texels.  The texture fetch/filter code should probably be
moved into the main/ module since it doesn't really depend upon other
swrast code.
2007-04-17 15:56:46 -06:00
Brian
d2d86a3f0b In bind_inputs() set VB->EdgeFlag to NULL if it's not needed.
Otherwise, the clip/interp code was finding VB->EdgeFlag to be non-null and
reading/writing it when the memory may have been freed earlier in free_space().
This fixes several VTK segfaults/failures reported by Brad King @ Kitware.
2007-04-17 10:19:47 -06:00
Brian
9cbcf7c696 regenerated 2007-04-17 09:16:59 -06:00
Brian
468a33d19a fix/simplify some texture functions 2007-04-17 09:16:30 -06:00
Brian
893b368a82 more matrix function updates 2007-04-17 09:15:57 -06:00
Brian
41fc55dd81 don't set GL_TEXTURE_MAX_LEVEL for GL_TEXTURE_RECTANGLE_ARB as that generates an error 2007-04-17 08:29:37 -06:00
Thomas Hellstrom
1a9483c954 Defer buffer pool creation to the first context creation.
This way we have a hw context so that we can take the hardware lock.
Also, at this point, AIGLX isn't locked with the X server context as it is
at screen creation.
2007-04-17 15:21:54 +02:00
Roland Scheidegger
36949abec7 cleanups for t_vb_program.c
use VertexProgram._Current instead of VertexProgram.Current in a few more places.
Only fixup fogc and psiz in case this is really a nv program (others are fine
if undefined), and fix this case up so the values actually get written.
2007-04-17 14:01:42 +02:00
Oliver McFadden
6459adf79b r300: r300_render.c:391: warning: unused variable 'i' 2007-04-17 07:05:15 +00:00
Brian
badc346206 lots of changes, fixes, clean-ups 2007-04-16 17:56:13 -06:00
Brian
4a7c45118d just clean-ups 2007-04-16 17:36:39 -06:00
Brian
34ca2be769 move GL_EXT_stencil_two_side into alphabetical position 2007-04-16 17:18:39 -06:00
Brian
5888010362 Fix glActiveStencilFaceEXT dispatch problem (bug 10523).
OK, _all_ extensions that might get enabled by the driver need to be in the
card_extensions[] list.  driInitExtensions() is called at least twice: first
during screen creation, then once for each context that's created.
The first call sets up the dispatch table.  The second call just sets the
extension enable/disable flags.
2007-04-16 17:16:46 -06:00
Brian
dfee7619d4 remove _tnl_arb_vertex_program_stage 2007-04-16 15:15:53 -06:00
Brian
96e05da1c9 remove _tnl_arb_vertex_program_stage 2007-04-16 15:15:23 -06:00
Brian
1560de2c3c need to clamp MAD for linear fog 2007-04-16 15:09:39 -06:00
Brian
921b008419 removed unused t_vb_arbprogram stage 2007-04-16 11:03:14 -06:00
Brian
aa6992a296 remove t_vb_arbprogram.c 2007-04-16 10:59:00 -06:00
Brian
4b3835dadf unhook t_vb_arbprogram.c code - it's going away 2007-04-16 10:58:30 -06:00
Brian
64e8088667 Use generic program limits instead of NV-specific ones to init program constants.
Previously, this limited us to 12 temp regs for vertex programs.  Many vertex
shaders could exceed that.  This forces us to stop using t_vb_arbprogram.c
for now because of its particular register indexing scheme.  Need to increase
bits allocated for register indexing, etc.
2007-04-16 10:36:28 -06:00
Brian
3dfcd48469 Fix some assertions that could occur when an error was earlier logged. 2007-04-16 10:32:48 -06:00
Brian
e812a2a484 use b->display instead of b->xm_visual->display to fix some problems detected w/ valgrind 2007-04-16 09:11:20 -06:00
Thomas Hellstrom
da56df9d72 Make sure we are locked when creating drm buffer objects.
Don't place buffer objects on unfenced list when newly created.
Fix a buffer object wait-for-idle deadlock.
2007-04-16 16:04:12 +02:00
Brian
9519785e29 illegal to set GL_TEXTURE_MAX_LEVEL w/ GL_TEXTURE_RECTANGLE_ARB 2007-04-14 09:38:20 -06:00
Brian
83ad64d94a implement shadow2DRect functions 2007-04-14 09:36:17 -06:00
Brian
fde15a2bae Fix sample_depth_texture() to handle texture rectangle coords. 2007-04-14 09:33:20 -06:00
Brian
216eb81c53 set osmesa renderbuffer refcount=1 upon creation, free renderbuffer in OSMesaDestroyContext() 2007-04-14 08:09:12 -06:00
Brian
4fc46a6c82 more _mesa_unreference_framebuffer() calls, remove dead code 2007-04-14 08:06:54 -06:00
Brian
e19cfabb6e fix negative zoom factor bug (10636), more comments 2007-04-14 07:49:21 -06:00
Dave Airlie
8d8a3cc398 r300: emit different clear paths for non-TCL, this gets the clear color correct 2007-04-14 17:44:33 +10:00
Dave Airlie
fb1d22d23d r300: remove unneeded semicolon from macro 2007-04-14 17:42:59 +10:00
Dave Airlie
3d59042afd r300: if we don't have TCL don't setup state emissions for vertex shaders 2007-04-14 04:54:49 +01:00
Brian
967c1056d5 patch for Digital/Tru64 (bug 10635) - forwarded to OpenGL ARB as well 2007-04-13 09:55:35 -06:00
George Sapountzis
9f8373d5ca xmesa: drop unused XMesaPutImageHelper.
It could only be called from XMesaCopySubBuffer but this function is not used
by XFree86.

It seems that XMesaPutImageHelper would handle sub-images but never got
finished. Proper sub-image helpers should be written if need be.
2007-04-13 18:13:08 +03:00
George Sapountzis
50aaabc248 xmesa: export xmesa functions used by xfree86.
This uses xmesa.h as the GLcore interface and avoids adding an explicit GLcore
inteface which would not be a proper interface anyway.

It puts the declarations of the three functions specific for XMesa/XFree86 in
xmesa.h, we can push them down to xmesa_xf86.h if hiding behind XFree86Server
ifdef's is not enough.
2007-04-13 18:12:37 +03:00
Brian
30b6f11de1 s/version/vertex/ 2007-04-12 16:18:27 -06:00
Brian
f11604a30d fix bug in _playback_copy_to_current(): need to skip version position data (see bug 10587) 2007-04-12 16:17:01 -06:00
Brian
99193e4f74 disable debug printfs 2007-04-12 15:45:02 -06:00
Brian
5b74fe0889 Added sanity checking in _slang_sizeof_type_specifier() to be sure sizes are what's expected. 2007-04-12 15:23:55 -06:00
Brian
431d650f2b use _mesa_clear_shader_program_data() 2007-04-12 15:22:53 -06:00
Brian
3c008a014f New _mesa_reference_shader/program() function to consolidate refcounting.
Note that (unlike texture objects), shader handles remain valid (in the
hash table) after glDeleteShader/Program() if the refcount isn't zero.
2007-04-12 15:22:32 -06:00
Brian
bf287356cf restore 200x200 window size, animation, version check 2007-04-11 14:09:32 -06:00
Brian
bce7043ebc regenerated 2007-04-11 12:30:31 -06:00
Brian
70b0e123c4 checkpoint: updating non-square matrix constructors and operators 2007-04-11 12:30:03 -06:00
Brian
f98f4f6d7a move/fix texture sampling funcs 2007-04-11 12:29:38 -06:00
Brian
afc58f5f7e s/Shadow/SHADOW/ 2007-04-11 11:13:37 -06:00
Brian
b61d74c575 as with prev commit, also fix color index mode zoomed depth copies (bug 10608) 2007-04-11 09:04:18 -06:00
Brian
9f66025f54 fix invalid error detection problem in _mesa_bind_attrib_location(), bug 10602 2007-04-11 09:00:56 -06:00
Brian
183d8e0620 fix zoomed depth copies (bug 10608) 2007-04-11 08:47:05 -06:00
Brian
b0bba03846 use _mesa_reference_renderbuffer(), fix typo 2007-04-11 08:11:52 -06:00
Brian
ba876be0c0 fix/work-around allocation bugs for non-square matrices 2007-04-10 21:51:27 -06:00
Brian
319ce38fa4 update SLANG version test 2007-04-10 21:50:53 -06:00
Dave Airlie
64700be4e1 rs480: set vap cntl to what fglrx uses for non-TCL cards 2007-04-10 11:46:58 +01:00
Michel Dänzer
159ecba4b3 i915: Bring test for vsync to pipe B in line with i915tex. 2007-04-10 11:05:17 +02:00
Michel Dänzer
e798d22556 Add missing generated file. 2007-04-10 11:04:19 +02:00
Brian
0109b47106 NULL ptr check 2007-04-09 19:07:22 -06:00
Brian
7b2626f7d8 plug in GLSL 1.20 unit 2007-04-09 19:07:22 -06:00
Brian
19121e2802 undo a debug/test change 2007-04-09 19:07:22 -06:00
Dave Airlie
e0bbf46342 r300: don't enable VAP/TCL on cards that don't support it 2007-04-10 09:32:13 +10:00
Brian
702c8f1e6c remove unneeded initialization code (see bug 10569) 2007-04-09 11:21:51 -06:00
Brian
f9574c3f6b allocate __GLXdisplayPrivate w/ Xcalloc instead of Xmalloc (bug 10569) 2007-04-09 08:49:26 -06:00
Michel Dänzer
e8292d28e4 i915tex: Fix some mismatches between texels or bytes for pitch/stride. 2007-04-09 14:57:08 +02:00
Michel Dänzer
c96974f78c i915tex: Make sure texture format fetch hooks are initialized. 2007-04-09 14:53:41 +02:00
Dave Airlie
6461e91ac3 the RS400 definitely doesn't work at this point so don't let it init 2007-04-09 22:03:31 +10:00
Brian
af807a4696 enable GLSL 1.20 2007-04-08 21:48:19 -06:00
Brian
5c0c60a13c support for GLSL 1.20 non-square matrices 2007-04-08 16:47:32 -06:00
Brian
5dba996dba add glsl to PROGRAM_DIRS 2007-04-08 15:50:31 -06:00
Brian
9612a3011f fix some dependencies, remove some CFLAGS 2007-04-08 15:42:26 -06:00
Brian
0d3d930912 add 2.1 functions 2007-04-08 15:41:02 -06:00
Adam Jackson
d8bfc42bb7 Make sure GLX entrypoints are marked PUBLIC.
Fedora bug #229808.
2007-04-08 14:40:03 -04:00
Wei Wang
ca7885f733 fix bug 9823: GL_CLIENT_ATTRIB_STACK_DEPTH query fails for indirect rendering 2007-04-08 11:24:08 -06:00
Michel Dänzer
9176752172 i915tex: Clean up resizing of renderbuffers. 2007-04-08 14:04:15 +02:00
Michel Dänzer
79bf692420 driUpdateFramebufferSize: Use ctx->Driver.ResizeBuffers. 2007-04-08 14:02:14 +02:00
Brian
f72e7fb1d6 MAX_TEXTURE_COORDS_ARB and MAX_TEXTURE_IMAGE_UNITS_ARB had wrong glGet info.
Fixes bug 10371.
2007-04-07 20:38:25 -06:00
Brian
4647f13c43 fix etags command to find headers 2007-04-07 19:36:58 -06:00
George Sapountzis
20ec486baf Drop XFree86Server from execmem.c
This is a remnant from the libcwrapper days that can be removed now. It is the
last XFree86 glitch in Mesa core.

Reverts the following commit (thanks to Brian Paul for pointing to it):

commit 8b1dc68662
Author: Alan Hourihane <alanh@tungstengraphics.com>
Date:   Tue Jan 24 21:40:53 2006 +0000

    pull in fix from 6.4 branch for XFree86Server definition

commit cc7b6810e2
Author: Ian Romanick <idr@us.ibm.com>
Date:   Fri Oct 21 18:09:24 2005 +0000

    Make execmem.c compile in the server (libGLcore).  Since xf86mmap
    doesn't know about MAP_ANONYMOUS, this is the only viable fix.  This
    issue will likely have to be revisited at some point.
2007-04-07 18:41:14 +03:00
Richard Hughes
55000888b9 set version for tarballs to 6.5.3pre for now 2007-04-07 08:48:07 -06:00
Richard Hughes
4f9d3a07bb fix references to non-existant sz4 field 2007-04-07 08:46:44 -06:00
Richard Hughes
84803279ca fix some CHAN_TYPE==GL_FLOAT breakage 2007-04-07 08:46:10 -06:00
Brian
8d2d6e5194 fix comment typo 2007-04-07 08:43:40 -06:00
Richard Hughes
e9c614a1af remove array_cache/, add vbo/ 2007-04-07 08:39:24 -06:00
Brian
8f3fc5221c added glActiveStencilFaceEXT 2007-04-07 08:38:36 -06:00
Brian
ae55d5322c for evaluators, loop to VBO_ATTRIB_TEX7, not VBO_ATTRIB_INDEX. See bug 10543 2007-04-06 15:45:11 -06:00
George Sapountzis
92b7fa7b48 xmesa: use newly added xm_image.[hc]
Keep external includes to glxheader.h and xmesa includes to xmesaP.h.

Drop the following from xm_image.h:
- dix-config.h (comes from glheader.h)
- xfree86 includes (come from GL/xmesa_xf86.h)
- ifdef __CYGWIN__ (leftover ? xm_api.c has something similar)
2007-04-06 13:28:39 +03:00
George Sapountzis
eb4a8b4bb5 xmesa: add xf86glx_util.[hc] from xserver as xm_image.[hc] 2007-04-06 13:27:43 +03:00
George Sapountzis
663a3e9ba7 Drop the funky SSE exception test on linux.
Replace the check for IN_DRI_DRIVER with the appropriate kernel version check
and just disable SSE on older (pre 2.4) kernels.
2007-04-06 13:22:41 +03:00
Brian
51a894e6eb fix color storage bug in convolution path 2007-04-05 21:12:44 -06:00
Brian
ac32b644ee include points.h to fix warnings 2007-04-05 11:43:07 -06:00
George Sapountzis
487f7a73cb Remove SI imports/exports remnants. 2007-04-05 19:01:51 +03:00
George Sapountzis
aa1c79eaea glx: minor cosmetic in glcontextmodes.c
move memory macros to separate block and unwrap malloc/free for miniglx towards
cleaning Mesa core glitches in glx...
2007-04-05 19:00:47 +03:00
George Sapountzis
885111518e Move glcontextmodes.c to glx.
It is no longer linked with DRI drivers, libGL passes function pointers through
the DRI interface.
2007-04-05 18:59:42 +03:00
Brian
0cae814f36 temporary add some extra renderbuffer debug code 2007-04-05 09:28:09 -06:00
Brian
33c3739628 Remove the never-used SI-style imports/exports code. 2007-04-04 22:18:53 -06:00
Brian
4d864b087e assorted updates 2007-04-04 09:33:12 -06:00
Brian
2f207dcf1e assorted documentation updates 2007-04-04 09:31:41 -06:00
Brian
f9c01c33d3 init span.y=0 to silence warnings 2007-04-04 09:30:28 -06:00
Brian
d4dc57bb13 Overlapping copies with zoomZ=-1 were broken. See bug 10521.
Need to check for overlapping src/dest regions before computing bottom-to-top
vs. top-to-bottom order.
2007-04-04 08:48:06 -06:00
Brian
a28e648690 remove debug printf 2007-04-04 08:26:41 -06:00
Xiang, Haihao
40ae3943f2 i810/i915/i915tex: reinitialize the context point state 2007-04-04 16:50:47 +08:00
Nicolai Haehnle
dba21ed913 Fix in t_vp_build: Missed necessary updates sometimes
_mesa_update_state doesn't always reset VertexProgram._Current to NULL.
This caused us to skip a necessary update of the fixed function vertex
program sometimes.

Change the logic such that we check for updates whenever the _Current
program is either NULL or the program generated by t_vp_build.
2007-04-02 21:01:32 +02:00
Brian
66d336808d Call _glapi_set_context(NULL) in _glapi_check_multithread() to make sure the _glapi_Context global gets cleared properly. 2007-04-02 10:03:34 -06:00
Brian
dccd9c4f4d use _mesa_reference_renderbuffer() in a few more places 2007-04-02 09:57:27 -06:00
Brian
3fe47d5c57 updated debug printf 2007-04-02 09:57:27 -06:00
Brian
3fd88089c0 Fix some bugs/issues related to alpha channel support. See bug 10483. 2007-04-01 18:30:28 -06:00
Brian
0683e4ce4b If using PF_8A8B8G8R, be sure alpha is correctly handled. 2007-04-01 18:28:28 -06:00
Brian
ec42af9263 re-order tokens, fix comments 2007-04-01 18:27:23 -06:00
Brian
00831b5b3b always emit BGN/ENDSUB, for now anyway 2007-03-31 09:09:48 -06:00
Brian
ec6c8f86f3 fix scoping mistake in previous commit that checked for writable LHSs 2007-03-31 09:09:21 -06:00
Brian
e608d92c5b check that LHS of assignment is writable 2007-03-30 14:59:02 -06:00
Eric Anholt
57dadf71ca Merge branch 'origin' 2007-03-30 13:18:27 -07:00
Eric Anholt
adb91c056f Merge branch 'crestline-qa', adding support for the 965GM chipset. 2007-03-30 13:11:38 -07:00
Gustavo Pichorim Boiko
6f652c89d7 call DRI_VALIDATE_DRAWABLE_INFO(), bug 10477 2007-03-30 14:10:10 -06:00
George Sapountzis
7439a36785 Clean and update XMesa/XFree86 interface.
Drop XMesaSetVisualDisplay(), XMesaReset(), no longer used.

Add XMesaCopyContext() and move the GlxSetRenderTables() call for XGL within
XMesaForceCurrent(). This is to make xserver/GL/mesa/X/xf86glx.c unaware of
Mesa internals.

Also, clean some ifdef's to make it clear that USE_XSHM and XFree86Server are
mutually exclusive.

Lastly,
- move gcstruct.h from glxheader.h up to xmesa_xf86.h since it calls *gc->ops
- drop GL/glxtokens.h from xm_api|dd.c, GLX tokens come from glcore.h and are
  used irrelevant of XFree86.
2007-03-30 19:19:00 +03:00
Brian
7eba12edce more tips, validation info 2007-03-28 17:14:35 -06:00
Brian
ba730e14ed cond code fix 2007-03-28 17:08:17 -06:00
Brian
1ba858591b fix cond code swizzle bug 2007-03-28 15:45:24 -06:00
Brian
f2f5d06853 Handle logical NOT and XOR without library functions. Results in much tighter code. 2007-03-28 15:16:33 -06:00
Brian
b2ac30ac36 optimization for the emit_not() function 2007-03-28 14:49:33 -06:00
Brian
3b7f2f53a2 remove IR_BREAK_IF_FALSE 2007-03-28 14:38:36 -06:00
Brian
8128f7143d don't generate IR_BREAK_IF_FALSE 2007-03-28 14:33:25 -06:00
Brian
393a93ea32 Get rid of IR_CONT_IF_FALSE 2007-03-28 14:25:30 -06:00
Brian
3e7d43cd48 Get rid of BRK0, BRK1, CONT0, CONT1 instructions. 2007-03-28 14:23:33 -06:00
Brian
1bbd69251b Don't emit OPCODE_CONT0/1, BRK0/1 instructions, clean-ups elsewhere. 2007-03-28 14:21:26 -06:00
Brian
f841b04601 simplify, clean-up break/cont code 2007-03-28 14:14:00 -06:00
Brian
b463d52143 added some null ptr checks to handle error recovery 2007-03-28 13:29:57 -06:00
Brian
7e4a7fdddd Use constant_to_src_reg() to simplify some code 2007-03-28 13:23:44 -06:00
Brian
ee2f31e281 added missing returns after slang_info_log_error() calls 2007-03-28 12:48:27 -06:00
Brian
dad97b4688 Fix, clean-up code related to comparisons, condition codes, etc. 2007-03-28 11:06:34 -06:00
Brian
a01616eed5 print condcodes if DEBUG_PROG 2007-03-28 11:01:28 -06:00
Brian
d750861dc2 expose _mesa_condcode_string(), fix some printing 2007-03-28 11:01:09 -06:00
Brian
59f7f6dbe9 check that if/while/do-while condition is boolean or scalar 2007-03-28 10:44:38 -06:00
Brian
20d85c609a bump version to 6.5.3 to match version.h 2007-03-28 09:07:41 -06:00
Alan Hourihane
ad766b5785 Add missing OSMesaColorClamp function 2007-03-28 15:58:08 +01:00
Brian
0420d8505a disable MakeTexture() 2007-03-27 16:06:48 -06:00
Brian
05e6fd8398 added ftransform() comment 2007-03-27 16:06:48 -06:00
Brian
e5d00e8cf4 Implement true CAL/RET subroutines. Some optimizations, clean-ups coming... 2007-03-27 16:06:48 -06:00
Brian
31dc7a3c89 fix another pc off-by one 2007-03-27 16:06:47 -06:00
Brian
17238f1ee5 added _slang_label_new_unique() 2007-03-27 16:06:47 -06:00
Brian
f407cada8a fix some printing issues related to subroutines 2007-03-27 16:06:47 -06:00
Brian
e713ef66ef fix a fragment fog regression 2007-03-27 16:06:47 -06:00
Brian
a0275b0d2c fix off by one error in OPCODE_RET 2007-03-27 16:06:47 -06:00
Brian
d6d6d20b13 init machine->StackDepth=0 2007-03-27 16:06:47 -06:00
Brian
1f1f582304 more parenthesis 2007-03-27 16:06:47 -06:00
Roland Scheidegger
811c2e9a91 i915tex compile fix (account for moved _UseTexEnvProgram var) 2007-03-27 22:57:22 +02:00
Roland Scheidegger
cda3236092 fix incorrect _MaxElement calculation
The calculation of _MaxElement was wrong if the stride was larger than
elementSize, which lead to rejection of every DrawElements call which accessed
the maximum element if CheckArrayBounds was enabled.
2007-03-27 21:03:32 +02:00
Roland Scheidegger
9b9e056615 recommit e731d8aafa.
This got lost with glsl-compiler-1 merge, it fixes segfaults when using
ATI_fragment_shader, which uses the ProgramStringNotify mechanism but doesn't
have a valid program pointer.
2007-03-27 19:33:34 +02:00
Brian
ff65fa39e8 add parenthesis around a bit-wise AND term in _tnl_InvalidateState() 2007-03-27 09:52:53 -06:00
Brian
3e45db6729 Restore the UseTexEnvProgram logic.
Was removed during glsl-compiler work.  Still need to go back and revisit this
because of the interaction with fragment shaders...
2007-03-27 09:51:52 -06:00
Roland Scheidegger
3b8ab88131 r300: Fix radeonUpdatePageFlipping() function.
Always call driFlipRenderbuffers() with pfCurrentPage value, in case it's
initially 1 instead of 0. May fix some issues with pageflip, the same fix was
applied to r128, radeon and r200 (6e0e6eff05).
2007-03-27 16:27:34 +02:00
Roland Scheidegger
32225d06b9 r128, radeon, r200: Check ctx->WinSysDrawBuffer before calling function that dereferences it.
Same fix as for r300 (which fixed https://bugs.freedesktop.org/show_bug.cgi?id=10417),
since it's likely an issue with those drivers too.
2007-03-27 16:22:00 +02:00
Bernardo Innocenti
a835939222 always print error messages, unless LIBGL_DEBUG=quiet 2007-03-27 08:05:33 -06:00
Brian
98abd1bbc8 simplify .a suffixing 2007-03-27 07:58:47 -06:00
Bernardo Innocenti
a9455bb9a7 remove static lib before building to make more bulletproof 2007-03-27 07:56:34 -06:00
Michel Dänzer
63c57a14d3 r300: Check ctx->WinSysDrawBuffer before calling function that dereferences it.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=10417 .
2007-03-27 09:44:32 +02:00
Miroslav Šustek
25f21b5331 fix r128 rendering, lockups
mis-count in offset led to mis-rendering and lockups;
units are 4 bytes rather than 1.  Noticed by Chris Salch.
fixes bug 7994, possibly others.
2007-03-26 23:40:04 -04:00
Zou Nan hai
da82d86ea0 Merge branch 'master' of git+ssh://znh@git.freedesktop.org/git/mesa/mesa 2007-03-27 09:41:31 +08:00
Zou Nan hai
075d3d892f Fix compile error 2007-03-27 09:41:01 +08:00
Brian
ae36cfc65e s/SUB/BGNSUB/ 2007-03-26 18:47:19 -06:00
Brian
9878e8ff51 Checkpoint: implementing true CAL/RET instructions for subroutine calls.
Also, found/fixed a code generation regression:  the emit_swizzle() function
was always returning NULL.  This caused emit_move() to miss its chance at peephole
optimization.
2007-03-26 18:46:07 -06:00
Brian
6583429f89 Get rid of IR_JUMP and related code. 2007-03-26 17:16:26 -06:00
Brian
037c068460 special case RET 2007-03-26 16:58:50 -06:00
Brian
c042a91b8b Get rid of SLANG_OPER_GOTO, start rewrite of 'return' handling. 2007-03-26 16:56:45 -06:00
Brian
813a0e11f1 remove debug abort() calls 2007-03-26 16:01:58 -06:00
Brian
52cc32378c Additional error checking for 'return' statements. 2007-03-26 15:46:35 -06:00
Brian
c3da0bd7dd undo some debugging hacks 2007-03-26 15:09:59 -06:00
Brian
e508155d16 dead code elimination for constant-valued if/then/else 2007-03-26 15:02:21 -06:00
Nicolai Haehnle
0426d3c0c8 r300: Remove a warning when vertex programs produce an unused output
As far as we know, the hardware prefers outputs packed tightly together
with no holes caused by outputs that are not even read by the fragment
program. Therefore, we slightly rewrite vertex programs in this case.

It would be interesting to test this interaction between vertex programs
and fragment programs further, because some of that rewrite may be
unnecessary. However, play it safe for now and don't change the current
behaviour.
2007-03-26 22:25:06 +02:00
Nicolai Haehnle
b53745ce91 r300: Whitespace cleanup (remove trailing spaces) 2007-03-26 22:25:06 +02:00
Brian
768f7231ea Fix a few issues with computing storage sizes with respect to swizzles. 2007-03-26 13:46:46 -06:00
Brian
680abf8a02 In _mesa_lookup_parameter_constant() make sure we return a full, 4-component swizzle. 2007-03-26 13:46:46 -06:00
Nicolai Haehnle
1170268088 r300: Fix warnings that were introduced by the glsl merge 2007-03-26 21:41:57 +02:00
Brian
38a1c2b495 Add _swrast_span_default_secondary_color() for use with glBitmap, glDrawPixels, etc.
Secondary color wasn't getting added to post-texture color when drawing
bitmaps, images.  See bug 10409.
2007-03-26 11:30:05 -06:00
Brian
b5d988dd19 remove incorrect assertions 2007-03-26 10:39:56 -06:00
Brian
b67d93111d minor status updates 2007-03-26 10:23:50 -06:00
Nian Wu
ee9bc897f8 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-26 17:00:29 +08:00
Nian Wu
1b354bb5e4 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-25 17:00:24 +08:00
Nian Wu
44fb5156bb Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-24 17:00:29 +08:00
Nian Wu
ad76128204 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-23 17:00:28 +08:00
Nian Wu
2eb656ef4f Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-22 17:00:33 +08:00
Nian Wu
8ba06464ac Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-21 17:00:32 +08:00
Nian Wu
76444d042c Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-20 13:10:46 +08:00
Nian Wu
e01ee3da57 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-19 17:00:19 +08:00
Nian Wu
fd1b1fce3f Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-18 17:00:18 +08:00
Nian Wu
38889f5221 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-17 17:00:25 +08:00
Nian Wu
a02870f4f6 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-16 17:00:24 +08:00
Nian Wu
d63eef4b86 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-15 17:00:22 +08:00
Nian Wu
805b1cf482 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-14 17:00:15 +08:00
Nian Wu
4110fac389 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-13 17:00:18 +08:00
Nian Wu
5a5b55943d Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-12 09:03:27 +08:00
Nian Wu
1e055089a3 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-07 16:01:36 -05:00
Nian Wu
87c9ad6fd5 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-06 16:01:23 -05:00
Nian Wu
c05b6f800a Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-06 07:43:03 -05:00
Nian Wu
540e1c70cc Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-05 09:01:31 -05:00
Nian Wu
180c0d70c4 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-02 09:01:27 -05:00
Nian Wu
6a47e35065 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-03-01 09:01:58 -05:00
Nian Wu
381b4b0c91 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-02-27 14:42:16 -05:00
Nian Wu
675f7f627b Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2007-02-25 09:40:28 -08:00
Wang Zhenyu
51bfb8fc8c Add Intel 965GM chipset info 2007-02-02 10:04:48 +08:00
Wang Zhenyu
6b6760d6bc Revert origin crestline pci id patch 2007-02-02 10:01:42 +08:00
Zou Nan hai
c171166987 1. Fix bug #155
2. I notice multiple ARB_occlusion_query should be able to overlap according to spec.

3. Declaring extern variables in a .c file is evil, fix it.
2007-01-18 14:41:38 +08:00
Keith Packard
a27d3e43fe Merge branch 'master' into crestline 2007-01-07 23:03:01 -08:00
Keith Packard
6a632de96d Merge branch 'origin' into crestline 2007-01-07 20:57:56 -08:00
Keith Packard
92de58f001 Merge branch 'master' into crestline 2007-01-06 17:14:14 -08:00
Wang Zhenyu
caf8010652 Merge branch 'master' into crestline
Conflicts:

	src/mesa/drivers/dri/i965/brw_tex_layout.c

Michel Dänzer replaced the copy of the 945 mipmap layout code with that from
the 945 driver directly.
2007-01-06 15:49:23 -08:00
Nian Wu
f34cad0f97 Merge branch 'crestline' into crestline-qa 2006-12-26 16:46:51 -08:00
Haihao Xiang
adccb084df Support linear format in i965.
Fix bug #117 #118
2006-12-26 16:45:02 -08:00
Nian Wu
ead0f46d5f Merge branch 'crestline' into crestline-qa 2006-12-17 10:49:43 -08:00
Nian Wu
77b862a849 Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline 2006-12-13 13:49:00 -08:00
Zou Nan hai
ed7fbad206 Fix bug #93, i965 driver not thread safe.
I am not confident of it is 100% thread safe now.
  bufmgr_fake.c need a total rewrite later
(cherry picked from 606632ca27558ee1335be2f4a5906f2baa240a6a commit)
2006-12-13 13:29:37 -08:00
Zou Nan hai
4720cd0050 fix bug #99.
prim_count overflow when there is more than 1 cliprect
(cherry picked from 84b958d66fe7d3fe03ed12b493e3f3197f656531 commit)
2006-12-13 13:29:20 -08:00
Michel Dänzer
c9795c6ca2 minstall: Pass correct destination file path to $RM regardless of source path.
(cherry picked from 26626c0052 commit)
2006-12-13 13:26:09 -08:00
Michel Dänzer
bce82efe1f minstall: Always remove destination file before (re-)creating it.
This avoids issues with overwriting files that are being used.
(cherry picked from d71a5647a3 commit)
2006-12-13 13:25:42 -08:00
Zou Nan hai
aeda4c589a ARB_occlusion_query support 2006-12-13 13:25:12 -08:00
Zou Nan hai
696fe3f52e if (tex width < 4), mipmap calculation will be out of range 2006-12-13 13:24:35 -08:00
Zou Nan hai
c34d026eb0 Fix bug #93 2006-12-13 15:27:17 +08:00
Zou Nan hai
de90bbd0b7 fix for bug #99 2006-12-12 15:00:27 +08:00
Eric Anholt
d214138910 Merge branch 'origin' into crestline 2006-12-11 10:50:25 -08:00
Wang Zhenyu
89433fef0d ARB_occlusion_query support 2006-12-11 00:01:56 -08:00
Wang Zhenyu
b4d9c0048f if (tex width < 4), mipmap calculation will be out of range 2006-12-11 00:00:51 -08:00
Eric Anholt
9a94dae4c2 Avoid branch instructions while in single program flow mode.
There is an errata for Broadwater that threads don't have the instruction/loop
mask stacks initialized on thread spawn.  In single program flow mode, those
stacks are not writable, so we can't initialize them.  However, they do get
read during ELSE and ENDIF instructions.  So, instead, replace branch
instructions in single program flow mode with predicated jumps (ADD to the ip
register), avoiding use of the more complicated branch instructions that may
fail.  This is also a minor optimization as no ENDIF equivalent is necessary.
2006-12-10 12:24:51 -08:00
Eric Anholt
183abbcd6b Connect INTEL_DEBUG=sync up to cmd/batch ioctls. 2006-12-10 12:24:46 -08:00
Wang Zhenyu
0536268267 adding pci id of Crestline 2006-12-10 12:24:40 -08:00
308 changed files with 17795 additions and 15997 deletions

3
.gitignore vendored
View File

@@ -1,7 +1,8 @@
*~
*.a
*.o
*.so
*.sw[a-z]
*~
depend
depend.bak
lib

View File

@@ -7,7 +7,9 @@ SUBDIRS = src progs
default: $(TOP)/configs/current
@for dir in $(SUBDIRS) ; do \
(cd $$dir ; $(MAKE)) || exit 1 ; \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
@@ -16,7 +18,9 @@ doxygen:
clean:
@for dir in $(SUBDIRS) ; do \
(cd $$dir ; $(MAKE) clean) ; \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done
@@ -34,9 +38,12 @@ realclean:
install:
@for dir in $(SUBDIRS) ; do \
(cd $$dir ; $(MAKE) install) || exit 1 ; \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
done
# DirectFBGL module installation
linux-directfb-install:
cd src/mesa/drivers/directfb && $(MAKE) install
@@ -155,10 +162,10 @@ ultrix-gcc:
# Rules for making release tarballs
DIRECTORY = Mesa-6.5.2
LIB_NAME = MesaLib-6.5.2
DEMO_NAME = MesaDemos-6.5.2
GLUT_NAME = MesaGLUT-6.5.2
DIRECTORY = Mesa-7.0
LIB_NAME = MesaLib-7.0
DEMO_NAME = MesaDemos-7.0
GLUT_NAME = MesaGLUT-7.0
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
@@ -209,9 +216,6 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
$(DIRECTORY)/src/mesa/glapi/descrip.mms \
$(DIRECTORY)/src/mesa/glapi/sources \
$(DIRECTORY)/src/mesa/array_cache/*.[ch] \
$(DIRECTORY)/src/mesa/array_cache/descrip.mms \
$(DIRECTORY)/src/mesa/array_cache/sources \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/math/sources \
@@ -225,12 +229,17 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
$(DIRECTORY)/src/mesa/shader/slang/sources \
$(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \
$(DIRECTORY)/src/mesa/shader/slang/library/*.gc \
$(DIRECTORY)/src/mesa/shader/slang/library/*.syn \
$(DIRECTORY)/src/mesa/shader/slang/library/Makefile \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/sources \
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
$(DIRECTORY)/src/mesa/swrast_setup/sources \
$(DIRECTORY)/src/mesa/vbo/*.[chS] \
$(DIRECTORY)/src/mesa/vbo/descrip.mms \
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
$(DIRECTORY)/src/mesa/tnl/sources \
@@ -289,7 +298,16 @@ MAIN_FILES = \
$(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
$(DIRECTORY)/windows/VC7/mesa/mesa.sln \
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj \
$(DIRECTORY)/windows/VC8/mesa/mesa.sln \
$(DIRECTORY)/windows/VC8/mesa/gdi/gdi.vcproj \
$(DIRECTORY)/windows/VC8/mesa/glu/glu.vcproj \
$(DIRECTORY)/windows/VC8/mesa/mesa/mesa.vcproj \
$(DIRECTORY)/windows/VC8/mesa/osmesa/osmesa.vcproj \
$(DIRECTORY)/windows/VC8/progs/progs.sln \
$(DIRECTORY)/windows/VC8/progs/demos/gears.vcproj \
$(DIRECTORY)/windows/VC8/progs/glut/glut.vcproj
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
@@ -365,6 +383,9 @@ DEMO_FILES = \
$(DIRECTORY)/progs/samples/Makefile* \
$(DIRECTORY)/progs/samples/README \
$(DIRECTORY)/progs/samples/*.c \
$(DIRECTORY)/progs/glsl/Makefile* \
$(DIRECTORY)/progs/glsl/*.c \
$(DIRECTORY)/progs/glsl/*.txt \
$(DIRECTORY)/progs/windml/Makefile.ugl \
$(DIRECTORY)/progs/windml/*.c \
$(DIRECTORY)/progs/windml/*.bmp \

View File

@@ -100,6 +100,14 @@ do
-L*)
DEPS="$DEPS $1"
;;
-pthread)
# this is a special case (see bugzilla 10876)
DEPS="$DEPS $1"
;;
'-pthread')
# for FreeBSD
DEPS="$DEPS -pthread"
;;
'-cplusplus')
CPLUSPLUS=1
;;
@@ -212,15 +220,16 @@ case $ARCH in
# finish up
FINAL_LIBS="${LIBNAME}"
elif [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}" # prefix with "lib"
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
LIBNAME="lib${LIBNAME}.a" # prefix with "lib", suffix with ".a"
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
LINK="ar"
OPTS="-ru"
rm -f ${LIBNAME}
# make lib
${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
ranlib ${LIBNAME}.a
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
ranlib ${LIBNAME}
# finish up
FINAL_LIBS=${LIBNAME}.a
FINAL_LIBS=${LIBNAME}
else
LIBNAME="lib${LIBNAME}" # prefix with "lib"
case $ARCH in 'Linux' | 'GNU' | GNU/*)

View File

@@ -8,9 +8,9 @@
CONFIG_NAME = default
# Version info
MESA_MAJOR=6
MESA_MINOR=5
MESA_TINY=2
MESA_MAJOR=7
MESA_MINOR=1
MESA_TINY=0
# external projects. This should be useless now that we use libdrm.
DRM_SOURCE_PATH=$(TOP)/../drm
@@ -63,7 +63,7 @@ SRC_DIRS = mesa glu glut/glx glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = demos redbook samples xdemos
PROGRAM_DIRS = demos redbook samples glsl xdemos
# Library/program dependencies

View File

@@ -27,9 +27,9 @@ ASM_SOURCES =
# Library/program dependencies
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread $(LIBDRM_LIB)
-lm -pthread $(LIBDRM_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11

View File

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

View File

@@ -22,7 +22,8 @@ ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I x11-xcb` `pkg-config --cflags-only-I xcb-glx`
@@ -65,4 +66,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
savage sis tdfx trident unichrome ffb nouveau

View File

@@ -15,6 +15,13 @@ PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
# DRM and pciaccess
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
PCIACCESS_CFLAGS = `pkg-config --cflags pciaccess`
PCIACCESS_LIB = `pkg-config --libs pciaccess`
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE -DHAVE_POSIX_MEMALIGN \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC -DIN_DRI_DRIVER
@@ -28,7 +35,7 @@ CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
ASM_SOURCES =
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(TOP)/$(LIB_DIR)
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(TOP)/$(LIB_DIR) $(PCIACCESS_LIB)
GL_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
@@ -39,5 +46,5 @@ SRC_DIRS = glx/mini mesa glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx
#DRI_DIRS = ffb gamma sis savage
DRI_DIRS = i810 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
#DRI_DIRS = ffb gamma sis savage tdfx unichrome fb
DRI_DIRS = i810 i915tex i915 mach64 mga r128 r200 radeon

View File

@@ -88,19 +88,6 @@ driver (such as <code>radeon_dri.so</code>) at runtime. &nbsp;The
environment variable <code>LIBGL_DRIVERS_PATH</code> should name the
directory where these modules are located.<br>
<br>
Prior to running a MiniGXL application, the following kernel modules
must be installed:<br>
<br>
<div style="margin-left: 40px;"> agpgart.o<br>
radeonfb.o &nbsp;(assuming Radeon hardware)<br>
radeon.o &nbsp;(assuming Radeon hardware)<br>
</div>
<code></code> <br>
Finally, MiniGLX reads a configuration file (by default,<code>
/etc/miniglx.conf</code>) to determine basic configuration information.
&nbsp;The configuration file may also be located in the directory
specified by the <code>MINIGLX_CONF</code> environment variable).<br>
<br>
The remainder of this section describes the MiniGLX API functions.<br>
<br>
<h2>3.1 Initialization</h2>

View File

@@ -1,155 +1,163 @@
File: docs/README.WIN32
Last updated: Mar 31, 2006 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
----- -----
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
directory. The libs and demos build separately, so if you do not care
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
more than one ZIP file, they all need to be unzipped into the same
directory. Don't worry, you will not overwrite anything.
The Windows build system uses Microsoft Visual Studio. Project files
for a specific version of Visual Studio are in their own directory in
the top-level "windows" directory. For example, Visual Studio 6 files
are in windows/VC6. If a directory does not exist for your version of
Visual Studio, you can try importing the project files from an earlier
version of Visual Studio. At this time, project files exist for
Version 6 and Version 7. The code has been built with a beta version
of Version 8 and it runs on 64-bit Windows. If you want to try this,
start by importing the VC7 files and create the 64-bit targets in the
configuration manager.
It is likely that the new and free Visual Studio Express can be used
to build Mesa, but it hasn't been tried yet. Start with the VC7
project files.
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
to build GLUT and some demo programs are in the progs directory.
Makefiles are no longer shipped or supported, but can be generated
from the projects using Visual Studio.
Windows Drivers
------- -------
At this time, only the GDI driver is known to work. Most of the demos
in progs/demos should work with this driver.
Source code also exists in the tree for other drivers in
src/mesa/drivers/windows, but the status of this code is unknown.
The GDI driver operates basically by writing pixel spans into a DIB
section and then blitting the DIB to the window. The driver was
recently cleaned up and rewitten and so may have bugs or may be
missing some functionality. The older versions of the CVS source may
be useful in figuring out any problems, or report them to me.
To build Mesa with the GDI driver, build the mesa, gdi, and glu
projects in the Visual Studio workspace found at
windows/VC6/mesa/mesa.dsw
or
windows/VC7/mesa/mesa.sln
The osmesa DLL can also be built with the osmesa project.
The build system creates a lib top-level directory and copies
resulting LIB and DLL files to this lib directory. The files are:
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
If the MesaDemos ZIP file was extracted, the DLL files are also copied
to the demos directory. This facilitates running the demos as described
below.
GLUT and Demos
---- --- -----
A Visual Studio workspace can be found at
windows/VC6/progs/progs.dsw
or
windows/VC7/progs/progs.sln
It can be used to build GLUT and a few demos. The GLUT lib and DLL
are copied to the top-level lib directory, along with the Mesa libs.
The demo build system expects to find the LIB files in the top level
lib directory, so you must build the Mesa libs first. The demo
executables are placed in the demos directory, because some of them
rely on data files found there. Also, the Mesa lib DLL's were copied
there by the Mesa lib build process. Therefore, you should be able to
simply run the demo executables from the demo directory.
If you want to run the demos from the Visual Studio, you may have to
change the startup directory and explicitly state where the executables are.
You may also build all the demo programs by using a makefile. Go to
the progs/demos directory and make sure you have executed VCVARS32.BAT
or whatever setup script is appropriate for your compiler. Then,
nmake -f Makefile.win
should build all the demos.
Build System Notes
----- ------ -----
VC6
---
Visual Studio 6 does not recognize files with the .cc extension as C++
language files, without a lot of unnatural tweaking. So, the VC6
build process uses custom build steps to compile these files in the
GLU library.
Two additional configurations are provided, Debug x86 and Release x86
that activate the shader code compilation by defining SLANG_86. It is
unknown if and how this works.
VC7
---
The above-mentioned .cc problem does not exist in this version.
General
-------
After building, you can copy the above DLL files to a place in your
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
in a system directory, place them in the same directory as the
executable(s). Be careful about accidentially overwriting files of
the same name in the SYSTEM32 directory.
The DLL files are built so that the external entry points use the
stdcall calling convention.
Static LIB files are not built. The LIB files that are built with are
the linker import files associated with the DLL files.
The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code.
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
to the project settings. You will also need to edit src/mesa.def to
change all the gl* symbols to mgl*. Because this is easy to do with a
global replace operation in a text editor, no additional mangled
version of mesa.def is maintained or shipped.
If you have a Windows-related build problem or question, it is
probably better to direct it to me (kschultz@users.sourceforge.net),
rather than directly to the other Mesa developers. I will help you as
much as I can. I also monitor the Mesa mailing lists and will answer
questions in this area there as well.
Karl Schultz
File: docs/README.WIN32
Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
----- -----
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
directory. The libs and demos build separately, so if you do not care
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
more than one ZIP file, they all need to be unzipped into the same
directory. Don't worry, you will not overwrite anything.
The Windows build system uses Microsoft Visual Studio. Project files
for a specific version of Visual Studio are in their own directory in
the top-level "windows" directory. For example, Visual Studio 8 files
are in windows/VC8.
Support has been dropped for versions of Visual Studio prior to 8. The
main reason is because Microsoft now provides a free compiler and
developer environment. Visual Studio Express can be found at
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
You'll also need the Platform SDK. Instructions for obtaining and
using the SDK with Visual Studio Express can be found at
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
If you are stuck using VC6 or VC7, you may start with these project
files, but you may need to modify them to reflect changes in the
Mesa source code tree. If you sucessfully update the project files,
please submit them to the author of this document so that they may
be included in the next distribution.
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
to build GLUT and some demo programs are in the progs directory.
Makefiles are no longer shipped or supported, but can be generated
from the projects using Visual Studio.
Windows Drivers
------- -------
At this time, only the GDI driver is known to work. Most of the demos
in progs/demos should work with this driver.
Source code also exists in the tree for other drivers in
src/mesa/drivers/windows, but the status of this code is unknown.
The GDI driver operates basically by writing pixel spans into a DIB
section and then blitting the DIB to the window. The driver was
recently cleaned up and rewitten and so may have bugs or may be
missing some functionality. The older versions of the CVS source may
be useful in figuring out any problems, or report them to me.
To build Mesa with the GDI driver, build the mesa, gdi, and glu
projects in the Visual Studio workspace found at
windows/VC8/mesa/mesa.sln
The osmesa DLL can also be built with the osmesa project.
The build system creates a lib top-level directory and copies
resulting LIB and DLL files to this lib directory. The files are:
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
If the MesaDemos ZIP file was extracted, the DLL files are also copied
to the demos directory. This facilitates running the demos as described
below.
GLUT and Demos
---- --- -----
A Visual Studio workspace can be found at
windows/VC8/progs/progs.sln
It can be used to build GLUT and a few demos. The GLUT lib and DLL
are copied to the top-level lib directory, along with the Mesa libs.
The demo build system expects to find the LIB files in the top level
lib directory, so you must build the Mesa libs first. The demo
executables are placed in the demos directory, because some of them
rely on data files found there. Also, the Mesa lib DLL's were copied
there by the Mesa lib build process. Therefore, you should be able to
simply run the demo executables from the demo directory.
If you want to run the demos from the Visual Studio, you may have to
change the startup directory and explicitly state where the executables are.
You may also build all the demo programs by using a makefile. Go to
the progs/demos directory and make sure you have executed VCVARS32.BAT
or whatever setup script is appropriate for your compiler. Then,
nmake -f Makefile.win
should build all the demos.
Build System Notes
----- ------ -----
VC6 (not actively supported)
---
Visual Studio 6 does not recognize files with the .cc extension as C++
language files, without a lot of unnatural tweaking. So, the VC6
build process uses custom build steps to compile these files in the
GLU library.
Two additional configurations are provided, Debug x86 and Release x86
that activate the shader code compilation by defining SLANG_86. It is
unknown if and how this works.
VC7 (not actively supported)
---
The above-mentioned .cc problem does not exist in this version.
VC8
---
No notes.
General
-------
After building, you can copy the above DLL files to a place in your
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
in a system directory, place them in the same directory as the
executable(s). Be careful about accidentially overwriting files of
the same name in the SYSTEM32 directory.
The DLL files are built so that the external entry points use the
stdcall calling convention.
Static LIB files are not built. The LIB files that are built with are
the linker import files associated with the DLL files.
The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code.
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
to the project settings. You will also need to edit src/mesa.def to
change all the gl* symbols to mgl*. Because this is easy to do with a
global replace operation in a text editor, no additional mangled
version of mesa.def is maintained or shipped.
If you have a Windows-related build problem or question, it is
probably better to direct it to me (kschultz@users.sourceforge.net),
rather than directly to the other Mesa developers. I will help you as
much as I can. I also monitor the Mesa mailing lists and will answer
questions in this area there as well.
Karl Schultz

View File

@@ -25,6 +25,7 @@ a:visited {
<ul>
<li><a href="intro.html" target="MainFrame">Introduction</a>
<li><a href="news.html" target="MainFrame">News</a>
<LI><A HREF="developers.html" target="MainFrame">Developers</A>
<li><a href="systems.html" target="MainFrame">Platforms and Drivers</a>
<li><a href="license.html" target="MainFrame">License & Copyright</a>
<li><a href="faq.html" target="MainFrame">FAQ</a>
@@ -64,15 +65,15 @@ a:visited {
<ul>
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
<li><a href="memory.html" target="MainFrame">DRI Memory Management</a>
<li><a href="shading.html" target="MainFrame">Shading Language</a>
<li><a href="utilities.html" target="MainFrame">Utilities</a>
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
<li><a href="devinfo.html" target="MainFrame">Development Notes</a>
<li><a href="sourcedocs.html" target="MainFrame">Source Documentation</a>
<li><a href="subset.html" target="MainFrame">Subset Information</a>
<li><a href="fbdev-dri.html" target="MainFrame">fbdev/DRI Environment</a>
<li><a href="subset.html" target="MainFrame">Mesa Subset Driver</a>
<li><a href="glfbdev-driver.html" target="MainFrame">glFBDev Driver</a>
<LI><A HREF="custom.html" target="MainFrame">Custom Development</A>
<LI><A HREF="dispatch.html" target="MainFrame">GL Dispatch</A>
</ul>

View File

@@ -1,27 +0,0 @@
<HTML>
<TITLE>Custom Development</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<H1>Custom Development</H1>
<p>
Mesa is primarily developed and maintained on a volunteer basis.
Some Mesa development work has been done in conjuction with contracted
projects, such as the XFree86/DRI drivers.
</p>
<p>
<pre>[Begin shameless plug]</pre>
If you have a need for specific or custom Mesa development work,
<a href="http://www.tungstengraphics.com/" target="_parent">
Tungsten Graphics, Inc.</a> may be able to help you.
<pre>[End shameless plug]</pre>
</p>
</body>
</html>

51
docs/developers.html Normal file
View File

@@ -0,0 +1,51 @@
<HTML>
<TITLE>Developers</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<H1>Developers</H1>
<p>
Both professional and volunteer developers contribute to Mesa.
</p>
<p>
<a href="http://www.tungstengraphics.com/" target="_parent">Tungsten Graphics</a>
employs several of the main Mesa developers including Brian Paul
and Keith Whitwell.
Much of the on-going work in Mesa is done through Tungsten Graphics engineering
contracts.
Prominent examples of this work includes:
</p>
<ul>
<li>DRI drivers for Intel i965, i945, i915 and other chips
<li>Advanced memory manager and framebuffer object support
<li>Shading language compiler and OpenGL 2.0 support
<li>MiniGLX environment
</ul>
<p>
Other companies including
<a href="http://www.intellinuxgraphics.org/index.html" target="_parent">Intel</a>
and IBM also actively contribute to the project.
</p>
<p>
Volunteers have made significant contributions to all parts of Mesa, including
complete device drivers.
</p>
<H1>Custom Development</H1>
<p>
Contact <a href="http://www.tungstengraphics.com/" target="_parent">
Tungsten Graphics</a>
for information about custom development in Mesa, OpenGL, X and other
graphics technologies.
</p>
</body>
</html>

View File

@@ -9,11 +9,7 @@
<H1>Downloading</H1>
<p>
Last development release: <b>6.5.2</b>
</p>
<p>
Last stable release: <b>6.4.2</b>
Last stable release: <b>7.0</b>
</p>
<p>

View File

@@ -12,161 +12,77 @@
<H1>1. Introduction</H1>
<p>
The fbdev/DRI sub-project within Mesa brings hardware accelerated OpenGL
rendering to the Linux fbdev environment.
The X Window System / XFree86 is not needed.
The fbdev/DRI environment supports hardware-accelerated 3D rendering without
the X window system. This is typically used for embedded applications.
</p>
<p>
Basically, the <a href="http://dri.sf.net/">DRI</a> drivers for hardware
accelerated OpenGL for XFree86 have been ported to fbdev so that X is
not needed.
This means fbdev/DRI works in full-screen mode only.
Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
</p>
<p>
DRI driver writers may find this simplified environment easier to work in,
compared to the full XFree86/DRI environment.
Applications in the fbdev/DRI environment use
the <a href="MiniGXL.html"> MiniGLX</a> interface to choose pixel
formats, create rendering contexts, etc. It's a subset of the GLX and
Xlib interfaces allowing some degree of application portability between
the X and X-less environments.
</p>
<p>
Much of the work for this project has been done by Jon Smirl and
Keith Whitwell.
</p>
<p>
To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel.
</p>
<h3>Background Info</h3>
<p>
The Mesa-based DRI drivers used to be hosted in the DRI tree (which is
basically a copy of the XFree86 tree).
Since the Mesa-based DRI drivers are moreso "Mesa drivers" than "XFree86
drivers" and the fact that with some work, the drivers could be used
without X, the driver code was moved into the Mesa tree.
</p>
<p>
So now the DRI drivers can be compiled for two different environments:
fbdev and XFree86.
To build the drivers for XFree86, one has to download/build the DRI
source tree.
Eventually, we'd like to be able to build the drivers for XFree86 outside
of the XFree86/DRI trees.
</p>
<h1>2. Compilation</h1>
<h2>2.1 Compiling the DRM modules</h2>
<p>
First, you'll need the DRM (Direct Rendering Manager) kernel module sources.
They're found in a module of the DRI CVS tree.
To obtain the code do the following:
You'll need the DRM and pciaccess libraries. Check with:
</p>
<pre>
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri login
</pre>
<p>
Press Enter/Return when prompted for a password. Then,
</p>
<pre>
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri co drm
pkg-config --modversion libdrm
pkg-config --modversion pciaccess
</pre>
<p>
Compile the DRM kernel modules:
You can get them from the git repository with:
</p>
<pre>
cd drm/linux
make
git clone git://anongit.freedesktop.org/git/mesa/drm
git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
</pre>
<p>
Note: you may need to be root in order to make a few symlinks.
See the README files in those projects for build/install instructions.
</p>
<p>
When compilation is done, you should have at least the following
kernel modules:
You'll need fbdev header files. Check with:
</p>
<pre>
gamma.o
i810.o
i830.o
mach64.o
mga.o
r128.o
radeon.o
savage.o
sis.o
tdfx.o
via.o
ls -l /usr/include/linux/fb.h
</pre>
<p>
You'll probably want to copy/move them into your kernel module directory
(for example: <code>/lib/modules/2.4.18-14/kernel/drivers/char/drm/</code>).
</p>
<h2>2.2 Compiling the Mesa drivers</h2>
<p>
Begin by editing the <code>Mesa/configs/default</code> file to set
the <code>DRM_SOURCE_PATH</code> variable.
Set it to the location where the DRM module sources are located.
For example, if your current directory in step 2.1 was <code>/home/fred/</code>
set DRM_SOURCE_PATH to <code>/home/fred/drm</code>
</p>
<p>
Next, assuming you're starting with a fresh Mesa CVS checkout,
do the following:
Compile Mesa with the 'linux-solo' configuration:
</p>
<pre>
make linux-solo
</pre>
<p>
If you previously built the source tree, run <code>make realclean</code>
first to remove the old object files.
When complete you should have the following:
</p>
<p>
When this is finished, check the <code>Mesa/lib/</code> directory
to verify that the following files were made:
</p>
<ul>
<li><code>libGL.so.1.2</code> - the client-side OpenGL library
(and a few symlinks to it).
<li><code>libGLU.so.1.1</code> - the GLU library (and a few symlinks to it).
<li><code>libglut.so.3.7</code> - the GLUT library (and a few symlinks to it).
<li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
<li><code>r128_dri.so</code> - DRI driver for ATI Rage 128 cards.
<li><code>r200_dri.so</code> - DRI driver for ATI R200 Radeon cards.
<li><code>radeon_dri.so</code> - DRI driver for original ATI Radeon cards.
<li><code>i810_dri.so</code> - DRI driver for Intel i810/i815 chips.
<li><code>i830_dri.so</code> - DRI driver for Intel i830/i845 chips.
<li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
<li><code>sis_dri.so</code> - DRI driver for SIS cards.
<li><code>tdfx_dri.so</code> - DRI driver for 3dfx Voodoo 3/4/5 cards.
<li><code>gamma_dri.so</code> - DRI driver for 3Dlabs gamma cards.
<li><code>fb_dri.so</code> - software-only fbdev driver.
<li><code>miniglx.conf</code> - configuration file for the MiniGLX interface
<li>lib/libGL.so - the GL library which applications link with
<li>lib/*_dri_so - DRI drivers
<li>lib/miniglx.conf - sample MiniGLX config file
<li>progs/miniglx/* - several MiniGLX sample programs
</ul>
<h1>3. Using fbdev/DRI</h1>
<p>
If XFree86 is currently running, exit/stop the X server so you're
working from the console.
If an X server currently running, exit/stop it so you're working from
the console.
</p>
@@ -175,12 +91,23 @@ working from the console.
<p>
You'll need to load the kernel modules specific to your graphics hardware.
Typically, this consists of the agpgart module, an fbdev driver module
and the DRM kernel module (from step 2.1).
and the DRM kernel module.
</p>
<p>
As root, the kernel modules can be loaded as follows:
</p>
<p>
If you have Intel i915/i945 hardware:
</p>
<pre>
modprobe agpgart # the AGP GART module
modprobe intelfb # the Intel fbdev driver
modprobe i915 # the i915/945 DRI kernel module
</pre>
<p>
If you have ATI Radeon/R200 hardware, run as root:
If you have ATI Radeon/R200 hardware:
</p>
<pre>
modprobe agpgart # the AGP GART module
@@ -189,7 +116,7 @@ If you have ATI Radeon/R200 hardware, run as root:
</pre>
<p>
If you have ATI Rage 128 hardware, run as root:
If you have ATI Rage 128 hardware:
</p>
<pre>
modprobe agpgart # the AGP GART module
@@ -198,7 +125,7 @@ If you have ATI Rage 128 hardware, run as root:
</pre>
<p>
If you have Matrox G200/G400 hardware, run as root:
If you have Matrox G200/G400 hardware:
</p>
<pre>
modprobe agpgart # the AGP GART module
@@ -207,37 +134,46 @@ If you have Matrox G200/G400 hardware, run as root:
</pre>
<p>
Then run <code>lsmod</code> to be sure the modules are loaded.
For a Radeon card, you should see something like this:
To verify that the agpgart, fbdev and drm modules are loaded:
</p>
<pre>
Module Size Used by Not tainted
radeon 110308 0 (unused)
radeonfb 21900 0 (unused)
agpgart 43072 1
ls -l /dev/agpgart /dev/fb* /dev/dri
</pre>
<p>
Alternately, use lsmod to inspect the currently installed modules.
If you have problems, look at the output of dmesg.
</p>
<h2>3.2 Configuration File</h2>
<p>
The <code>Mesa/lib/miniglx.conf</code> file should be installed
in <code>/etc/</code>.
Copy the sample miniglx.conf to /etc/miniglx.conf and review/edit its contents.
Alternately, the MINIGLX_CONF environment variable can be used to
indicate the location of miniglx.conf
</p>
<p>
Edit <code>/etc/miniglx.conf</code> to be sure it's set up correctly
for your hardware.
Comments in the file explain the options.
To determine the pciBusID value, run lspci and examine the output.
For example:
</p>
<pre>
/sbin/lspci:
00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Express Chipset Family Graphics Controller (rev 04)
</pre>
<p>
00:02.0 indicates that pciBusID should be PCI:0:2:0
</p>
<h2>3.3 Running fbdev/DRI Programs</h2>
<p>
Make sure your LD_LIBRARY_PATH environment variable is set to the
<code>Mesa/lib/</code> directory.
location of the libGL.so library. You may need to append other paths
to LD_LIBRARY_PATH if libpciaccess.so is in a non-standard location,
for example.
</p>
<p>
@@ -245,7 +181,7 @@ Change to the <code>Mesa/progs/miniglx/</code> directory and
start the sample_server program in the background:
</p>
<pre>
./sample_server &
./sample_server &amp;
</pre>
<p>
@@ -268,27 +204,24 @@ them from a remote shell so that you can stop them with ctrl-C.
<h1>4.0 Troubleshooting</h1>
<p>
<ol>
<li>
If you try to run miniglxtest and get the following:
</p>
<br>
<pre>
[miniglx] failed to probe chipset
connect: Connection refused
server connection lost
</pre>
<p>
It means that the sample_server process is not running.
</p>
<br>
<br>
</li>
</ol>
<h1>5.0 Programming Information</h1>
<p>
The full OpenGL API is available with fbdev/DRI.
</p>
<p>
OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
interface.

View File

@@ -9,35 +9,31 @@
<H1>Introduction</H1>
<p>
Mesa is a 3-D graphics library with an API which is very similar to
that of <a href="http://www.opengl.org/" target="_parent">OpenGL</a>.*
To the extent that Mesa utilizes the OpenGL command syntax or state
machine, it is being used with authorization from <a
href="http://www.sgi.com/" target="_parent">Silicon Graphics,
Inc.</a>(SGI). However, the author does not possess an OpenGL license
from SGI, and makes no claim that Mesa is in any way a compatible
replacement for OpenGL or associated with SGI. Those who want a
licensed implementation of OpenGL should contact a licensed
vendor.
Mesa is an open-source implementation of the
<a href="http://www.opengl.org/" target="_parent">OpenGL</a> specification -
a system for rendering interactive 3D graphics.
</p>
<p>
Please do not refer to the library as <em>MesaGL</em> (for legal
reasons). It's just <em>Mesa</em> or <em>The Mesa 3-D graphics
library</em>. <br>
A variety of device drivers allows Mesa to be used in many different
environments ranging from software emulation to complete hardware acceleration
for modern GPUs.
</p>
<p>
* OpenGL is a trademark of <a href="http://www.sgi.com/"
target="_parent">Silicon Graphics Incorporated</a>.
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.
</p>
<H1>Project History</H1>
<p>
The Mesa project was founded by me, Brian Paul. Here's a short history
of the project.
The Mesa project was originally started by Brian Paul.
Here's a short history of the project.
</p>
<p>
@@ -132,10 +128,15 @@ specification as well as the GL_ARB_vertex_program and
GL_ARB_fragment_program extensions.
</p>
<p>
June 2007: Mesa 7.0 is released, implementing the OpenGL 2.1 specification
and OpenGL Shading Language.
</p>
<p>
Ongoing: Mesa is used as the core of many hardware OpenGL drivers for
the XFree86 X.org X servers within the
the XFree86 and X.org X servers within the
<A href="http://dri.freedesktop.org/" target="_parent">DRI project</A>.
I continue to enhance Mesa with new extensions and features.
</p>
@@ -145,9 +146,16 @@ I continue to enhance Mesa with new extensions and features.
<H1>Major Versions</H1>
<p>
This is a summary of the major versions of Mesa. Note that Mesa's major
version number tracks OpenGL's minor version number (+1).
Work is underway to implement the OpenGL 2.0 specification.
This is a summary of the major versions of Mesa.
Mesa's major version number has been incremented whenever a new version
of the OpenGL specification is implemented.
</p>
<H2>Version 7.x features</H2>
<p>
Version 7.x of Mesa implements the OpenGL 2.1 API. The main feature
of OpenGL 2.x is the OpenGL Shading Language.
</p>

View File

@@ -6,6 +6,34 @@
<BODY>
<H1>Disclaimer</H1>
<p>
Mesa is a 3-D graphics library with an API which is very similar to
that of <a href="http://www.opengl.org/" target="_parent">OpenGL</a>.*
To the extent that Mesa utilizes the OpenGL command syntax or state
machine, it is being used with authorization from <a
href="http://www.sgi.com/" target="_parent">Silicon Graphics,
Inc.</a>(SGI). However, the author does not possess an OpenGL license
from SGI, and makes no claim that Mesa is in any way a compatible
replacement for OpenGL or associated with SGI. Those who want a
licensed implementation of OpenGL should contact a licensed
vendor.
</p>
<p>
Please do not refer to the library as <em>MesaGL</em> (for legal
reasons). It's just <em>Mesa</em> or <em>The Mesa 3-D graphics
library</em>. <br>
</p>
<p>
* OpenGL is a trademark of <a href="http://www.sgi.com/"
target="_parent">Silicon Graphics Incorporated</a>.
</p>
<H1>License / Copyright Information</H1>
<p>
@@ -24,7 +52,7 @@ The default Mesa license is as follows:
</p>
<pre>
Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

View File

@@ -11,6 +11,40 @@
<H1>News</H1>
<h2>June 22, 2007</h2>
<p>
<a href="relnotes-7.0.html">Mesa 7.0</a> is released.
This is a stable release featuring OpenGL 2.1 support.
</p>
<h2>April 27, 2007</h2>
<p>
<a href="relnotes-6.5.3.html">Mesa 6.5.3</a> is released.
This is a development release which will lead up to the Mesa 7.0 release
(which will advertise OpenGL 2.1 API support).
</p>
<h2>March 26, 2007</h2>
<p>
The new Shading Language compiler branch has been merged into the git
master branch. This is a step toward hardware support for the OpenGL
2.0 Shading Language and will be included in the next Mesa release.
In conjunction, <a href="http://glean.sf.net" target="_parent">Glean
</a> has been updated with a new test that does over 130 tests of the
shading language and built-in functions.
</p>
<h2>April 2007</h2>
<p>
Thomas Hellstr&ouml;m of
<a href="http://www.tungstengraphics.com" target="_parent">
Tungsten Graphics</a> has written a whitepaper describing the new
<a href="http://www.tungstengraphics.com/mm.pdf">DRI memory management
system</a>.
</p>
<h2>December 5, 2006</h2>
<p>
Mesa is now using git as its source code management system.

View File

@@ -8,27 +8,53 @@
<body bgcolor="#eeeeee">
<H1>Mesa 6.5.3 Release Notes / (in progress)</H1>
<H1>Mesa 6.5.3 Release Notes / April 27, 2007</H1>
<p>
Mesa 6.5.3 is a 6.5 follow-on development release with many internal changes.
Mesa 6.5.3 is a development release with many changes and new features.
Mesa 7.0 is expected to follow shortly.
</p>
<h2>MD5 checksums</h2>
<pre>
TBD
39f33ea64e34e2d5b20640b008b57649 MesaLib-6.5.3.tar.gz
46359457147c469745f24b5074a186f0 MesaLib-6.5.3.tar.bz2
a8946fa861634ce15971396f47992c41 MesaLib-6.5.3.zip
08e26948d57eaca74d02a530b2d8106e MesaDemos-6.5.3.tar.gz
8af91773ab2653fe537499676b05f2e8 MesaDemos-6.5.3.tar.bz2
783f81b171bf89b0929abc894efd25a6 MesaDemos-6.5.3.zip
9467d415388fe1ad82991fb20704b812 MesaGLUT-6.5.3.tar.gz
360843e46b7ebb6909290b023f9b26fa MesaGLUT-6.5.3.tar.bz2
7686065e5c15a30de08a1610860b6840 MesaGLUT-6.5.3.zip
</pre>
<h2>Shared library numbering</h2>
<p>
Mesa 6.5.3 supports the OpenGL 2.0/2.1 API. However, the (unix)
shared library version is still 1.5 (i.e. libGL.so.1.5.xxxxxx).
Bumping the shared library version to 2.x would cause linking problems
with existing OpenGL applications. Since OpenGL 2.x is backward
compatible with OpenGL 1.x the shared library version number doesn't
have to be incremented (which would indicate an incompatible ABI).
</p>
<p>
Other OpenGL vendors name their OpenGL 2.x libraries libGL.so.1.0.xxxxx
for the same reason.
</p>
<h2>New features</h2>
<ul>
<li>OpenGL 2.0 support.
<li>Entirely new Shading Language code generator.
<li>OpenGL 2.0 and 2.1 API support.
<li>Entirely new Shading Language code generator. See the
<a href="shading.html">Shading Language</a> page for more information.
<li>Much faster software execution of vertex, fragment shaders.
<li>New vertex buffer object infrastructure (replaces old array_cache code).
<li>New vertex buffer object (vbo) infrastructure
<li>Updated glext.h file (version 39)
<li>Updated glxext.h file (version 18)
<li>Updated glxext.h file (version 19)
<li>GL_MAX_DRAWBUFFERS is now 4 (software rendering) so
"multiple render targets" are really supported.
</ul>
@@ -40,20 +66,25 @@ TBD
<li>With 32-bit Z buffer, the fragment Z of lines and points was sometimes wrong.
<li>GL_POST_CONVOLUTION_ALPHA_BIAS/SCALE was broken.
<li>1D convolution state could effect 2D image transfers
<li>Overlapping glCopyPixels with negative Y zoom didn't work (bug 10521)
<li>Fixed a number of framebuffer/renderbuffer reference counting bugs
<li>Fixed a few bugs in software-emulated alpha planes
<li>Assorted minor bug fixes in glCopy/DrawPixels, glPixelZoom, etc.
<li>Assorted DRI driver bug fixes.
<li>Fixed a number of bugs that prevented "depth-peeling" rendering from working.
</ul>
<h2>Internal code changes</h2>
<ul>
<li>Massive changes to the Shading Language compiler.
<li>The _MaintainTnlProgram, _MaintainTexEnvProgram, _TexEnvProgram and
_TnlProgram fields have been moved.
<li>The ctx->FragmentProgram._Active field has been removed.
<li>The ctx->Vertex/FragmentProgram._Current fields point to the program
in effect, whether it comes from a shader, user-program or generated
fixed-function program.
<li>The _UseTexEnvProgram field has been removed.
<li>Old array_cache module replaced by new vbo module. All geometry
rendering is now cast in the form of vertex buffer objects.
<li>Massive changes to the Shading Language compiler and related state.
<li>Vertex/fragment shaders are compiled into GPU instructions and
programs very similar to GL_ARB_vertex/fragment_program.
<li>Vertex and fragment programs are executed with the same code now.
<li>The SSE-optimized vertex program path has been removed since it didn't
support more than 12 temp registers, didn't support branching/looping, etc.
</ul>
@@ -71,17 +102,17 @@ fixed-function program.
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa/GLX (on Xlib) implements OpenGL 2.0
OSMesa (off-screen) implements OpenGL 2.0
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 implements OpenGL 1.3
Wind River UGL implements OpenGL 1.3
Windows/Win32 implements OpenGL 1.5
DJGPP implements OpenGL 1.5
GGI implements OpenGL 1.3
BeOS implements OpenGL 1.5
Allegro needs updating
D3D needs updating
SVGA unsupported
Wind River UGL unsupported
DJGPP unsupported
GGI unsupported
BeOS unsupported
Allegro unsupported
D3D unsupported
</pre>
</body>

85
docs/relnotes-7.0.html Normal file
View File

@@ -0,0 +1,85 @@
<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 Release Notes / June 22, 2007</H1>
<p>
Mesa 7.0 is a stable release, featuring OpenGL 2.1 API support.
A number of bugs have been fixed since the 6.5.3 release.
</p>
<h2>MD5 checksums</h2>
<pre>
TBD
</pre>
<h2>New features</h2>
<ul>
<li>OpenGL 2.0 and 2.1 API support.
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Fixed a few fog-related bugs.
<li>Fixed broken GLSL mix() function.
<li>Fixed broken GLSL exp() functions.
<li>Fixed GLSL mod4(vec4, vec4) bug.
<li>Implemented GLSL asin(), acos(), atan() functions.
<li>Fixed an R300 driver bug that caused Xorg composite manager to crash
<li>Fixed R300 vertex program/matrix bug (10848)
<li>GLSL dFdx() and dFdy() work for fragment program inputs now (texcoords)
<li>Specifying an invalid texture unit as a sampler could lead to a crash
<li>The GLX protocol request for glXDestroyPBuffer() was incorrect (bug 10983)
<li>ARB vp state.light[n].half value was incorrect (bug 10987)
<li>Fixed a positional light source bug (bug 11009)
<li>Fixed point size attenuation problem (bug 11042)
<li>glPopAttrib didn't restore texture object's LOD bias (bug 11049)
<li>Fixed a TLS / TEXTREL problem (bug 7459)
</ul>
<h2>Internal code changes</h2>
<ul>
<li>Some texture code consolidation and simplifiction (Ian Romanick)
<li>R300 driver clean-ups.
</ul>
<h2>To Do (someday) items</h2>
<ul>
<li>Switch to freeglut
<li>Fix linux-glide target/driver.
<li>Improved lambda and derivative calculation for frag progs.
</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

@@ -20,6 +20,7 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.0.html">7.0 release notes</A>
<LI><A HREF="relnotes-6.5.3.html">6.5.3 release notes</A>
<LI><A HREF="relnotes-6.5.2.html">6.5.2 release notes</A>
<LI><A HREF="relnotes-6.5.1.html">6.5.1 release notes</A>

View File

@@ -15,7 +15,7 @@ OpenGL Shading Language</a>.
</p>
<p>
Last updated on 17 Feb 2007.
Last updated on 28 March 2007.
</p>
<p>
@@ -27,6 +27,7 @@ Contents
<li><a href="#hints">Programming Hints</a>
<li><a href="#standalone">Stand-alone Compiler</a>
<li><a href="#implementation">Compiler Implementation</a>
<li><a href="#validation">Compiler Validation</a>
</ul>
@@ -40,11 +41,13 @@ in Mesa:
<ul>
<li>Dereferencing arrays with non-constant indexes
<li>User-defined structs
<li>Comparison of user-defined structs
<li>Linking of multiple shaders is not supported
<li>Integer operations are not fully implemented (most are implemented
as floating point).
<li>gl_ClipVertex
<li>The derivative functions such as dFdx() are not implemented
<li>The inverse trig functions asin(), acos(), and atan() are not implemented
<li>The gl_Color and gl_SecondaryColor varying vars are interpolated
without perspective correction
</ul>
<p>
@@ -67,7 +70,8 @@ All other major features of the shading language should function.
<li>The quality of generated code is pretty good, register usage is fair.
<li>Shader error detection and reporting of errors (InfoLog) is not
very good yet.
<li>There are known memory leaks in the compiler.
<li>The ftransform() function doesn't necessarily match the results of
fixed-function transformation.
</ul>
<p>
@@ -121,6 +125,9 @@ These issues will be addressed/resolved in the future.
<pre>
float x = inversesqrt(y);
</pre>
<li>
Use ++i when possible as it's more efficient than i++
</li>
</ul>
@@ -282,5 +289,24 @@ Extra NOP instructions will also be inserted.
</ul>
<a name="validation">
<h2>Compiler Validation</h2>
<p>
A new <a href="http://glean.sf.net" target="_parent">Glean</a> test has
been create to exercise the GLSL compiler.
</p>
<p>
The <em>glsl1</em> test runs over 150 sub-tests to check that the language
features and built-in functions work properly.
This test should be run frequently while working on the compiler to catch
regressions.
</p>
<p>
The test coverage is reasonably broad and complete but additional tests
should be added.
</p>
</BODY>
</HTML>

View File

@@ -1,17 +1,18 @@
<HTML>
<TITLE>Mesa Subset</TITLE>
<TITLE>Mesa Subset Driver</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<H1>Mesa Subset</H1>
<H1>Mesa Subset Driver</H1>
<p>
In 2002/2003 Tungsten Graphics was contracted to develop a subset Mesa/Radeon
driver for an embedded environment. The result is a reduced-size DRI driver
for the ATI R200 chip, for use with Linux fbdev rather than XFree86.
for the ATI R200 chip, for use with
<a href="fbdev-dri.html">fbdev/DRI environment</a>.
</p>
<p>
@@ -19,15 +20,5 @@ The specification for this subset can be found
<a href="subset-A.html">here</a>.
</p>
<p>
The <a href="MiniGLX.html">MiniGLX specification</a> describes the
interface between fbdev and Mesa.
</p>
<p>
More info to come...
</p>
</BODY>
</HTML>

View File

@@ -42,7 +42,7 @@ WIDTH="88" HEIGHT="31" ALIGN="BOTTOM" ALT="Sourceforge.net" BORDER="0"></A>
<br>
<br>
<li>The Mesa CVS repository is hosted by
<li>The Mesa git repository is hosted by
<a href="http://freedesktop.org/" target="_parent">freedesktop.org</a>.
<br>
<br>

View File

@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.1
* Version: 7.0
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),

View File

@@ -27,10 +27,6 @@
#define MANGLE(x) mgl##x
#endif /*MANGLE*/
/* Internal symbols which may collide with other OpenGL implementations. */
#define __glCoreCreateContext __mglCoreCreateContext
#define __glCoreNopDispatch __mglCoreNopDispatch
/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
#define glAccum MANGLE(Accum)

View File

@@ -46,9 +46,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glxext.h last updated 2007/02/13 */
/* glxext.h last updated 2007/04/21 */
/* Current version at http://www.opengl.org/registry/ */
#define GLX_GLXEXT_VERSION 18
#define GLX_GLXEXT_VERSION 19
#ifndef GLX_VERSION_1_3
#define GLX_WINDOW_BIT 0x00000001
@@ -386,7 +386,7 @@ typedef struct {
/* (as used in the GLX_OML_sync_control 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__)

View File

@@ -38,17 +38,11 @@
#include <sys/types.h>
#ifdef CAPI
#undef CAPI
#endif
#define CAPI
#define GL_CORE_SGI 1
#define GL_CORE_MESA 2
#define GL_CORE_APPLE 4
typedef struct __GLcontextRec __GLcontext;
typedef struct __GLinterfaceRec __GLinterface;
/*
** This file defines the interface between the GL core and the surrounding
@@ -186,81 +180,4 @@ typedef struct __GLcontextModesRec {
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
/************************************************************************/
/*
** Procedures which are imported by the GL from the surrounding
** "operating system". Math functions are not considered part of the
** "operating system".
*/
typedef struct __GLimportsRec {
/* Memory management */
void * (*malloc)(__GLcontext *gc, size_t size);
void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
void (*free)(__GLcontext *gc, void *addr);
/* Error handling */
void (*warning)(__GLcontext *gc, char *fmt);
void (*fatal)(__GLcontext *gc, char *fmt);
/* other system calls */
char *(CAPI *getenv)(__GLcontext *gc, const char *var);
int (CAPI *atoi)(__GLcontext *gc, const char *str);
int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
int (CAPI *fclose)(__GLcontext *gc, void *stream);
int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
/* Drawing surface management */
void *(*getDrawablePrivate)(__GLcontext *gc);
void *(*getReadablePrivate)(__GLcontext *gc);
/* Operating system dependent data goes here */
void *other;
} __GLimports;
/************************************************************************/
/*
** Procedures which are exported by the GL to the surrounding "operating
** system" so that it can manage multiple GL context's.
*/
typedef struct __GLexportsRec {
/* Context management (return GL_FALSE on failure) */
GLboolean (*destroyContext)(__GLcontext *gc);
GLboolean (*loseCurrent)(__GLcontext *gc);
/* oldglPriv isn't used anymore, kept for backwards compatibility */
GLboolean (*makeCurrent)(__GLcontext *gc);
GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
GLboolean (*forceCurrent)(__GLcontext *gc);
/* Drawing surface notification callbacks */
GLboolean (*notifyResize)(__GLcontext *gc);
void (*notifyDestroy)(__GLcontext *gc);
void (*notifySwapBuffers)(__GLcontext *gc);
/* Dispatch table override control for external agents like libGLS */
struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
void (*beginDispatchOverride)(__GLcontext *gc);
void (*endDispatchOverride)(__GLcontext *gc);
} __GLexports;
/************************************************************************/
/*
** This must be the first member of a __GLcontext structure. This is the
** only part of a context that is exposed to the outside world; everything
** else is opaque.
*/
struct __GLinterfaceRec {
__GLimports imports;
__GLexports exports;
};
extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
extern void __glCoreNopDispatch(void);
#endif /* __gl_core_h_ */

View File

@@ -180,6 +180,21 @@ extern XMesaContext XMesaCreateContext( XMesaVisual v,
extern void XMesaDestroyContext( XMesaContext c );
#ifdef XFree86Server
/*
* These are the extra routines required for integration with XFree86.
* None of these routines should be user visible. -KEM
*/
extern GLboolean XMesaForceCurrent( XMesaContext c );
extern GLboolean XMesaLoseCurrent( XMesaContext c );
extern GLboolean XMesaCopyContext( XMesaContext src,
XMesaContext dst,
GLuint mask );
#endif /* XFree86Server */
/*
* Create an XMesaBuffer from an X window.
*/

View File

@@ -41,6 +41,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "gcstruct.h"
typedef struct _XMesaImageRec XMesaImage;
@@ -123,8 +124,7 @@ do { \
do { \
/* Assumes: Images are always in ZPixmap format */ \
(void) __d; \
if (__sx || __sy) /* The non-trivial case */ \
XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \
ASSERT(!__sx && !__sy); /* The SubImage case */ \
ValidateGC(__b, __gc); \
(*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \
__x, __y, __w, __h, 0, ZPixmap, \

View File

@@ -17,7 +17,7 @@ message:
subdirs:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir ; $(MAKE)) || exit 1 ; \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
@@ -27,6 +27,6 @@ install:
clean:
@for dir in $(SUBDIRS) tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir ; $(MAKE) clean) ; \
(cd $$dir && $(MAKE) clean) ; \
fi \
done

View File

@@ -118,34 +118,39 @@ extfuncs.h: $(TOP)/progs/util/extfuncs.h
reflect: reflect.o showbuffer.o readtex.o
$(CC) -I$(INCDIR) $(CFLAGS) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) -o $@
$(CC) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) -o $@
reflect.o: reflect.c showbuffer.h
$(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
shadowtex: shadowtex.o showbuffer.o
$(CC) -I$(INCDIR) $(CFLAGS) shadowtex.o showbuffer.o $(APP_LIB_DEPS) -o $@
$(CC) shadowtex.o showbuffer.o $(APP_LIB_DEPS) -o $@
shadowtex.o: shadowtex.c showbuffer.h
$(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
gloss: gloss.o trackball.o readtex.o
$(CC) -I$(INCDIR) $(CFLAGS) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
$(CC) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
gloss.o: gloss.c trackball.h
$(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
engine: engine.o trackball.o readtex.o
$(CC) -I$(INCDIR) $(CFLAGS) engine.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
$(CC) engine.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
engine.o: engine.c trackball.h
$(CC) -c -I$(INCDIR) $(CFLAGS) engine.c
fslight.c: extfuncs.h
fslight: fslight.o
$(CC) fslight.o $(APP_LIB_DEPS) -o $@
fslight.o: fslight.c extfuncs.h
$(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
clean:

View File

@@ -22,9 +22,11 @@ LIBS = GLUT32.LIB OPENGL32.LIB
all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \
readtex.h readtex.c showbuffer.h showbuffer.c \
extfuncs.h trackball.h trackball.c \
arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \
clearspd.exe cubemap.exe drawpix.exe fire.exe fogcoord.exe \
fplight.exe gamma.exe gearbox.exe \
clearspd.exe cubemap.exe drawpix.exe engine.exe \
fire.exe fogcoord.exe \
fplight.exe fslight.exe gamma.exe gearbox.exe \
gears.exe geartrain.exe gloss.exe \
glinfo.exe glslnoise.exe \
gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \
@@ -42,14 +44,16 @@ bounce.exe: bounce.obj
clearspd.exe: clearspd.obj
cubemap.exe: cubemap.obj readtex.obj
drawpix.exe: drawpix.obj readtex.obj
engine.exe: engine.obj readtex.obj trackball.obj
fire.exe: fire.obj readtex.obj
fogcoord.exe: fogcoord.obj readtex.obj
fplight.exe: fplight.obj
fslight.exe: fslight.obj
gamma.exe: gamma.obj
gearbox.exe: gearbox.obj
gears.exe: gears.obj
geartrain.exe: geartrain.obj
gloss.exe: gloss.obj readtex.obj
gloss.exe: gloss.obj readtex.obj trackball.obj
glinfo.exe: glinfo.obj
glslnoise.exe: glslnoise.obj
gltestperf.exe: gltestperf.obj
@@ -105,14 +109,23 @@ showbuffer.c: $(TOP)\progs\util\showbuffer.c
showbuffer.h: $(TOP)\progs\util\showbuffer.h
copy $** .
trackball.c: $(TOP)\progs\util\trackball.c
copy $** .
trackball.h: $(TOP)\progs\util\trackball.h
copy $** .
extfuncs.h: $(TOP)\progs\util\extfuncs.h
copy $** .
.obj.exe:
$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
.c.obj:
$(cc) $(cdebug) $(cflags) $(cvars) /I$(INCDIR) $*.c
$(cc) $(cdebug) $(cflags) $(cvars) -D_USE_MATH_DEFINES /I$(INCDIR) $*.c
clean::
del *.obj *.exe readtex.* showbuffer.*
del *.obj *.exe readtex.* showbuffer.* trackball.*
clobber::

View File

@@ -24,6 +24,7 @@ static GLuint VertProg;
static GLboolean Anim = GL_TRUE;
static GLboolean Wire = GL_FALSE;
static GLboolean PixelLight = GL_TRUE;
static GLint Win;
static GLint T0 = 0;
static GLint Frames = 0;
@@ -148,6 +149,7 @@ static void Key( unsigned char key, int x, int y )
case 27:
glDeleteProgramsARB_func(1, &VertProg);
glDeleteProgramsARB_func(1, &FragProg);
glutDestroyWindow(Win);
exit(0);
break;
}
@@ -382,7 +384,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
Win = glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -62,7 +62,7 @@ static PFNGLUNIFORM3FVARBPROC glUniform4fvARB = NULL;
static void normalize (GLfloat *dst, const GLfloat *src)
{
GLfloat len = sqrtf (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
GLfloat len = sqrt (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
dst[0] = src[0] / len;
dst[1] = src[1] / len;
dst[2] = src[2] / len;

View File

@@ -7,151 +7,136 @@
* Daniel Borca
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
#include "readtex.h"
#define DEPTH 5.0f
#define TEXTURE_FILE "../images/bw.rgb"
static PFNGLFOGCOORDFEXTPROC glFogCoordf_ext;
static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
#define ARRAYS 0 /* use glDrawElements */
#define VERBOSE 1 /* tell me what happens */
#define DEPTH 15.0f
#if !defined(GLAPIENTRYP)
# define GLAPIENTRYP *
#endif
typedef void (GLAPIENTRYP GLFOGCOORDFEXTPROC) (GLfloat f);
typedef void (GLAPIENTRYP GLFOGCOORDPOINTEREXTPROC) (GLenum, GLsizei, const GLvoid *);
static GLFOGCOORDFEXTPROC glFogCoordf_ext;
#if ARRAYS
static GLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
#endif
static GLboolean have_fog_coord;
static GLfloat camz;
static GLuint texture[1];
static GLint fogMode;
static GLboolean fogCoord;
static GLfloat fogDensity = 0.75;
static GLfloat fogStart = 1.0, fogEnd = 40.0;
static GLfloat fogStart = 1.0, fogEnd = DEPTH;
static GLfloat fogColor[4] = {0.6f, 0.3f, 0.0f, 1.0f};
static const char *ModeStr = NULL;
static GLboolean Arrays = GL_FALSE;
static GLboolean Texture = GL_TRUE;
static void APIENTRY glFogCoordf_nop (GLfloat f)
static void
Reset(void)
{
fogMode = 1;
fogCoord = 1;
fogDensity = 0.75;
fogStart = 1.0;
fogEnd = DEPTH;
Arrays = GL_FALSE;
Texture = GL_TRUE;
}
static void APIENTRY
glFogCoordf_nop (GLfloat f)
{
(void)f;
}
static int BuildTexture (const char *filename, GLuint texid[])
static void
PrintString(const char *s)
{
GLubyte *tex_data;
GLenum tex_format;
GLint tex_width, tex_height;
tex_data = LoadRGBImage(filename, &tex_width, &tex_height, &tex_format);
if (tex_data == NULL) {
return -1;
while (*s) {
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
s++;
}
{
GLint tex_max;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &tex_max);
if ((tex_width > tex_max) || (tex_height > tex_max)) {
return -1;
}
}
glGenTextures(1, texid);
glBindTexture(GL_TEXTURE_2D, texid[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, tex_format, tex_width, tex_height, 0,
tex_format, GL_UNSIGNED_BYTE, tex_data);
return 0;
}
static int SetFogMode (GLint fogMode)
static void
PrintInfo(void)
{
char s[100];
glDisable(GL_FOG);
glColor3f(0, 1, 1);
sprintf(s, "Mode(m): %s Start(s/S): %g End(e/E): %g Density(d/D): %g",
ModeStr, fogStart, fogEnd, fogDensity);
glWindowPos2iARB(5, 20);
PrintString(s);
sprintf(s, "Arrays(a): %s glFogCoord(c): %s EyeZ(z/z): %g",
(Arrays ? "Yes" : "No"),
(fogCoord ? "Yes" : "No"),
camz);
glWindowPos2iARB(5, 5);
PrintString(s);
}
static int
SetFogMode(GLint fogMode)
{
fogMode &= 3;
switch (fogMode) {
case 0:
ModeStr = "Off";
glDisable(GL_FOG);
#if VERBOSE
printf("fog(disable)\n");
#endif
break;
case 1:
ModeStr = "GL_LINEAR";
glEnable(GL_FOG);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogf(GL_FOG_START, fogStart);
glFogf(GL_FOG_END, fogEnd);
#if VERBOSE
printf("fog(GL_LINEAR, %.2f, %.2f)\n", fogStart, fogEnd);
#endif
break;
case 2:
ModeStr = "GL_EXP";
glEnable(GL_FOG);
glFogi(GL_FOG_MODE, GL_EXP);
glFogf(GL_FOG_DENSITY, fogDensity);
#if VERBOSE
printf("fog(GL_EXP, %.2f)\n", fogDensity);
#endif
break;
case 3:
ModeStr = "GL_EXP2";
glEnable(GL_FOG);
glFogi(GL_FOG_MODE, GL_EXP2);
glFogf(GL_FOG_DENSITY, fogDensity);
#if VERBOSE
printf("fog(GL_EXP2, %.2f)\n", fogDensity);
#endif
break;
}
return fogMode;
}
static GLboolean SetFogCoord (GLboolean fogCoord)
static GLboolean
SetFogCoord(GLboolean fogCoord)
{
glFogCoordf_ext = glFogCoordf_nop;
if (!have_fog_coord) {
#if VERBOSE
printf("fog(GL_FRAGMENT_DEPTH_EXT)%s\n", fogCoord ? " EXT_fog_coord not available!" : "");
#endif
return GL_FALSE;
}
if (fogCoord) {
glFogCoordf_ext = (GLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT");
glFogCoordf_ext = (PFNGLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT");
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
#if VERBOSE
printf("fog(GL_FOG_COORDINATE_EXT)\n");
#endif
} else {
}
else {
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT);
#if VERBOSE
printf("fog(GL_FRAGMENT_DEPTH_EXT)\n");
#endif
}
return fogCoord;
}
#if ARRAYS
/* could reuse vertices */
static GLuint vertex_index[] = {
/* Back */
@@ -172,19 +157,19 @@ static GLuint vertex_index[] = {
static GLfloat vertex_pointer[][3] = {
/* Back */
{-2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, { 2.5f, 2.5f,-DEPTH}, {-2.5f, 2.5f,-DEPTH},
{-1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, { 1.0f, 1.0f,-DEPTH}, {-1.0f, 1.0f,-DEPTH},
/* Floor */
{-2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f, DEPTH}, {-2.5f,-2.5f, DEPTH},
{-1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f, 0.0}, {-1.0f,-1.0f, 0.0},
/* Roof */
{-2.5f, 2.5f,-DEPTH}, { 2.5f, 2.5f,-DEPTH}, { 2.5f, 2.5f, DEPTH}, {-2.5f, 2.5f, DEPTH},
{-1.0f, 1.0f,-DEPTH}, { 1.0f, 1.0f,-DEPTH}, { 1.0f, 1.0f, 0.0}, {-1.0f, 1.0f, 0.0},
/* Right */
{ 2.5f,-2.5f, DEPTH}, { 2.5f, 2.5f, DEPTH}, { 2.5f, 2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH},
{ 1.0f,-1.0f, 0.0}, { 1.0f, 1.0f, 0.0}, { 1.0f, 1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH},
/* Left */
{-2.5f,-2.5f, DEPTH}, {-2.5f, 2.5f, DEPTH}, {-2.5f, 2.5f,-DEPTH}, {-2.5f,-2.5f,-DEPTH}
{-1.0f,-1.0f, 0.0}, {-1.0f, 1.0f, 0.0}, {-1.0f, 1.0f,-DEPTH}, {-1.0f,-1.0f,-DEPTH}
};
static GLfloat texcoord_pointer[][2] = {
@@ -192,118 +177,139 @@ static GLfloat texcoord_pointer[][2] = {
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
/* Floor */
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, DEPTH}, {0.0f, DEPTH},
/* Roof */
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
{1.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, DEPTH}, {1.0f, DEPTH},
/* Right */
{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f},
{0.0f, 1.0f}, {0.0f, 0.0f}, {DEPTH, 0.0f}, {DEPTH, 1.0f},
/* Left */
{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f}
{0.0f, 0.0f}, {0.0f, 1.0f}, {DEPTH, 1.0f}, {DEPTH, 0.0f}
};
static GLfloat fogcoord_pointer[][1] = {
static GLfloat fogcoord_pointer[] = {
/* Back */
{1.0f}, {1.0f}, {1.0f}, {1.0f},
DEPTH, DEPTH, DEPTH, DEPTH,
/* Floor */
{1.0f}, {1.0f}, {0.0f}, {0.0f},
DEPTH, DEPTH, 0.0, 0.0,
/* Roof */
{1.0f}, {1.0f}, {0.0f}, {0.0f},
DEPTH, DEPTH, 0.0, 0.0,
/* Right */
{0.0f}, {0.0f}, {1.0f}, {1.0f},
0.0, 0.0, DEPTH, DEPTH,
/* Left */
{0.0f}, {0.0f}, {1.0f}, {1.0f}
0.0, 0.0, DEPTH, DEPTH
};
#endif
static void Display( void )
static void
Display( void )
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity ();
glTranslatef(0.0f, 0.0f, camz);
glTranslatef(0.0f, 0.0f, -camz);
#if ARRAYS
glDrawElements(GL_QUADS, sizeof(vertex_index) / sizeof(vertex_index[0]), GL_UNSIGNED_INT, vertex_index);
#else
/* Back */
glBegin(GL_QUADS);
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
glEnd();
SetFogMode(fogMode);
/* Floor */
glBegin(GL_QUADS);
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f,-2.5f, DEPTH);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f,-2.5f, DEPTH);
glEnd();
glColor3f(1, 1, 1);
/* Roof */
glBegin(GL_QUADS);
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f, DEPTH);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f, DEPTH);
glEnd();
if (Texture)
glEnable(GL_TEXTURE_2D);
/* Right */
glBegin(GL_QUADS);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 2.5f,-2.5f, DEPTH);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 2.5f, 2.5f, DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
glEnd();
if (Arrays) {
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glDrawElements(GL_QUADS, sizeof(vertex_index) / sizeof(vertex_index[0]),
GL_UNSIGNED_INT, vertex_index);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
else {
/* Back */
glBegin(GL_QUADS);
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
glEnd();
/* Left */
glBegin(GL_QUADS);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f, DEPTH);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f, DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
glEnd();
#endif
/* Floor */
glBegin(GL_QUADS);
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, DEPTH); glVertex3f( 1.0f,-1.0f,0.0);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, DEPTH); glVertex3f(-1.0f,-1.0f,0.0);
glEnd();
/* Roof */
glBegin(GL_QUADS);
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, DEPTH); glVertex3f( 1.0f, 1.0f,0.0);
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, DEPTH); glVertex3f(-1.0f, 1.0f,0.0);
glEnd();
/* Right */
glBegin(GL_QUADS);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,-1.0f,0.0);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f,0.0);
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 0.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 1.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
glEnd();
/* Left */
glBegin(GL_QUADS);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,0.0);
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,0.0);
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 1.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
glEnd();
}
glDisable(GL_TEXTURE_2D);
PrintInfo();
glutSwapBuffers();
}
static void Reshape( int width, int height )
static void
Reshape( int width, int height )
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f, (GLfloat)(width)/(GLfloat)(height), 0.1f, 100.0f);
glFrustum(-1, 1, -1, 1, 1.0, 100);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
static void Key( unsigned char key, int x, int y )
static void
Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 'a':
Arrays = !Arrays;
break;
case 'f':
case 'm':
fogMode = SetFogMode(fogMode + 1);
break;
case '+':
if (fogDensity < 1.0) {
fogDensity += 0.05;
}
case 'D':
fogDensity += 0.05;
SetFogMode(fogMode);
break;
case '-':
case 'd':
if (fogDensity > 0.0) {
fogDensity -= 0.05;
}
@@ -311,31 +317,43 @@ static void Key( unsigned char key, int x, int y )
break;
case 's':
if (fogStart > 0.0) {
fogStart -= 1.0;
fogStart -= 0.25;
}
SetFogMode(fogMode);
break;
case 'S':
if (fogStart < fogEnd) {
fogStart += 1.0;
if (fogStart < 100.0) {
fogStart += 0.25;
}
SetFogMode(fogMode);
break;
case 'e':
if (fogEnd > fogStart) {
fogEnd -= 1.0;
if (fogEnd > 0.0) {
fogEnd -= 0.25;
}
SetFogMode(fogMode);
break;
case 'E':
if (fogEnd < 100.0) {
fogEnd += 1.0;
fogEnd += 0.25;
}
SetFogMode(fogMode);
break;
case 'c':
fogCoord = SetFogCoord(fogCoord ^ GL_TRUE);
break;
case 't':
Texture = !Texture;
break;
case 'z':
camz -= 0.1;
break;
case 'Z':
camz += 0.1;
break;
case 'r':
Reset();
break;
case 27:
exit(0);
break;
@@ -344,37 +362,28 @@ static void Key( unsigned char key, int x, int y )
}
static void SpecialKey( int key, int x, int y )
static void
Init(void)
{
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
if (camz < (DEPTH - 1.0)) {
camz += 1.0f;
}
break;
case GLUT_KEY_DOWN:
if (camz > -19.0) {
camz -= 1.0f;
}
break;
}
glutPostRedisplay();
}
static const GLubyte teximage[2][2][4] = {
{ { 255, 255, 255, 255}, { 128, 128, 128, 255} },
{ { 128, 128, 128, 255}, { 255, 255, 255, 255} }
};
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
static void Init( void )
{
have_fog_coord = glutExtensionSupported("GL_EXT_fog_coord");
if (BuildTexture(TEXTURE_FILE, texture) == -1) {
exit(1);
if (!have_fog_coord) {
printf("GL_EXT_fog_coord not supported!\n");
}
glEnable(GL_TEXTURE_2D);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glClearDepth(1.0f);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0,
GL_RGBA, GL_UNSIGNED_BYTE, teximage);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glClearColor(0.1f, 0.1f, 0.1f, 0.0f);
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
glShadeModel(GL_SMOOTH);
@@ -383,11 +392,8 @@ static void Init( void )
glFogfv(GL_FOG_COLOR, fogColor);
glHint(GL_FOG_HINT, GL_NICEST);
fogCoord = SetFogCoord(GL_TRUE); /* try to enable fog_coord */
fogMode = SetFogMode(2); /* GL_EXP */
fogMode = SetFogMode(1);
camz = -19.0f;
#if ARRAYS
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, vertex_pointer);
@@ -395,24 +401,24 @@ static void Init( void )
glTexCoordPointer(2, GL_FLOAT, 0, texcoord_pointer);
if (have_fog_coord) {
glFogCoordPointer_ext = (GLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT");
glFogCoordPointer_ext = (PFNGLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT");
glEnableClientState(GL_FOG_COORDINATE_ARRAY_EXT);
glFogCoordPointer_ext(GL_FLOAT, 0, fogcoord_pointer);
}
#endif
Reset();
}
int main( int argc, char *argv[] )
int
main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 640, 480 );
glutInitWindowSize( 600, 600 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
Init();
glutMainLoop();

View File

@@ -24,7 +24,7 @@ static GLuint VertProg;
static GLboolean Anim = GL_TRUE;
static GLboolean Wire = GL_FALSE;
static GLboolean PixelLight = GL_TRUE;
static GLint Win;
static GLfloat Xrot = 0, Yrot = 0;
@@ -136,8 +136,8 @@ static void Key( unsigned char key, int x, int y )
}
break;
case 27:
glutDestroyWindow(Win);
exit(0);
break;
}
glutPostRedisplay();
}
@@ -272,7 +272,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
Win = glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );

View File

@@ -23,6 +23,8 @@
#include "extfuncs.h"
#define TEXTURE 0
static GLint CoordAttrib = 0;
static char *FragProgFile = NULL;
@@ -43,7 +45,7 @@ static GLint uTexture;
static GLuint SphereList, RectList, CurList;
static GLint win = 0;
static GLboolean anim = GL_FALSE;
static GLboolean anim = GL_TRUE;
static GLboolean wire = GL_FALSE;
static GLboolean pixelLight = GL_TRUE;
@@ -56,7 +58,7 @@ static GLfloat xRot = 90.0f, yRot = 0.0f;
static void
normalize(GLfloat *dst, const GLfloat *src)
{
GLfloat len = sqrtf(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
GLfloat len = sqrt(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
dst[0] = src[0] / len;
dst[1] = src[1] / len;
dst[2] = src[2] / len;
@@ -281,11 +283,12 @@ TestFunctions(void)
}
#if TEXTURE
static void
MakeTexture(void)
{
#define SZ0 128
#define SZ1 64
#define SZ0 64
#define SZ1 32
GLubyte image0[SZ0][SZ0][SZ0][4];
GLubyte image1[SZ1][SZ1][SZ1][4];
GLuint i, j, k;
@@ -348,6 +351,7 @@ MakeTexture(void)
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
#endif
static void
@@ -473,8 +477,8 @@ Init(void)
version = (const char *) glGetString(GL_VERSION);
if (version[0] != '2' || version[1] != '.') {
printf("Warning: this program expects OpenGL 2.0\n");
/*exit(1);*/
printf("This program requires OpenGL 2.x, found %s\n", version);
exit(1);
}
GetExtensionFuncs();
@@ -540,7 +544,9 @@ Init(void)
CurList = SphereList;
#if TEXTURE
MakeTexture();
#endif
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
printf("Press p to toggle between per-pixel and per-vertex lighting\n");
@@ -573,6 +579,8 @@ Init(void)
#if 0
TestFunctions();
#else
(void) TestFunctions;
#endif
}
@@ -597,7 +605,7 @@ main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowPosition( 0, 0);
glutInitWindowSize(100, 100);
glutInitWindowSize(200, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);

View File

@@ -296,14 +296,27 @@ RenderShadowMap(void)
0, 1, 0); /* up */
if (UseFBO) {
GLenum fbo_status;
glTexImage2D(GL_TEXTURE_2D, 0, depthFormat,
ShadowTexWidth, ShadowTexHeight, 0,
depthFormat, depthType, NULL);
/* Set the filter mode so that the texture is texture-complete.
* Otherwise it will cause the framebuffer to fail the framebuffer
* completeness test.
*/
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ShadowFBO);
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)
== GL_FRAMEBUFFER_COMPLETE_EXT);
fbo_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (fbo_status != GL_FRAMEBUFFER_COMPLETE_EXT) {
fprintf(stderr, "FBO not complete! status = 0x%04x\n", fbo_status);
assert(fbo_status == GL_FRAMEBUFFER_COMPLETE_EXT);
}
}
assert(!glIsEnabled(GL_TEXTURE_1D));

View File

@@ -4,10 +4,10 @@
* Updated for GLU 1.3 tessellation by Gareth Hughes <gareth@valinux.com>
*/
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glut.h>
#define MAX_POINTS 256
#define MAX_CONTOURS 32

View File

@@ -5,17 +5,12 @@ include $(TOP)/configs/current
INCDIR = $(TOP)/include
OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
PROGS = \
brick \
bump \
deriv \
mandelbrot \
noise \
toyball \

319
progs/glsl/deriv.c Normal file
View File

@@ -0,0 +1,319 @@
/**
* Test OpenGL 2.0 dx/dy functions for texcoords.
* Brian Paul
* 2 May 2007
*
* NOTE: resize the window to observe how the partial derivatives of
* the texcoords change.
*/
#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"
static char *FragProgFile = NULL;
static char *VertProgFile = NULL;
static GLuint fragShader;
static GLuint vertShader;
static GLuint program;
static GLuint SphereList, RectList, CurList;
static GLint win = 0;
static GLboolean anim = GL_TRUE;
static GLfloat xRot = 0.0f, yRot = 0.0f;
static void
Redisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
glCallList(CurList);
glPopMatrix();
glutSwapBuffers();
}
static void
Idle(void)
{
yRot = glutGet(GLUT_ELAPSED_TIME) * 0.1;
glutPostRedisplay();
}
static void
Reshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -15.0f);
}
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 ' ':
case 'a':
anim = !anim;
if (anim)
glutIdleFunc(Idle);
else
glutIdleFunc(NULL);
break;
case 'o':
if (CurList == SphereList)
CurList = RectList;
else
CurList = SphereList;
break;
case 27:
CleanUp();
exit(0);
break;
}
glutPostRedisplay();
}
static void
SpecialKey(int key, int x, int y)
{
const GLfloat step = 3.0f;
(void) x;
(void) y;
switch(key) {
case GLUT_KEY_UP:
xRot -= step;
break;
case GLUT_KEY_DOWN:
xRot += step;
break;
case GLUT_KEY_LEFT:
yRot -= step;
break;
case GLUT_KEY_RIGHT:
yRot += step;
break;
}
glutPostRedisplay();
}
static void
MakeSphere(void)
{
GLUquadricObj *obj = gluNewQuadric();
SphereList = glGenLists(1);
gluQuadricTexture(obj, GL_TRUE);
glNewList(SphereList, GL_COMPILE);
gluSphere(obj, 2.0f, 30, 15);
glEndList();
}
static void
MakeRect(void)
{
RectList = glGenLists(1);
glNewList(RectList, GL_COMPILE);
glBegin(GL_POLYGON);
glTexCoord2f(0, 0); glVertex2f(-2, -2);
glTexCoord2f(1, 0); glVertex2f( 2, -2);
glTexCoord2f(1, 1); glVertex2f( 2, 2);
glTexCoord2f(0, 1); glVertex2f(-2, 2);
glEnd();
glEndList();
}
static void
LoadAndCompileShader(GLuint shader, const char *text)
{
GLint stat;
glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
glCompileShader_func(shader);
glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
glGetShaderInfoLog_func(shader, 1000, &len, log);
fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log);
exit(1);
}
}
/**
* Read a shader from a file.
*/
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, "fslight: Unable to open shader file %s\n", filename);
exit(1);
}
n = fread(buffer, 1, max, f);
printf("fslight: 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;
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
glGetProgramInfoLog_func(prog, 1000, &len, log);
fprintf(stderr, "Linker error:\n%s\n", log);
}
}
static void
Init(void)
{
static const char *fragShaderText =
"void main() {\n"
" gl_FragColor = abs(dFdy(gl_TexCoord[0])) * 50.0;\n"
" // gl_FragColor = gl_TexCoord[0];\n"
"}\n";
static const char *vertShaderText =
"void main() {\n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
" gl_TexCoord[0] = gl_MultiTexCoord0;\n"
"}\n";
const char *version;
version = (const char *) glGetString(GL_VERSION);
if (version[0] != '2' || version[1] != '.') {
printf("This program requires OpenGL 2.x, found %s\n", version);
exit(1);
}
GetExtensionFuncs();
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
if (FragProgFile)
ReadShader(fragShader, FragProgFile);
else
LoadAndCompileShader(fragShader, fragShaderText);
vertShader = glCreateShader_func(GL_VERTEX_SHADER);
if (VertProgFile)
ReadShader(vertShader, VertProgFile);
else
LoadAndCompileShader(vertShader, vertShaderText);
program = glCreateProgram_func();
glAttachShader_func(program, fragShader);
glAttachShader_func(program, vertShader);
glLinkProgram_func(program);
CheckLink(program);
glUseProgram_func(program);
/*assert(glGetError() == 0);*/
glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
glEnable(GL_DEPTH_TEST);
MakeSphere();
MakeRect();
CurList = SphereList;
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
assert(glIsProgram_func(program));
assert(glIsShader_func(fragShader));
assert(glIsShader_func(vertShader));
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(200, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Redisplay);
if (anim)
glutIdleFunc(Idle);
ParseOptions(argc, argv);
Init();
glutMainLoop();
return 0;
}

View File

@@ -1,5 +1,3 @@
/* $Id: miniglxtest.c,v 1.3 2004/03/25 14:58:39 brianp Exp $ */
/*
* Test the mini GLX interface.
*/
@@ -7,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <GL/gl.h>
#define USE_MINI_GLX 1
@@ -16,90 +15,86 @@
#include <GL/glx.h>
#endif
#define FRONTBUFFER 1
#define NR 6
#define DO_SLEEPS 1
#define NR_DISPLAYS 2
static GLXContext ctx;
GLXContext ctx;
static GLuint NumFrames = 100;
static GLuint NumDisplays = 1;
static GLboolean Texture = GL_FALSE;
static GLboolean SingleBuffer = GL_FALSE;
static GLboolean Sleeps = GL_TRUE;
static void _subset_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
static void
rect(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
{
glBegin( GL_QUADS );
glVertex2f( x1, y1 );
glVertex2f( x2, y1 );
glVertex2f( x2, y2 );
glVertex2f( x1, y2 );
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glColor3f(0, 0, 1); glVertex2f(x1, y1);
glTexCoord2f(1, 0); glColor3f(1, 0, 0); glVertex2f(x2, y1);
glTexCoord2f(1, 1); glColor3f(0, 1, 0); glVertex2f(x2, y2);
glTexCoord2f(0, 1); glColor3f(0, 0, 0); glVertex2f(x1, y2);
glEnd();
}
static void redraw( Display *dpy, Window w, int rot )
static void
redraw(Display *dpy, Window w, int rot)
{
printf("Redraw event\n");
GLfloat a;
#if FRONTBUFFER
glDrawBuffer( GL_FRONT );
#else
/* glDrawBuffer( GL_BACK ); */
#endif
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor( rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX,
1);
glClear( GL_COLOR_BUFFER_BIT );
#if 1
glColor3f( rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX );
glPushMatrix();
glRotatef(rot, 0, 0, 1);
glScalef(.5, .5, .5);
_subset_Rectf( -1, -1, 1, 1 );
glRotatef(rot, 0, 0, 1);
glScalef(.5, .5, .5);
for (a = 0.0; a < 360.0; a += 30.0) {
glPushMatrix();
glRotatef(a, 0, 0, 1);
glRotatef(40, 1, 0, 0);
glColor3f(a / 360.0, 1-a/360.0, 0);
rect(0.3, -0.25, 1.5, 0.25);
glPopMatrix();
}
glPopMatrix();
#endif
#if FRONTBUFFER
glFlush();
#else
glXSwapBuffers( dpy, w );
#endif
glFinish();
if (SingleBuffer)
glFlush();
else
glXSwapBuffers(dpy, w);
}
static Window make_rgb_db_window( Display *dpy,
unsigned int width, unsigned int height )
static Window
make_window(Display *dpy, unsigned int width, unsigned int height)
{
int attrib[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
#if !FRONTBUFFER
GLX_DOUBLEBUFFER,
#endif
None };
int scrnum;
int attrib_single[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
None };
int attrib_double[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
GLX_DOUBLEBUFFER,
None };
int *attrib = SingleBuffer ? attrib_single : attrib_double;
int scrnum = 0;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
XVisualInfo *visinfo;
scrnum = 0;
root = RootWindow( dpy, scrnum );
root = RootWindow(dpy, scrnum);
if (!(visinfo = glXChooseVisual( dpy, scrnum, attrib ))) {
if (!(visinfo = glXChooseVisual(dpy, scrnum, attrib))) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");
exit(1);
}
if(!(ctx = glXCreateContext( dpy, visinfo, NULL, True ))) {
if (!(ctx = glXCreateContext(dpy, visinfo, NULL, True))) {
printf("Error: glXCreateContext failed\n");
exit(1);
}
@@ -107,19 +102,19 @@ static Window make_rgb_db_window( Display *dpy,
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( dpy, root, 0, 0, width, height,
win = XCreateWindow(dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr );
visinfo->visual, mask, &attr);
if (!win) {
printf("Error: XCreateWindow failed\n");
exit(1);
}
glXMakeCurrent( dpy, win, ctx );
glXMakeCurrent(dpy, win, ctx);
glViewport(0, 0, width, height);
@@ -127,22 +122,24 @@ static Window make_rgb_db_window( Display *dpy,
}
static void event_loop( Display *dpy, Window win )
static void
event_loop(Display *dpy, Window win)
{
int i;
printf("Hang on... drawing %d frames\n", NR);
for (i = 0; i < NR; i++) {
redraw( dpy, win, i*10 );
if (DO_SLEEPS) {
printf("sleep(1)\n");
sleep(1);
printf("Drawing %d frames\n", NumFrames);
for (i = 0; i < NumFrames; i++) {
redraw(dpy, win, -i*2);
if (Sleeps) {
usleep(20000);
}
}
}
static int foo( void )
static int
runtest(void)
{
Display *dpy;
Window win;
@@ -153,41 +150,121 @@ static int foo( void )
return 1;
}
win = make_rgb_db_window( dpy, 800, 600);
win = make_window(dpy, 800, 600);
srand(getpid());
glShadeModel( GL_FLAT );
glClearColor( 0.5, 0.5, 0.5, 1.0 );
/* init GL state */
glClearColor(0.5, 0.5, 0.5, 1.0);
glEnable(GL_DEPTH_TEST);
if (Texture) {
GLubyte image[16][16][4];
GLint i, j;
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
if (((i / 2) ^ (j / 2)) & 1) {
image[i][j][0] = 255;
image[i][j][1] = 255;
image[i][j][2] = 255;
image[i][j][3] = 255;
}
else {
image[i][j][0] = 128;
image[i][j][1] = 128;
image[i][j][2] = 128;
image[i][j][3] = 128;
}
}
}
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0,
GL_RGBA, GL_UNSIGNED_BYTE, image);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEnable(GL_TEXTURE_2D);
}
if (SingleBuffer) {
glDrawBuffer(GL_FRONT);
glReadBuffer(GL_FRONT);
}
else {
glDrawBuffer(GL_BACK);
}
XMapWindow( dpy, win );
XMapWindow(dpy, win);
/* wait for window to get mapped */
{
XEvent e;
while (1) {
XNextEvent( dpy, &e );
XNextEvent(dpy, &e);
if (e.type == MapNotify && e.xmap.window == win) {
break;
}
}
}
event_loop( dpy, win );
event_loop(dpy, win);
glXDestroyContext( dpy, ctx );
XDestroyWindow( dpy, win );
glXDestroyContext(dpy, ctx);
XDestroyWindow(dpy, win);
XCloseDisplay( dpy );
XCloseDisplay(dpy);
return 0;
}
int main()
static void
usage(void)
{
printf("Usage:\n");
printf(" -f N render N frames (default %d)\n", NumFrames);
printf(" -d N do N display cycles\n");
printf(" -t texturing\n");
printf(" -s single buffering\n");
printf(" -n no usleep() delay\n");
}
static void
parse_args(int argc, char *argv[])
{
int i;
for (i = 0 ; i < NR_DISPLAYS ; i++) {
if (foo() != 0)
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-f") == 0) {
NumFrames = atoi(argv[i + 1]);
i++;
}
else if (strcmp(argv[i], "-d") == 0) {
NumDisplays = atoi(argv[i + 1]);
i++;
}
else if (strcmp(argv[i], "-n") == 0) {
Sleeps = GL_FALSE;
}
else if (strcmp(argv[i], "-s") == 0) {
SingleBuffer = GL_TRUE;
}
else if (strcmp(argv[i], "-t") == 0) {
Texture = GL_TRUE;
}
else {
usage();
exit(1);
}
}
}
int
main(int argc, char *argv[])
{
int i;
parse_args(argc, argv);
for (i = 0; i < NumDisplays; i++) {
if (runtest() != 0)
break;
}

View File

@@ -1,221 +0,0 @@
LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\Mesaaux.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a
INCLUDES = -I$(TOP)\include
SRCS = accanti.c \
accnot.c \
accpersp.c \
accum.c \
aim.c \
alpha.c \
alpha3D.c \
anti.c \
antiindex.c \
antipindex.c \
antipoint.c \
antipoly.c \
bezcurve.c \
bezmesh.c \
bezsurf.c \
checker.c \
checker2.c \
chess.c \
clip.c \
colormat.c \
cone.c \
cube.c \
curve.c \
depthcue.c \
disk.c \
dof.c \
dofnot.c \
double.c \
drawf.c \
feedback.c \
fog.c \
fogindex.c \
font.c \
light.c \
linelist.c \
lines.c \
list.c \
list2.c \
maplight.c \
material.c \
mipmap.c \
model.c \
movelight.c \
nurbs.c \
pickdepth.c \
pickline.c \
picksquare.c \
plane.c \
planet.c \
planetup.c \
polys.c \
robot.c \
sccolorlight.c \
scene.c \
scenebamb.c \
sceneflat.c \
select.c \
simple.c \
smooth.c \
sphere.c \
stencil.c \
stroke.c \
surface.c \
tea.c \
teaambient.c \
teapots.c \
texgen.c \
texturesurf.c \
trim.c \
xfont.c
PROGRAMS = ProgramTargetName(accanti) \
ProgramTargetName(accnot) \
ProgramTargetName(accpersp) \
ProgramTargetName(accum) \
ProgramTargetName(aim) \
ProgramTargetName(alpha) \
ProgramTargetName(alpha3D) \
ProgramTargetName(anti) \
ProgramTargetName(antiindex) \
ProgramTargetName(antipindex) \
ProgramTargetName(antipoint) \
ProgramTargetName(antipoly) \
ProgramTargetName(bezcurve) \
ProgramTargetName(bezmesh) \
ProgramTargetName(bezsurf) \
ProgramTargetName(checker) \
ProgramTargetName(checker2) \
ProgramTargetName(chess) \
ProgramTargetName(clip) \
ProgramTargetName(colormat) \
ProgramTargetName(cone) \
ProgramTargetName(cube) \
ProgramTargetName(curve) \
ProgramTargetName(depthcue) \
ProgramTargetName(disk) \
ProgramTargetName(dof) \
ProgramTargetName(dofnot) \
ProgramTargetName(double) \
ProgramTargetName(drawf) \
ProgramTargetName(feedback) \
ProgramTargetName(fog) \
ProgramTargetName(fogindex) \
ProgramTargetName(font) \
ProgramTargetName(light) \
ProgramTargetName(linelist) \
ProgramTargetName(lines) \
ProgramTargetName(list) \
ProgramTargetName(list2) \
ProgramTargetName(maplight) \
ProgramTargetName(material) \
ProgramTargetName(mipmap) \
ProgramTargetName(model) \
ProgramTargetName(movelight) \
ProgramTargetName(nurbs) \
ProgramTargetName(pickdepth) \
ProgramTargetName(pickline) \
ProgramTargetName(picksquare) \
ProgramTargetName(plane) \
ProgramTargetName(planet) \
ProgramTargetName(planetup) \
ProgramTargetName(polys) \
ProgramTargetName(robot) \
ProgramTargetName(sccolorlight) \
ProgramTargetName(scene) \
ProgramTargetName(scenebamb) \
ProgramTargetName(sceneflat) \
ProgramTargetName(select) \
ProgramTargetName(simple) \
ProgramTargetName(smooth) \
ProgramTargetName(sphere) \
ProgramTargetName(stencil) \
ProgramTargetName(stroke) \
ProgramTargetName(surface) \
ProgramTargetName(tea) \
ProgramTargetName(teaambient) \
ProgramTargetName(teapots) \
ProgramTargetName(texgen) \
ProgramTargetName(texturesurf) \
ProgramTargetName(trim) \
ProgramTargetName(xfont)
AllTarget($(PROGRAMS))
NormalProgramTarget(accanti,accanti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(accnot,accnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(accpersp,accpersp.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(aim,aim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(alpha,alpha.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(alpha3D,alpha3D.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(anti,anti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(antiindex,antiindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(antipindex,antipindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(antipoint,antipoint.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(antipoly,antipoly.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(bezcurve,bezcurve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(bezmesh,bezmesh.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(bezsurf,bezsurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(checker,checker.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(checker2,checker2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(chess,chess.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(clip,clip.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(colormat,colormat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(cone,cone.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(cube,cube.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(curve,curve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(depthcue,depthcue.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(disk,disk.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(dof,dof.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(dofnot,dofnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(double,double.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(drawf,drawf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(feedback,feedback.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(fogindex,fogindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(light,light.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(linelist,linelist.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(lines,lines.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(list,list.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(list2,list2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(maplight,maplight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(material,material.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(mipmap,mipmap.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(model,model.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(movelight,movelight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(nurbs,nurbs.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(pickdepth,pickdepth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(pickline,pickline.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(picksquare,picksquare.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(plane,plane.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(planet,planet.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(planetup,planetup.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(polys,polys.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(robot,robot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(sccolorlight,sccolorlight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(scene,scene.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(scenebamb,scenebamb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(sceneflat,sceneflat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(simple,simple.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(smooth,smooth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(stroke,stroke.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(surface,surface.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(tea,tea.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(teaambient,teaambient.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(teapots,teapots.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(texgen,texgen.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(texturesurf,texturesurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(trim,trim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(xfont,xfont.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
DependTarget()

View File

@@ -1,101 +0,0 @@
LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\glut.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a
INCLUDES = -I$(TOP)\include
SRCS = accum.c \
bitmap1.c \
bitmap2.c \
blendeq.c \
blendxor.c \
copy.c \
cursor.c \
depth.c \
eval.c \
fog.c \
font.c \
line.c \
logo.c \
nurb.c \
oglinfo.c \
olympic.c \
overlay.c \
point.c \
prim.c \
quad.c \
select.c \
shape.c \
speed.c \
sphere.c \
star.c \
stencil.c \
stretch.c \
texture.c \
tri.c \
wave.c
PROGRAMS = ProgramTargetName(accum) \
ProgramTargetName(bitmap1) \
ProgramTargetName(bitmap2) \
ProgramTargetName(blendeq) \
ProgramTargetName(blendxor) \
ProgramTargetName(copy) \
ProgramTargetName(cursor) \
ProgramTargetName(depth) \
ProgramTargetName(eval) \
ProgramTargetName(fog) \
ProgramTargetName(font) \
ProgramTargetName(line) \
ProgramTargetName(logo) \
ProgramTargetName(nurb) \
ProgramTargetName(oglinfo) \
ProgramTargetName(olympic) \
ProgramTargetName(overlay) \
ProgramTargetName(point) \
ProgramTargetName(prim) \
ProgramTargetName(quad) \
ProgramTargetName(select) \
ProgramTargetName(shape) \
ProgramTargetName(speed) \
ProgramTargetName(sphere) \
ProgramTargetName(star) \
ProgramTargetName(stencil) \
ProgramTargetName(stretch) \
ProgramTargetName(texture) \
ProgramTargetName(tri) \
ProgramTargetName(wave)
AllTarget($(PROGRAMS))
NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(bitmap1,bitmap1.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(bitmap2,bitmap2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(blendeq,blendeq.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(blendxor,blendxor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(copy,copy.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(cursor,cursor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(depth,depth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(eval,eval.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(line,line.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(logo,logo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(nurb,nurb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(oglinfo,oglinfo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(olympic,olympic.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(overlay,overlay.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(point,point.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(prim,prim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(quad,quad.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(shape,shape.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(speed,speed.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(star,star.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(stretch,stretch.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(texture,texture.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(tri,tri.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(wave,wave.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
DependTarget()

View File

@@ -11,6 +11,7 @@ static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL;
static PFNGLCREATESHADERPROC glCreateShader_func = NULL;
static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL;
static PFNGLDELETESHADERPROC glDeleteShader_func = NULL;
static PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib_func = NULL;
static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL;
static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL;
static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL;
@@ -38,6 +39,13 @@ static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f_func = NULL;
static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL;
static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL;
/* OpenGL 2.1 */
static PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv_func = NULL;
static PFNGLUNIFORMMATRIX3X2FVPROC glUniformMatrix3x2fv_func = NULL;
static PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv_func = NULL;
static PFNGLUNIFORMMATRIX4X2FVPROC glUniformMatrix4x2fv_func = NULL;
static PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv_func = NULL;
static PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv_func = NULL;
/* GL_ARB_vertex/fragment_program */
static PFNGLBINDPROGRAMARBPROC glBindProgramARB_func = NULL;
@@ -56,6 +64,8 @@ static PFNGLDELETEVERTEXARRAYSAPPLEPROC glDeleteVertexArraysAPPLE_func = NULL;
static PFNGLGENVERTEXARRAYSAPPLEPROC glGenVertexArraysAPPLE_func = NULL;
static PFNGLISVERTEXARRAYAPPLEPROC glIsVertexArrayAPPLE_func = NULL;
/* GL_EXT_stencil_two_side */
static PFNGLACTIVESTENCILFACEEXTPROC glActiveStencilFaceEXT_func = NULL;
static void
@@ -69,6 +79,7 @@ GetExtensionFuncs(void)
glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader");
glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram");
glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader");
glGetActiveAttrib_func = (PFNGLGETACTIVEATTRIBPROC) glutGetProcAddress("glGetActiveAttrib");
glGetAttachedShaders_func = (PFNGLGETATTACHEDSHADERSPROC) glutGetProcAddress("glGetAttachedShaders");
glGetAttribLocation_func = (PFNGLGETATTRIBLOCATIONPROC) glutGetProcAddress("glGetAttribLocation");
glGetProgramInfoLog_func = (PFNGLGETPROGRAMINFOLOGPROC) glutGetProcAddress("glGetProgramInfoLog");
@@ -96,6 +107,13 @@ GetExtensionFuncs(void)
glVertexAttrib3f_func = (PFNGLVERTEXATTRIB3FPROC) glutGetProcAddress("glVertexAttrib3f");
glVertexAttrib4f_func = (PFNGLVERTEXATTRIB4FPROC) glutGetProcAddress("glVertexAttrib4f");
/* OpenGL 2.1 */
glUniformMatrix2x3fv_func = (PFNGLUNIFORMMATRIX2X3FVPROC) glutGetProcAddress("glUniformMatrix2x3fv");
glUniformMatrix3x2fv_func = (PFNGLUNIFORMMATRIX3X2FVPROC) glutGetProcAddress("glUniformMatrix3x2fv");
glUniformMatrix2x4fv_func = (PFNGLUNIFORMMATRIX2X4FVPROC) glutGetProcAddress("glUniformMatrix2x4fv");
glUniformMatrix4x2fv_func = (PFNGLUNIFORMMATRIX4X2FVPROC) glutGetProcAddress("glUniformMatrix4x2fv");
glUniformMatrix3x4fv_func = (PFNGLUNIFORMMATRIX3X4FVPROC) glutGetProcAddress("glUniformMatrix3x4fv");
glUniformMatrix4x3fv_func = (PFNGLUNIFORMMATRIX4X3FVPROC) glutGetProcAddress("glUniformMatrix4x3fv");
/* GL_ARB_vertex/fragment_program */
glBindProgramARB_func = (PFNGLBINDPROGRAMARBPROC) glutGetProcAddress("glBindProgramARB");
@@ -114,5 +132,7 @@ GetExtensionFuncs(void)
glGenVertexArraysAPPLE_func = (PFNGLGENVERTEXARRAYSAPPLEPROC) glutGetProcAddress("glGenVertexArraysAPPLE");
glIsVertexArrayAPPLE_func = (PFNGLISVERTEXARRAYAPPLEPROC) glutGetProcAddress("glIsVertexArrayAPPLE");
/* GL_EXT_stencil_two_side */
glActiveStencilFaceEXT_func = (PFNGLACTIVESTENCILFACEEXTPROC) glutGetProcAddress("glActiveStencilFaceEXT");
}

View File

@@ -17,14 +17,14 @@ message:
subdirs:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir ; $(MAKE)) || exit 1 ; \
(cd $$dir && $(MAKE)) || exit 1; \
fi \
done
install:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir ; $(MAKE) install) || exit 1 ; \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
done
@@ -35,6 +35,6 @@ $(TOP)/$(LIB_DIR):
clean:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir ; $(MAKE) clean) ; \
(cd $$dir && $(MAKE) clean) ; \
fi \
done

View File

@@ -1,4 +1,4 @@
DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32'
;DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32'
VERSION 5.1
;
; Module definition file for GLU (GLU32.DLL)

View File

@@ -349,12 +349,18 @@ getVisualInfoRGB(unsigned int mode)
__glutScreen, list);
}
#ifndef VisualIDMask
#define VisualIDMask 0
#endif
static XVisualInfo *
getVisualInfoID(int id)
{
XVisualInfo temp;
int count;
#if !defined(_WIN32)
temp.visualid = id;
#endif
return XGetVisualInfo(__glutDisplay, VisualIDMask, &temp, &count);
}

View File

@@ -90,7 +90,7 @@ int APIENTRY glutCreateWindow (const char *title)
attr.event_mask = StructureNotifyMask | ExposureMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( dpy, root, 0, 0, g_width, g_height,
win = XCreateWindow( dpy, root, g_xpos, g_ypos, g_width, g_height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr );
if (!win) {

View File

@@ -1,5 +1,4 @@
# Build a subset DRI-based libGL.so library.
# Indirect rendering not supported, etc.
# Build the MiniGLX libGL.so library.
TOP = ../../..
include $(TOP)/configs/current
@@ -11,7 +10,7 @@ C_SOURCES = \
$(TOP)/src/mesa/main/dispatch.c \
$(TOP)/src/mesa/glapi/glapi.c \
$(TOP)/src/mesa/glapi/glthread.c \
$(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c \
$(TOP)/src/glx/x11/glcontextmodes.c \
miniglx.c \
miniglx_events.c
@@ -27,12 +26,11 @@ INCLUDE_DIRS = \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/math \
-I$(TOP)/src/mesa/transform \
-I$(TOP)/src/mesa/swrast \
-I$(TOP)/src/mesa/swrast_setup \
-I$(TOP)/src/glx/x11 \
-I$(TOP)/src/mesa/drivers/dri/common \
`pkg-config --cflags libdrm`
$(LIBDRM_CFLAGS) \
$(PCIACCESS_CFLAGS)
##### RULES #####
@@ -46,16 +44,20 @@ INCLUDE_DIRS = \
##### TARGETS #####
default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/miniglx.conf
# Make libGL
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
$(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
-major 1 -minor 2 $(MKLIB_OPTIONS) \
-install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) `/usr/bin/pkg-config --libs libdrm` `/usr/bin/pkg-config --libs pciaccess`
rm -f $(TOP)/$(LIB_DIR)/miniglx.conf
install example.miniglx.conf $(TOP)/$(LIB_DIR)/miniglx.conf
-install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) \
$(LIBDRM_LIB) $(PCIACCESS_LIB)
# install sample miniglx.conf
$(TOP)/$(LIB_DIR)/miniglx.conf:
$(INSTALL) example.miniglx.conf $(TOP)/$(LIB_DIR)/miniglx.conf
drmtest: xf86drm.o drmtest.o

View File

@@ -47,8 +47,6 @@
#ifndef _driver_H_
#define _driver_H_
#define CAPI /* XXX this should be globally defined somewhere */
#include "GL/gl.h"
#include "GL/internal/glcore.h"

View File

@@ -1528,8 +1528,8 @@ XCreateWindow( Display *dpy, Window parent, int x, int y,
}
/* init other per-window fields */
win->x = 0;
win->y = 0;
win->x = x;
win->y = y;
win->w = width;
win->h = height;
win->visual = visual; /* ptr assignment */
@@ -1537,7 +1537,7 @@ XCreateWindow( Display *dpy, Window parent, int x, int y,
win->bytesPerPixel = dpy->driverContext.cpp;
win->rowStride = dpy->driverContext.shared.virtualWidth * win->bytesPerPixel;
win->size = win->rowStride * height;
win->frontStart = dpy->driverContext.FBAddress;
win->frontStart = dpy->driverContext.FBAddress + (win->rowStride * win->x) + (win->y * win->bytesPerPixel);
win->frontBottom = (GLubyte *) win->frontStart + (height-1) * win->rowStride;
/* This is incorrect: the hardware driver could put the backbuffer

View File

@@ -46,7 +46,6 @@ INCLUDES = -I. \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/drivers/dri/common \
$(LIBDRM_CFLAGS) \
$(X11_INCLUDES)
@@ -63,9 +62,6 @@ INCLUDES = -I. \
default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
glcontextmodes.c:
ln -s $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c .
# Make libGL
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
$(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
@@ -81,7 +77,7 @@ depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_ASM_API) Makefile
# Emacs tags
tags:
etags `find . -name \*.[ch]` `find ../include`
etags `find . -name \*.[ch]` `find $(TOP)/include`
# Dummy install target
install:

View File

@@ -39,6 +39,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xlibint.h>
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
#include "glheader.h"
#include "glxclient.h"
#include "xf86dri.h"
#include "sarea.h"
@@ -81,11 +82,15 @@ static void InfoMessageF(const char *f, ...)
}
}
/**
* Print error to stderr, unless LIBGL_DEBUG=="quiet".
*/
static void ErrorMessageF(const char *f, ...)
{
va_list args;
const char *env;
if (getenv("LIBGL_DEBUG")) {
if ((env = getenv("LIBGL_DEBUG")) && !strstr(env, "quiet")) {
fprintf(stderr, "libGL error: ");
va_start(args, f);
vfprintf(stderr, f, args);
@@ -338,7 +343,7 @@ __DRIdriver *driGetDriver(Display *dpy, int scrNum)
* The returned char pointer points to a static array that will be
* overwritten by subsequent calls.
*/
const char *glXGetScreenDriver (Display *dpy, int scrNum) {
PUBLIC const char *glXGetScreenDriver (Display *dpy, int scrNum) {
static char ret[32];
char *driverName;
if (GetDriverName(dpy, scrNum, &driverName)) {
@@ -367,7 +372,7 @@ const char *glXGetScreenDriver (Display *dpy, int scrNum) {
*
* Note: The driver remains opened after this function returns.
*/
const char *glXGetDriverConfig (const char *driverName) {
PUBLIC const char *glXGetDriverConfig (const char *driverName) {
__DRIdriver *driver = OpenDriver (driverName);
if (driver)
return dlsym (driver->handle, "__driConfigOptions");

View File

@@ -31,21 +31,25 @@
* \author Ian Romanick <idr@us.ibm.com>
*/
#if defined(IN_MINI_GLX)
#include <GL/gl.h>
#else
#if defined(HAVE_DIX_CONFIG_H)
# include <dix-config.h>
#endif
#include <X11/X.h>
#include <GL/glx.h>
#include "GL/glxint.h"
#endif
/* Memory macros */
#if defined(IN_MINI_GLX)
# include <stdlib.h>
# include <string.h>
# include <GL/gl.h>
# include "GL/internal/dri_interface.h"
# include "imports.h"
# define _mesa_malloc(b) malloc(b)
# define _mesa_free(m) free(m)
# define _mesa_memset memset
#else
# if defined(HAVE_DIX_CONFIG_H)
# include <dix-config.h>
# endif
# include <X11/X.h>
# include <GL/glx.h>
# include "GL/glxint.h"
# ifdef XFree86Server
# include <os.h>
# include <string.h>

View File

@@ -150,7 +150,7 @@ DestroyPbuffer( Display * dpy, GLXDrawable drawable )
if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
xGLXDestroyPbufferReq * req;
GetReqExtra( GLXDestroyPbuffer, 4, req );
GetReq( GLXDestroyPbuffer, req );
req->reqType = opcode;
req->glxCode = X_GLXDestroyPbuffer;
req->pbuffer = (GLXPbuffer) drawable;

View File

@@ -1246,7 +1246,7 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
__glXUnlock();
return 0;
}
dpyPriv = (__GLXdisplayPrivate *) Xmalloc(sizeof(__GLXdisplayPrivate));
dpyPriv = (__GLXdisplayPrivate *) Xcalloc(1, sizeof(__GLXdisplayPrivate));
if (!dpyPriv) {
__glXUnlock();
Xfree((char*) private);
@@ -1271,12 +1271,7 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
** Note: This _must_ be done before calling any other DRI routines
** (e.g., those called in AllocAndFetchScreenConfigs).
*/
if (getenv("LIBGL_ALWAYS_INDIRECT")) {
/* Assinging zero here assures we'll never go direct */
dpyPriv->driDisplay.private = 0;
dpyPriv->driDisplay.destroyDisplay = 0;
}
else {
if (getenv("LIBGL_ALWAYS_INDIRECT") == NULL) {
dpyPriv->driDisplay.private =
driCreateDisplay(dpy, &dpyPriv->driDisplay);
}
@@ -1488,7 +1483,7 @@ void __glXSendLargeCommand(__GLXcontext *ctx,
/************************************************************************/
GLXContext glXGetCurrentContext(void)
PUBLIC GLXContext glXGetCurrentContext(void)
{
GLXContext cx = __glXGetCurrentContext();
@@ -1499,7 +1494,7 @@ GLXContext glXGetCurrentContext(void)
}
}
GLXDrawable glXGetCurrentDrawable(void)
PUBLIC GLXDrawable glXGetCurrentDrawable(void)
{
GLXContext gc = __glXGetCurrentContext();
return gc->currentDrawable;

View File

@@ -1667,7 +1667,7 @@ __glXGetArrayType( const __GLXattribute * const state,
key, index );
if ( a != NULL ) {
*dest = (GLintptr) a->enabled;
*dest = (GLintptr) a->data_type;
}
return (a != NULL);

View File

@@ -145,9 +145,10 @@ GLenum __indirect_glGetError(void)
* On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned.
*/
static GLboolean
get_client_data( __GLXattribute * state, GLenum cap, GLintptr * data )
get_client_data( __GLXcontext * gc, GLenum cap, GLintptr * data )
{
GLboolean retval = GL_TRUE;
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
const GLint tex_unit = __glXGetActiveTextureUnit( state );
@@ -281,6 +282,9 @@ get_client_data( __GLXattribute * state, GLenum cap, GLintptr * data )
case GL_UNPACK_LSB_FIRST:
*data = (GLintptr)state->storeUnpack.lsbFirst;
break;
case GL_CLIENT_ATTRIB_STACK_DEPTH:
*data = (GLintptr)(gc->attributes.stackPointer - gc->attributes.stack);
break;
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
*data = (GLintptr)__GL_CLIENT_ATTRIB_STACK_DEPTH;
break;
@@ -302,7 +306,6 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
{
const GLenum origVal = val;
__GLX_SINGLE_DECLARE_VARIABLES();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
val = RemapTransposeEnum( val );
@@ -326,7 +329,7 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
** for example, to call a query between glBegin() and glEnd()).
*/
if ( get_client_data( state, val, & data ) ) {
if ( get_client_data( gc, val, & data ) ) {
*b = (GLboolean) data;
}
else {
@@ -351,7 +354,6 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d)
{
const GLenum origVal = val;
__GLX_SINGLE_DECLARE_VARIABLES();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
val = RemapTransposeEnum( val );
@@ -375,7 +377,7 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d)
** for example, to call a query between glBegin() and glEnd()).
*/
if ( get_client_data( state, val, & data ) ) {
if ( get_client_data( gc, val, & data ) ) {
*d = (GLdouble) data;
}
else {
@@ -400,7 +402,6 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f)
{
const GLenum origVal = val;
__GLX_SINGLE_DECLARE_VARIABLES();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
val = RemapTransposeEnum( val );
@@ -424,7 +425,7 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f)
** for example, to call a query between glBegin() and glEnd()).
*/
if ( get_client_data( state, val, & data ) ) {
if ( get_client_data( gc, val, & data ) ) {
*f = (GLfloat) data;
}
else {
@@ -449,7 +450,6 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i)
{
const GLenum origVal = val;
__GLX_SINGLE_DECLARE_VARIABLES();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
val = RemapTransposeEnum( val );
@@ -473,7 +473,7 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i)
** for example, to call a query between glBegin() and glEnd()).
*/
if ( get_client_data( state, val, & data ) ) {
if ( get_client_data( gc, val, & data ) ) {
*i = (GLint) data;
}
else {

View File

@@ -89,9 +89,7 @@ fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS)
# Stand-alone Mesa libGL and libOSMesa
STAND_ALONE_DRIVER_SOURCES = \
$(COMMON_DRIVER_SOURCES) \
$(X11_DRIVER_SOURCES) \
$(GLIDE_DRIVER_SOURCES) \
$(SVGA_DRIVER_SOURCES)
$(X11_DRIVER_SOURCES)
STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o)

View File

@@ -28,9 +28,9 @@
#include "buffers.h"
#include "context.h"
#include "framebuffer.h"
#include "occlude.h"
#include "program.h"
#include "prog_execute.h"
#include "queryobj.h"
#include "renderbuffer.h"
#include "texcompress.h"
#include "texformat.h"

View File

@@ -14,21 +14,25 @@ $(TOP)/$(LIB_DIR):
subdirs:
echo $(DRI_DIRS)
@for dir in $(DRI_DIRS) ; do \
echo $$dir ; \
(cd $$dir && $(MAKE)) || exit 1; \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
install:
@for dir in $(DRI_DIRS) ; do \
(cd $$dir && $(MAKE) install) || exit 1; \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
done
clean:
@for dir in $(DRI_DIRS) ; do \
(cd $$dir && $(MAKE) clean) ; \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean ; \
fi \
done
-rm -f common/*.o

View File

@@ -25,11 +25,13 @@ OBJECTS = $(C_SOURCES:.c=.o) \
$(ASM_SOURCES:.S=.o)
else
# miniglx
WINOBJ=
WINLIB=-L$(MESA)/src/glx/mini
MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
INCLUDES = $(MINIGLX_INCLUDES) \
$(SHARED_INCLUDES)
$(SHARED_INCLUDES) \
$(PCIACCESS_CFLAGS)
OBJECTS = $(C_SOURCES:.c=.o) \
$(MINIGLX_SOURCES:.c=.o) \
@@ -54,7 +56,8 @@ SHARED_INCLUDES = \
-I$(TOP)/src/mesa/swrast_setup \
-I$(TOP)/src/egl/main \
-I$(TOP)/src/egl/drivers/dri \
`pkg-config --cflags libdrm`
$(LIBDRM_CFLAGS)
##### RULES #####
@@ -70,11 +73,6 @@ SHARED_INCLUDES = \
default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
#$(TOP)/$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
# @echo BUILDING FOR: $(WINDOW_SYSTEM)
# $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(TOP)/$(LIB_DIR) \
# $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
$(TOP)/bin/mklib -noprefix -o $@ \
$(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
@@ -84,9 +82,6 @@ $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
$(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
# Run 'make depend' to update the dependencies if you change
# what's included by any source file.
depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
@@ -103,8 +98,10 @@ clean:
-rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
-rm -f depend depend.bak
install: $(LIBNAME)
$(INSTALL) -d $(DRI_DRIVER_INSTALL_DIR)
$(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR)
include depend

View File

@@ -190,11 +190,16 @@ driBOKernel(struct _DriBufferObject *buf)
void
driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
{
assert(buf->private != NULL);
struct _DriBufferPool *pool;
void *priv;
_glthread_LOCK_MUTEX(buf->mutex);
BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, lazy));
pool = buf->pool;
priv = buf->private;
_glthread_UNLOCK_MUTEX(buf->mutex);
assert(priv != NULL);
BM_CKFATAL(buf->pool->waitIdle(pool, priv, lazy));
}
void *
@@ -296,7 +301,8 @@ driBOData(struct _DriBufferObject *buf,
pool->destroy(pool, buf->private);
if (!flags)
flags = buf->flags;
buf->private = pool->create(pool, size, flags, 0, buf->alignment);
buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
buf->alignment);
if (!buf->private)
BM_CKFATAL(-ENOMEM);
BM_CKFATAL(pool->map(pool, buf->private,

View File

@@ -185,7 +185,7 @@ pool_setstatic(struct _DriBufferPool *pool, unsigned long offset,
return NULL;
ret = drmBOCreate(pool->fd, offset, size, 0, NULL, drm_bo_type_fake,
flags, 0, buf);
flags, DRM_BO_HINT_DONT_FENCE, buf);
if (ret) {
free(buf);

View File

@@ -49,8 +49,6 @@
#ifndef _DRI_UTIL_H_
#define _DRI_UTIL_H_
#define CAPI /* XXX this should be globally defined somewhere */
#include <GL/gl.h>
#include "drm.h"
#include "drm_sarea.h"

View File

@@ -208,7 +208,7 @@ driUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv)
{
struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
_mesa_resize_framebuffer(ctx, fb, dPriv->w, dPriv->h);
ctx->Driver.ResizeBuffers(ctx, fb, dPriv->w, dPriv->h);
assert(fb->Width == dPriv->w);
assert(fb->Height == dPriv->h);
}

View File

@@ -40,6 +40,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "extensions.h"
#include "framebuffer.h"
#include "imports.h"
#include "points.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -278,6 +279,11 @@ i810CreateContext( const __GLcontextModes *mesaVis,
ctx->Const.MaxPointSizeAA = 3.0;
ctx->Const.PointSizeGranularity = 1.0;
/* reinitialize the context point state.
* It depend on constants in __GLcontextRec::Const
*/
_mesa_init_point(ctx);
ctx->Driver.GetBufferSize = i810BufferSize;
ctx->Driver.GetString = i810GetString;

View File

@@ -168,6 +168,7 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
driInitExtensions( ctx, i915_extensions, GL_FALSE );

View File

@@ -531,7 +531,7 @@ void i915_update_fog( GLcontext *ctx )
GLboolean enabled;
GLboolean try_pixel_fog;
if (ctx->FragmentProgram._Enabled) {
if (ctx->FragmentProgram._Active) {
/* Pull in static fog state from program */
mode = ctx->FragmentProgram._Current->FogOption;
@@ -541,17 +541,19 @@ void i915_update_fog( GLcontext *ctx )
else {
enabled = ctx->Fog.Enabled;
mode = ctx->Fog.Mode;
try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT &&
ctx->Hint.Fog == GL_NICEST &&
0); /* XXX - DISABLE -- Need ortho fallback */
#if 0
/* XXX - DISABLED -- Need ortho fallback */
try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT
&&ctx->Hint.Fog == GL_NICEST);
#else
try_pixel_fog = 0;
#endif
}
if (!enabled) {
i915->vertex_fog = I915_FOG_NONE;
}
else if (try_pixel_fog) {
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
i915->vertex_fog = I915_FOG_PIXEL;
@@ -567,8 +569,8 @@ void i915_update_fog( GLcontext *ctx )
i915->vertex_fog = I915_FOG_VERTEX;
}
else {
GLfloat c1 = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start);
GLfloat c2 = 1.0/(ctx->Fog.End-ctx->Fog.Start);
GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start);
GLfloat c1 = ctx->Fog.End * c2;
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK;
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR;
@@ -576,10 +578,11 @@ void i915_update_fog( GLcontext *ctx )
((GLuint)(c1 * FMC1_C1_ONE)) & FMC1_C1_MASK;
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
i915->state.Fog[I915_FOGREG_MODE2] = (GLuint)(c2 * FMC2_C2_ONE);
i915->state.Fog[I915_FOGREG_MODE2]
= (GLuint)(c2 * FMC2_C2_ONE);
}
else {
union { float f; int i; } fi;
fi_type fi;
fi.f = c2;
i915->state.Fog[I915_FOGREG_MODE2] = fi.i;
}
@@ -602,24 +605,22 @@ void i915_update_fog( GLcontext *ctx )
i915->vertex_fog = I915_FOG_VERTEX;
}
{
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
if (enabled)
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
else
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
}
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
if (enabled)
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
else
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
/* always enbale pixel fog
* vertex fog use precaculted fog coord will conflict with appended
* fog program
/* Always enable pixel fog. Vertex fog using fog coord will conflict
* with fog code appended onto fragment program.
*/
_tnl_allow_vertex_fog( ctx, 0 );
_tnl_allow_pixel_fog( ctx, 1 );
}
static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
static void
i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
{
i915ContextPtr i915 = I915_CONTEXT(ctx);
@@ -634,8 +635,8 @@ static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
i915->state.Fog[I915_FOGREG_MODE3] = (GLuint)(ctx->Fog.Density *
FMC3_D_ONE);
i915->state.Fog[I915_FOGREG_MODE3]
= (GLuint)(ctx->Fog.Density * FMC3_D_ONE);
}
else {
union { float f; int i; } fi;

View File

@@ -172,12 +172,8 @@ static void i915LayoutTextureImages( i915ContextPtr i915,
t->intel.image[0][i].offset = total_height * pitch;
t->intel.image[0][i].internalFormat = baseImage->_BaseFormat;
if (t->intel.image[0][i].image->IsCompressed)
{
if (t->intel.image[0][i].image->Height > 4)
total_height += t->intel.image[0][i].image->Height/4;
else
total_height += 1;
if (t->intel.image[0][i].image->IsCompressed) {
total_height += (t->intel.image[0][i].image->Height + 3) / 4;
}
else
total_height += MAX2(2, t->intel.image[0][i].image->Height);

View File

@@ -46,7 +46,7 @@ static void i915_render_start( intelContextPtr intel )
GLcontext *ctx = &intel->ctx;
i915ContextPtr i915 = I915_CONTEXT(intel);
if (ctx->FragmentProgram._Current)
if (ctx->FragmentProgram._Active)
i915ValidateFragmentProgram( i915 );
else {
assert(!ctx->FragmentProgram._MaintainTexEnvProgram);

View File

@@ -33,6 +33,7 @@
#include "extensions.h"
#include "framebuffer.h"
#include "imports.h"
#include "points.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -195,7 +196,6 @@ static const struct tnl_pipeline_stage *intel_pipeline[] = {
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
&_tnl_arb_vertex_program_stage,
&_tnl_vertex_program_stage,
#if 1
&_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */
@@ -302,6 +302,11 @@ GLboolean intelInitContext( intelContextPtr intel,
ctx->Const.MaxPointSizeAA = 3.0;
ctx->Const.PointSizeGranularity = 1.0;
/* reinitialize the context point state.
* It depend on constants in __GLcontextRec::Const
*/
_mesa_init_point(ctx);
/* Initialize the software rasterizer and helper modules. */
_swrast_CreateContext( ctx );
_vbo_CreateContext( ctx );
@@ -563,7 +568,7 @@ void intelWindowMoved( intelContextPtr intel )
GLint areaB = driIntersectArea( drw_rect, pipeB_rect );
GLuint flags = intel->vblank_flags;
if (areaB > areaA || (areaA > 0 && areaB > 0)) {
if (areaB > areaA || (areaA == areaB && areaB > 0)) {
flags = intel->vblank_flags | VBLANK_FLAG_SECONDARY;
} else {
flags = intel->vblank_flags & ~VBLANK_FLAG_SECONDARY;

View File

@@ -634,11 +634,32 @@ static void intelUploadTexImage( intelContextPtr intel,
image->Height);
}
else if (image->IsCompressed) {
GLuint row_len = image->Width * 2;
GLuint row_len = 0;
GLubyte *dst = (GLubyte *)(t->BufAddr + offset);
GLubyte *src = (GLubyte *)image->Data;
GLuint j;
/* must always copy whole blocks (8/16 bytes) */
switch (image->InternalFormat) {
case GL_COMPRESSED_RGB_FXT1_3DFX:
case GL_COMPRESSED_RGBA_FXT1_3DFX:
case GL_RGB_S3TC:
case GL_RGB4_S3TC:
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
row_len = (image->Width * 2 + 7) & ~7;
break;
case GL_RGBA_S3TC:
case GL_RGBA4_S3TC:
case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
row_len = (image->Width * 4 + 15) & ~15;
break;
default:
fprintf(stderr,"Internal Compressed format not supported %d\n", image->InternalFormat);
break;
}
if (INTEL_DEBUG & DEBUG_TEXTURE)
fprintf(stderr,
"Upload image %dx%dx%d offset %xm row_len %x "
@@ -646,30 +667,11 @@ static void intelUploadTexImage( intelContextPtr intel,
image->Width, image->Height, image->Depth, offset,
row_len, t->Pitch, t->depth_pitch);
switch (image->InternalFormat) {
case GL_COMPRESSED_RGB_FXT1_3DFX:
case GL_COMPRESSED_RGBA_FXT1_3DFX:
case GL_RGB_S3TC:
case GL_RGB4_S3TC:
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
__memcpy(dst, src, row_len );
src += row_len;
}
break;
case GL_RGBA_S3TC:
case GL_RGBA4_S3TC:
case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
for (j = 0 ; j < image->Height/4 ; j++, dst += (t->Pitch)) {
__memcpy(dst, src, (image->Width*4) );
src += image->Width*4;
}
break;
default:
fprintf(stderr,"Internal Compressed format not supported %d\n", image->InternalFormat);
break;
if (row_len) {
for (j = 0 ; j < (image->Height + 3)/4 ; j++, dst += (t->Pitch)) {
__memcpy(dst, src, row_len );
src += row_len;
}
}
}
/* Time for another vtbl entry:

View File

@@ -455,12 +455,14 @@ static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, l
}
unsigned long
I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *result, I830MemPool *pool, long size, unsigned long alignment, int flags)
I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830,
I830MemRange *result, I830MemPool *pool, long size,
unsigned long alignment, int flags)
{
int ret;
unsigned long ret;
if (!result)
return 0;
if (!result)
return 0;
/* Make sure these are initialised. */
result->Size = 0;
@@ -470,16 +472,15 @@ I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *resul
return 0;
}
if (pool->Free.Size < size)
return AllocFromAGP(ctx, pI830, size, alignment, result);
else
{
ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
if (ret==0)
return AllocFromAGP(ctx, pI830, size, alignment, result);
return ret;
if (pool->Free.Size < size) {
ret = AllocFromAGP(ctx, pI830, size, alignment, result);
}
else {
ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
if (ret == 0)
ret = AllocFromAGP(ctx, pI830, size, alignment, result);
}
return ret;
}
static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem)

View File

@@ -158,7 +158,7 @@ i915CreateContext(const __GLcontextModes * mesaVis,
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
/*ctx->_UseTexEnvProgram = 1;*/
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
driInitExtensions(ctx, i915_extensions, GL_FALSE);

View File

@@ -561,9 +561,8 @@ i915_update_fog(GLcontext * ctx)
GLboolean enabled;
GLboolean try_pixel_fog;
if (ctx->FragmentProgram._Enabled) {
if (ctx->FragmentProgram._Active) {
/* Pull in static fog state from program */
mode = ctx->FragmentProgram._Current->FogOption;
enabled = (mode != GL_NONE);
try_pixel_fog = 0;
@@ -571,15 +570,19 @@ i915_update_fog(GLcontext * ctx)
else {
enabled = ctx->Fog.Enabled;
mode = ctx->Fog.Mode;
try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT && ctx->Hint.Fog == GL_NICEST && 0); /* XXX - DISABLE -- Need ortho fallback */
#if 0
/* XXX - DISABLED -- Need ortho fallback */
try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT
&& ctx->Hint.Fog == GL_NICEST);
#else
try_pixel_fog = 0;
#endif
}
if (!enabled) {
i915->vertex_fog = I915_FOG_NONE;
}
else if (try_pixel_fog) {
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
i915->vertex_fog = I915_FOG_PIXEL;
@@ -591,12 +594,13 @@ i915_update_fog(GLcontext * ctx)
* either fallback or append fog instructions to end of
* program in the case of linear fog.
*/
printf("vertex fog!\n");
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
i915->vertex_fog = I915_FOG_VERTEX;
}
else {
GLfloat c1 = ctx->Fog.End / (ctx->Fog.End - ctx->Fog.Start);
GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start);
GLfloat c1 = ctx->Fog.End * c2;
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK;
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR;
@@ -604,15 +608,11 @@ i915_update_fog(GLcontext * ctx)
((GLuint) (c1 * FMC1_C1_ONE)) & FMC1_C1_MASK;
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
i915->state.Fog[I915_FOGREG_MODE2] =
(GLuint) (c2 * FMC2_C2_ONE);
i915->state.Fog[I915_FOGREG_MODE2]
= (GLuint) (c2 * FMC2_C2_ONE);
}
else {
union
{
float f;
int i;
} fi;
fi_type fi;
fi.f = c2;
i915->state.Fog[I915_FOGREG_MODE2] = fi.i;
}
@@ -628,26 +628,22 @@ i915_update_fog(GLcontext * ctx)
break;
}
}
else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */
else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
i915->vertex_fog = I915_FOG_VERTEX;
}
{
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
if (enabled)
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
else
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
}
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
if (enabled)
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE;
else
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
/* always enbale pixel fog
* vertex fog use precaculted fog coord will conflict with appended
* fog program
/* Always enable pixel fog. Vertex fog using fog coord will conflict
* with fog code appended onto fragment program.
*/
_tnl_allow_vertex_fog( ctx, 0 );
_tnl_allow_pixel_fog( ctx, 1 );
@@ -669,15 +665,11 @@ i915Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param)
I915_STATECHANGE(i915, I915_UPLOAD_FOG);
if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
i915->state.Fog[I915_FOGREG_MODE3] = (GLuint) (ctx->Fog.Density *
FMC3_D_ONE);
i915->state.Fog[I915_FOGREG_MODE3] =
(GLuint) (ctx->Fog.Density * FMC3_D_ONE);
}
else {
union
{
float f;
int i;
} fi;
fi_type fi;
fi.f = ctx->Fog.Density;
i915->state.Fog[I915_FOGREG_MODE3] = fi.i;
}

View File

@@ -161,11 +161,9 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
if (mt->compressed)
img_height = MAX2(1, height / 4);
else
img_height = MAX2(2, height);
img_height = (MAX2(2, height) + 1) & ~1;
mt->total_height += img_height;
mt->total_height += 1;
mt->total_height &= ~1;
width = minify(width);
height = minify(height);

View File

@@ -96,7 +96,7 @@ createBPool(int fd, unsigned long bufSize, unsigned numBufs, unsigned flags,
_glthread_INIT_MUTEX(p->mutex);
if (drmBOCreate(fd, 0, numBufs * bufSize, 0, NULL, drm_bo_type_dc,
flags, 0, &p->kernelBO)) {
flags, DRM_BO_HINT_DONT_FENCE, &p->kernelBO)) {
free(p->bufs);
free(p);
return NULL;

View File

@@ -76,7 +76,9 @@ intel_bufferobj_release_region(struct intel_context *intel,
*/
driGenBuffers(intel->intelScreen->regionPool,
"buffer object", 1, &intel_obj->buffer, 64, 0, 0);
LOCK_HARDWARE(intel);
driBOData(intel_obj->buffer, intel_obj->Base.Size, NULL, 0);
UNLOCK_HARDWARE(intel);
}
/* Break the COW tie to the region. Both the pbo and the region end
@@ -137,7 +139,9 @@ intel_bufferobj_data(GLcontext * ctx,
if (intel_obj->region)
intel_bufferobj_release_region(intel, intel_obj);
LOCK_HARDWARE(intel);
driBOData(intel_obj->buffer, size, data, 0);
UNLOCK_HARDWARE(intel);
}

View File

@@ -33,6 +33,7 @@
#include "extensions.h"
#include "framebuffer.h"
#include "imports.h"
#include "points.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -208,7 +209,6 @@ static const struct tnl_pipeline_stage *intel_pipeline[] = {
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
&_tnl_arb_vertex_program_stage,
&_tnl_vertex_program_stage,
#if 1
&_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */
@@ -346,7 +346,15 @@ intelInitContext(struct intel_context *intel,
drmI830Sarea *saPriv = (drmI830Sarea *)
(((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset);
int fthrottle_mode;
GLboolean havePools;
DRM_LIGHT_LOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
havePools = intelCreatePools(intelScreen);
DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
if (!havePools)
return GL_FALSE;
if (!_mesa_initialize_context(&intel->ctx,
mesaVis, shareCtx,
functions, (void *) intel))
@@ -390,6 +398,11 @@ intelInitContext(struct intel_context *intel,
ctx->Const.MaxPointSizeAA = 3.0;
ctx->Const.PointSizeGranularity = 1.0;
/* reinitialize the context point state.
* It depend on constants in __GLcontextRec::Const
*/
_mesa_init_point(ctx);
ctx->Const.MaxColorAttachments = 4; /* XXX FBO: review this */
/* Initialize the software rasterizer and helper modules. */
@@ -581,10 +594,11 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
}
/* set GLframebuffer size to match window, if needed */
if (driReadPriv != driDrawPriv && readFb->Width != driReadPriv->w) {
_mesa_resize_framebuffer(&intel->ctx, readFb,
driReadPriv->w, driReadPriv->h);
}
driUpdateFramebufferSize(&intel->ctx, driDrawPriv);
if (driReadPriv != driDrawPriv) {
driUpdateFramebufferSize(&intel->ctx, driReadPriv);
}
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);

View File

@@ -309,27 +309,39 @@ static GLboolean
intel_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
struct intel_context *intel = intel_context(ctx);
struct intel_framebuffer *intel_fb;
ASSERT(rb->Name == 0);
rb->Width = width;
rb->Height = height;
rb->_ActualFormat = internalFormat;
if (intel && intel->driDrawable &&
(intel_fb = intel->driDrawable->driverPrivate) &&
intel_fb->pf_num_pages == 3 &&
rb == &intel_fb->color_rb[intel_fb->pf_current_page]->Base &&
(rb = &intel_fb->color_rb[(intel_fb->pf_current_page + 2) % 3]->Base)) {
rb->Width = width;
rb->Height = height;
rb->_ActualFormat = internalFormat;
}
return GL_TRUE;
}
static void
intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb,
GLuint width, GLuint height)
{
struct intel_framebuffer *intel_fb = (struct intel_framebuffer*)fb;
int i;
_mesa_resize_framebuffer(ctx, fb, width, height);
fb->Initialized = GL_TRUE; /* XXX remove someday */
if (fb->Name != 0) {
return;
}
/* Make sure all window system renderbuffers are up to date */
for (i = 0; i < 3; i++) {
struct gl_renderbuffer *rb = &intel_fb->color_rb[i]->Base;
/* only resize if size is changing */
if (rb && (rb->Width != width || rb->Height != height)) {
rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height);
}
}
}
static GLboolean
intel_nop_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
@@ -508,7 +520,7 @@ intel_framebuffer_renderbuffer(GLcontext * ctx,
/**
* When glFramebufferTexture[123]D is called this function sets up the
* gl_renderbuffer wrapp around the texture image.
* gl_renderbuffer wrapper around the texture image.
* This will have the region info needed for hardware rendering.
*/
static struct intel_renderbuffer *
@@ -594,7 +606,7 @@ intel_render_texture(GLcontext * ctx,
irb = intel_wrap_texture(ctx, newImage);
if (irb) {
/* bind the wrapper to the attachment point */
att->Renderbuffer = &irb->Base;
_mesa_reference_renderbuffer(&att->Renderbuffer, &irb->Base);
}
else {
/* fallback to software rendering */
@@ -671,4 +683,5 @@ intel_fbo_init(struct intel_context *intel)
intel->ctx.Driver.FramebufferRenderbuffer = intel_framebuffer_renderbuffer;
intel->ctx.Driver.RenderTexture = intel_render_texture;
intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
intel->ctx.Driver.ResizeBuffers = intel_resize_buffers;
}

View File

@@ -317,7 +317,7 @@ intel_miptree_image_data(struct intel_context *intel,
0, 0, /* source x, y */
dst->level[level].width, height); /* width, height */
src += src_image_pitch;
src += src_image_pitch * dst->cpp;
}
}

View File

@@ -90,6 +90,7 @@ intel_region_alloc(intelScreenPrivate *intelScreen,
GLuint cpp, GLuint pitch, GLuint height)
{
struct intel_region *region = calloc(sizeof(*region), 1);
struct intel_context *intel = intelScreenContext(intelScreen);
DBG("%s\n", __FUNCTION__);
@@ -107,7 +108,9 @@ intel_region_alloc(intelScreenPrivate *intelScreen,
0,
#endif
0);
LOCK_HARDWARE(intel);
driBOData(region->buffer, pitch * cpp * height, NULL, 0);
UNLOCK_HARDWARE(intel);
return region;
}
@@ -392,6 +395,8 @@ void
intel_region_release_pbo(intelScreenPrivate *intelScreen,
struct intel_region *region)
{
struct intel_context *intel = intelScreenContext(intelScreen);
assert(region->buffer == region->pbo->buffer);
region->pbo->region = NULL;
region->pbo = NULL;
@@ -400,8 +405,11 @@ intel_region_release_pbo(intelScreenPrivate *intelScreen,
driGenBuffers(intelScreen->regionPool,
"region", 1, &region->buffer, 64, 0, 0);
LOCK_HARDWARE(intel);
driBOData(region->buffer,
region->cpp * region->pitch * region->height, NULL, 0);
UNLOCK_HARDWARE(intel);
}
/* Break the COW tie to the pbo. Both the pbo and the region end up

View File

@@ -386,6 +386,45 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
intelPrintSAREA(sarea);
}
GLboolean
intelCreatePools(intelScreenPrivate *intelScreen)
{
unsigned batchPoolSize = 1024*1024;
__DRIscreenPrivate * sPriv = intelScreen->driScrnPriv;
if (intelScreen->havePools)
return GL_TRUE;
batchPoolSize /= intelScreen->maxBatchSize;
intelScreen->regionPool = driDRMPoolInit(sPriv->fd);
if (!intelScreen->regionPool)
return GL_FALSE;
intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd);
if (!intelScreen->staticPool)
return GL_FALSE;
intelScreen->texPool = intelScreen->regionPool;
intelScreen->batchPool = driBatchPoolInit(sPriv->fd,
DRM_BO_FLAG_EXE |
DRM_BO_FLAG_MEM_TT |
DRM_BO_FLAG_MEM_LOCAL,
intelScreen->maxBatchSize,
batchPoolSize, 5);
if (!intelScreen->batchPool) {
fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n");
return GL_FALSE;
}
intel_recreate_static_regions(intelScreen);
intelScreen->havePools = GL_TRUE;
return GL_TRUE;
}
static GLboolean
intelInitDriver(__DRIscreenPrivate * sPriv)
@@ -393,7 +432,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
intelScreenPrivate *intelScreen;
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
drmI830Sarea *sarea;
unsigned batchPoolSize = 1024*1024;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->
@@ -426,7 +464,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
intelScreen->deviceID = gDRIPriv->deviceID;
if (intelScreen->deviceID == PCI_CHIP_I865_G)
intelScreen->maxBatchSize = 4096;
batchPoolSize /= intelScreen->maxBatchSize;
intelScreen->mem = gDRIPriv->mem;
intelScreen->cpp = gDRIPriv->cpp;
@@ -517,31 +554,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
(*glx_enable_extension) (psc, "GLX_SGI_make_current_read");
}
intelScreen->regionPool = driDRMPoolInit(sPriv->fd);
if (!intelScreen->regionPool)
return GL_FALSE;
intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd);
if (!intelScreen->staticPool)
return GL_FALSE;
intelScreen->texPool = intelScreen->regionPool;
intelScreen->batchPool = driBatchPoolInit(sPriv->fd,
DRM_BO_FLAG_EXE |
DRM_BO_FLAG_MEM_TT |
DRM_BO_FLAG_MEM_LOCAL,
intelScreen->maxBatchSize,
batchPoolSize, 5);
if (!intelScreen->batchPool) {
fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n");
return GL_FALSE;
}
intel_recreate_static_regions(intelScreen);
return GL_TRUE;
}
@@ -553,9 +565,11 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv)
intelUnmapScreenRegions(intelScreen);
driPoolTakeDown(intelScreen->regionPool);
driPoolTakeDown(intelScreen->staticPool);
driPoolTakeDown(intelScreen->batchPool);
if (intelScreen->havePools) {
driPoolTakeDown(intelScreen->regionPool);
driPoolTakeDown(intelScreen->staticPool);
driPoolTakeDown(intelScreen->batchPool);
}
FREE(intelScreen);
sPriv->private = NULL;
}
@@ -892,6 +906,7 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &intelAPI);
if (psp != NULL) {
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
*driver_modes = intelFillInModes(dri_priv->cpp * 8,

View File

@@ -95,6 +95,7 @@ typedef struct
struct _DriBufferPool *regionPool;
struct _DriBufferPool *staticPool;
unsigned int maxBatchSize;
GLboolean havePools;
} intelScreenPrivate;
@@ -130,5 +131,7 @@ extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen)
extern void
intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea);
extern GLboolean
intelCreatePools(intelScreenPrivate *intelScreen);
#endif

View File

@@ -329,25 +329,7 @@ intelTexImage(GLcontext * ctx,
texImage->TexFormat = intelChooseTextureFormat(ctx, internalFormat,
format, type);
assert(texImage->TexFormat);
switch (dims) {
case 1:
texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D;
texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df;
break;
case 2:
texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D;
texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df;
break;
case 3:
texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D;
texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df;
break;
default:
assert(0);
break;
}
_mesa_set_fetch_functions(texImage, dims);
if (texImage->TexFormat->TexelBytes == 0) {
/* must be a compressed format */
@@ -632,6 +614,7 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
intelImage->level,
&intelImage->base.RowStride,
intelImage->base.ImageOffsets);
intelImage->base.RowStride /= intelImage->mt->cpp;
}
else {
/* Otherwise, the image should actually be stored in

View File

@@ -105,6 +105,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
{
struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current;
struct intel_texture_object *intelObj = intel_texture_object(tObj);
int comp_byte = 0;
int cpp;
GLuint face, i;
GLuint nr_faces = 0;
@@ -148,6 +150,12 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
intel_miptree_reference(&intelObj->mt, firstImage->mt);
}
if (firstImage->base.IsCompressed) {
comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat);
cpp = comp_byte;
}
else cpp = firstImage->base.TexFormat->TexelBytes;
/* Check tree can hold all active levels. Check tree matches
* target, imageFormat, etc.
*
@@ -165,7 +173,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
intelObj->mt->width0 != firstImage->base.Width ||
intelObj->mt->height0 != firstImage->base.Height ||
intelObj->mt->depth0 != firstImage->base.Depth ||
intelObj->mt->cpp != firstImage->base.TexFormat->TexelBytes ||
intelObj->mt->cpp != cpp ||
intelObj->mt->compressed != firstImage->base.IsCompressed)) {
intel_miptree_release(intel, &intelObj->mt);
}
@@ -174,10 +182,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
/* May need to create a new tree:
*/
if (!intelObj->mt) {
int comp_byte = 0;
if (firstImage->base.IsCompressed)
comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat);
intelObj->mt = intel_miptree_create(intel,
intelObj->base.Target,
firstImage->base.InternalFormat,
@@ -186,8 +190,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
firstImage->base.Width,
firstImage->base.Height,
firstImage->base.Depth,
firstImage->base.TexFormat->
TexelBytes,
cpp,
comp_byte);
}

View File

@@ -483,12 +483,14 @@ static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, l
}
unsigned long
I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *result, I830MemPool *pool, long size, unsigned long alignment, int flags)
I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830,
I830MemRange *result, I830MemPool *pool, long size,
unsigned long alignment, int flags)
{
int ret;
unsigned long ret;
if (!result)
return 0;
if (!result)
return 0;
/* Make sure these are initialised. */
result->Size = 0;
@@ -498,16 +500,15 @@ I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *resul
return 0;
}
if (pool->Free.Size < size)
return AllocFromAGP(ctx, pI830, size, alignment, result);
else
{
ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
if (ret==0)
return AllocFromAGP(ctx, pI830, size, alignment, result);
return ret;
if (pool->Free.Size < size) {
ret = AllocFromAGP(ctx, pI830, size, alignment, result);
}
else {
ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags);
if (ret == 0)
ret = AllocFromAGP(ctx, pI830, size, alignment, result);
}
return ret;
}
static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem)
@@ -895,31 +896,6 @@ I830DRIUnmapScreenRegions(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sa
}
}
#if 0
static void
I830InitTextureHeap(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
{
/* Start up the simple memory manager for agp space */
drmI830MemInitHeap drmHeap;
drmHeap.region = I830_MEM_REGION_AGP;
drmHeap.start = 0;
drmHeap.size = sarea->tex_size;
if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT_HEAP,
&drmHeap, sizeof(drmHeap))) {
fprintf(stderr,
"[drm] Failed to initialized agp heap manager\n");
} else {
fprintf(stderr,
"[drm] Initialized kernel agp heap manager, %d\n",
sarea->tex_size);
I830SetParam(ctx, I830_SETPARAM_TEX_LRU_LOG_GRANULARITY,
sarea->log_tex_granularity);
}
}
#endif
static Bool
I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
{
@@ -943,9 +919,6 @@ I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
I830DRIMapScreenRegions(ctx, pI830, sarea);
SetupDRIMM(ctx, pI830);
#if 0
I830InitTextureHeap(ctx, pI830, sarea);
#endif
if (ctx->pciDevice != PCI_CHIP_845_G &&
ctx->pciDevice != PCI_CHIP_I830_M) {
I830SetParam(ctx, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 );

View File

@@ -34,6 +34,7 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "brw_util.h"
#include "macros.h"
#include "enums.h"
static void upload_cc_vp( struct brw_context *brw )

View File

@@ -46,7 +46,7 @@
#include "tnl/tnl.h"
#include "vbo/vbo_context.h"
#include "swrast/swrast.h"

View File

@@ -29,7 +29,7 @@
* Keith Whitwell <keith@tungstengraphics.com>
*/
#include "shader/prog_parameter.h"
#include "brw_context.h"
#include "brw_aub.h"
#include "brw_util.h"

View File

@@ -115,6 +115,9 @@ static const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
case PCI_CHIP_I946_GZ:
chipset = "Intel(R) 946GZ"; break;
break;
case PCI_CHIP_I965_GM:
chipset = "Intel(R) 965GM"; break;
break;
default:
chipset = "Unknown Intel Chipset"; break;
}

View File

@@ -384,6 +384,7 @@ extern int INTEL_DEBUG;
#define PCI_CHIP_I965_Q 0x2992
#define PCI_CHIP_I965_G_1 0x2982
#define PCI_CHIP_I946_GZ 0x2972
#define PCI_CHIP_I965_GM 0x2A02
/* ================================================================

View File

@@ -74,7 +74,7 @@ void i945_miptree_layout_2d( struct intel_mipmap_tree *mt )
GLuint img_height;
intel_miptree_set_level_info(mt, level, 1, x, y, width,
mt->compressed ? height/4 : height, 1);
height, 1);
if (mt->compressed)
img_height = MAX2(1, height/4);

View File

@@ -81,7 +81,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
dst->specular[2] = ((GLubyte *)p)[0];
dst->specular[1] = ((GLubyte *)p)[1];
dst->specular[0] = ((GLubyte *)p)[2];
dst->fog = ((GLubyte *)p)[3];
dst->attrib[FRAG_ATTRIB_FOGC][0] = ((GLubyte *)p)[3];
p++;
case TINY_VERTEX_FORMAT:

View File

@@ -372,7 +372,6 @@ static const struct tnl_pipeline_stage *mga_pipeline[] = {
&_tnl_fog_coordinate_stage,
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_arb_vertex_program_stage,
&_tnl_vertex_program_stage,
/* REMOVE: point attenuation stage */
@@ -910,6 +909,7 @@ void mgaGetLock( mgaContextPtr mmesa, GLuint flags )
drmGetLock(mmesa->driFd, mmesa->hHWContext, flags);
DRI_VALIDATE_DRAWABLE_INFO( mmesa->driScreen, dPriv );
if (*(dPriv->pStamp) != mmesa->lastStamp) {
mmesa->lastStamp = *(dPriv->pStamp);
mmesa->SetupNewInputs |= VERT_BIT_POS;
@@ -920,7 +920,7 @@ void mgaGetLock( mgaContextPtr mmesa, GLuint flags )
mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS;
mmesa->sarea->dirty |= MGA_UPLOAD_CONTEXT;
mmesa->sarea->dirty |= MGA_UPLOAD_CONTEXT;
if (sarea->ctxOwner != me) {
mmesa->dirty |= (MGA_UPLOAD_CONTEXT | MGA_UPLOAD_TEX0 |

View File

@@ -52,8 +52,10 @@ static void
r128UpdatePageFlipping( r128ContextPtr rmesa )
{
rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
rmesa->sarea->pfCurrentPage);
if (rmesa->glCtx->WinSysDrawBuffer) {
driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
rmesa->sarea->pfCurrentPage);
}
rmesa->new_state |= R128_NEW_WINDOW;
}

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