Compare commits

..

314 Commits

Author SHA1 Message Date
Eric Anholt
482d9dd21d Don't index box by the box's index within numClipRects; just dereference it.
Fixes drawing with more than one cliprect. (Keith Packard)
2006-04-01 00:57:57 +00:00
Eric Anholt
9e8659f346 Call driUpdateFramebufferSize when we've found an updated DRI drawable stamp,
like other drivers.  Failure to do so resulted in incorrect buffer sizes for
resized windows.
2006-04-01 00:55:02 +00:00
Brian Paul
e3f41ce611 6.5 updates 2006-03-31 23:10:21 +00:00
Daniel Borca
3a3e63dc4f DMesa now uses OSMesa as a back-end. 2006-03-31 20:53:12 +00:00
Daniel Borca
3a46dff27d Removed empty arrays. 2006-03-31 20:49:55 +00:00
Aapo Tahkola
29d833bd52 Enough testing already 2006-03-31 18:46:33 +00:00
Brian Paul
9305cba6a7 bump version/date 2006-03-31 17:31:22 +00:00
Brian Paul
f2ad1b60c0 Dave Reveman's patch for GLX_MESA_copy_sub_buffer support 2006-03-31 15:48:04 +00:00
Brian Paul
df3d4e0bb9 Fix the fetch_texel_ci8() code to deal with floating point color palettes.
Fixes Quake on Windows bug.  (Karl Schultz)
2006-03-31 15:22:09 +00:00
Aapo Tahkola
6652dc8aac free rs300 and ban r350(according to r300.sf.net) 2006-03-31 14:11:41 +00:00
Aapo Tahkola
7da1daf0a2 make u_list adjustable 2006-03-31 10:10:45 +00:00
Karl Schultz
18b72d184c updated again for 6.5. 2006-03-31 06:54:11 +00:00
Aapo Tahkola
ef5b48dea1 warn about broken dxt 3/5 2006-03-31 03:54:36 +00:00
Aapo Tahkola
2cd4056fae Dont rely on writebacks 2006-03-31 03:50:29 +00:00
Aapo Tahkola
fb0175db93 disable r300 chips. R300_FORCE_R300 to force 2006-03-31 03:16:39 +00:00
Aapo Tahkola
aa70d92a13 More meaningful warning. 2006-03-31 03:01:28 +00:00
Eric Anholt
aba4967150 The pitches of the driRenderbuffers are in bytes, so no need to multiply by cpp.
Fixes software fallbacks. (Keith Packard)
2006-03-30 22:44:51 +00:00
Karl Schultz
174ce730c6 Clean up data structures, finishing off some of the cleanup work suggested by Brian. Now also creating two renderbuffers, so apps can now switch with glDrawBuffer. 2006-03-30 21:53:23 +00:00
Adam Jackson
48547ee129 Clarify which version of Mesa we're talking about 2006-03-30 19:26:54 +00:00
Adam Jackson
823c581f7c Revert my change from 1.37 as being bogus (see ensuing list discussion for
rationale).
2006-03-30 19:23:38 +00:00
Adam Jackson
8982697981 Update the install docs to make explicit note of libdrm version dependency.
Change pdx.fd.o to {anon,}cvs.fd.o as appropriate.
2006-03-30 19:21:20 +00:00
Adam Jackson
9542537cee Style fix, drop the explicit -ldrm from the link line. 2006-03-30 19:20:25 +00:00
Karl Schultz
c3f2c287ce Fix logic error in viewport function so that we still resize the buffers if the viewport and the window both change to the same new size. This lets the gloss demo work with the -f option. 2006-03-30 18:03:41 +00:00
Brian Paul
9e81d6ae3a When creating front/back renderbuffers, init the Red/Green/Blue/AlphaBits fields 2006-03-30 16:33:35 +00:00
Brian Paul
94d6bf883b Init the Red/Green/Blue/Alpha/Depth/StencilBits fields in driNewRenderbuffer() 2006-03-30 16:32:16 +00:00
Brian Paul
84c5d0a789 comments regarding assertions 2006-03-30 16:29:41 +00:00
Karl Schultz
dd7074736f Use [][3] for write_rgb_span_16 2006-03-30 16:26:26 +00:00
Brian Paul
ef8b89faee some comments for Darwin 2006-03-30 14:28:28 +00:00
Brian Paul
159ca321cb added glfbdev.h to MAIN_FILES 2006-03-30 14:27:25 +00:00
Brian Paul
ec83f38e2e fix bad call to FindLine() 2006-03-30 14:26:29 +00:00
Brian Paul
197d725601 added -f option for full-screeen 2006-03-30 14:25:54 +00:00
Brian Paul
693a66aea9 press '0' for glDrawBuffer(GL_NONE) 2006-03-30 14:24:58 +00:00
Brian Paul
8ea3353ec3 XMesaDrawLine macro, not currently used 2006-03-30 14:20:26 +00:00
Karl Schultz
87af12dbdc Fixes from Brian to help migrate to render buffer DD interfaces. Also fix bug in the viewport function that was using the viewport size to resize the buffer, when it should have been using the window size. Fix bug in write_rgb_span_32 where the incoming pixel data parameter was coded as a [][4] instead of [][3]. Now all the demos work correctly except singlebuffer. 2006-03-30 07:58:24 +00:00
Karl Schultz
a8c9ecfab0 Fixes from Brian 2006-03-30 07:53:15 +00:00
Dave Airlie
4ecb9f0532 Fix up some incorrect pointers and clear screen 2006-03-30 05:47:08 +00:00
Dave Airlie
8b186e3695 add initial miniglx files for i915, not integrated yet 2006-03-30 04:33:58 +00:00
Karl Schultz
e43edd3c70 Updated for Mesa 6.5 2006-03-29 23:53:43 +00:00
Brian Paul
20e15f9381 Add -ansi -pedantic flags to OPT_FLAGS. This got lost at some point. Good for catching sloppy coding. 2006-03-29 23:45:44 +00:00
Brian Paul
75a8383e8d Update the _WindowMap matrix in _mesa_set_viewport() and _mesa_DepthRange().
This is a temporary fix for the DRI drivers.
Should really only have to update the matrix via _mesa_update_state().
2006-03-29 23:44:31 +00:00
Brian Paul
920023240c put braces around RENDER_SPAN macro when called, not when defined. Fixes -pedantic warnings in x11 driver 2006-03-29 23:42:44 +00:00
Brian Paul
62c325af3f fix GETPROCADDRESS usage, remove carriage return chars (bug 6430) 2006-03-29 23:20:49 +00:00
Brian Paul
32244ac7e9 s/glslnose.c/glslnoise/ (bug 6430) 2006-03-29 23:18:13 +00:00
Kristian Høgsberg
3a6d968f37 Fixes to silence warnings in code generated by glapi scripts. 2006-03-29 22:32:38 +00:00
Karl Schultz
cec74532bf Add newest source code files to project. 2006-03-29 20:55:48 +00:00
Brian Paul
f331bb0312 added some no-op virtual destructors to silence g++ 4.0.0 warnings 2006-03-29 18:54:00 +00:00
Brian Paul
c3051df8e1 fixes from John Shell (bug 6339) 2006-03-29 18:46:46 +00:00
Brian Paul
db79d2abac minor clean-up 2006-03-29 18:41:19 +00:00
Brian Paul
c19de0b7f6 FP textures and fixes (Ewald Snel) 2006-03-29 15:21:01 +00:00
Brian Paul
e5b6eee15d fix components initialization in two places (Ewald Snel) 2006-03-29 15:17:57 +00:00
Brian Paul
006e183b6e move NumNativeAlu/TexInstruction assignments (Ewald Snel) 2006-03-29 15:15:37 +00:00
Jouk Jansen
180b0dab8b Committing in .
Removing <CR>

 Modified Files:
 	Mesa/src/mesa/main/fog.c Mesa/src/mesa/main/hint.c
 	Mesa/src/mesa/main/mtypes.h
 ----------------------------------------------------------------------
2006-03-29 12:09:08 +00:00
Brian Paul
a85fbb1d36 prep for 6.5 release 2006-03-29 04:53:02 +00:00
Brian Paul
555478fed6 New code for rendering to depth/stencil textures.
Re-org of the renderbuffer wrapper code.
2006-03-29 04:51:03 +00:00
Brian Paul
2742c4e4db new tests for GL_DEPTH_STENCIL_EXT 2006-03-29 04:48:21 +00:00
Brian Paul
2b430ef56a a few new assertions 2006-03-29 04:47:34 +00:00
Karl Schultz
b7a5a9db88 Windows makefile to easily build all demo programs. 2006-03-29 04:02:44 +00:00
Karl Schultz
888ab86f85 Repair corrupted file and remove rogue 'test' project. 2006-03-29 04:01:25 +00:00
Brian Paul
2526152a10 fix a GLuint vs GLushort test, new assertions 2006-03-29 04:01:05 +00:00
Brian Paul
519a2e7cb7 Move the computation of the viewport matrix into a new update_viewport_matrix()
function since the matrix depends on the viewport params and the framebuffer's
depth buffer resolution.
Fixes some renderbuffer / depth range issues.
This simplifies the _mesa_set_viewport() and _mesa_DepthRange() functions too.
2006-03-29 03:59:34 +00:00
Karl Schultz
b687531f69 Undef a conflicting symbol in Windows. 2006-03-29 03:42:32 +00:00
Karl Schultz
54b65e080e add showbuffer.[ch] which could be in this dir after the targets are built. 2006-03-29 03:41:38 +00:00
Karl Schultz
3076557ca3 Update for new Mesa entry points. I need to change the python script that generates this file to the new XML scheme, but for now, a manual update is OK. 2006-03-29 02:12:31 +00:00
Karl Schultz
4f21180416 Remove unneeded includes of time.h 2006-03-29 02:09:47 +00:00
Daniel Borca
c61763b5d2 Match pixel addresses with `compute_row_addresses' in RGB mode (also obey RGB/UNSIGNED_BYTE rule). 2006-03-28 21:40:14 +00:00
Roland Scheidegger
08e62a1476 fix missing *_STATECHANGE in *UpdateViewportOffset for radeon, r200 and r300 (reported by Jim Duchek). Fix some potential problems with strict-aliasing with r200 and radeon drivers in *UpdateViewportOffset, *PolygonOffset and *UpdateWindow functions (some compiler warnings about strict-aliasing remain in the codegen vertex code, and there may be more problems unnoticed by the compiler). 2006-03-28 17:22:57 +00:00
Brian Paul
0e26ca0834 updated comment about framebuffer's Visual field 2006-03-28 15:28:00 +00:00
Brian Paul
e44499480f added known issue: render to depth textures not working 2006-03-28 15:25:44 +00:00
Brian Paul
9f6ff49650 update conditional for render to GL_DEPTH_STENCIL texture, check for valid teximage before calling ctx->Driver.RenderTexture() 2006-03-28 15:24:50 +00:00
Brian Paul
c7a5d528c7 a little code movement so we don't make invalid casts from gl_renderbuffers to xmesa_renderbuffers 2006-03-28 15:21:44 +00:00
Aapo Tahkola
b8915340ea fix #6072 (Keith Whitwell) 2006-03-28 10:26:34 +00:00
Keith Whitwell
1155f64cc0 Revert merge of new/experimental code from texmem branch. 2006-03-28 07:40:57 +00:00
Brian Paul
255e8ebd58 enable GL_ARB_half_float_pixel, was GL_MESAX_half_float_pixel 2006-03-28 01:23:43 +00:00
Brian Paul
95174c4eb2 comment about byteswapping in _mesa_unpack_depth_span() 2006-03-28 01:22:48 +00:00
Roland Scheidegger
f76ff7e4a7 make allow_large_textures 1 by default for radeon and r200, and consequently enable all texture units by default on those cards (3 for radeon, 6 for r200). Fix the usually forgotten DRIVER_DATE accordingly. 2006-03-27 23:53:53 +00:00
Roland Scheidegger
96aa403cee remove unnecessary typedefs causing compiler warnings 2006-03-27 23:34:53 +00:00
Daniel Borca
004673d4d1 Disable `hidden' attribute for DJGPP 2006-03-27 17:34:31 +00:00
Daniel Borca
0ad1bda7a1 PutRowRGB was not initialized for OSMESA_RGB_565 2006-03-27 17:32:22 +00:00
Dave Airlie
e72b745f32 Fixup makefile for solo non-egl 2006-03-27 00:07:21 +00:00
Brian Paul
ea4fe661d7 merge from texman branch 2006-03-26 05:22:17 +00:00
Brian Paul
4cbd16ed3f fix some PFNGL* typedefs 2006-03-26 05:09:03 +00:00
Brian Paul
06049e2416 remove carriage returns 2006-03-25 22:52:39 +00:00
Brian Paul
753af3a206 fix issue in _mesa_free_framebuffer_data() 2006-03-25 17:57:52 +00:00
Brian Paul
70207b70c5 check for incomplete FBO in _mesa_Clear() 2006-03-25 16:16:37 +00:00
Brian Paul
1bbc203c6e Clean up the recent code related to texture_override(). Pass params in a
more logical order.
Remove a mess of stray ^M chars.
Fix a bug when checking if the texture object's format is GL_COLOR_INDEX
or GL_DEPTH_COMPONENT.  This fixes a segfault when GL_TEXTURE_BASE_LEVEL!=0.
2006-03-24 23:53:50 +00:00
Brian Paul
6494541eaa lots of debug options, some code movement, etc 2006-03-24 23:17:06 +00:00
Brian Paul
590cd26006 added some missing formats in _mesa_source/dest_buffer_exists() 2006-03-24 22:53:00 +00:00
Aapo Tahkola
ed4ab13cef Make ARB_vp backends happy with nv arl 2006-03-24 16:35:08 +00:00
Aapo Tahkola
af8d39861d secondary color fixes. 2006-03-24 16:33:34 +00:00
Brian Paul
c4f2710f9d Added -l option for explicit locking around Xlib and GLX calls in
threaded code.  Seems to improve reliability quite a bit.
2006-03-23 17:17:23 +00:00
Brian Paul
436d72e994 Added -p option to create a display connection per thread.
This seems more stabile than using one display connection for all threads.
Still get an occasional Xlib: unexpected async reply error, unfortunately.
2006-03-23 16:58:22 +00:00
Dave Airlie
d76ef5867d make solo build complete 2006-03-23 04:20:37 +00:00
Dave Airlie
0a6040dc2d fix coverity 1107: use after free 2006-03-23 04:15:29 +00:00
Dave Airlie
eab896cc21 fix coverity 926: use before NULL check 2006-03-23 04:13:37 +00:00
Brian Paul
f756924fa5 Need to check for new state and do readpixels/drawpixels clipping after
we call RENDER_START since that may involve validating the drawable and
updating its dimensions.
2006-03-22 22:02:07 +00:00
Aapo Tahkola
4fafe6390b implement arl and enable hw nv_vp. 2006-03-22 21:29:27 +00:00
Aapo Tahkola
6fc864b9e6 ARL dst idx was undefined. 2006-03-22 21:29:15 +00:00
Brian Paul
daffbe99dc GL_EXT_packed_depth_stencil should be off by default 2006-03-21 21:57:00 +00:00
Michal Krol
8995544bc9 Silencium gcc warnings. 2006-03-21 10:59:14 +00:00
Michal Krol
071357096e GLSL fixes:
- generate error on NULL pointers in glShaderSourceARB;
- reinstall program object, if current, in glLinkProgramARB;
- vertex and fragment shaders are optional in program object;
- floor asm was wrongly computed for x86 back-end;
- allow for (void) idiom in function prototypes;
- all fixed-state uniforms are updated;
- local variable initializers are working;
- implement texture* and shadow* functions for vertex processor;
- generate error if too many arguments in general constructor;
- trim unused data in general constructor;
- struct r-value field select was badly relocated;

Changes:
- add derived state gl_fog_attrib::_Scale;
- add derived state gl_light::_CosCutoffNeg;
2006-03-21 10:37:40 +00:00
Brian Paul
519b23b21f Lots of changes/fixes for rendering to framebuffer objects.
- When deleting texture objects, unbind from FBOs if necessary.
- Changed driver hooks for starting/ending render to texture.
- Now properly handle case where gl[Copy]TexImage() is called after
  glFramebufferTexture[123]D().  That didn't work before.
2006-03-20 18:51:57 +00:00
Brian Paul
4991888fa0 additional assertions and debug code for testing FBO completeness 2006-03-20 15:27:55 +00:00
Brian Paul
34bd1233a9 additional error checking to be sure source renderbuffer exists for glCopyTex[Sub]Image() 2006-03-20 15:27:33 +00:00
Brian Paul
457fb0e128 use new _mesa_sourc/dest_buffer_exists() functions 2006-03-20 15:26:20 +00:00
Brian Paul
7275d4d097 added _mesa_source/dest_buffer_exists() function to easily test if particular renderbuffers are present 2006-03-20 15:25:18 +00:00
Brian Paul
f1038f81e4 fix some buffer binding tests in _mesa_make_current() 2006-03-20 15:20:57 +00:00
Brian Paul
c27c382acc slightly improved error message 2006-03-20 15:20:30 +00:00
Aapo Tahkola
5319ed0e53 Fix texrect upload conflicts. 2006-03-20 13:37:28 +00:00
Aapo Tahkola
070f280895 Disable tnl programs when doing software vertex programs. compiz with its texrect and lighting needs was broken because of this. 2006-03-19 21:17:14 +00:00
Brian Paul
096dd541bd minor clean-ups 2006-03-19 19:07:12 +00:00
Aapo Tahkola
77174f0072 -fix texrect fallback when using vtxfmt_a (glitz, xgl, etc.)
-struct vertex_buffer to struct radeon_vertex_buffer conversion
-vertex attrib arrays did not supersede conventinal arrays when enabled
2006-03-19 18:04:12 +00:00
Brian Paul
21a4fb4137 Queries of GL_READ_BUFFER and GL_DRAW_BUFFER were still returning the
pre-GL_EXT_framebuffer_object state.  Now return the read/draw state stored
in the framebuffer objects.
2006-03-19 00:10:22 +00:00
Brian Paul
19b05d5009 Don't call Driver->Bitmap() if no image to render 2006-03-18 21:46:17 +00:00
Jouk Jansen
2d2af2dcf7 Committing in .
Mesa/src/mesa/main/imports.h : removed <CR>
 Mesa/src/mesa/shader/slang/descrip.mms : added new sources

 Modified Files:
 	Mesa/src/mesa/main/imports.h
 	Mesa/src/mesa/shader/slang/descrip.mms
 ----------------------------------------------------------------------
2006-03-17 14:38:41 +00:00
Brian Paul
eec33cc310 Init FogCoordFuncs[0..5] too, remove some unneeded #includes 2006-03-17 04:13:29 +00:00
Brian Paul
0f1d98c422 remove another test for IN_DRI_DRIVER 2006-03-17 04:10:03 +00:00
Kristian Høgsberg
724df02073 Don't use glx_ansic.h functions (__glXMemset). 2006-03-17 00:03:20 +00:00
Brian Paul
2b17741e1b added #undef GET_DISPATCH 2006-03-16 18:06:34 +00:00
Brian Paul
c6c0f94714 Moved _glapi_check_multithread() call into drivers, instead of in
_mesa_make_current().
This removes an ugly #if !defined(IN_DRI_DRIVER) from core Mesa.
2006-03-16 18:05:25 +00:00
Brian Paul
ef8653a838 finish up some loose ends in _mesa_texstore_z24_s8() 2006-03-16 04:44:00 +00:00
Brian Paul
514a15cea1 assorted code clean-ups, comments, etc. 2006-03-15 20:56:22 +00:00
Brian Paul
ac8b07b3ae remove invalid assertion in _glapi_get_dispatch(), fixes additional thread safety problem 2006-03-15 20:42:00 +00:00
Brian Paul
e660690985 Need to include glthread.h in glapi.h, not glapi.c so that GET_CURRENT_CONTEXT
is properly defined.  Fixes long-standing, but unnoticed thread safety failure.
Also, updated comments.
2006-03-15 20:31:50 +00:00
Brian Paul
30655c211c updated some printfs, added comment about sched_yield 2006-03-15 20:30:17 +00:00
Brian Paul
59e0faaa5c sync with texmem branch 2006-03-15 17:48:00 +00:00
Brian Paul
eccb6a0698 rename enums, fixes compilation breakage (Michal Krol) 2006-03-15 14:09:08 +00:00
Brian Paul
10f08cc202 use 'p' key to toggle use of GL_EXT_packed_depth_stencil 2006-03-15 01:44:03 +00:00
Brian Paul
b7e3e0d64e s/GLuint/GLushort/ in read_depth_stencil_image() 2006-03-15 01:36:52 +00:00
Brian Paul
19b8322169 init Red/Green/EtcBits = 0 in soft_renderbuffer_storage() 2006-03-14 22:39:43 +00:00
Brian Paul
2a0d441ebb Set always_array=true for glGenProgramsNV (Dave Reveman) 2006-03-14 15:41:53 +00:00
Brian Paul
15e74a6441 replace dprintf() with _glu_dprintf() (bug 6244) 2006-03-14 15:08:52 +00:00
Michal Krol
0f618b7eb7 Add slang_analyse.c and slang_library_texsample.c. 2006-03-14 11:39:58 +00:00
Michal Krol
8af48fc4d6 More GLSL code:
- add texture sampling support;
- fix assembly codegen bugs;
2006-03-14 11:23:16 +00:00
Aapo Tahkola
e9484e4085 Clean build. 2006-03-13 20:40:46 +00:00
Aapo Tahkola
a0cf4ceb36 Fix broken max mipmap leveling that was horribly wrong. 2006-03-13 18:23:19 +00:00
Aapo Tahkola
5042778449 Option to init vp temps(for testing) 2006-03-10 05:30:33 +00:00
Brian Paul
9c32af5bb2 Add prototypes for GLX_MESA_swap_frame_usage, GLX_MESA_swap_control, and
GLX_EXT_texture_from_pixmap to silence warnings while compiling glxcmds.c
XXX: Need to add the new tokens for GLX_EXT_texture_from_pixmap!!!
2006-03-09 16:27:35 +00:00
Brian Paul
841a823d6d s/GLint/int/, to fit GLX conventions 2006-03-09 16:25:46 +00:00
Brian Paul
0d57301ba2 Instead of adding extra flags to DEFINES with +=, define EXTRA_DEFINES instead.
This eliminates a bunch of duplication in the compilation commmands.
2006-03-09 16:24:46 +00:00
Aapo Tahkola
12d51beb7e Kick VBOs out of GART if nothing else helps. 2006-03-09 06:21:17 +00:00
Aapo Tahkola
e294d938f2 Use the force Luke, use the force. 2006-03-09 04:42:45 +00:00
Dave Airlie
f1b431b265 coverity check bug fix going over end of array 2006-03-08 05:44:07 +00:00
Dave Airlie
9fc897af7a coverity checker bug: Pointer dereferenced after NULL check 2006-03-08 05:37:58 +00:00
Aapo Tahkola
d97ab9a7bd Fix broken DrawElements & DrawRangeElements. 2006-03-07 22:46:52 +00:00
Jouk Jansen
d9894e0d72 Committing in .
Update OpenVMS makefiles

 Modified Files:
 	Mesa/src/mesa/shader/slang/descrip.mms
 	Mesa/src/mesa/swrast/descrip.mms
 ----------------------------------------------------------------------
2006-03-07 07:47:37 +00:00
Aapo Tahkola
dba9c0bafd Enable HW VBOs and other things needed by it. 2006-03-07 05:31:36 +00:00
Aapo Tahkola
ba7ea2e697 Convert to work with current DRM. + tag 2006-03-07 05:15:24 +00:00
Aapo Tahkola
50f319242b Various fallbacks, checks and tags. 2006-03-07 05:09:48 +00:00
Brian Paul
ca007cb449 just a comment for check_compatible() 2006-03-07 03:01:26 +00:00
Brian Paul
d75963d258 disable double-buffer test in check_compatible(), fixes pbuffer/visual problem 2006-03-07 02:57:04 +00:00
Brian Paul
8ee311d36d print newline in _mesa_warning() 2006-03-07 01:46:26 +00:00
Brian Paul
2e01918b55 call _mesa_update_framebuffer_visual() in _mesa_FramebufferRenderbufferEXT() to fix some minor glitches 2006-03-07 01:43:52 +00:00
Brian Paul
168a7516b1 FreeBSD updates (Pedro Giffuni) 2006-03-07 01:11:05 +00:00
Aapo Tahkola
c107058e7e Port r200 tex tiling code to run on r300 but keep it disabled. 2006-03-06 19:28:10 +00:00
Ian Romanick
3bca4f679a Later versions of Python handle formats like '% 5u' differently. For
whatever reason, a space is always inserted.  That is not the desired
behavior.
2006-03-06 18:31:50 +00:00
Ian Romanick
9d881ea718 Generate server-side GLX protocol decode functions using the 'make server'
target.  The environment variable XORG_BASE must be set to point to the base
of the X.org server sources where the files are to be placed.

The 7.0.0 server release already contains files generated by these scripts.
The scripts should have been committed months ago.  Sorry for the lag. :(
2006-03-06 18:30:17 +00:00
Ian Romanick
448d23331d Display the correct bug number in the information text. 2006-03-06 16:42:12 +00:00
Ian Romanick
66df1731e6 Don't try to bind to proxy texture target. This is defined by the spec to be
an error.  Since we're working with a proxy target, don't bother using real
texture data.

Add a missing new-line in an error printf.
2006-03-06 16:31:50 +00:00
Ian Romanick
5820f7998a Build test for bugzilla #3050 2006-03-04 04:46:10 +00:00
Ian Romanick
780d270312 Test case for bugzilla #3050. 2006-03-04 04:44:47 +00:00
Roland Scheidegger
e1e03b32ab Use standard ARB names instead of vendor-specific NV names for the ARB/NV_vertex_program enums in common state handling code, and update comments accordingly. Change some slightly confusing code which gave the impression GL_VERTEX_PROGRAM_ARB and GL_VERTEX_PROGRAM_NV enums were different. 2006-03-03 15:03:04 +00:00
Roland Scheidegger
f8ba07a77d fix up the emit_func list in the experimental arbprogram sse code. 2006-03-03 14:11:19 +00:00
Roland Scheidegger
5e01f9a114 Fix bogus span mask in s_atifragshader.c leading to trouble when the pixel was later discarded by z test (this fixes doom3 r200 renderpath with swrast). Fix calling _swrast_alpha_test potentially leading to bogus results when Alpha Test might not be enabled. While here, don't disable deferred_texture (early z) when ATI_fragment_shader is active, as it is not necessary (for the record, this boosts doom3 swrast performance by roughly a factor of 2 (4 seconds per frame now...) with the r200 render path, might be a worthwile optimization for fragment programs which don't write z). 2006-03-03 02:46:03 +00:00
Keith Whitwell
f4ab5654d0 Add position_invarient support 2006-03-02 20:16:34 +00:00
Roland Scheidegger
da16813f43 Fix more enums defined not only by one extension when queried by glGet (GL_COLOR_SUM_EXT, GL_POINT_SPRITE_NV, GL_POINT_SPRITE_COORD_ORIGIN, GL_TRANSPOSE_CURRENT_MATRIX_ARB). Fix similar bugs (also those previously overseen dependant on NV/ARB_vertex_program) in glIsEnabled. Add missing GL_COLOR_SUM_EXT enum to glIsEnabled. 2006-03-02 12:06:57 +00:00
Brian Paul
9227bca103 added GL_EXT_framebuffer_blit, etc 2006-03-02 04:12:34 +00:00
Brian Paul
81b8aa9ecd test glBlitFramebufferEXT w/ -blit flag 2006-03-02 03:54:14 +00:00
Brian Paul
14d3ab9662 improved error msg 2006-03-02 03:51:04 +00:00
Brian Paul
904ab0c22c check FEATURE_EXT_framebuffer_blit 2006-03-02 03:46:33 +00:00
Brian Paul
afa1df5871 plug in BlitFramebuffer function 2006-03-02 03:45:28 +00:00
Brian Paul
c241d3b06a implementation of _swrast_BlitFramebuffer() 2006-03-02 03:37:18 +00:00
Roland Scheidegger
93da673904 Fix glGet with enums which are used not only in NV_vertex_program, but other extensions too (ARB_vertex_program, ARB_fragment_program, NV_fragment_program), if no support for NV_vertex_program is present. While here, fix return value if enum is used which is not supported by the exposed extensions (GL_INVALID_ENUM instead of GL_INVALID_VALUE). Fix some compile-time #ifs depending on NV_vertex/fragment_program which should also be dependant on ARB_vertex/fragment_program. See bug #6070 2006-03-01 23:11:14 +00:00
Brian Paul
cf6be2d5bd No need for _mesa_save_error() to be public.
glVertexAttrib() w/ bad index should generate GL_INVALID_VALUE, not
GL_INVALID_ENUM.
Misc clean-ups.
2006-03-01 15:44:20 +00:00
Brian Paul
dbfd246db8 added BlitFramebuffer() support 2006-03-01 15:36:34 +00:00
Brian Paul
190e5595bc New comments. Use tuples () instead of lists [] in a few places. 2006-03-01 15:33:56 +00:00
Brian Paul
68edf28df6 added Flush in glXCopyContext() 2006-03-01 15:32:38 +00:00
Brian Paul
9b8059e536 updated comment 2006-03-01 02:09:40 +00:00
Brian Paul
6d4284e2bf Added glBlitFramebufferEXT function. 2006-03-01 02:07:50 +00:00
Brian Paul
9974540c73 remove temporary tokens, more error checks for blit function 2006-03-01 02:02:43 +00:00
Brian Paul
2c61fdafd6 added s_blit.c 2006-03-01 02:00:58 +00:00
Brian Paul
1eca891dbe _swrast_blit_framebuffer() function 2006-03-01 01:57:30 +00:00
Brian Paul
a231097609 GL_EXT_framebuffer_blit tokens/functions 2006-03-01 01:54:59 +00:00
Aapo Tahkola
fbe48ef01f Free temps when possible 2006-02-28 23:39:32 +00:00
Aapo Tahkola
71932ef85c Dont let (possibly) undefined z component reach hw as its unused 2006-02-28 23:22:48 +00:00
Aapo Tahkola
6754e17138 No need to call *_FIREVERTICES twice. 2006-02-28 23:17:00 +00:00
Aapo Tahkola
f71fd439f5 Fix aliasing bug (Benjamin Herrenschmidt) 2006-02-28 23:08:28 +00:00
Brian Paul
147f5091a1 Allow error checking to look for presence of either of two extensions.
See bug 6070.
2006-02-28 21:45:09 +00:00
Brian Paul
176dac684a only run shader on active fragments in the span 2006-02-28 15:48:43 +00:00
Brian Paul
34b60b001d check if active fragment shader for deferred texturing/shading 2006-02-28 15:48:19 +00:00
Brian Paul
3073cf21d2 check for active shader, set FRAGPROG_BIT in raster mask 2006-02-28 15:44:33 +00:00
Brian Paul
d1d4121682 silence a bunch of warnings 2006-02-27 15:45:38 +00:00
Michal Krol
9ac9605de1 More GLSL code:
- add x86 code generator;
- add full support for uniforms in ARB_shader_objects;
- add assembly instruction: global_addr;
- reorganize #includes;
- built-in uniforms accessed by index, rather than by name;
- add some entries to x86sse rtasm;
- add configurations to VC6 projects: 'Release x86' and 'Debug x86';
- #define SLANG_X86 active only on VC6 x86 builds;
- introduce code export table for a shader;
- remove GNU license from the noise library;
2006-02-27 14:41:41 +00:00
Brian Paul
c56f2c49a5 re-formated with indent. 2006-02-26 18:18:12 +00:00
Brian Paul
be42f53020 Remove need to initialize the InstSize[] array elements by just storing
the instruction size in _mesa_alloc_instruction().
2006-02-26 18:02:13 +00:00
Brian Paul
a764b7eae0 display list clean-ups 2006-02-26 17:16:37 +00:00
Roland Scheidegger
4e77669926 Add all pci ids known by ddx to radeon dri driver. Remove the entries not known by ddx (probably secondary ids, non-existant cards and similar). Add rs400 to the family enum, and configure the rv410 like a 2 quad chip (?) 2006-02-25 02:03:12 +00:00
Brian Paul
2aabdc743f fix broken _mesa_copy_context() for GL_LIGHTING_BIT 2006-02-24 18:19:11 +00:00
Brian Paul
ee2339f673 need to check for _NEW_BUFFERS in xmesa_update_state() 2006-02-24 17:58:48 +00:00
Brian Paul
228d4a6de7 Fix _mesa_copy_texture_state() so that we copy texture object bindings,
not the actual contents of texture objects.  This makes glXCopyContext()
work properly.
2006-02-24 17:16:57 +00:00
Brian Paul
1aad408b5a EXT_framebuffer_object (Dave Reveman) 2006-02-24 15:36:24 +00:00
Brian Paul
44a2e96729 include inttypes.h if __osf__ defined (Randall Hand) 2006-02-23 15:36:39 +00:00
Brian Paul
5b2ee9c1e9 update Blender link 2006-02-23 14:29:03 +00:00
Brian Paul
956fff6345 add some #includes, fix some prototypes (bug 5992) 2006-02-22 16:54:05 +00:00
Brian Paul
7b6fd8a0c6 include proper header file, remove local extern declarations 2006-02-22 16:44:04 +00:00
Brian Paul
cebad151a1 add missing prototypes, use _slang_ prefix on non-static functions 2006-02-22 16:43:26 +00:00
Brian Paul
4f8b59d59b silence a variety of compiler warnings 2006-02-22 16:35:34 +00:00
Brian Paul
49ad2d4ed1 updated GLUT link 2006-02-22 15:50:57 +00:00
Michal Krol
cc1591667d More GLSL code:
- uniforms (only GetLocation, Uniform1f and Uniform4fv for now for demos);
- fix bugs and optimize array size handling;
- 2D texture sampling (needs Enable(TEXTURE_2D) to work);
- decrease built-in library assembly size by 30%.
2006-02-21 12:35:06 +00:00
Jouk Jansen
8986e36f36 Committing in .
Update OpenVMS makefiles

 Modified Files:
 	Mesa/src/mesa/shader/slang/descrip.mms
 	Mesa/src/mesa/swrast/descrip.mms Mesa/src/mesa/tnl/descrip.mms
 ----------------------------------------------------------------------
2006-02-21 12:28:34 +00:00
Jeremy Kolb
fcbbdf9991 Added xcb dri config file. 2006-02-19 22:31:26 +00:00
Jeremy Kolb
97a3023c9f Remove old linux-x86-xcb (didn't do anything).
Removed reference to linux-x86-xcb and added linux-dri-xcb in Makefile.
2006-02-19 22:30:46 +00:00
Michal Krol
3654193a4d More GLSL code.
- general constructors allowed;
- implement noise functions (from Stefan Gustavson - thanks!)
- cosmetic stuff.
2006-02-18 15:11:18 +00:00
Keith Whitwell
e94be8d5c0 Fix STENCIL_WRITE_MASK defn for bug 5902 2006-02-17 17:03:14 +00:00
Aapo Tahkola
8da9f448f4 Skip ARL while we dont implement it. Fix broken nv vps but do it with software for now. 2006-02-16 19:50:40 +00:00
Roland Scheidegger
555b5fac4f Reinstate vertex format after a rasterization fallback for both r200 and radeon driver when a tcl fallback is active, fixes a blender issue with non-tcl hw (bug #5601) 2006-02-16 17:16:33 +00:00
Eric Anholt
a176bc6c17 Include dix-config.h if HAVE_DIX_CONFIG_H is defined. This will be used by the
X Server to get things like _XSERVER64 (for X headers) and NO_LIBCWRAPPER
defined consistently when its builds Mesa internally.
2006-02-15 21:03:34 +00:00
Brian Paul
ee40c4fb34 Set NumInstructions (bug 5864) 2006-02-15 15:59:37 +00:00
Brian Paul
a584e846d4 Fix a few warnings:
- nested comments (use #if 0 / #endif instead)
 - missing default clause in switch statements
 - use of possibly undefined variables
2006-02-15 15:51:01 +00:00
Michal Krol
dd02edf381 Add support for forward function declarations. 2006-02-15 11:15:16 +00:00
Michal Krol
88d994c3b2 Add fragment shader execute entry. 2006-02-15 11:12:47 +00:00
Michal Krol
50092f8f33 Add s_arbshader.c, s_arbshader.h. 2006-02-15 11:09:26 +00:00
Michal Krol
870ebefb3b Add swrast/s_arbshader.c. 2006-02-15 11:07:56 +00:00
Michal Krol
a663931204 Add arbshader stage. 2006-02-15 11:06:00 +00:00
Michal Krol
5bc35a823a Enable texcoords when program object in use. 2006-02-15 11:03:57 +00:00
Michal Krol
dc3a922cf3 Get arbfslight demo running. 2006-02-15 11:02:07 +00:00
Michal Krol
0c8e578a38 Enable GL_ARB_fragment_shader extension. 2006-02-15 11:00:15 +00:00
Michal Krol
3699751b0b Demonstrate GLSL fragment and vertex shaders. 2006-02-15 10:58:52 +00:00
Brian Paul
d5aca8bf0c remove stray 'foo' line 2006-02-15 04:10:55 +00:00
Brian Paul
0c1438d331 replace size_t * w/ unsigned int * (Jurg Billeter) 2006-02-14 15:04:45 +00:00
Brian Paul
a5033a0421 fix AIX issues (bug 5874) 2006-02-14 14:57:04 +00:00
Jouk Jansen
2189d9c96e Update OpenVMS compile support 2006-02-13 12:00:29 +00:00
Michal Krol
e7ffe4619f More glsl code. 2006-02-13 11:47:41 +00:00
Michal Krol
8a54fad6cd REVISION 3.
Remove illegal operators for overloading.
2006-02-13 11:45:57 +00:00
Michal Krol
ebcbf2f853 Cosmetic changes. 2006-02-13 11:42:48 +00:00
Michal Krol
41eeae5fb1 Delete most of the comments.
Minor tweaks with the functions.
Add experimental print functions.
2006-02-13 11:40:32 +00:00
Michal Krol
02eb9acc5e Get it running for ARB_vertex_shader.
Add experimental print functions to builtin library.
Some functionality missing:
- automatic arrays;
- general constructors;
- local variable initialization;
- texture sampling and noise;
- semantic error checking;
- function prototypes.
2006-02-13 11:38:37 +00:00
Michal Krol
44e9ccc708 Rename current_program to CurrentProgram.
Temporary vertex_shader execution code.
2006-02-13 11:31:16 +00:00
Michal Krol
adef42c88d Add tnl\t_vb_arbshader.c. 2006-02-13 11:27:33 +00:00
Michal Krol
7d376c76c9 Add tnl/t_vb_arbshader.c. 2006-02-13 11:25:43 +00:00
Michal Krol
a2ea606377 Add ARB_vertex_shader stage just before render stage.
If enabled, all other stages, except render, are disabled.
2006-02-13 11:23:36 +00:00
Michal Krol
2363fff347 Enable GL_ARB_shader_objects, GL_ARB_shading_language_100 and
GL_ARB_vertex_shader extensions.
2006-02-13 11:04:27 +00:00
Michal Krol
c92e688e15 Rename current glsl program variable. 2006-02-13 10:56:54 +00:00
Michal Krol
170f08d4b1 Add _mesa_atanf and _mesa_asinf functions. 2006-02-13 10:55:14 +00:00
Eric Anholt
91c30771b6 Add the ability to define NO_LIBCWRAPPER to avoid libcwrapper brain damage.
If it's true that libcwrapper usage isn't necessary ever in the DllLoader world,
then this code should probbaly all go away.
2006-02-11 02:59:38 +00:00
Dave Airlie
f236300e3a commit to fixup MGL namespacing for XGL 2006-02-10 21:46:17 +00:00
Aapo Tahkola
a73094cc6a Workaround problems with NWN. (Tilman Sauerbeck) 2006-02-10 17:26:44 +00:00
Brian Paul
42447365b2 remove the test for XFree86Server from prev patch (bug 5835) 2006-02-09 14:28:40 +00:00
Alan Hourihane
b77a225250 Check DDX for 1.5.0 2006-02-08 22:05:42 +00:00
Brian Paul
d93615fc1e include dix-config.h (Mike Harris) (bug 5835) 2006-02-08 14:52:06 +00:00
Brian Paul
42725d6f54 David Reveman's GLX_EXT_texture_from_pixmap extension patch 2006-02-07 00:39:56 +00:00
Dave Airlie
4cd0e24f86 add vblank support to i915 driver 2006-02-06 00:09:58 +00:00
Brian Paul
640ef7f890 EGL 1.2 tokens/functions/etc. 2006-02-05 16:39:19 +00:00
Brian Paul
63b852f4f9 fix typo 2006-02-05 16:38:33 +00:00
Brian Paul
ea970da0b6 bring in changes from 6.4 branch 2006-02-03 17:21:54 +00:00
Roland Scheidegger
e7276b7fa5 replace the texture level hack used in radeon/r200 to allow larger textures with different methods to calculate the announced maximum texture sizes. Default is still the same (that is, radeon/r200 default to not announce anything which might not fit, i830/i915 default to 1 texture must fit). Bug #5785. 2006-02-03 13:29:11 +00:00
Brian Paul
16a14510c4 use calloc instead of malloc so try_codegen field is initialized to zero (bug 5791) 2006-02-02 17:33:26 +00:00
Brian Paul
725740c7c8 add some assertions to check emit_func[] table validity 2006-02-02 14:30:16 +00:00
Roland Scheidegger
5951aab823 fix texcoord unit assertion, the right one (bug 5780) 2006-02-01 23:14:42 +00:00
Brian Paul
865ad82bb8 fix texcoord unit assertion (bug 5780) 2006-02-01 16:50:16 +00:00
Roland Scheidegger
3b6f62fc73 fix test for valid texunit in _mesa_ClientActiveTextureARB 2006-02-01 01:05:40 +00:00
Brian Paul
111281f1fc s/malloc/calloc/, fix mem leak 2006-01-31 03:00:14 +00:00
Roland Scheidegger
663138a951 fix broken assertions so dri drivers compile with -DDEBUG (replace GL_STENCIL_INDEX8 with GL_STENCIL_INDEX8_EXT). Fix potential problem with drivers which use 32bit z buffers. 2006-01-30 23:49:31 +00:00
Roland Scheidegger
a45f23bed1 fix broken assertion to make radeon driver compile with -DDEBUG... 2006-01-30 23:36:42 +00:00
Brian Paul
4b4cc650e1 updated comment 2006-01-30 17:13:19 +00:00
Brian Paul
781c54a5b8 silence warning about duplicate M_PI definition 2006-01-30 17:12:10 +00:00
Brian Paul
6a36407a00 added more tests (Pedro Maia) 2006-01-30 17:11:47 +00:00
Brian Paul
7905b19ec9 use fmod() when incrementing CubeRot 2006-01-30 15:35:35 +00:00
Michal Krol
bd8c742762 Add shader/slang/slang_compile_*.* files. 2006-01-30 14:50:01 +00:00
Michal Krol
9dc8bce88e Split slang_compile.c into several smaller files - it was just too big.
Minor fixes and cosmetic changes.
2006-01-30 14:48:42 +00:00
Brian Paul
b2006a40eb some initial EGL 1.2 work 2006-01-30 00:10:55 +00:00
Brian Paul
daf3093f28 Test glCopyTexSubImage2D by drawing gears as texture on sides of a box. 2006-01-28 00:30:07 +00:00
Brian Paul
5e9d73153c misc updates 2006-01-27 20:12:06 +00:00
Brian Paul
0b3c2a9a24 Don't do swapbuffers if -nodraw specified. Get t0 after setup code. 2006-01-27 15:44:40 +00:00
Aapo Tahkola
5594ddbcfe remove broken non arb fp path 2006-01-27 14:35:24 +00:00
Aapo Tahkola
58e4aa0ec9 missing link in the fallback chain 2006-01-27 14:09:05 +00:00
Aapo Tahkola
0fcfa1c5b0 enable hw vertex programs by default 2006-01-27 14:03:22 +00:00
Aapo Tahkola
e797bc8bbe per vp sw fallbacks 2006-01-27 13:21:47 +00:00
Aapo Tahkola
7d82d284e3 radeon driver doesnt have this so i assume we shouldnt either. 2006-01-27 13:09:59 +00:00
Aapo Tahkola
a7bd2563c3 drop all that (slow) locking stuff and make u_list per context. 2006-01-27 13:05:56 +00:00
Aapo Tahkola
875df252a7 R300_PFS_NODE_LAST_NODE -> R300_PFS_NODE_OUTPUT_COLOR 2006-01-27 12:38:20 +00:00
Aapo Tahkola
e804370014 Work around problems with t_vp_build.c 2006-01-27 12:23:26 +00:00
Aapo Tahkola
32551222bc r300UpdateTextureEnv shouldnt be called. 2006-01-27 12:18:58 +00:00
Brian Paul
77667266a7 Test glTexSubImage and glCopyTexSubImage rate.
Run with -nodraw to skip rendering of test quad to get "pure" sub-tex rate.
2006-01-26 17:35:31 +00:00
Brian Paul
32a6468014 copypixrate.c - measure the speed of glCopyPixels. 2006-01-26 16:37:47 +00:00
Aapo Tahkola
e65ad47a8f remove some testing code 2006-01-26 16:28:54 +00:00
Aapo Tahkola
edc98df891 Fix a problem where offsets from disabled tmus reach drm 2006-01-26 15:53:18 +00:00
Alan Hourihane
fbcb37cac5 remove i830 2006-01-26 08:53:32 +00:00
Brian Paul
3a5bb1729d New comments, clean-up of fields related to point/line/triangle validation. 2006-01-26 01:32:47 +00:00
Brian Paul
2219a15b06 remove unneeded init of swrast->invalidate_line/triangle 2006-01-26 01:28:00 +00:00
Brian Paul
74235b1cf1 remove the GL_HP_occlusion_test code 2006-01-26 01:27:17 +00:00
Brian Paul
f3cf636e57 WGL_ARB_extensions_string extension 2006-01-25 17:33:13 +00:00
Brian Paul
166b0ff973 added wglGetExtensionsStringARB 2006-01-25 15:05:36 +00:00
Karl Schultz
7f1274fa8b add wglGetExtensionsStringARB 2006-01-25 06:02:55 +00:00
Jerome Glisse
99da2d30eb fix using a tmp without asking for one 2006-01-24 23:04:51 +00:00
Alan Hourihane
8b1dc68662 pull in fix from 6.4 branch for XFree86Server definition 2006-01-24 21:40:53 +00:00
Aapo Tahkola
4dd8a8907e fix broken get_half & get_zero 2006-01-24 20:24:06 +00:00
Alan Hourihane
65573edd1b remove very old i830 code 2006-01-24 19:59:54 +00:00
Alan Hourihane
f3134ca7ad use front.size instead of sPriv->fbSize 2006-01-24 19:40:26 +00:00
Alan Hourihane
f7360cd42d use screen->front.map instead of pFB from libdri 2006-01-24 19:28:49 +00:00
Alan Hourihane
39c492bb14 Add Intel 945GM support
Add rotation support
(Tungsten Graphics)
2006-01-23 10:10:48 +00:00
Jerome Glisse
acd1f16b35 Do individual negetation in swizzling, thus we can
save one instruction in some case.
2006-01-21 15:16:53 +00:00
Jerome Glisse
c6f35dd8db Indent & wrap around 80 2006-01-21 13:08:46 +00:00
Aapo Tahkola
f087d60f18 Doesnt apply anymore 2006-01-21 12:48:09 +00:00
Jerome Glisse
41a874f486 Add individual component negation. 2006-01-21 11:43:37 +00:00
Aapo Tahkola
ef073b7a75 Try to tackle bug #5148 2006-01-20 21:56:52 +00:00
Aapo Tahkola
c90b569238 Sync from drm. 2006-01-20 21:16:28 +00:00
Aapo Tahkola
93a7605b1d Fix ARGB1555 component swizzling. 2006-01-20 20:48:05 +00:00
Jerome Glisse
b42d5bcaff Fix swizzling table & add struct. 2006-01-20 18:24:44 +00:00
Adam Jackson
37e86254c1 Avoid a crash when the user has enabled glVertex{,Attrib}Pointer but hasn't
filled in a valid pointer for that attribute or vertex array.
2006-01-19 18:00:38 +00:00
Adam Jackson
216f729a95 Search for makedepend in the PATH rather than hardcoding /usr/X11R6/bin 2006-01-18 20:57:02 +00:00
Adam Jackson
38da697546 Nuke the old attempt at software DRI, it's broken and awful 2006-01-18 00:29:35 +00:00
Adam Jackson
f93a228c38 Start a software-only DRI driver for use in the new accelerated indirect
world.
2006-01-18 00:22:21 +00:00
Brian Paul
1096eae18d properly free ATI fragment shaders (Tilman Sauerbeck) 2006-01-16 16:35:13 +00:00
Brian Paul
361bccb4ec Free visinfo object (Tilman Sauerbeck) 2006-01-16 16:17:18 +00:00
348 changed files with 18990 additions and 28557 deletions

View File

@@ -89,6 +89,7 @@ linux-dri \
linux-dri-x86 \
linux-dri-x86-64 \
linux-dri-ppc \
linux-dri-xcb \
linux-indirect \
linux-fbdev \
linux-glide \
@@ -113,7 +114,6 @@ linux-x86-32 \
linux-x86-64 \
linux-x86-64-debug \
linux-x86-64-static \
linux-x86-xcb \
linux-x86-glide \
linux-x86-static \
netbsd \
@@ -166,6 +166,7 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/glx.h \
$(DIRECTORY)/include/GL/glxext.h \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/glfbdev.h \
$(DIRECTORY)/include/GL/mesa_wgl.h \
$(DIRECTORY)/include/GL/mglmesa.h \
$(DIRECTORY)/include/GL/osmesa.h \

View File

@@ -20,9 +20,9 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP makefile v1.6 for Mesa
# DOS/DJGPP makefile for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Author: Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -31,9 +31,6 @@
# Available options:
#
# Environment variables:
# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
# or `mesa'.
# default = mesa
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
@@ -57,8 +54,6 @@
.PHONY : all libgl libglu libglut clean realclean
GLU ?= mesa
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math
@@ -75,7 +70,7 @@ all: libgl libglu libglut
libgl: lib
$(MAKE) -f Makefile.DJ -C src/mesa
libglu: lib
$(MAKE) -f Makefile.DJ -C src/glu/$(GLU)
$(MAKE) -f Makefile.DJ -C src/glu/sgi
libglut: lib
$(MAKE) -f Makefile.DJ -C src/glut/dos

View File

@@ -53,6 +53,8 @@ if [ `uname` = "FreeBSD" ] ; then
CP_FLAGS="-f"
elif [ `uname` = "Darwin" ] ; then
CP_FLAGS="-f"
elif [ `uname` = "AIX" ] ; then
CP_FLAGS="-fh"
else
CP_FLAGS="-fd"
fi

View File

@@ -502,6 +502,9 @@ case $ARCH in
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
# may need these:
# CFLAGS += -fno-common
# LDFLAGS += -bundle -flat_namespace -undefined suppress
LIBNAME="lib${LIBNAME}.dylib"
echo "mklib: Making Darwin shared library: " ${LIBNAME}
FLAGS="-dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0"

View File

@@ -14,6 +14,6 @@ CXXFLAGS = -O2 -DAIXV3
MKLIB_OPTIONS = -arch aix-gcc
GL_LIB_DEPS = -lX11 -lXext -lm
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(LIB_DIR -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
APP_LIB_DEPS = -L$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi

View File

@@ -10,6 +10,9 @@ MESA_MAJOR=6
MESA_MINOR=5
MESA_TINY=0
# external projects. This should be useless now that we use libdrm.
DRM_SOURCE_PATH=$(TOP)/../drm
# Compiler and flags
CC = cc
CXX = CC

View File

@@ -5,13 +5,22 @@ include $(TOP)/configs/default
CONFIG_NAME = FreeBSD
# Compiler and flags
CC = gcc
CXX = g++
CC = cc
CXX = c++
MAKE = gmake
CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 \
$(ASM_FLAGS)
CXXFLAGS = -O2 -fPIC -pedantic
OPT_FLAGS = -O2
PIC_FLAGS = -fPIC
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM -DHZ=100
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ffast-math -pedantic
CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES)
GLUT_CFLAGS = -fexceptions
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm
EXTRA_LIB_PATH = -L/usr/X11R6/lib
APP_LIB_DEPS = -L$(LIB_DIR) $(EXTRA_LIB_PATH) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm

View File

@@ -22,7 +22,7 @@ CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
ASM_SOURCES =
# Library/program dependencies
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB)
@@ -40,6 +40,6 @@ DRM_SOURCE_PATH=$(TOP)/../drm
# ffb and gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 r300 radeon tdfx \
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon tdfx \
unichrome savage sis

View File

@@ -4,5 +4,5 @@ include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
OPT_FLAGS = -g
OPT_FLAGS = -g -ansi -pedantic
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -13,8 +13,7 @@ CXX = g++
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
#OPT_FLAGS = -g -march=pentium4 -fprefetch-loop-arrays
OPT_FLAGS = -O2
OPT_FLAGS = -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
@@ -23,7 +22,6 @@ 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 \
-DDEBUG \
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS
X11_INCLUDES = -I/usr/X11R6/include
@@ -39,7 +37,7 @@ ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB)
@@ -65,7 +63,5 @@ WINDOW_SYSTEM=dri
# gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = i915 mach64 mga r128 r200 r300 radeon s3v \
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb
DRI_DIRS = i915

View File

@@ -17,7 +17,7 @@ LIB_DIR = $(TOP)/lib64
EXTRA_LIB_PATH=-L/usr/X11R6/lib64
# ffb, gamma, and sis are missing because they have not be converted to use
# the new interface. i810 and i830 are missing because there is no x86-64
# the new interface. i810 are missing because there is no x86-64
# system where they could *ever* be used.
#
DRI_DIRS = i915 mach64 mga r128 r200 radeon tdfx unichrome savage r300

67
configs/linux-dri-xcb Normal file
View File

@@ -0,0 +1,67 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri-xcb
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
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
X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb`
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=`pkg-config --libs-only-L x11`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) `pkg-config --libs xcb`
# This is now 0 by default since it seems to confuse the hell out of people
# and generate a lot of extra noise on bugzilla. If you need to build with
# EGL, do 'make linux-dri USING_EGL=1'
USING_EGL=0
# Directories
ifeq ($(USING_EGL), 1)
SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
PROGRAM_DIRS = egl
else
SRC_DIRS = glx/x11 mesa glu glut/glx glw
PROGRAM_DIRS =
endif
DRIVER_DIRS = dri
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

View File

@@ -10,7 +10,7 @@ CONFIG_NAME = linux-dri
CC = gcc
CXX = g++
MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend

View File

@@ -40,4 +40,4 @@ DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx
#DRI_DIRS = ffb gamma sis savage
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
DRI_DIRS = i810 i915 mach64 mga r128 r200 radeon tdfx unichrome fb

View File

@@ -1,25 +0,0 @@
# Configuration for Linux with x86 optimizations
include $(TOP)/configs/default
CONFIG_NAME = linux-x86-xcb
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -DUSE_XCB -I/usr/X11R6/include
CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XCB
GLUT_CFLAGS = -fexceptions
ASM_SOURCES = $(X86_SOURCES)
ASM_API = $(X86_API)
# Library/program dependencies
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lXCB
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@@ -1,4 +1,4 @@
Mesa 6.3 DOS/DJGPP Port v1.7
Mesa 6.5 DOS/DJGPP Port v1.8
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -7,8 +7,7 @@ Description:
~~~~~~~~~~~~
Well, guess what... this is the DOS port of Mesa 6.3, for DJGPP fans... Whoa!
The driver has its origins in ddsample.c, written by Brian Paul and found by me
in Mesa 3.4.2.
The driver uses OSMesa to draw off screen, and then blits the buffer.
@@ -32,9 +31,6 @@ Available options:
Environment variables:
CPU optimize for the given processor.
default = pentium
GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
or `mesa'.
default = mesa
GLIDE path to Glide3 SDK; used with FX.
default = $(TOP)/glide3
FX=1 build for 3dfx Glide3. Note that this disables
@@ -56,11 +52,9 @@ Available options:
Tested on:
CPU: AMD Athlon XP 1800+
Mainboard: GA-7VTXE w/ 512 MB DDRAM
Video card: Voodoo5 6000 AGP w/ 128 MB SDRAM
DJGPP: djdev 2.04 + gcc v3.4.3 + make v3.80
OS: DOS and Win98SE
Video card: Radeon 9500
DJGPP: djdev 2.04 + gcc v4.1.0 + make v3.80
OS: DOS, Win98SE, WinXP (using Videoport driver)
@@ -98,7 +92,7 @@ FAQ:
Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
A) Is that a question? If you have a 3dfx Voodoo (any model), you're
lucky (check http://sourceforge.net/projects/glide for the DJGPP port).
If you haven't, sorry; everything is done in software. Suggestions?
If you haven't, sorry; everything is done in software.
Q) I tried to set refresh rate w/ DMesa, but without success.
A) Refresh rate control works only for VESA 3.0 and the 3dfx driver (in
@@ -107,7 +101,8 @@ FAQ:
Q) I made a simple application and it does nothing. It exits right away. Not
even a blank screen.
A) Pure software drivers (VESA/VGA/NUL) support only double-buffered modes.
A) Software drivers (VESA/VGA/NUL) must to be constructed as single-buffered
visuals. However, DMesaSwapBuffers must be called to get any output.
A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
lazy programmer and I found that the easiest way to keep buffer handling
at peak performance ;-).
@@ -265,6 +260,11 @@ v1.7 (???-2005)
* no more GLX sources in DOS GLUT
* made GLUT timer callbacks less accurate but safer
v1.8 (apr-2006)
* killed lots of code, the driver is now a front-end to OSMesa
* fixed problem with WinNT (http://www.volny.cz/martin.sulak/)
- removed 3dfx Glide3 support (temporarily?)
Contact:

View File

@@ -1,15 +1,15 @@
File: docs/README.WIN32
Last updated: Jul 01, 2005 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: Mar 31, 2006 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
----- -----
Unzip both ZIP files (MesaLib and MesaDemos) into the same directory.
The libs and demos build separately, so if you do not care about the
demos, you do not have to unzip that zip file. But if you do, it does
need to be unzipped into the same directory as the lib zip file
because the demos depend on the libs.
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
@@ -22,6 +22,10 @@ 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.
@@ -33,10 +37,11 @@ from the projects using Visual Studio.
Windows Drivers
------- -------
At this time, only the GDI driver is known to work, as it has been
ported and rewritten to the latest Mesa DD interfaces. Source code
also exists in the tree for other drivers in src/mesa/drivers/windows,
but the status of this code is unknown.
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
@@ -86,6 +91,14 @@ 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
----- ------ -----
@@ -98,6 +111,9 @@ 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
---

47
docs/RELNOTES-6.4.1 Normal file
View File

@@ -0,0 +1,47 @@
Mesa 6.4.1 Release Notes
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.3) designate new developmental releases.
Even numbered versions (such as 6.4) designate stable releases.
6.4.1 is a bug-fix release. See the VERSIONS file for details.
GLUT tarball
------------
Starting with 6.4, the GLUT library sources are distributed in a separate
tarball. This was done at the request of Linux distro vendors who prefer
to use freeglut.
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Windows/Win32 implements OpenGL 1.5
Glide (3dfx Voodoo1/2) requires updates
SVGA requires updates
DJGPP requires updates
GGI requires updates
BeOS requires updates
Allegro requires updates
D3D requires updates
The drivers which require updates mostly need to be updated to work
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
in Mesa 6.3.
----------------------------------------------------------------------
$Id: RELNOTES-6.4.1,v 3.1 2006/02/03 17:21:54 brianp Exp $

47
docs/RELNOTES-6.4.2 Normal file
View File

@@ -0,0 +1,47 @@
Mesa 6.4.2 Release Notes
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.3) designate new developmental releases.
Even numbered versions (such as 6.4) designate stable releases.
6.4.2 is a minor bug-fix release. See the VERSIONS file for details.
GLUT tarball
------------
Starting with 6.4, the GLUT library sources are distributed in a separate
tarball. This was done at the request of Linux distro vendors who prefer
to use freeglut.
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Windows/Win32 implements OpenGL 1.5
Glide (3dfx Voodoo1/2) requires updates
SVGA requires updates
DJGPP requires updates
GGI requires updates
BeOS requires updates
Allegro requires updates
D3D requires updates
The drivers which require updates mostly need to be updated to work
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
in Mesa 6.3.
----------------------------------------------------------------------
$Id: RELNOTES-6.4.2,v 3.1 2006/02/03 17:21:54 brianp Exp $

View File

@@ -1,7 +1,5 @@
Mesa 6.5 Release Notes
month, day, 2005
Mesa 6.5 Release Notes
@@ -17,23 +15,29 @@ Even numbered versions (such as 6.4) designate stable releases.
New Features
------------
GL_EXT_timer_query - used to get elapsed time information from the renderer.
OpenGL Shading language support
This includes the GL_ARB_shader_objects, GL_ARB_shading_language_100,
GL_ARB_vertex_shader and GL_ARB_fragment_shader extensions. Most of
the work was done by Michal Krol.
There's probably a fair number of bugs since this is a pretty large,
complicated body of code.
The OpenGL 2.0 interface to these features will be implemented in a
future version of Mesa,
GL_EXT_timer_query
Used to measure the time of OpenGL operations at high precision.
Only supported in the software/Xlib driver at this time.
Driver Interface Changes
------------------------
GL_EXT_packed_depth_stencil
Defines a new GL_DEPTH_STENCIL_EXT pixel format.
Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by
the two-sided versions: Driver.Stencil*Separate().
To Do
-----
Fix linux-glide target/driver.
Fix lambda calculation for frag progs.
GL_EXT_framebuffer_blit
A simplified glCopyPixels-like feature for copying pixel rectangles.
GL_ARB_half_float_pixel
Adds a new half-precision floating point format for image transfers,
such as for glDrawPixels, glReadPixels, glTexImage, etc.
@@ -46,18 +50,37 @@ The following extensions have been removed:
Known Issues
------------
Rendering to depth textures will not work. Rendering to GL_DEPTH_STENCIL
textures should work.
Driver Interface Changes
------------------------
Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by
the two-sided versions: Driver.Stencil*Separate().
Render-to-texture: The functions for rendering to textures have changed.
To Do (someday) items
---------------------
Switch to freeglut
Increase MAX_DRAWBUFFERS
Fix linux-glide target/driver.
Fix lambda calculation for frag progs.
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa (Xlib) implements OpenGL 1.5
XMesa/GLX (on Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA implements OpenGL 1.3
@@ -71,4 +94,4 @@ D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.5,v 3.1 2005/09/14 14:34:54 brianp Exp $
$Id: RELNOTES-6.5,v 3.4 2006/03/29 04:53:02 brianp Exp $

View File

@@ -1407,10 +1407,42 @@ Mesa Version History
- fragment programs that wrote result.depth.z didn't work
6.5 month, day, 2005
6.4.1 November 30, 2005
Bug fixes:
- redefining a vertex program string didn't take effect in TNL module
- fixed occasional segfault upon vertex/fragment parsing error
- vertex program LIT instruction didn't handle 0^0=1 correctly
- fragment program fog option didn't work with glDrawPixels, glBitmap
- USE_MGL_NAMESPACE didn't work for x86-64
- OSMesa demos were missing from previous release tarballs
- fixed problem with float->ushort conversion in glClear (bug 4992)
- popping of GL_EYE_PLANE texgen state was broken (bug 4996)
- popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
- fixed occasional triangle color interpolation problem on VMS
- work around invalid free() call (bug 5131)
- fixed BSD X server compilation problem by including stdint.h
6.4.2 February 2, 2006
New:
- added OSMesaColorClamp() function/feature
- added wglGetExtensionStringARB() function
Bug fixes:
- fixed some problems when building on Windows
- GLw header files weren't installed by installmesa script (bug 5396)
- GL/glfbdev.h file was missing from tarballs
- fixed TNL initialization bug which could lead to crash (bug 5791)
6.5 March 31, 2006
New:
- OpenGL Shading Language support through GL_ARB_shader_objects,
GL_ARB_shading_language_100, GL_ARB_vertex_shader and
GL_ARB_fragment_shader (done by Michal Krol)
- GL_EXT_packed_depth_stencil extension
- GL_EXT_timer_query extension
- GL_EXT_framebuffer_blit extension
- GL_ARB_half_float_pixel
- reflect demo improved to support multiple windows
- singlebuffer demo (shows no/little-flicker single-buffered rendering)
- r200: enable GL_ARB_texture_env_crossbar, separate the texture
@@ -1420,8 +1452,21 @@ Mesa Version History
- radeon: add support for all 3 tmus, GL_ARB_texture_cube_map
and GL_EXT_fog_coord
- MESA_GLX_ALPHA_BITS env var for xlib driver
- many DRI driver updates (including screen rotation support
for the Intel DRI driver)
Changes:
- removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
- removed GL_SGIX/SGIS_pixel_texture extensions
Bug fixes:
- fixed glxcontextmodes.c datatype problem (bug 5835)
- fixed aix-gcc build/install bugs (bug 5874)
- fixed some bugs in texture env program generation
- glXCopyContext() didn't handle texture object bindings properly
- glXCopyContext() didn't copy all lighting state
- fixed FreeBSD config (Pedro Giffuni)
- fixed some minor framebuffer object bugs
- replaced dprintf() with _glu_printf() in GLU (bug 6244)
- fixed a number of thread safety bugs/regressions
- fixed a number of GLU tesselator bugs (John Shell, bug 6339)
- paletted texturing was broken w/ floating point palettes (K. Schultz)
- lots of assorted framebuffer object bug fixes

View File

@@ -40,14 +40,14 @@ Here are the basic instructions for Unix systems:
Version 1.9.28 is known to work.
<li>Login as an anonymous user:
<pre>
cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa login
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa login
</pre>
Just press Enter/Return when prompted for a password.
<br>
<br>
<li>Check out the code:
<pre>
cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa co Mesa
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa co Mesa
</pre>
</ol>
@@ -56,7 +56,7 @@ Here are the basic instructions for Unix systems:
<ol>
<li><code>cd Mesa</code>
<li><code>cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa update</code>
<li><code>cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa update</code>
</ol>
@@ -86,7 +86,7 @@ with:
</pre>
followed by:
<pre>
cvs -d:ext:yourusername@pdx.freedesktop.org:/cvs/mesa co Mesa
cvs -d:ext:yourusername@cvs.freedesktop.org:/cvs/mesa co Mesa
</pre>
<p>

View File

@@ -83,7 +83,7 @@ Brace example:
Here's the GNU indent command which will best approximate my preferred style:
</p>
<pre>
indent -br -i3 -npcs infile.c -o outfile.c
indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
</pre>
@@ -145,7 +145,7 @@ DEMO_NAME are correct.
</p>
<p>
Update the docs/news.html file and docs/contents.html files.
Update the docs/news.html file and docs/download.html files.
</p>
<p>

View File

@@ -9,11 +9,11 @@
<H1>Downloading</H1>
<p>
Last development release: <b>6.3.2</b>
Last development release: <b>6.5</b>
</p>
<p>
Last stable release: <b>6.2.1</b>
Last stable release: <b>6.4.2</b>
</p>
<p>

View File

@@ -23,16 +23,17 @@ generate exceptions.
</ul>
<p>
The following environment variables are only applicable to the Xlib/X11
software driver:
The following are only applicable to the Xlib software driver.
See <A HREF="README.X11">README.X11</A> for details.
</p>
<ul>
<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
<li>MESA_GAMMA - gamma correction coefficients (X only)
<li>MESA_XSYNC - enable synchronous X behavior (for X debugging only)
<li>MESA_GLX_FORCE_CI - if set, force GLX to treak 8bpp visuals as CI visuals
<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
either "pixmap" or "ximage"
<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
<li>MESA_GLX_FX - set to either "fullscreen" for full-screen rendering,
"window" to render into a window, or "disable" to disable the Glide driver.
<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.

View File

@@ -70,13 +70,13 @@ They're found in a module of the DRI CVS tree.
To obtain the code do the following:
</p>
<pre>
cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri login
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@pdx.freedesktop.org:/cvs/dri co drm
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri co drm
</pre>
<p>

View File

@@ -50,26 +50,18 @@ Rendering Manager) kernel drivers and header files.
They're available from the <a href="http://dri.sf.net/" target="_parent">DRI</a> project.
</p>
<p>
You can get them from CVS by doing:
Your distribution should already have both the kernel modules and support
library already installed. If not, you can get them from CVS by doing:
<pre>
cvs -d:pserver:anonymous@pds.freedesktop.org:/cvs/dri login
(hit enter when prompted for a password)
cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri co drm
</pre>
<p>
Make note of the directory in which the drm files are placed.
</p>
<p>
See the <a href="http://dri.freedesktop.org/wiki/Building" target="_parent">
DRI Building Instructions</a> for the steps to build the DRM modules.
DRI Building Instructions</a> for the steps to build the DRM modules. Mesa
6.5 requires at least libdrm 2.0.1 or greater.
</p>
<p>
Next, in the <code>Mesa-x.y.z/configs/default</code> file, set the
<code>DRM_SOURCE_PATH</code> variable to indicate where the DRM files
are located.
</p>
<p>
Now build Mesa and the DRI drivers by running
Build Mesa and the DRI drivers by running
</p>
<pre>
make linux-dri

View File

@@ -21,7 +21,7 @@
<li><a href="http://math.nist.gov/f90gl" target="_parent">Fortran77/90 bindings for OpenGL and Mesa</a> - by William Mitchell
<li><a href="http://glow.sourceforge.net/" target="_parent">GLOW</a> - a GUI toolkit for GLUT and OpenGL
<li><a href="http://www.nigels.com/glt/">Glt</a> - an OpenGL C++ toolkit
<li><a href="http://www.opengl.org/developers/documentation/glut/" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
<li><a href="http://www.opengl.org/resources/libraries/glut.html" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
<li><a href="http://atrey.karlin.mff.cuni.cz/%7E0rfelyus/guileGL/" target="_parent">GuileGL</a> - OpenGL and GtkGLArea language bindings for Guile
<li><a href="http://www.rsinc.com/" target="_parent">IDL</a> - Interactive Data Language
<li><a href="http://www.newplanetsoftware.com/jx/" target="_parent">JX</a> - C++ application framework and GUI library

View File

@@ -14,7 +14,7 @@
</li><li><a href="http://mesa3d.sourceforge.net/notfound.html">ARCAD</a> - CAD program
</li><li><a href="http://www.mediascape.com/" target="_parent">Artstream</a> - provides
functionality like Corel Draw and Illustrator
</li><li><a href="http://www.blender.nl/" target="_parent">Blender</a> - 3-D animation
</li><li><a href="http://www.blender.org/" target="_parent">Blender</a> - 3-D animation
software
</li><li><a href="http://www.arq.net/%7Ekasten/demtools/" target="_parent">Demtools</a>
- Map viewer

View File

@@ -11,6 +11,122 @@
<H1>News</H1>
<h2>March 31, 2006</h2>
<p>
Mesa 6.5 has been released. This is a new development release.
</p>
<pre>
New:
- OpenGL Shading Language support through GL_ARB_shader_objects,
GL_ARB_shading_language_100, GL_ARB_vertex_shader and
GL_ARB_fragment_shader (done by Michal Krol)
- GL_EXT_packed_depth_stencil extension
- GL_EXT_timer_query extension
- GL_EXT_framebuffer_blit extension
- GL_ARB_half_float_pixel
- GLX_MESA_copy_sub_buffer for DRI drivers (Dave Reveman)
- reflect demo improved to support multiple windows
- singlebuffer demo (shows no/little-flicker single-buffered rendering)
- r200: enable GL_ARB_texture_env_crossbar, separate the texture
sampling unit bits from the texture env combine enable bits
- r200: add support for GL_ATI_fragment_shader
- added fast XOR-mode line drawing optimization
- radeon: add support for all 3 tmus, GL_ARB_texture_cube_map
and GL_EXT_fog_coord
- MESA_GLX_ALPHA_BITS env var for xlib driver
- many DRI driver updates (including screen rotation support
for the Intel DRI driver)
Changes:
- removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
- removed GL_SGIX/SGIS_pixel_texture extensions
Bug fixes:
- fixed glxcontextmodes.c datatype problem (bug 5835)
- fixed aix-gcc build/install bugs (bug 5874)
- fixed some bugs in texture env program generation
- glXCopyContext() didn't handle texture object bindings properly
- glXCopyContext() didn't copy all lighting state
- fixed FreeBSD config (Pedro Giffuni)
- fixed some minor framebuffer object bugs
- replaced dprintf() with _glu_printf() in GLU (bug 6244)
- fixed a number of thread safety bugs/regressions
- fixed a number of GLU tesselator bugs (John Shell, bug 6339)
- paletted texturing was broken w/ floating point palettes (K. Schultz)
- lots of assorted framebuffer object bug fixes
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
TBD
</pre>
<h2>February 2, 2006</h2>
<p>
Mesa 6.4.2 has been released. This is primarily a bug-fix release.
</p>
<pre>
New items:
- added OSMesaColorClamp() function/feature
- added wglGetExtensionStringARB() function
Bug fixes:
- fixed some problems when building on Windows
- GLw header files weren't installed by installmesa script (bug 5396)
- GL/glfbdev.h file was missing from tarballs
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
cb0d745d520fa7c2bb9178058b763544 MesaLib-6.4.2.tar.gz
7674d2c603b5834259e4e5a820cefd5b MesaLib-6.4.2.tar.bz2
d224e1325b33ff71a0f3893fc6b4d594 MesaLib-6.4.2.zip
d4b345d4588fc750cd3d34f3ac26673e MesaDemos-6.4.2.tar.gz
9cae1ab874af533ce356bd7dfe2e0bb0 MesaDemos-6.4.2.tar.bz2
2da6e1d1245e441d27813595c6ba50de MesaDemos-6.4.2.zip
84427d18c3453f0ea52388eeba7169b5 MesaGLUT-6.4.2.tar.gz
b157ba8ad1ea63260cf5339132e7aac6 MesaGLUT-6.4.2.tar.bz2
fe1523744fc05edc3811dfc6a1bf4181 MesaGLUT-6.4.2.zip
</pre>
<h2>November 29, 2005</h2>
<p>
Mesa 6.4.1 has been released. This is a stable, bug-fix release.
</p>
<pre>
Bug fixes:
- redefining a vertex program string didn't take effect in TNL module
- fixed occasional segfault upon vertex/fragment parsing error
- vertex program LIT instruction didn't handle 0^0=1 correctly
- fragment program fog option didn't work with glDrawPixels, glBitmap
- USE_MGL_NAMESPACE didn't work for x86-64
- OSMesa demos were missing from previous release tarballs
- fixed problem with float->ushort conversion in glClear (bug 4992)
- popping of GL_EYE_PLANE texgen state was broken (bug 4996)
- popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
- fixed occasional triangle color interpolation problem on VMS
- work around invalid free() call (bug 5131)
- fixed BSD X server compilation problem by including stdint.h
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
698ceb574cf882b0226761f5913c0da9 MesaLib-6.4.1.tar.gz
ea148c828ec6f645526451db1b8556f1 MesaLib-6.4.1.tar.bz2
42e93279468975ed2bf3111b8721e5d9 MesaLib-6.4.1.zip
e3b0d50807fd2bdcd1a95aaddd786f13 MesaDemos-6.4.1.tar.gz
99df1fdcb98d391666b476ca6f1dda8a MesaDemos-6.4.1.tar.bz2
b999d2c6d92fb4b7740a3dbd889348e3 MesaDemos-6.4.1.zip
eadfe01fe5ddfb1eb8227dd567b31635 MesaGLUT-6.4.1.tar.gz
bd003bb4f981a4f91dee4c38644d4f3f MesaGLUT-6.4.1.tar.bz2
71c401c037088bf688a88afdaeb3420f MesaGLUT-6.4.1.zip
</pre>
<h2>October 24, 2005</h2>
<p>
Mesa 6.4 has been released. This is a stable, bug-fix release.
@@ -1102,6 +1218,6 @@ source code</a>.</p>
<hr>
$Id: news.html,v 3.25 2005/10/24 23:33:27 brianp Exp $
$Id: news.html,v 3.27 2006/03/31 23:10:21 brianp Exp $
</body>
</html>

View File

@@ -13,6 +13,8 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="RELNOTES-6.4.2">RELNOTES-6.4.2</A>
<LI><A HREF="RELNOTES-6.4.1">RELNOTES-6.4.1</A>
<LI><A HREF="RELNOTES-6.4">RELNOTES-6.4</A>
<LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A>
<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>

View File

@@ -23,9 +23,9 @@
*/
/*
* DOS/DJGPP device driver v1.7 for Mesa
* DOS/DJGPP device driver for Mesa
*
* Copyright (C) 2002 - Daniel Borca
* Author: Daniel Borca
* Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
@@ -35,7 +35,7 @@
#define DMESA_H_included
#define DMESA_MAJOR_VERSION 6
#define DMESA_MINOR_VERSION 3
#define DMESA_MINOR_VERSION 5
/* Sample Usage:
*
@@ -138,7 +138,7 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
/*
* DMesa functions
*/
typedef void (*DMesaProc) (void);
typedef void (*DMesaProc) ();
DMesaProc DMesaGetProcAddress (const char *name);
/*
@@ -149,8 +149,8 @@ DMesaProc DMesaGetProcAddress (const char *name);
#define DMESA_GET_VIDEO_MODES 0x0300
#define DMESA_GET_BUFFER_ADDR 0x0400
#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */
#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */
#define DMESA_DRIVER_DBL_BIT 0x1 /* double-buffered */
#define DMESA_DRIVER_YUP_BIT 0x2 /* lower-left window origin */
int DMesaGetIntegerv (GLenum pname, GLint *params);
#ifdef __cplusplus

View File

@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
* Version: 6.3
* Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2006 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

@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2006 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"),
@@ -379,6 +379,60 @@ extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attr
#endif /* GLX_NV_float_buffer */
/*
* #?. GLX_MESA_swap_frame_usage
*/
#ifndef GLX_MESA_swap_frame_usage
#define GLX_MESA_swap_frame_usage 1
extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
#endif /* GLX_MESA_swap_frame_usage */
/*
* #?. GLX_MESA_swap_control
*/
#ifndef GLX_MESA_swap_control
#define GLX_MESA_swap_control 1
extern int glXSwapIntervalMESA(unsigned int interval);
extern int glXGetSwapIntervalMESA(void);
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
#endif /* GLX_MESA_swap_control */
/*
* #?. GLX_EXT_texture_from_pixmap
* XXX not finished?
*/
#ifndef GLX_EXT_texture_from_pixmap
#define GLX_EXT_texture_from_pixmap 1
/* XXX need enums/tokens! */
extern Bool glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
extern Bool glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
#endif /* GLX_EXT_texture_from_pixmap */
/*** Should these go here, or in another header? */
/*
** GLX Events

View File

@@ -331,7 +331,7 @@ typedef struct {
} GLXBufferClobberEventSGIX;
#endif
#if defined(__sun__)
#if defined(__sun__) || defined(__osf__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__)

View File

@@ -472,6 +472,14 @@ struct __DRIdrawableRec {
* \since Internal API version 20030317.
*/
unsigned swap_interval;
/**
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
*
* \since Internal API version 20060314.
*/
void (*copySubBuffer)(__DRInativeDisplay *dpy, void *drawablePrivate,
int x, int y, int w, int h);
};
#endif

View File

@@ -111,6 +111,15 @@ WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDE
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc);
#endif /* WGL_ARB_extensions_string */
#ifdef _MSC_VER
# pragma warning( pop )
#endif

View File

@@ -100,15 +100,14 @@ extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
/*
* Destroy a rendering context as returned by WMesaCreateContext()
*/
/*extern void WMesaDestroyContext( WMesaContext ctx );*/
extern void WMesaDestroyContext( void );
extern void WMesaDestroyContext( WMesaContext ctx );
/*
* Make the specified context the current one.
*/
extern void WMesaMakeCurrent( WMesaContext ctx );
extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
/*
@@ -121,7 +120,7 @@ extern WMesaContext WMesaGetCurrentContext( void );
* Swap the front and back buffers for the current context. No action
* taken if the context is not double buffered.
*/
extern void WMesaSwapBuffers(void);
extern void WMesaSwapBuffers(HDC hdc);
/*

View File

@@ -64,6 +64,7 @@ typedef XColor XMesaColor;
#define XMesaDrawPoint XDrawPoint
#define XMesaDrawPoints XDrawPoints
#define XMesaDrawLine XDrawLine
#define XMesaFillRectangle XFillRectangle
#define XMesaPutImage XPutImage
#define XMesaCopyArea XCopyArea

View File

@@ -95,6 +95,18 @@ do { \
(*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \
} while (0)
#define XMesaDrawLine(__d, __b, __gc, __x0, __y0, __x1, __y1) \
do { \
XMesaPoint __p[2]; \
(void) __d; \
__p[0].x = __x0; \
__p[0].y = __y0; \
__p[1].x = __x1; \
__p[1].y = __y1; \
ValidateGC(__b, __gc); \
(*gc->ops->PolyLines)(__b, __gc, CoordModeOrigin, 2, __p); \
} while (0)
#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \
do { \
xRectangle __r[1]; \

View File

@@ -64,9 +64,7 @@
** Versioning and extensions
*/
#define EGL_VERSION_1_0 1
#if 0
#define EGL_VERSION_1_1 1
#endif
/*
** Boolean
@@ -269,6 +267,56 @@ GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source,
#endif /* EGL_MESA_copy_context */
/* XXX this is preliminary! */
#ifndef EGL_VERSION_1_2
#define EGL_VERSION_1_2 1
typedef int EGLenum;
typedef int EGLClientBuffer;
#define EGL_DISPLAY_SCALING 10000
#define EGL_UNKNOWN ((EGLint)-1)
#define EGL_OPENGL_ES_BIT 0x1
#define EGL_OPENVG_BIT 0x2
#define EGL_OPENGL_ES_API 0x30A0
#define EGL_OPENVG_API 0x30A1
#define EGL_LUMINANCE_SIZE 0x303D
#define EGL_ALPHA_MASK_SIZE 0x303E
#define EGL_COLOR_BUFFER_TYPE 0x303F
#define EGL_RENDERABLE_TYPE 0x3040
#define EGL_SINGLE_BUFFER 0x3085
#define EGL_RENDER_BUFFER 0x3086
#define EGL_COLORSPACE 0x3087
#define EGL_ALPHA_FORMAT 0x3088
#define EGL_COLORSPACE_sRGB 0x3089
#define EGL_COLORSPACE_LINEAR 0x308A
#define EGL_ALPHA_FORMAT_NONPRE 0x308B
#define EGL_ALPHA_FORMAT_PRE 0x308C
#define EGL_CLIENT_APIS 0x308D
#define EGL_RGB_BUFFER 0x308E
#define EGL_LUMINANCE_BUFFER 0x308F
#define EGL_HORIZONTAL_RESOLUTION 0x3090
#define EGL_VERTICAL_RESOLUTION 0x3091
#define EGL_PIXEL_ASPECT_RATIO 0x3092
#define EGL_SWAP_BEHAVIOR 0x3093
#define EGL_BUFFER_PRESERVED 0x3094
#define EGL_BUFFER_DESTROYED 0x3095
#define EGL_OPENVG_IMAGE 0x3096
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
GLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api);
GLAPI EGLenum APIENTRY eglQueryAPI(void);
GLAPI EGLBoolean APIENTRY eglWaitClient(void);
GLAPI EGLBoolean APIENTRY eglReleaseThread(void);
GLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
#endif /* EGL_VERSION_1_2 */
#ifdef __cplusplus
}
#endif

View File

@@ -31,6 +31,8 @@ readtex.h
reflect
renormal
shadowtex
showbuffer.c
showbuffer.h
spectex
stex3d
teapot

View File

@@ -15,22 +15,22 @@ LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME) $(LIB_DIR)/$(GLUT
PROGS = \
arbfplight \
arbfslight \
arbocclude \
bounce \
clearspd \
cubemap \
drawpix \
copypix \
drawpix_pbo \
fire \
fogcoord \
fplight \
gamma \
gears \
gearbox \
gears \
geartrain \
glinfo \
gloss \
glslnoise \
gltestperf \
glutfx \
isosurf \
@@ -54,7 +54,7 @@ PROGS = \
terrain \
tessdemo \
texcyl \
texdown-pool \
texdown \
texenv \
texobj \
trispd \
@@ -76,8 +76,9 @@ PROGS = \
##### TARGETS #####
default: readtex.o $(PROGS)
default: $(PROGS)
$(PROGS): readtex.o
readtex.c: $(TOP)/progs/util/readtex.c
cp $< .

118
progs/demos/Makefile.win Normal file
View File

@@ -0,0 +1,118 @@
# Mesa 3-D graphics library
# Version: 6.5
# Copyright (C) 1995-2006 Brian Paul
# Makefile for GLUT-based demo programs for Windows
# Build the Mesa and GLUT libraries by using the Visual Studio
# Workspaces in this distribution before running this Makefile.
# Invocation: nmake -f Makefile.win
NODEBUG=1
!include <win32.mak>
##### MACROS #####
TOP = ..\..
INCDIR = ..\..\include
LIBDIR = ..\..\lib
LIBS = GLUT32.LIB OPENGL32.LIB
all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \
readtex.h readtex.c showbuffer.h showbuffer.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 \
gears.exe geartrain.exe gloss.exe \
glinfo.exe glslnoise.exe \
gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \
morph3d.exe multiarb.exe occlude.exe paltex.exe pointblast.exe \
ray.exe readpix.exe reflect.exe renormal.exe \
shadowtex.exe singlebuffer.exe spectex.exe spriteblast.exe \
stex3d.exe teapot.exe terrain.exe tessdemo.exe texcyl.exe \
texdown.exe texenv.exe texobj.exe trispd.exe tunnel.exe tunnel2.exe \
winpos.exe
arbfplight.exe: arbfplight.obj
arbfslight.exe: arbfslight.obj
arbocclude.exe: arbocclude.obj
bounce.exe: bounce.obj
clearspd.exe: clearspd.obj
cubemap.exe: cubemap.obj readtex.obj
drawpix.exe: drawpix.obj readtex.obj
fire.exe: fire.obj readtex.obj
fogcoord.exe: fogcoord.obj readtex.obj
fplight.exe: fplight.obj
gamma.exe: gamma.obj
gearbox.exe: gearbox.obj
gears.exe: gears.obj
geartrain.exe: geartrain.obj
gloss.exe: gloss.obj readtex.obj
glinfo.exe: glinfo.obj
glslnoise.exe: glslnoise.obj
gltestperf.exe: gltestperf.obj
glutfx.exe: glutfx.obj
ipers.exe: ipers.obj readtex.obj
isosurf.exe: isosurf.obj readtex.obj
lodbias.exe: lodbias.obj readtex.obj
morph3d.exe: morph3d.obj
multiarb.exe: multiarb.obj readtex.obj
occlude.exe: occlude.obj
paltex.exe: paltex.obj
pointblast.exe: pointblast.obj
ray.exe: ray.obj
readpix.exe: readpix.obj readtex.obj
reflect.exe: reflect.obj readtex.obj showbuffer.obj
renormal.exe: renormal.obj
shadowtex.exe: shadowtex.obj showbuffer.obj
singlebuffer.exe: singlebuffer.obj
spectex.exe: spectex.obj
spriteblast.exe: spriteblast.obj
stex3d.exe: stex3d.obj
teapot.exe: teapot.obj readtex.obj
terrain.exe: terrain.obj
tessdemo.exe: tessdemo.obj
texcyl.exe: texcyl.obj readtex.obj
texdown.exe: texdown.obj
texenv.exe: texenv.obj
texobj.exe: texobj.obj
trispd.exe: trispd.obj
tunnel.exe: tunnel.obj readtex.obj
tunnel2.exe: tunnel2.obj readtex.obj
winpos.exe: winpos.obj readtex.obj
OPENGL32.DLL: $(LIBDIR)\OPENGL32.DLL
copy $? .
GLU32.DLL: $(LIBDIR)\GLU32.DLL
copy $? .
GLUT32.DLL: $(LIBDIR)\GLUT32.DLL
copy $? .
readtex.c: $(TOP)\progs\util\readtex.c
copy $** .
readtex.h: $(TOP)\progs\util\readtex.h
copy $** .
showbuffer.c: $(TOP)\progs\util\showbuffer.c
copy $** .
showbuffer.h: $(TOP)\progs\util\showbuffer.h
copy $** .
.obj.exe:
$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
.c.obj:
$(cc) $(cdebug) $(cflags) $(cvars) /I$(INCDIR) $*.c
clean::
del *.obj *.exe readtex.* showbuffer.*
clobber::

View File

@@ -343,7 +343,7 @@ static void Init( void )
(const GLubyte *) vertProgramText);
glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos);
if (glGetError() != GL_NO_ERROR || errorPos != -1) {
int l = FindLine(fragProgramText, errorPos);
int l = FindLine(vertProgramText, errorPos);
printf("Vertex Program Error (pos=%d line=%d): %s\n", errorPos, l,
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
exit(0);

289
progs/demos/arbfslight.c Normal file
View File

@@ -0,0 +1,289 @@
/*
* Use GL_ARB_fragment_shader and GL_ARB_vertex_shader to implement
* simple per-pixel lighting.
*
* Michal Krol
* 20 February 2006
*
* Based on the original demo by:
* Brian Paul
* 17 April 2003
*/
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
#ifdef WIN32
#define GETPROCADDRESS wglGetProcAddress
#else
#define GETPROCADDRESS glutGetProcAddress
#endif
static GLfloat diffuse[4] = { 0.5f, 0.5f, 1.0f, 1.0f };
static GLfloat specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f };
static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 1.0f };
static GLfloat delta = 1.0f;
static GLhandleARB fragShader;
static GLhandleARB vertShader;
static GLhandleARB program;
static GLint uLightPos;
static GLint uDiffuse;
static GLint uSpecular;
static GLboolean anim = GL_TRUE;
static GLboolean wire = GL_FALSE;
static GLboolean pixelLight = GL_TRUE;
static GLint t0 = 0;
static GLint frames = 0;
static GLfloat xRot = 0.0f, yRot = 0.0f;
static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL;
static PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL;
static PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL;
static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
static PFNGLATTACHOBJECTARBPROC glAttachObjectARB = NULL;
static PFNGLLINKPROGRAMARBPROC glLinkProgramARB = NULL;
static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = NULL;
static PFNGLUNIFORM4FVARBPROC glUniform4fvARB = NULL;
static void Redisplay (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (pixelLight)
{
glUseProgramObjectARB (program);
glUniform4fvARB (uLightPos, 1, lightPos);
glDisable(GL_LIGHTING);
}
else
{
glUseProgramObjectARB (0);
glLightfv (GL_LIGHT0, GL_POSITION, lightPos);
glEnable(GL_LIGHTING);
}
glPushMatrix ();
glRotatef (xRot, 1.0f, 0.0f, 0.0f);
glRotatef (yRot, 0.0f, 1.0f, 0.0f);
glutSolidSphere (2.0, 10, 5);
glPopMatrix ();
glutSwapBuffers();
frames++;
if (anim)
{
GLint t = glutGet (GLUT_ELAPSED_TIME);
if (t - t0 >= 5000)
{
GLfloat seconds = (GLfloat) (t - t0) / 1000.0f;
GLfloat fps = frames / seconds;
printf ("%d frames in %6.3f seconds = %6.3f FPS\n", frames, seconds, fps);
t0 = t;
frames = 0;
}
}
}
static void Idle (void)
{
lightPos[0] += delta;
if (lightPos[0] > 25.0f || lightPos[0] < -25.0f)
delta = -delta;
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 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 'x':
lightPos[0] -= 1.0f;
break;
case 'X':
lightPos[0] += 1.0f;
break;
case 'w':
wire = !wire;
if (wire)
glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
else
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
break;
case 'p':
pixelLight = !pixelLight;
if (pixelLight)
printf ("Per-pixel lighting\n");
else
printf ("Conventional lighting\n");
break;
case 27:
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 Init (void)
{
static const char *fragShaderText =
"uniform vec4 lightPos;\n"
"uniform vec4 diffuse;\n"
"uniform vec4 specular;\n"
"void main () {\n"
" // Compute dot product of light direction and normal vector\n"
" float dotProd;\n"
" dotProd = clamp (dot (normalize (lightPos).xyz, normalize (gl_TexCoord[0]).xyz), 0.0, 1.0);\n"
" // Compute diffuse and specular contributions\n"
" gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
"}\n"
;
static const char *vertShaderText =
"void main () {\n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
" gl_TexCoord[0] = vec4 (gl_NormalMatrix * gl_Normal, 1.0);\n"
"}\n"
;
if (!glutExtensionSupported ("GL_ARB_fragment_shader"))
{
printf ("Sorry, this demo requires GL_ARB_fragment_shader\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_shader_objects"))
{
printf ("Sorry, this demo requires GL_ARB_shader_objects\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_shading_language_100"))
{
printf ("Sorry, this demo requires GL_ARB_shading_language_100\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_vertex_shader"))
{
printf ("Sorry, this demo requires GL_ARB_vertex_shader\n");
exit(1);
}
glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) GETPROCADDRESS ("glCreateShaderObjectARB");
glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) GETPROCADDRESS ("glShaderSourceARB");
glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) GETPROCADDRESS ("glCompileShaderARB");
glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) GETPROCADDRESS ("glCreateProgramObjectARB");
glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) GETPROCADDRESS ("glAttachObjectARB");
glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) GETPROCADDRESS ("glLinkProgramARB");
glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) GETPROCADDRESS ("glUseProgramObjectARB");
glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) GETPROCADDRESS ("glGetUniformLocationARB");
glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC) GETPROCADDRESS ("glUniform4fvARB");
fragShader = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
glShaderSourceARB (fragShader, 1, &fragShaderText, NULL);
glCompileShaderARB (fragShader);
vertShader = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
glShaderSourceARB (vertShader, 1, &vertShaderText, NULL);
glCompileShaderARB (vertShader);
program = glCreateProgramObjectARB ();
glAttachObjectARB (program, fragShader);
glAttachObjectARB (program, vertShader);
glLinkProgramARB (program);
glUseProgramObjectARB (program);
uLightPos = glGetUniformLocationARB (program, "lightPos");
uDiffuse = glGetUniformLocationARB (program, "diffuse");
uSpecular = glGetUniformLocationARB (program, "specular");
glUniform4fvARB (uDiffuse, 1, diffuse);
glUniform4fvARB (uSpecular, 1, specular);
glClearColor (0.3f, 0.3f, 0.3f, 0.0f);
glEnable (GL_DEPTH_TEST);
glEnable (GL_LIGHT0);
glEnable (GL_LIGHTING);
glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, specular);
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 20.0f);
printf ("GL_RENDERER = %s\n", (const char *) glGetString (GL_RENDERER));
printf ("Press p to toggle between per-pixel and per-vertex lighting\n");
}
int main (int argc, char *argv[])
{
glutInit (&argc, argv);
glutInitWindowPosition ( 0, 0);
glutInitWindowSize (200, 200);
glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow (argv[0]);
glutReshapeFunc (Reshape);
glutKeyboardFunc (Key);
glutSpecialFunc (SpecialKey);
glutDisplayFunc (Redisplay);
if (anim)
glutIdleFunc (Idle);
Init ();
glutMainLoop ();
return 0;
}

View File

@@ -14,8 +14,6 @@
#include <stdlib.h>
#include <string.h>
#include <GL/glut.h>
#include <sys/time.h>
#include <time.h>
#define COS(X) cos( (X) * 3.14159/180.0 )
#define SIN(X) sin( (X) * 3.14159/180.0 )

View File

@@ -1,364 +0,0 @@
/*
* glDrawPixels demo/test/benchmark
*
* Brian Paul September 25, 1997 This file is in the public domain.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <GL/glut.h>
#include "readtex.h"
#define IMAGE_FILE "../images/girl.rgb"
static int ImgWidth, ImgHeight;
static GLenum ImgFormat;
static GLubyte *Image = NULL;
static int Xpos, Ypos;
static int SkipPixels, SkipRows;
static int DrawWidth, DrawHeight;
static int Scissor = 0;
static int Fog = 0;
static GLfloat Zpos = -1.0;
static float Xzoom, Yzoom;
static GLboolean DrawFront = GL_FALSE;
static GLboolean Dither = GL_TRUE;
static void Reset( void )
{
Xpos = Ypos = 20;
DrawWidth = ImgWidth;
DrawHeight = ImgHeight;
SkipPixels = SkipRows = 0;
Scissor = 0;
Fog = 0;
Zpos = -1.0;
Xzoom = Yzoom = 1.0;
}
static void Display( void )
{
glClear( GL_COLOR_BUFFER_BIT );
glRasterPos2i(10, 10);
glPixelZoom( 1, 1 );
glDisable(GL_SCISSOR_TEST);
glDisable(GL_FOG);
glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
#if 0
glRasterPos2i(Xpos, Ypos);
#else
/* This allows negative raster positions: */
glRasterPos3f(0, 0, Zpos);
glBitmap(0, 0, 0, 0, Xpos, Ypos, NULL);
#endif
glPixelStorei(GL_UNPACK_SKIP_PIXELS, SkipPixels);
glPixelStorei(GL_UNPACK_SKIP_ROWS, SkipRows);
glPixelZoom( Xzoom, Yzoom );
if (Scissor)
glEnable(GL_SCISSOR_TEST);
if (Fog)
glEnable(GL_FOG);
glCopyPixels(10, 10, ImgWidth, ImgHeight, GL_COLOR);
glDisable(GL_SCISSOR_TEST);
glDisable(GL_FOG);
if (DrawFront)
glFinish();
else
glutSwapBuffers();
}
static void Benchmark( void )
{
int startTime, endTime;
int draws = 500;
double seconds, pixelsPerSecond;
printf("Benchmarking...\n");
/* GL set-up */
glPixelStorei(GL_UNPACK_SKIP_PIXELS, SkipPixels);
glPixelStorei(GL_UNPACK_SKIP_ROWS, SkipRows);
glPixelZoom( Xzoom, Yzoom );
if (Scissor)
glEnable(GL_SCISSOR_TEST);
if (Fog)
glEnable(GL_FOG);
if (DrawFront)
glDrawBuffer(GL_FRONT);
else
glDrawBuffer(GL_BACK);
/* Run timing test */
draws = 0;
startTime = glutGet(GLUT_ELAPSED_TIME);
do {
glCopyPixels(10, 10, ImgWidth, ImgHeight, GL_COLOR);
draws++;
endTime = glutGet(GLUT_ELAPSED_TIME);
} while (endTime - startTime < 4000); /* 4 seconds */
/* GL clean-up */
glDisable(GL_SCISSOR_TEST);
glDisable(GL_FOG);
/* Results */
seconds = (double) (endTime - startTime) / 1000.0;
pixelsPerSecond = draws * DrawWidth * DrawHeight / seconds;
printf("Result: %d draws in %f seconds = %f pixels/sec\n",
draws, seconds, pixelsPerSecond);
}
static void Reshape( int width, int height )
{
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0.0, width, 0.0, height, 0.0, 2.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glScissor(width/4, height/4, width/2, height/2);
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case ' ':
Reset();
break;
case 'd':
Dither = !Dither;
if (Dither)
glEnable(GL_DITHER);
else
glDisable(GL_DITHER);
break;
case 'w':
if (DrawWidth > 0)
DrawWidth--;
break;
case 'W':
DrawWidth++;
break;
case 'h':
if (DrawHeight > 0)
DrawHeight--;
break;
case 'H':
DrawHeight++;
break;
case 'p':
if (SkipPixels > 0)
SkipPixels--;
break;
case 'P':
SkipPixels++;
break;
case 'r':
if (SkipRows > 0)
SkipRows--;
break;
case 'R':
SkipRows++;
break;
case 's':
Scissor = !Scissor;
break;
case 'x':
Xzoom -= 0.1;
break;
case 'X':
Xzoom += 0.1;
break;
case 'y':
Yzoom -= 0.1;
break;
case 'Y':
Yzoom += 0.1;
break;
case 'z':
Zpos -= 0.1;
printf("RasterPos Z = %g\n", Zpos);
break;
case 'Z':
Zpos += 0.1;
printf("RasterPos Z = %g\n", Zpos);
break;
case 'b':
Benchmark();
break;
case 'F':
Fog = !Fog;
printf("Fog %d\n", Fog);
break;
case 'f':
DrawFront = !DrawFront;
if (DrawFront)
glDrawBuffer(GL_FRONT);
else
glDrawBuffer(GL_BACK);
printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK");
break;
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void SpecialKey( int key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
Ypos += 1;
break;
case GLUT_KEY_DOWN:
Ypos -= 1;
break;
case GLUT_KEY_LEFT:
Xpos -= 1;
break;
case GLUT_KEY_RIGHT:
Xpos += 1;
break;
}
glutPostRedisplay();
}
static void Init( GLboolean ciMode, const char *filename )
{
static const GLfloat fogColor[4] = {0, 1, 0, 0};
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
Image = LoadRGBImage( filename, &ImgWidth, &ImgHeight, &ImgFormat );
if (!Image) {
printf("Couldn't read %s\n", filename);
exit(0);
}
if (ciMode) {
/* Convert RGB image to grayscale */
GLubyte *indexImage = (GLubyte *) malloc( ImgWidth * ImgHeight );
GLint i;
for (i=0; i<ImgWidth*ImgHeight; i++) {
int gray = Image[i*3] + Image[i*3+1] + Image[i*3+2];
indexImage[i] = gray / 3;
}
free(Image);
Image = indexImage;
ImgFormat = GL_COLOR_INDEX;
for (i=0;i<255;i++) {
float g = i / 255.0;
glutSetColor(i, g, g, g);
}
}
printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, ImgWidth);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogf(GL_FOG_START, 0);
glFogf(GL_FOG_END, 2);
glFogfv(GL_FOG_COLOR, fogColor);
Reset();
}
static void Usage(void)
{
printf("Keys:\n");
printf(" SPACE Reset Parameters\n");
printf(" Up/Down Move image up/down\n");
printf(" Left/Right Move image left/right\n");
printf(" x Decrease X-axis PixelZoom\n");
printf(" X Increase X-axis PixelZoom\n");
printf(" y Decrease Y-axis PixelZoom\n");
printf(" Y Increase Y-axis PixelZoom\n");
printf(" w Decrease glDrawPixels width*\n");
printf(" W Increase glDrawPixels width*\n");
printf(" h Decrease glDrawPixels height*\n");
printf(" H Increase glDrawPixels height*\n");
printf(" p Decrease GL_UNPACK_SKIP_PIXELS*\n");
printf(" P Increase GL_UNPACK_SKIP_PIXELS*\n");
printf(" r Decrease GL_UNPACK_SKIP_ROWS*\n");
printf(" R Increase GL_UNPACK_SKIP_ROWS*\n");
printf(" s Toggle GL_SCISSOR_TEST\n");
printf(" F Toggle GL_FOG\n");
printf(" z Decrease RasterPos Z\n");
printf(" Z Increase RasterPos Z\n");
printf(" f Toggle front/back buffer drawing\n");
printf(" b Benchmark test\n");
printf(" ESC Exit\n");
printf("* Warning: no limits are imposed on these parameters so it's\n");
printf(" possible to cause a segfault if you go too far.\n");
}
int main( int argc, char *argv[] )
{
GLboolean ciMode = GL_FALSE;
const char *filename = IMAGE_FILE;
int i = 1;
if (argc > i && strcmp(argv[i], "-ci")==0) {
ciMode = GL_TRUE;
i++;
}
if (argc > i) {
filename = argv[i];
}
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 500, 400 );
if (ciMode)
glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
else
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
Init(ciMode, filename);
Usage();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
glutMainLoop();
return 0;
}

View File

@@ -1,376 +0,0 @@
/*
* glDrawPixels demo/test/benchmark
*
* Brian Paul September 25, 1997 This file is in the public domain.
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <GL/glut.h>
#include "readtex.h"
#define IMAGE_FILE "../images/tree2.rgba"
static int ImgWidth, ImgHeight;
static GLenum ImgFormat;
static GLenum ImgType = GL_UNSIGNED_BYTE;
static GLubyte *Image = NULL;
static int Xpos, Ypos;
static int SkipPixels, SkipRows;
static int DrawWidth, DrawHeight;
static int Scissor = 0;
static int Fog = 0;
static GLfloat Zpos = -1.0;
static float Xzoom, Yzoom;
static GLboolean DrawFront = GL_FALSE;
static GLboolean Dither = GL_TRUE;
static GLuint DrawPBO;
static void Reset( void )
{
Xpos = Ypos = 20;
DrawWidth = ImgWidth;
DrawHeight = ImgHeight;
SkipPixels = SkipRows = 0;
Scissor = 0;
Fog = 0;
Zpos = -1.0;
Xzoom = Yzoom = 1.0;
}
static void Display( void )
{
glClear( GL_COLOR_BUFFER_BIT );
#if 0
glRasterPos2i(Xpos, Ypos);
#else
/* This allows negative raster positions: */
glRasterPos3f(0, 0, Zpos);
glBitmap(0, 0, 0, 0, Xpos, Ypos, NULL);
#endif
glPixelStorei(GL_UNPACK_SKIP_PIXELS, SkipPixels);
glPixelStorei(GL_UNPACK_SKIP_ROWS, SkipRows);
glPixelZoom( Xzoom, Yzoom );
if (Scissor)
glEnable(GL_SCISSOR_TEST);
if (Fog)
glEnable(GL_FOG);
/*** Draw from the DrawPBO */
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
glDrawPixels(DrawWidth, DrawHeight, ImgFormat, ImgType, NULL);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
glDisable(GL_SCISSOR_TEST);
glDisable(GL_FOG);
if (DrawFront)
glFinish();
else
glutSwapBuffers();
}
static void Benchmark( void )
{
int startTime, endTime;
int draws = 500;
double seconds, pixelsPerSecond;
printf("Benchmarking...\n");
/* GL set-up */
glPixelStorei(GL_UNPACK_SKIP_PIXELS, SkipPixels);
glPixelStorei(GL_UNPACK_SKIP_ROWS, SkipRows);
glPixelZoom( Xzoom, Yzoom );
if (Scissor)
glEnable(GL_SCISSOR_TEST);
if (Fog)
glEnable(GL_FOG);
if (DrawFront)
glDrawBuffer(GL_FRONT);
else
glDrawBuffer(GL_BACK);
/* Run timing test */
draws = 0;
startTime = glutGet(GLUT_ELAPSED_TIME);
do {
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
glDrawPixels(DrawWidth, DrawHeight, ImgFormat, ImgType, NULL);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
draws++;
endTime = glutGet(GLUT_ELAPSED_TIME);
} while (endTime - startTime < 4000); /* 4 seconds */
/* GL clean-up */
glDisable(GL_SCISSOR_TEST);
glDisable(GL_FOG);
/* Results */
seconds = (double) (endTime - startTime) / 1000.0;
pixelsPerSecond = draws * DrawWidth * DrawHeight / seconds;
printf("Result: %d draws in %f seconds = %f pixels/sec\n",
draws, seconds, pixelsPerSecond);
}
static void Reshape( int width, int height )
{
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0.0, width, 0.0, height, 0.0, 2.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glScissor(width/4, height/4, width/2, height/2);
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case ' ':
Reset();
break;
case 'd':
Dither = !Dither;
if (Dither)
glEnable(GL_DITHER);
else
glDisable(GL_DITHER);
break;
case 'w':
if (DrawWidth > 0)
DrawWidth--;
break;
case 'W':
DrawWidth++;
break;
case 'h':
if (DrawHeight > 0)
DrawHeight--;
break;
case 'H':
DrawHeight++;
break;
case 'p':
if (SkipPixels > 0)
SkipPixels--;
break;
case 'P':
SkipPixels++;
break;
case 'r':
if (SkipRows > 0)
SkipRows--;
break;
case 'R':
SkipRows++;
break;
case 's':
Scissor = !Scissor;
break;
case 'x':
Xzoom -= 0.1;
break;
case 'X':
Xzoom += 0.1;
break;
case 'y':
Yzoom -= 0.1;
break;
case 'Y':
Yzoom += 0.1;
break;
case 'z':
Zpos -= 0.1;
printf("RasterPos Z = %g\n", Zpos);
break;
case 'Z':
Zpos += 0.1;
printf("RasterPos Z = %g\n", Zpos);
break;
case 'b':
Benchmark();
break;
case 'F':
Fog = !Fog;
printf("Fog %d\n", Fog);
break;
case 'f':
DrawFront = !DrawFront;
if (DrawFront)
glDrawBuffer(GL_FRONT);
else
glDrawBuffer(GL_BACK);
printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK");
break;
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void SpecialKey( int key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
Ypos += 1;
break;
case GLUT_KEY_DOWN:
Ypos -= 1;
break;
case GLUT_KEY_LEFT:
Xpos -= 1;
break;
case GLUT_KEY_RIGHT:
Xpos += 1;
break;
}
glutPostRedisplay();
}
static void Init( GLboolean ciMode, const char *filename )
{
static const GLfloat fogColor[4] = {0, 1, 0, 0};
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
Image = LoadRGBImage( filename, &ImgWidth, &ImgHeight, &ImgFormat );
if (!Image) {
printf("Couldn't read %s\n", filename);
exit(0);
}
if (ciMode) {
/* Convert RGB image to grayscale */
GLubyte *indexImage = (GLubyte *) malloc( ImgWidth * ImgHeight );
GLint i;
for (i=0; i<ImgWidth*ImgHeight; i++) {
int gray = Image[i*3] + Image[i*3+1] + Image[i*3+2];
indexImage[i] = gray / 3;
}
free(Image);
Image = indexImage;
ImgFormat = GL_COLOR_INDEX;
for (i=0;i<255;i++) {
float g = i / 255.0;
glutSetColor(i, g, g, g);
}
}
printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, ImgWidth);
/* put image into DrawPBO */
glGenBuffersARB(1, &DrawPBO);
glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, DrawPBO);
glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT,
ImgWidth * ImgHeight * 4, Image, GL_STATIC_DRAW);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogf(GL_FOG_START, 0);
glFogf(GL_FOG_END, 2);
glFogfv(GL_FOG_COLOR, fogColor);
Reset();
}
static void Usage(void)
{
printf("Keys:\n");
printf(" SPACE Reset Parameters\n");
printf(" Up/Down Move image up/down\n");
printf(" Left/Right Move image left/right\n");
printf(" x Decrease X-axis PixelZoom\n");
printf(" X Increase X-axis PixelZoom\n");
printf(" y Decrease Y-axis PixelZoom\n");
printf(" Y Increase Y-axis PixelZoom\n");
printf(" w Decrease glDrawPixels width*\n");
printf(" W Increase glDrawPixels width*\n");
printf(" h Decrease glDrawPixels height*\n");
printf(" H Increase glDrawPixels height*\n");
printf(" p Decrease GL_UNPACK_SKIP_PIXELS*\n");
printf(" P Increase GL_UNPACK_SKIP_PIXELS*\n");
printf(" r Decrease GL_UNPACK_SKIP_ROWS*\n");
printf(" R Increase GL_UNPACK_SKIP_ROWS*\n");
printf(" s Toggle GL_SCISSOR_TEST\n");
printf(" F Toggle GL_FOG\n");
printf(" z Decrease RasterPos Z\n");
printf(" Z Increase RasterPos Z\n");
printf(" f Toggle front/back buffer drawing\n");
printf(" b Benchmark test\n");
printf(" ESC Exit\n");
printf("* Warning: no limits are imposed on these parameters so it's\n");
printf(" possible to cause a segfault if you go too far.\n");
}
int main( int argc, char *argv[] )
{
GLboolean ciMode = GL_FALSE;
const char *filename = IMAGE_FILE;
int i = 1;
if (argc > i && strcmp(argv[i], "-ci")==0) {
ciMode = GL_TRUE;
i++;
}
if (argc > i) {
filename = argv[i];
}
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 500, 400 );
if (ciMode)
glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
else
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
Init(ciMode, filename);
Usage();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
glutMainLoop();
return 0;
}

View File

@@ -18,7 +18,7 @@
static GLint WinWidth = 800, WinHeight = 500;
static GLint TexWidth, TexHeight;
static GLuint TexObj = 1;
static GLenum IntFormat = GL_RGBA;
static GLenum IntFormat = GL_RGB;
static GLboolean WireFrame = GL_FALSE;
@@ -325,10 +325,9 @@ idle(void)
dt = t - t0;
t0 = t;
GearRot += 70.0 * dt; /* 70 degrees per second */
GearRot = fmod(GearRot, 360.0); /* prevents eventual overflow */
CubeRot += 15.0 * dt;
/* fmod to prevent overflow */
GearRot = fmod(GearRot + 70.0 * dt, 360.0); /* 70 deg/sec */
CubeRot = fmod(CubeRot + 15.0 * dt, 360.0); /* 15 deg/sec */
glutPostRedisplay();
}

View File

@@ -236,6 +236,7 @@ static void SpecialKey( int key, int x, int y )
static void Init( int argc, char *argv[] )
{
GLboolean convolve = GL_FALSE;
GLboolean fullscreen = GL_FALSE;
int i;
for (i = 1; i < argc; i++) {
@@ -248,8 +249,13 @@ static void Init( int argc, char *argv[] )
else if (strcmp(argv[i], "-c")==0) {
convolve = GL_TRUE;
}
else if (strcmp(argv[i], "-f")==0) {
fullscreen = GL_TRUE;
}
}
if (fullscreen)
glutFullScreen();
/* Cylinder object */
{
@@ -421,7 +427,8 @@ int main( int argc, char *argv[] )
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
glutIdleFunc( Idle );
if (Animate)
glutIdleFunc( Idle );
glutCreateMenu(ModeMenu);
glutAddMenuEntry("Toggle Highlight", DO_SPEC_TEXTURE);

185
progs/demos/glslnoise.c Executable file
View File

@@ -0,0 +1,185 @@
/*
* GLSL noise demo.
*
* Michal Krol
* 20 February 2006
*
* Based on the original demo by:
* Stefan Gustavson (stegu@itn.liu.se) 2004, 2005
*/
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
#ifdef WIN32
#define GETPROCADDRESS(F) wglGetProcAddress(F)
#else
#define GETPROCADDRESS(F) glutGetProcAddress(F)
#endif
static GLhandleARB fragShader;
static GLhandleARB vertShader;
static GLhandleARB program;
static GLint uTime;
static GLfloat u_time = 0.0f;
static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL;
static PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL;
static PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL;
static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
static PFNGLATTACHOBJECTARBPROC glAttachObjectARB = NULL;
static PFNGLLINKPROGRAMARBPROC glLinkProgramARB = NULL;
static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = NULL;
static PFNGLUNIFORM1FARBPROC glUniform1fARB = NULL;
static void Redisplay (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glUniform1fARB (uTime, u_time);
glPushMatrix ();
glutSolidSphere (2.0, 20, 10);
glPopMatrix ();
glutSwapBuffers();
}
static void Idle (void)
{
u_time += 0.1f;
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 Key (unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch (key)
{
case 27:
exit(0);
break;
}
glutPostRedisplay ();
}
static void Init (void)
{
static const char *fragShaderText =
"uniform float time;\n"
"void main () {\n"
" gl_FragColor = gl_Color * vec4 ((0.5 + 0.5 * vec3 (noise1 (\n"
" vec4 (4.0 * gl_TexCoord[0].xyz, 0.5 * time)))), 1.0);\n"
"}\n"
;
static const char *vertShaderText =
"void main () {\n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
" gl_TexCoord[0] = gl_Vertex;\n"
" gl_FrontColor = gl_Color;\n"
"}\n"
;
if (!glutExtensionSupported ("GL_ARB_fragment_shader"))
{
printf ("Sorry, this demo requires GL_ARB_fragment_shader\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_shader_objects"))
{
printf ("Sorry, this demo requires GL_ARB_shader_objects\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_shading_language_100"))
{
printf ("Sorry, this demo requires GL_ARB_shading_language_100\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_vertex_shader"))
{
printf ("Sorry, this demo requires GL_ARB_vertex_shader\n");
exit(1);
}
glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)
GETPROCADDRESS("glCreateShaderObjectARB");
glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)
GETPROCADDRESS("glShaderSourceARB");
glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)
GETPROCADDRESS("glCompileShaderARB");
glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)
GETPROCADDRESS("glCreateProgramObjectARB");
glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)
GETPROCADDRESS("glAttachObjectARB");
glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)
GETPROCADDRESS ("glLinkProgramARB");
glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)
GETPROCADDRESS("glUseProgramObjectARB");
glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)
GETPROCADDRESS("glGetUniformLocationARB");
glUniform1fARB = (PFNGLUNIFORM1FARBPROC)
GETPROCADDRESS("glUniform1fARB");
fragShader = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
glShaderSourceARB (fragShader, 1, &fragShaderText, NULL);
glCompileShaderARB (fragShader);
vertShader = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
glShaderSourceARB (vertShader, 1, &vertShaderText, NULL);
glCompileShaderARB (vertShader);
program = glCreateProgramObjectARB ();
glAttachObjectARB (program, fragShader);
glAttachObjectARB (program, vertShader);
glLinkProgramARB (program);
glUseProgramObjectARB (program);
uTime = glGetUniformLocationARB (program, "time");
glClearColor (0.0f, 0.1f, 0.3f, 1.0f);
glEnable (GL_CULL_FACE);
glEnable (GL_DEPTH_TEST);
printf ("GL_RENDERER = %s\n", (const char *) glGetString (GL_RENDERER));
}
int main (int argc, char *argv[])
{
glutInit (&argc, argv);
glutInitWindowPosition ( 0, 0);
glutInitWindowSize (200, 200);
glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow (argv[0]);
glutReshapeFunc (Reshape);
glutKeyboardFunc (Key);
glutDisplayFunc (Redisplay);
glutIdleFunc (Idle);
Init ();
glutMainLoop ();
return 0;
}

View File

@@ -42,6 +42,9 @@
#define INIT_WIDTH 400
#define INIT_HEIGHT 300
#ifdef _WIN32
#undef CreateWindowA
#endif
struct window {
int id; /* returned by glutCreateWindow() */
@@ -299,11 +302,21 @@ DrawWindow(void)
GLfloat dist = 20.0;
GLfloat eyex, eyey, eyez;
glDrawBuffer(w->drawBuffer);
glReadBuffer(w->drawBuffer);
if (w->drawBuffer == GL_NONE) {
glDrawBuffer(GL_BACK);
glReadBuffer(GL_BACK);
}
else {
glDrawBuffer(w->drawBuffer);
glReadBuffer(w->drawBuffer);
}
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
if (w->drawBuffer == GL_NONE) {
glDrawBuffer(GL_NONE);
}
eyex = dist * cos(w->yrot * DEG2RAD) * cos(w->xrot * DEG2RAD);
eyez = dist * sin(w->yrot * DEG2RAD) * cos(w->xrot * DEG2RAD);
eyey = dist * sin(w->xrot * DEG2RAD);
@@ -373,10 +386,10 @@ DrawWindow(void)
ShowAlphaBuffer(w->width, w->height);
}
if (w->drawBuffer == GL_BACK)
glutSwapBuffers();
else
if (w->drawBuffer == GL_FRONT)
glFinish();
else
glutSwapBuffers();
/* calc/show frame rate */
{
@@ -457,6 +470,10 @@ Key(unsigned char key, int x, int y)
w->drawBuffer = GL_FRONT;
glutPostRedisplay();
break;
case '0':
w->drawBuffer = GL_NONE;
glutPostRedisplay();
break;
case ' ':
w->anim = !w->anim;
w->t0 = -1;

View File

@@ -41,7 +41,6 @@
#undef GL_ARB_shadow_ambient
#endif
#define DEG_TO_RAD (3.14159 / 180.0)
static GLint WindowWidth = 450, WindowHeight = 300;
@@ -67,6 +66,7 @@ static GLfloat Bias = -0.06;
static GLboolean Anim = GL_TRUE;
static GLboolean UsePackedDepthStencil = GL_FALSE;
static GLboolean HaveEXTshadowFuncs = GL_FALSE;
static GLint Operator = 0;
static const GLenum OperatorFunc[8] = {
@@ -266,7 +266,7 @@ Display(void)
0, 1, 0); /* up */
glViewport(0, 0, ShadowTexWidth, ShadowTexHeight);
glClear(GL_DEPTH_BUFFER_BIT);
glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
DrawScene();
/*
@@ -274,9 +274,21 @@ Display(void)
*/
if (DisplayMode == SHOW_DEPTH_MAPPING) {
/* load depth image as gray-scale luminance texture */
GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
* sizeof(GLfloat));
if (depth) {
if (UsePackedDepthStencil) {
GLuint *depth = (GLuint *) malloc(ShadowTexWidth * ShadowTexHeight
* sizeof(GLuint));
assert(depth);
glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, depth);
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
ShadowTexWidth, ShadowTexHeight, 0,
GL_LUMINANCE, GL_UNSIGNED_INT, depth);
free(depth);
}
else {
GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
* sizeof(GLfloat));
assert(depth);
glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
GL_DEPTH_COMPONENT, GL_FLOAT, depth);
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
@@ -287,8 +299,18 @@ Display(void)
}
else {
/* The normal shadow case */
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
if (UsePackedDepthStencil) {
GLint intFormat;
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_EXT,
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
GL_TEXTURE_INTERNAL_FORMAT, &intFormat);
assert(intFormat == GL_DEPTH_STENCIL_EXT);
}
else {
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
}
}
/*
@@ -447,6 +469,17 @@ Key(unsigned char key, int x, int y)
OperatorFunc[Operator]);
}
break;
case 'p':
UsePackedDepthStencil = !UsePackedDepthStencil;
if (UsePackedDepthStencil
&& !glutExtensionSupported("GL_EXT_packed_depth_stencil")) {
printf("Sorry, GL_EXT_packed_depth_stencil not supported\n");
UsePackedDepthStencil = GL_FALSE;
}
else {
printf("Use GL_DEPTH_STENCIL_EXT: %d\n", UsePackedDepthStencil);
}
break;
case 'z':
Zrot -= step;
break;
@@ -572,6 +605,7 @@ PrintHelp(void)
printf(" n = show normal, shadowed image\n");
printf(" f = toggle nearest/bilinear texture filtering\n");
printf(" b/B = decrease/increase shadow map Z bias\n");
printf(" p = toggle use of packed depth/stencil\n");
printf(" cursor keys = rotate scene\n");
printf(" <shift> + cursor keys = rotate light source\n");
if (HaveEXTshadowFuncs)
@@ -585,7 +619,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(WindowWidth, WindowHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);

View File

@@ -38,8 +38,8 @@
#include <GL/glut.h>
static GLsizei MaxSize = 2048;
static GLsizei TexWidth = 1024, TexHeight = 1024, TexBorder = 0;
static GLsizei MaxSize = 1024;
static GLsizei TexWidth = 256, TexHeight = 256, TexBorder = 0;
static GLboolean ScaleAndBias = GL_FALSE;
static GLboolean SubImage = GL_FALSE;
static GLdouble DownloadRate = 0.0; /* texels/sec */
@@ -47,32 +47,6 @@ static GLdouble DownloadRate = 0.0; /* texels/sec */
static GLuint Mode = 0;
/* Try and avoid L2 cache effects by cycling through a small number of
* textures.
*
* At the initial size of 1024x1024x4 == 4mbyte, say 8 textures will
* keep us out of most caches at 32mb total.
*
* This turns into a fairly interesting question of what exactly you
* expect to be in cache in normal usage, and what you think should be
* outside. There's no rules for this, no reason to favour one usage
* over another except what the application you care about happens to
* resemble most closely.
*
* - Should the client texture image be in L2 cache? Has it just been
* generated or read from disk?
* - Does the application really use >1 texture, or is it constantly
* updating one image in-place?
*
* Different answers will favour different texture upload mechanisms.
* To upload an image that is purely outside of cache, a DMA-based
* upload will probably win, whereas for small, in-cache textures,
* copying looks good.
*/
#define NR_TEXOBJ 4
static GLuint TexObj[NR_TEXOBJ];
struct FormatRec {
GLenum Format;
GLenum Type;
@@ -142,57 +116,25 @@ TypeStr(GLenum type)
}
}
/* On x86, there is a performance cliff for memcpy to texture memory
* for sources below 64 byte alignment. We do our best with this in
* the driver, but it is better if the images are correctly aligned to
* start with:
*/
#define ALIGN (1<<12)
static unsigned align(unsigned value, unsigned a)
{
return (value + a - 1) & ~(a-1);
}
static int MIN2(int a, int b)
{
return a < b ? a : b;
}
static void
MeasureDownloadRate(void)
{
const int w = TexWidth + 2 * TexBorder;
const int h = TexHeight + 2 * TexBorder;
const int image_bytes = align(w * h * BytesPerTexel(Format), ALIGN);
const int bytes = image_bytes * NR_TEXOBJ;
GLubyte *orig_texImage, *orig_getImage;
const int bytes = w * h * BytesPerTexel(Format);
GLubyte *texImage, *getImage;
GLdouble t0, t1, time;
int count;
int i;
int offset = 0;
GLdouble total = 0; /* ints will tend to overflow */
printf("allocating %d bytes for %d %dx%d images\n",
bytes, NR_TEXOBJ, w, h);
orig_texImage = (GLubyte *) malloc(bytes + ALIGN);
orig_getImage = (GLubyte *) malloc(image_bytes + ALIGN);
if (!orig_texImage || !orig_getImage) {
texImage = (GLubyte *) malloc(bytes);
getImage = (GLubyte *) malloc(bytes);
if (!texImage || !getImage) {
DownloadRate = 0.0;
return;
}
printf("alloc %p %p\n", orig_texImage, orig_getImage);
texImage = (GLubyte *)align((unsigned)orig_texImage, ALIGN);
getImage = (GLubyte *)align((unsigned)orig_getImage, ALIGN);
for (i = 1; !(((unsigned)texImage) & i); i<<=1)
;
printf("texture image alignment: %d bytes (%p)\n", i, texImage);
for (i = 0; i < bytes; i++) {
texImage[i] = i & 0xff;
}
@@ -224,80 +166,51 @@ MeasureDownloadRate(void)
count = 0;
t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
do {
int img = count%NR_TEXOBJ;
GLubyte *img_ptr = texImage + img * image_bytes;
glBindTexture(GL_TEXTURE_2D, TexObj[img]);
if (SubImage && count > 0) {
/* Only update a portion of the image each iteration. This
* is presumably why you'd want to use texsubimage, otherwise
* you may as well just call teximage again.
*
* A bigger question is whether to use a pointer that moves
* with each call, ie does the incoming data come from L2
* cache under normal circumstances, or is it pulled from
* uncached memory?
*
* There's a good argument to say L2 cache, ie you'd expect
* the data to have been recently generated. It's possible
* that it could have come from a file read, which may or may
* not have gone through the cpu.
*/
glTexSubImage2D(GL_TEXTURE_2D, 0,
-TexBorder,
-TexBorder + offset * h/8,
w,
h/8,
glTexSubImage2D(GL_TEXTURE_2D, 0, -TexBorder, -TexBorder, w, h,
FormatTable[Format].Format,
FormatTable[Format].Type,
#if 1
texImage /* likely in L2$ */
#else
img_ptr + offset * bytes/8 /* unlikely in L2$ */
#endif
);
offset += 1;
offset %= 8;
total += w * h / 8;
FormatTable[Format].Type, texImage);
}
else {
glTexImage2D(GL_TEXTURE_2D, 0,
FormatTable[Format].IntFormat, w, h, TexBorder,
FormatTable[Format].Format,
FormatTable[Format].Type,
img_ptr);
total += w*h;
FormatTable[Format].Type, texImage);
}
#if 1
/* Render a texture, but not necessarily the one just uploaded.
*/
/* glBindTexture(GL_TEXTURE_2D, TexObj[(img + NR_TEXOBJ/2)%NR_TEXOBJ]); */
/* draw a tiny polygon to force texture into texram */
glBegin(GL_TRIANGLES);
glTexCoord2f(0, 0); glVertex2f(1, 1);
glTexCoord2f(1, 0); glVertex2f(3, 1);
glTexCoord2f(0.5, 1); glVertex2f(2, 3);
glEnd();
/* glFinish(); */
#endif
t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
time = t1 - t0;
count++;
/* printf("total %f count %d\n", total, count); */
} while (time < 3.0);
glDisable(GL_TEXTURE_2D);
printf("total texels=%f time=%f\n", total, time);
DownloadRate = total / time;
printf("w*h=%d count=%d time=%f\n", w*h, count, time);
DownloadRate = w * h * count / time;
#if 0
if (!ScaleAndBias) {
/* verify texture readback */
glGetTexImage(GL_TEXTURE_2D, 0,
FormatTable[Format].Format,
FormatTable[Format].Type, getImage);
for (i = 0; i < w * h; i++) {
if (texImage[i] != getImage[i]) {
printf("[%d] %d != %d\n", i, texImage[i], getImage[i]);
}
}
}
#endif
free(orig_texImage);
free(orig_getImage);
free(texImage);
free(getImage);
{
GLint err = glGetError();

View File

@@ -82,60 +82,12 @@ static void render_image( void )
glutSolidCone(1.0, 2.0, 16, 1);
glPopMatrix();
#ifdef GL_HP_occlusion_test
if (perf == 0) {
GLboolean bRet;
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
glEnable(GL_OCCLUSION_TEST_HP);
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
glPushMatrix();
glTranslatef(0.75, 0.0, -1.0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
glutSolidSphere(1.0, 20, 20);
glPopMatrix();
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
printf("Occlusion test 1 (result should be 1): %d\n",bRet);
glDepthMask(GL_TRUE);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
glDisable(GL_OCCLUSION_TEST_HP);
}
#endif
glPushMatrix();
glTranslatef(0.75, 0.0, -1.0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
glutSolidSphere(1.0, 20, 20);
glPopMatrix();
#ifdef GL_HP_occlusion_test
if (perf == 0){
GLboolean bRet;
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
glEnable(GL_OCCLUSION_TEST_HP);
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
/* draw a sphere inside the previous sphere */
glPushMatrix();
glTranslatef(0.75, 0.0, -1.0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
glutSolidSphere(0.5, 20, 20);
glPopMatrix();
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
printf("Occlusion test 2 (result should be 0): %d\n",bRet);
glDepthMask(GL_TRUE);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
glDisable(GL_OCCLUSION_TEST_HP);
}
#endif
glPopMatrix();
/* This is very important!!!

View File

@@ -10,11 +10,14 @@ include $(TOP)/configs/current
LIBS = $(APP_LIB_DEPS)
SOURCES = antialias.c \
SOURCES = \
afsmultiarb.c \
antialias.c \
arbfpspec.c \
arbfptest1.c \
arbfptexture.c \
arbfptrig.c \
arbnpot.c \
arbvptest1.c \
arbvptest3.c \
arbvptorus.c \
@@ -22,14 +25,15 @@ SOURCES = antialias.c \
blendminmax.c \
blendsquare.c \
bufferobj.c \
bug_3050.c \
bug_3101.c \
bug_3195.c \
copypixrate.c \
crossbar.c \
cva.c \
dinoshade.c \
floattex.c \
fbotest1.c \
fbotest2.c \
fbotexture.c \
fog.c \
fogcoord.c \
@@ -38,6 +42,7 @@ SOURCES = antialias.c \
getprocaddress.c \
interleave.c \
invert.c \
jkrahntest.c \
manytex.c \
multipal.c \
no_s3tc.c \

View File

@@ -1,13 +1,9 @@
/*
* GL_ARB_multitexture demo
* GL_ATI_fragment_shader test
* Roland Scheidegger
*
* Command line options:
* -info print GL implementation information
*
*
* Brian Paul November 1998 This program is in the public domain.
* Modified on 12 Feb 2002 for > 2 texture units.
*/

162
progs/tests/bug_3050.c Normal file
View File

@@ -0,0 +1,162 @@
/*
* (C) Copyright IBM Corporation 2006
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file bug_3050.c
*
* Simple regression test for bug #3050. Create a texture and make a few
* calls to \c glGetTexLevelParameteriv. If the bug still exists, trying
* to get \c GL_TEXTURE_WITDH will cause a protocol error.
*
* This test \b only applies to indirect-rendering. This may mean that the
* test needs to be run with the environment variable \c LIBGL_ALWAYS_INDIRECT
* set to a non-zero value.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glut.h>
static int Width = 400;
static int Height = 200;
static const GLfloat Near = 5.0, Far = 25.0;
static void Display( void )
{
}
static void Reshape( int width, int height )
{
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void Init( void )
{
unsigned i;
static const GLenum pnames[] = {
GL_TEXTURE_RED_SIZE,
GL_TEXTURE_GREEN_SIZE,
GL_TEXTURE_BLUE_SIZE,
GL_TEXTURE_ALPHA_SIZE,
GL_TEXTURE_LUMINANCE_SIZE,
GL_TEXTURE_INTENSITY_SIZE,
GL_TEXTURE_BORDER,
GL_TEXTURE_INTERNAL_FORMAT,
GL_TEXTURE_WIDTH,
GL_TEXTURE_HEIGHT,
GL_TEXTURE_DEPTH,
~0
};
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("\nThis program should log some data about a texture and exit.\n");
printf("This is a regression test for bug #3050. If the bug still\n");
printf("exists, a GLX protocol error will be generated.\n");
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3050\n\n");
if ( ! glutExtensionSupported( "GL_NV_texture_rectangle" )
&& ! glutExtensionSupported( "GL_EXT_texture_rectangle" )
&& ! glutExtensionSupported( "GL_ARB_texture_rectangle" ) ) {
printf( "This test requires one of GL_ARB_texture_rectangle, GL_EXT_texture_rectangle,\n"
"or GL_NV_texture_rectangle be supported\n." );
exit( 1 );
}
glBindTexture( GL_TEXTURE_RECTANGLE_NV, 1 );
glTexImage2D( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, GL_RGBA, 8, 8, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL );
for ( i = 0 ; pnames[i] != ~0 ; i++ ) {
GLint param_i;
GLfloat param_f;
GLenum err;
glGetTexLevelParameteriv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_i );
err = glGetError();
if ( err ) {
printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n"
"error of 0x%04x!",
pnames[i], err );
exit( 1 );
}
else {
printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = 0x%04x\n",
pnames[i], param_i );
}
glGetTexLevelParameterfv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_f );
err = glGetError();
if ( err ) {
printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n"
"error of 0x%04x!\n",
pnames[i], err );
exit( 1 );
}
else {
printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = %.1f (0x%04x)\n",
pnames[i], param_f, (GLint) param_f );
}
}
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3050 Test" );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
Init();
return 0;
}

View File

@@ -185,8 +185,8 @@ static void Init( void )
printf("\nThis program should function nearly identically to Mesa's lodbias demo.\n"
"It should cycle through the complet LOD bias range once and exit. If bug\n"
"#3195 still exists, the demo should crash almost immediatly.\n");
printf("This is a regression test for bug #3101.\n");
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3101\n");
printf("This is a regression test for bug #3195.\n");
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3195\n");
if (!glutExtensionSupported("GL_EXT_texture_lod_bias")) {
printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n");

259
progs/tests/copypixrate.c Normal file
View File

@@ -0,0 +1,259 @@
/*
* Measure glCopyPixels speed
*
* Brian Paul
* 26 Jan 2006
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glut.h>
static GLint WinWidth = 1000, WinHeight = 800;
static GLint ImgWidth, ImgHeight;
static GLenum Buffer = GL_FRONT;
static GLenum AlphaTest = GL_FALSE;
static GLboolean UseBlit = GL_FALSE;
static PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT_func = NULL;
/**
* draw teapot in lower-left corner of window
*/
static void
DrawTestImage(void)
{
GLfloat ar;
ImgWidth = WinWidth / 3;
ImgHeight = WinHeight / 3;
glViewport(0, 0, ImgWidth, ImgHeight);
glScissor(0, 0, ImgWidth, ImgHeight);
glEnable(GL_SCISSOR_TEST);
glClearColor(0.5, 0.5, 0.5, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
ar = (float) WinWidth / WinHeight;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
glFrontFace(GL_CW);
glPushMatrix();
glRotatef(45, 1, 0, 0);
glutSolidTeapot(2.0);
glPopMatrix();
glFrontFace(GL_CCW);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glDisable(GL_SCISSOR_TEST);
glViewport(0, 0, WinWidth, WinHeight);
glFinish();
}
static int
Rand(int max)
{
return ((int) random()) % max;
}
/**
* Measure glCopyPixels rate
*/
static void
RunTest(void)
{
double t1, t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
int iters = 0;
float copyRate, mbRate;
int r, g, b, a, bpp;
if (AlphaTest) {
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.0);
}
glGetIntegerv(GL_RED_BITS, &r);
glGetIntegerv(GL_GREEN_BITS, &g);
glGetIntegerv(GL_BLUE_BITS, &b);
glGetIntegerv(GL_ALPHA_BITS, &a);
bpp = (r + g + b + a) / 8;
do {
int x, y;
x = Rand(WinWidth);
y = Rand(WinHeight);
if (x > ImgWidth || y > ImgHeight) {
#ifdef GL_EXT_framebuffer_blit
if (UseBlit)
{
glBlitFramebufferEXT_func(0, 0, ImgWidth, ImgHeight,
x, y, x + ImgWidth, y + ImgHeight,
GL_COLOR_BUFFER_BIT, GL_LINEAR);
}
else
#endif
{
glWindowPos2iARB(x, y);
glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR);
}
glFinish(); /* XXX OK? */
iters++;
t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
}
} while (t1 - t0 < 5.0);
glDisable(GL_ALPHA_TEST);
copyRate = iters / (t1 - t0);
mbRate = ImgWidth * ImgHeight * bpp * copyRate / (1024 * 1024);
printf("Image size: %d x %d, %d Bpp\n", ImgWidth, ImgHeight, bpp);
printf("%d copies in %.2f = %.2f copies/sec, %.2f MB/s\n",
iters, t1-t0, copyRate, mbRate);
}
static void
Draw(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glClearColor(0.2, 0.2, 0.8, 0);
glReadBuffer(Buffer);
glDrawBuffer(Buffer);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
DrawTestImage();
RunTest();
if (Buffer == GL_FRONT)
glFinish();
else
glutSwapBuffers();
printf("exiting\n");
exit(0);
}
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.0, 0.0, -15.0);
}
static void
Key(unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void
SpecialKey(int key, int x, int y)
{
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
break;
case GLUT_KEY_DOWN:
break;
case GLUT_KEY_LEFT:
break;
case GLUT_KEY_RIGHT:
break;
}
glutPostRedisplay();
}
static void
ParseArgs(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-back") == 0)
Buffer = GL_BACK;
else if (strcmp(argv[i], "-alpha") == 0)
AlphaTest = GL_TRUE;
else if (strcmp(argv[i], "-blit") == 0)
UseBlit = GL_TRUE;
}
}
static void
Init(void)
{
if (glutExtensionSupported("GL_EXT_framebuffer_blit")) {
glBlitFramebufferEXT_func = (PFNGLBLITFRAMEBUFFEREXTPROC)
glutGetProcAddress("glBlitFramebufferEXT");
}
else if (UseBlit) {
printf("Warning: GL_EXT_framebuffer_blit not supported.\n");
UseBlit = GL_FALSE;
}
}
int
main(int argc, char *argv[])
{
GLint mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE | GLUT_DEPTH;
glutInit(&argc, argv);
ParseArgs(argc, argv);
if (AlphaTest)
mode |= GLUT_ALPHA;
glutInitWindowPosition(0, 0);
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Draw);
printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
printf("Draw Buffer: %s\n", (Buffer == GL_BACK) ? "Back" : "Front");
Init();
glutMainLoop();
return 0;
}

View File

@@ -1,204 +0,0 @@
/*
* Test GL_EXT_framebuffer_object
*
* Brian Paul
* 19 Mar 2006
*/
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
static int Width = 400, Height = 400;
static GLuint MyFB, ColorRb, DepthRb;
static GLboolean Animate = GL_FALSE;
static GLfloat Rotation = 0.0;
static void
CheckError(int line)
{
GLenum err = glGetError();
if (err) {
printf("fbotest1: GL Error 0x%x at line %d\n", (int) err, line);
}
}
static void
Display( void )
{
GLubyte *buffer = malloc(Width * Height * 4);
GLenum status;
printf("Drawing\n");
CheckError(__LINE__);
/* draw to user framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
printf("fbotest1: Error: Framebuffer is incomplete!!!\n");
}
CheckError(__LINE__);
glClearColor(0.5, 0.5, 1.0, 0.0);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glPushMatrix();
glRotatef(30.0, 1, 0, 0);
glRotatef(Rotation, 0, 1, 0);
glutSolidTeapot(2.0);
glPopMatrix();
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
/* read from user framebuffer */
glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
/* draw to window */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glWindowPos2iARB(0, 0);
glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
free(buffer);
glutSwapBuffers();
CheckError(__LINE__);
}
static void
Reshape( int width, int height )
{
float ar = (float) width / (float) height;
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -15.0 );
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, width, height);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
width, height);
Width = width;
Height = height;
}
static void
CleanUp(void)
{
glDeleteFramebuffersEXT(1, &MyFB);
glDeleteRenderbuffersEXT(1, &ColorRb);
glDeleteRenderbuffersEXT(1, &DepthRb);
assert(!glIsFramebufferEXT(MyFB));
assert(!glIsRenderbufferEXT(ColorRb));
assert(!glIsRenderbufferEXT(DepthRb));
exit(0);
}
static void
Idle(void)
{
Rotation = glutGet(GLUT_ELAPSED_TIME) * 0.1;
glutPostRedisplay();
}
static void
Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 'a':
Animate = !Animate;
if (Animate)
glutIdleFunc(Idle);
else
glutIdleFunc(NULL);
break;
case 27:
CleanUp();
break;
}
glutPostRedisplay();
}
static void
Init( void )
{
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
printf("fbotest1: GL_EXT_framebuffer_object not found!\n");
exit(0);
}
printf("fbotest1: GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
glGenFramebuffersEXT(1, &MyFB);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
assert(glIsFramebufferEXT(MyFB));
/* set color buffer */
glGenRenderbuffersEXT(1, &ColorRb);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb);
assert(glIsRenderbufferEXT(ColorRb));
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
GL_RENDERBUFFER_EXT, ColorRb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
/* setup depth buffer */
glGenRenderbuffersEXT(1, &DepthRb);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRb);
assert(glIsRenderbufferEXT(DepthRb));
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, DepthRb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, Width, Height);
CheckError(__LINE__);
/* restore to default */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
CheckError(__LINE__);
}
int
main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize(Width, Height);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
if (Animate)
glutIdleFunc(Idle);
Init();
glutMainLoop();
return 0;
}

View File

@@ -20,16 +20,23 @@
/* For debug */
#define DEPTH 1
#define STENCIL 1
#define DRAW 1
static int Width = 400, Height = 400;
static GLenum TexTarget = GL_TEXTURE_2D; /*GL_TEXTURE_RECTANGLE_ARB;*/
static int TexWidth = 512, TexHeight = 512;
/*static int TexWidth = 600, TexHeight = 600;*/
static GLuint MyFB;
static GLuint TexObj;
static GLuint DepthRB, StencilRB;
static GLboolean Anim = GL_FALSE;
static GLfloat Rot = 0.0;
static GLboolean UsePackedDepthStencil = GL_FALSE;
static GLuint TextureLevel = 1; /* which texture level to render to */
static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
static void
@@ -45,7 +52,7 @@ CheckError(int line)
static void
Idle(void)
{
Rot = glutGet(GLUT_ELAPSED_TIME) * 0.05;
Rot = glutGet(GLUT_ELAPSED_TIME) * 0.1;
glutPostRedisplay();
}
@@ -53,7 +60,6 @@ Idle(void)
static void
RenderTexture(void)
{
GLint level = 0;
GLenum status;
glMatrixMode(GL_PROJECTION);
@@ -64,10 +70,7 @@ RenderTexture(void)
glTranslatef(0.0, 0.0, -15.0);
/* draw to texture image */
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, TexObj, level);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -82,6 +85,7 @@ RenderTexture(void)
#if DEPTH
glEnable(GL_DEPTH_TEST);
#endif
#if STENCIL
glEnable(GL_STENCIL_TEST);
@@ -91,6 +95,7 @@ RenderTexture(void)
CheckError(__LINE__);
#if DEPTH || STENCIL
/* draw diamond-shaped stencil pattern */
glColor3f(0, 1, 0);
glBegin(GL_POLYGON);
@@ -99,6 +104,7 @@ RenderTexture(void)
glVertex2f( 0.2, 0.0);
glVertex2f( 0.0, 0.2);
glEnd();
#endif
/* draw teapot where stencil != 1 */
#if STENCIL
@@ -107,7 +113,6 @@ RenderTexture(void)
#endif
CheckError(__LINE__);
#endif
#if 0
glBegin(GL_POLYGON);
@@ -126,12 +131,18 @@ RenderTexture(void)
glutSolidTeapot(0.5);
glPopMatrix();
glDisable(GL_LIGHTING);
/*
PrintStencilHistogram(TexWidth, TexHeight);
*/
#endif
glDisable(GL_DEPTH_TEST);
glDisable(GL_STENCIL_TEST);
#if DRAW
/* Bind normal framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
#endif
CheckError(__LINE__);
}
@@ -146,7 +157,7 @@ Display(void)
RenderTexture();
/* draw textured quad in the window */
#if DRAW
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
@@ -161,23 +172,38 @@ Display(void)
glPushMatrix();
glRotatef(Rot, 0, 1, 0);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, TexObj);
glEnable(TexTarget);
glBindTexture(TexTarget, TexObj);
glBegin(GL_POLYGON);
glColor3f(0.25, 0.25, 0.25);
glTexCoord2f(0, 0);
glVertex2f(-1, -1);
glTexCoord2f(1, 0);
glVertex2f(1, -1);
glColor3f(1.0, 1.0, 1.0);
glTexCoord2f(1, 1);
glVertex2f(1, 1);
glTexCoord2f(0, 1);
glVertex2f(-1, 1);
if (TexTarget == GL_TEXTURE_2D) {
glTexCoord2f(0, 0);
glVertex2f(-1, -1);
glTexCoord2f(1, 0);
glVertex2f(1, -1);
glColor3f(1.0, 1.0, 1.0);
glTexCoord2f(1, 1);
glVertex2f(1, 1);
glTexCoord2f(0, 1);
glVertex2f(-1, 1);
}
else {
assert(TexTarget == GL_TEXTURE_RECTANGLE_ARB);
glTexCoord2f(0, 0);
glVertex2f(-1, -1);
glTexCoord2f(TexWidth, 0);
glVertex2f(1, -1);
glColor3f(1.0, 1.0, 1.0);
glTexCoord2f(TexWidth, TexHeight);
glVertex2f(1, 1);
glTexCoord2f(0, TexHeight);
glVertex2f(-1, 1);
}
glEnd();
glPopMatrix();
glDisable(GL_TEXTURE_2D);
glDisable(TexTarget);
#endif
glutSwapBuffers();
CheckError(__LINE__);
}
@@ -237,6 +263,7 @@ Key(unsigned char key, int x, int y)
static void
Init(int argc, char *argv[])
{
static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 };
GLint i;
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
@@ -268,6 +295,30 @@ Init(int argc, char *argv[])
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i);
assert(i == MyFB);
/* Make texture object/image */
glGenTextures(1, &TexObj);
glBindTexture(TexTarget, TexObj);
/* make two image levels */
glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
TexWidth = TexWidth >> TextureLevel;
TexHeight = TexHeight >> TextureLevel;
glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel);
glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
CheckError(__LINE__);
/* Render color to texture */
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
TexTarget, TexObj, TextureLevel);
#if DEPTH
/* make depth renderbuffer */
glGenRenderbuffersEXT(1, &DepthRB);
@@ -323,21 +374,14 @@ Init(int argc, char *argv[])
assert(i > 0);
#endif
CheckError(__LINE__);
/* bind regular framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
CheckError(__LINE__);
/* Make texture object/image */
glGenTextures(1, &TexObj);
glBindTexture(GL_TEXTURE_2D, TexObj);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
CheckError(__LINE__);
/* lighting */
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat);
}

View File

@@ -1,4 +1,4 @@
/* $Id: jkrahntest.c,v 1.1 2002/06/16 03:57:48 brianp Exp $ */
/* $Id: jkrahntest.c,v 1.2 2006/01/30 17:12:10 brianp Exp $ */
/* This is a good test for glXSwapBuffers on non-current windows,
* and the glXCopyContext function. Fixed several Mesa/DRI bugs with
@@ -25,7 +25,11 @@
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159
#endif
#define DEGTOR (M_PI/180.0)
static int AttributeList[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None };

View File

@@ -15,7 +15,7 @@
#include "../util/readtex.c" /* a hack, I know */
#define IMAGE_FILE "../images/tree2.rgba"
#define IMAGE_FILE "../images/girl.rgb"
static int ImgWidth, ImgHeight;
static GLenum ImgFormat;
@@ -32,8 +32,8 @@ static GLboolean Benchmark = GL_FALSE;
static GLuint DrawPBO, TempPBO;
static GLenum ReadFormat = GL_BGRA;
static GLenum ReadType = GL_UNSIGNED_INT_8_8_8_8_REV;
static GLenum ReadFormat = GL_RGBA;
static GLenum ReadType = GL_UNSIGNED_BYTE;

View File

@@ -17,8 +17,8 @@ static GLint TexWidth = 512, TexHeight = 512;
static GLuint TexObj = 1;
static GLenum IntFormat = GL_RGBA;
static GLenum ReadFormat = GL_BGRA; /* for glReadPixels */
static GLenum IntFormat = GL_RGBA8;
static GLenum ReadFormat = GL_RGBA; /* for glReadPixels */
static GLboolean DrawQuad = GL_TRUE;
@@ -77,15 +77,15 @@ DoCopyTex(GLboolean doSubRect)
int w = TexWidth / 2, h = TexHeight / 2;
int x0 = 0, y0 = 0;
int x1 = w, y1 = h;
#if 0
#if 1
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, x0, y0, w, h);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, x1, y0, w, h);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, x0, y1, w, h);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, x1, y1, w, h);
#else
/* scramble */
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, x1, y1, w, h);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, x0, y1, w, h);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, x1, y1, w, h);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, x0, y1, w, h);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, x1, y0, w, h);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, x0, y0, w, h);
#endif
@@ -110,31 +110,26 @@ SubTex(GLboolean doSubRect, const GLubyte *image)
int x1 = w, y1 = h;
glPixelStorei(GL_UNPACK_ROW_LENGTH, TexWidth);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei( GL_PACK_INVERT_MESA, GL_TRUE );
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
/* glPixelStorei(GL_UNPACK_SKIP_ROWS, y0); */
/* glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0); */
glPixelStorei(GL_UNPACK_SKIP_ROWS, y0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0);
glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, w, h,
ReadFormat, GL_UNSIGNED_BYTE, image);
/* glPixelStorei(GL_UNPACK_SKIP_ROWS, y0); */
/* glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1); */
glPixelStorei(GL_UNPACK_SKIP_ROWS, y0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1);
glTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, w, h,
ReadFormat, GL_UNSIGNED_BYTE, image);
/* glPixelStorei(GL_UNPACK_SKIP_ROWS, y1); */
/* glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0); */
glPixelStorei(GL_UNPACK_SKIP_ROWS, y1);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0);
glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, w, h,
ReadFormat, GL_UNSIGNED_BYTE, image);
/* glPixelStorei(GL_UNPACK_SKIP_ROWS, y1); */
/* glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1); */
glPixelStorei(GL_UNPACK_SKIP_ROWS, y1);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1);
glTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, w, h,
ReadFormat, GL_UNSIGNED_BYTE, image);
glPixelStorei( GL_PACK_INVERT_MESA, GL_FALSE );
}
else {
/* all at once */
@@ -178,9 +173,6 @@ RunTest(GLboolean copyTex, GLboolean doSubRect)
t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
if (!DrawQuad)
glDrawBuffer(GL_FRONT);
do {
if (copyTex)
/* Framebuffer -> Texture */
@@ -202,36 +194,16 @@ RunTest(GLboolean copyTex, GLboolean doSubRect)
glTexCoord2f(0, 1); glVertex2f(-1, 1);
glEnd();
glPopMatrix();
glutSwapBuffers();
}
else {
/* Draw something tiny to ensure that the texture is really
* uploaded:
*/
glPushMatrix();
glRotatef(rot, 0, 0, 1);
glTranslatef(1, 0, 0);
glBegin(GL_POLYGON);
glTexCoord2f(0, 0); glVertex2f(-.01, -.01);
glTexCoord2f(.01, 0); glVertex2f( .01, -.01);
glTexCoord2f(.01, .01); glVertex2f( .01, .01);
glTexCoord2f(0, .01); glVertex2f(-.01, .01);
glEnd();
glPopMatrix();
glFlush();
}
iters++;
rot += 2.0;
t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
} while (t1 - t0 < 2.0);
/* Make sure everything is done before taking the final timing:
*/
glFinish();
t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
if (DrawQuad) {
glutSwapBuffers();
}
} while (t1 - t0 < 5.0);
glDisable(GL_TEXTURE_2D);
if (image)
@@ -270,15 +242,15 @@ Draw(void)
glutSwapBuffers();
}
RunTest(GL_FALSE, GL_FALSE);
RunTest(GL_FALSE, GL_TRUE);
RunTest(GL_TRUE, GL_FALSE);
RunTest(GL_FALSE, GL_FALSE);
RunTest(GL_FALSE, GL_TRUE);
RunTest(GL_TRUE, GL_FALSE);
RunTest(GL_TRUE, GL_TRUE);
glutSwapBuffers();
glutSwapBuffers();
/* printf("exiting\n"); */
/* exit(0); */
printf("exiting\n");
exit(0);
}

View File

@@ -97,7 +97,7 @@ static rawImageRec *RawImageOpen(const char *fileName)
swapFlag = GL_FALSE;
}
raw = (rawImageRec *)malloc(sizeof(rawImageRec));
raw = (rawImageRec *)calloc(1, sizeof(rawImageRec));
if (raw == NULL) {
fprintf(stderr, "Out of memory!\n");
return NULL;
@@ -148,12 +148,15 @@ static rawImageRec *RawImageOpen(const char *fileName)
static void RawImageClose(rawImageRec *raw)
{
fclose(raw->file);
free(raw->tmp);
free(raw->tmpR);
free(raw->tmpG);
free(raw->tmpB);
if (raw->rowStart)
free(raw->rowStart);
if (raw->rowSize)
free(raw->rowSize);
if (raw->sizeZ>3) {
free(raw->tmpA);
}

View File

@@ -11,7 +11,6 @@ LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME)
PROGS = glthreads \
glxdemo \
glxgears \
fgl_glxgears \
glxgears_fbconfig \
glxcontexts \
glxheads \

View File

@@ -23,6 +23,7 @@
/*
* This program tests GLX thread safety.
* Command line options:
* -p Open a display connection for each thread
* -n <num threads> Number of threads to create (default is 2)
* -display <display name> Specify X display (default is :0.0)
*
@@ -32,6 +33,7 @@
#if defined(PTHREADS) /* defined by Mesa on Linux and other platforms */
#include <assert.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include <stdio.h>
@@ -61,6 +63,10 @@ static struct winthread WinThreads[MAX_WINTHREADS];
static int NumWinThreads = 0;
static volatile GLboolean ExitFlag = GL_FALSE;
static GLboolean MultiDisplays = 0;
static GLboolean Locking = 0;
static pthread_mutex_t Mutex;
static void
@@ -145,9 +151,22 @@ resize(struct winthread *wt, int w, int h)
static void
draw_loop(struct winthread *wt)
{
GLboolean firstIter = GL_TRUE;
while (!ExitFlag) {
if (Locking)
pthread_mutex_lock(&Mutex);
glXMakeCurrent(wt->Dpy, wt->Win, wt->Context);
if (firstIter) {
printf("glthreads: %d: GL_RENDERER = %s\n", wt->Index,
(char *) glGetString(GL_RENDERER));
firstIter = GL_FALSE;
}
if (Locking)
pthread_mutex_unlock(&Mutex);
glEnable(GL_DEPTH_TEST);
@@ -172,8 +191,15 @@ draw_loop(struct winthread *wt)
draw_object();
glPopMatrix();
if (Locking)
pthread_mutex_lock(&Mutex);
glXSwapBuffers(wt->Dpy, wt->Win);
if (Locking)
pthread_mutex_unlock(&Mutex);
usleep(5000);
wt->Angle += 1.0;
}
}
@@ -181,6 +207,7 @@ draw_loop(struct winthread *wt)
/*
* The main process thread runs this loop.
* Single display connection for all threads.
*/
static void
event_loop(Display *dpy)
@@ -188,8 +215,28 @@ event_loop(Display *dpy)
XEvent event;
int i;
assert(!MultiDisplays);
while (!ExitFlag) {
XNextEvent(dpy, &event);
if (Locking) {
while (1) {
int k;
pthread_mutex_lock(&Mutex);
k = XPending(dpy);
if (k) {
XNextEvent(dpy, &event);
pthread_mutex_unlock(&Mutex);
break;
}
pthread_mutex_unlock(&Mutex);
usleep(5000);
}
}
else {
XNextEvent(dpy, &event);
}
switch (event.type) {
case ConfigureNotify:
/* Find winthread for this event's window */
@@ -214,6 +261,41 @@ event_loop(Display *dpy)
}
/*
* Separate display connection for each thread.
*/
static void
event_loop_multi(void)
{
XEvent event;
int w = 0;
assert(MultiDisplays);
while (!ExitFlag) {
struct winthread *wt = &WinThreads[w];
if (XPending(wt->Dpy)) {
XNextEvent(wt->Dpy, &event);
switch (event.type) {
case ConfigureNotify:
resize(wt, event.xconfigure.width, event.xconfigure.height);
break;
case KeyPress:
/* tell all threads to exit */
ExitFlag = GL_TRUE;
/*printf("exit draw_loop %d\n", wt->Index);*/
return;
default:
/*no-op*/ ;
}
}
w = (w + 1) % NumWinThreads;
usleep(5000);
}
}
/*
* we'll call this once for each thread, before the threads are created.
*/
@@ -329,14 +411,14 @@ main(int argc, char *argv[])
{
char *displayName = ":0.0";
int numThreads = 2;
Display *dpy;
Display *dpy = NULL;
int i;
Status threadStat;
if (argc == 1) {
printf("threadgl: test of GL thread safety (any key = exit)\n");
printf("glthreads: test of GL thread safety (any key = exit)\n");
printf("Usage:\n");
printf(" threadgl [-display dpyName] [-n numthreads]\n");
printf(" glthreads [-display dpyName] [-n numthreads]\n");
}
else {
int i;
@@ -345,6 +427,12 @@ main(int argc, char *argv[])
displayName = argv[i + 1];
i++;
}
else if (strcmp(argv[i], "-p") == 0) {
MultiDisplays = 1;
}
else if (strcmp(argv[i], "-l") == 0) {
Locking = 1;
}
else if (strcmp(argv[i], "-n") == 0 && i + 1 < argc) {
numThreads = atoi(argv[i + 1]);
if (numThreads < 1)
@@ -353,48 +441,88 @@ main(int argc, char *argv[])
numThreads = MAX_WINTHREADS;
i++;
}
else {
fprintf(stderr, "glthreads: unexpected flag: %s\n", argv[i]);
}
}
}
if (Locking)
printf("glthreads: Using explict locks around Xlib calls.\n");
else
printf("glthreads: No explict locking.\n");
if (MultiDisplays)
printf("glthreads: Per-thread display connections.\n");
else
printf("glthreads: Single display connection.\n");
/*
* VERY IMPORTANT: call XInitThreads() before any other Xlib functions.
*/
threadStat = XInitThreads();
if (threadStat) {
printf("XInitThreads() returned %d (success)\n", (int) threadStat);
}
else {
printf("XInitThreads() returned 0 (failure- this program may fail)\n");
if (!MultiDisplays) {
if (!Locking) {
threadStat = XInitThreads();
if (threadStat) {
printf("XInitThreads() returned %d (success)\n", (int) threadStat);
}
else {
printf("XInitThreads() returned 0 (failure- this program may fail)\n");
}
}
dpy = XOpenDisplay(displayName);
if (!dpy) {
fprintf(stderr, "Unable to open display %s\n", displayName);
return -1;
}
}
dpy = XOpenDisplay(displayName);
if (!dpy) {
fprintf(stderr, "Unable to open display %s\n", displayName);
return -1;
if (Locking) {
pthread_mutex_init(&Mutex, NULL);
}
printf("glthreads: creating windows\n");
NumWinThreads = numThreads;
/* Create the GLX windows and contexts */
for (i = 0; i < numThreads; i++) {
WinThreads[i].Dpy = dpy;
if (MultiDisplays) {
WinThreads[i].Dpy = XOpenDisplay(displayName);
assert(WinThreads[i].Dpy);
}
else {
WinThreads[i].Dpy = dpy;
}
WinThreads[i].Index = i;
create_window(&WinThreads[i]);
}
printf("glthreads: creating threads\n");
/* Create the threads */
for (i = 0; i < numThreads; i++) {
pthread_create(&WinThreads[i].Thread, NULL, thread_function,
(void*) &WinThreads[i]);
printf("Created Thread %d\n", (int) WinThreads[i].Thread);
printf("glthreads: Created thread %u\n", (unsigned int) WinThreads[i].Thread);
}
event_loop(dpy);
if (MultiDisplays)
event_loop_multi();
else
event_loop(dpy);
clean_up();
XCloseDisplay(dpy);
if (MultiDisplays) {
for (i = 0; i < numThreads; i++) {
XCloseDisplay(WinThreads[i].Dpy);
}
}
else {
XCloseDisplay(dpy);
}
return 0;
}

View File

@@ -262,6 +262,7 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect );
if (!ctx) {
fprintf(stderr, "Error: glXCreateContext failed\n");
XFree(visinfo);
XDestroyWindow(dpy, win);
return;
}
@@ -336,6 +337,7 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
}
glXDestroyContext(dpy, ctx);
XFree(visinfo);
XDestroyWindow(dpy, win);
}

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "eglcontext.h"
#include "egldisplay.h"
@@ -346,6 +347,7 @@ void (* APIENTRY eglGetProcAddress(const char *procname))()
{ "eglWaitGL", (_EGLProc) eglWaitGL },
{ "eglWaitNative", (_EGLProc) eglWaitNative },
/* Extensions */
#ifdef EGL_MESA_screen_surface
{ "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA },
{ "eglGetModesMESA", (_EGLProc) eglGetModesMESA },
{ "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA },
@@ -358,6 +360,14 @@ void (* APIENTRY eglGetProcAddress(const char *procname))()
{ "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA },
{ "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA },
{ "eglQueryModeStringMESA", (_EGLProc) eglQueryModeStringMESA },
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_VERSION_1_2
{ "eglBindAPI", (_EGLProc) eglBindAPI },
{ "eglCreatePbufferFromClientBuffer", (_EGLProc) eglCreatePbufferFromClientBuffer },
{ "eglQueryAPI", (_EGLProc) eglQueryAPI },
{ "eglReleaseThread", (_EGLProc) eglReleaseThread },
{ "eglWaitClient", (_EGLProc) eglWaitClient },
#endif /* EGL_VERSION_1_2 */
{ NULL, NULL }
};
EGLint i;
@@ -492,6 +502,85 @@ eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
}
/**
** EGL 1.2
**/
#ifdef EGL_VERSION_1_2
EGLBoolean
eglBindAPI(EGLenum api)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
switch (api) {
case EGL_OPENGL_ES_API:
if (_eglGlobal.OpenGLESAPISupported) {
t->CurrentAPI = api;
return EGL_TRUE;
}
_eglError(EGL_BAD_PARAMETER, "eglBindAPI");
return EGL_FALSE;
case EGL_OPENVG_API:
if (_eglGlobal.OpenVGAPISupported) {
t->CurrentAPI = api;
return EGL_TRUE;
}
_eglError(EGL_BAD_PARAMETER, "eglBindAPI");
return EGL_FALSE;
default:
return EGL_FALSE;
}
return EGL_TRUE;
}
EGLSurface
eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
EGLClientBuffer buffer, EGLConfig config,
const EGLint *attrib_list)
{
_EGLDriver *drv = _eglLookupDriver(dpy);
return drv->API.CreatePbufferFromClientBuffer(drv, dpy, buftype, buffer,
config, attrib_list);
}
EGLenum
eglQueryAPI(void)
{
/* returns one of EGL_OPENGL_ES_API or EGL_OPENVG_API */
_EGLThreadInfo *t = _eglGetCurrentThread();
return t->CurrentAPI;
}
EGLBoolean
eglReleaseThread(void)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
EGLDisplay dpy = eglGetCurrentDisplay();
if (dpy) {
_EGLDriver *drv = _eglLookupDriver(dpy);
/* unbind context */
(void) drv->API.MakeCurrent(drv, dpy, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);
}
_eglDeleteThreadData(t);
return EGL_TRUE;
}
EGLBoolean
eglWaitClient(void)
{
EGLDisplay dpy = eglGetCurrentDisplay();
if (dpy != EGL_NO_DISPLAY) {
_EGLDriver *drv = _eglLookupDriver(dpy);
return drv->API.WaitClient(drv, dpy);
}
else
return EGL_FALSE;
}
#endif /* EGL_VERSION_1_2 */

View File

@@ -40,7 +40,7 @@ typedef EGLBoolean (*WaitGL_t)(_EGLDriver *drv, EGLDisplay dpy);
typedef EGLBoolean (*WaitNative_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint engine);
/* EGL_MESA_screen extension */
#ifdef EGL_MESA_screen_surface
typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode);
typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
@@ -53,6 +53,14 @@ typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScre
typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
typedef const char * (*QueryModeStringMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode);
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_VERSION_1_2
typedef EGLBoolean (*WaitClient_t)(_EGLDriver *drv, EGLDisplay dpy);
typedef EGLSurface (*CreatePbufferFromClientBuffer_t)(_EGLDriver *drv, EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
#endif /* EGL_VERSION_1_2 */
/**
@@ -101,6 +109,11 @@ struct _egl_api
QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA;
QueryScreenModeMESA_t QueryScreenModeMESA;
QueryModeStringMESA_t QueryModeStringMESA;
#ifdef EGL_VERSION_1_2
WaitClient_t WaitClient;
CreatePbufferFromClientBuffer_t CreatePbufferFromClientBuffer;
#endif
};
#endif /* EGLAPI_INCLUDED */

View File

@@ -92,6 +92,10 @@ _eglInitConfig(_EGLConfig *config, EGLint id)
_eglSetConfigAttrib(config, EGL_TRANSPARENT_RED_VALUE, EGL_DONT_CARE);
_eglSetConfigAttrib(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE);
_eglSetConfigAttrib(config, EGL_TRANSPARENT_BLUE_VALUE, EGL_DONT_CARE);
#ifdef EGL_VERSION_1_2
_eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER);
_eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT);
#endif /* EGL_VERSION_1_2 */
}
@@ -153,13 +157,37 @@ _eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list)
}
for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
if (attrib_list[i] >= EGL_BUFFER_SIZE &&
attrib_list[i] <= EGL_MAX_SWAP_INTERVAL) {
EGLint k = attrib_list[i] - FIRST_ATTRIB;
const EGLint attr = attrib_list[i];
if (attr >= EGL_BUFFER_SIZE &&
attr <= EGL_MAX_SWAP_INTERVAL) {
EGLint k = attr - FIRST_ATTRIB;
assert(k >= 0);
assert(k < MAX_ATTRIBS);
config->Attrib[k] = attrib_list[++i];
}
#ifdef EGL_VERSION_1_2
else if (attr == EGL_COLOR_BUFFER_TYPE) {
EGLint bufType = attrib_list[++i];
if (bufType != EGL_RGB_BUFFER && bufType != EGL_LUMINANCE_BUFFER) {
_eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
return EGL_FALSE;
}
_eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, bufType);
}
else if (attr == EGL_RENDERABLE_TYPE) {
EGLint renType = attrib_list[++i];
if (renType & ~(EGL_OPENGL_ES_BIT | EGL_OPENVG_BIT)) {
_eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
return EGL_FALSE;
}
_eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, renType);
}
else if (attr == EGL_ALPHA_MASK_SIZE ||
attr == EGL_LUMINANCE_SIZE) {
EGLint value = attrib_list[++i];
_eglSetConfigAttrib(config, attr, value);
}
#endif /* EGL_VERSION_1_2 */
else {
_eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
return EGL_FALSE;
@@ -184,6 +212,8 @@ struct sort_info {
/* This encodes the info from Table 3.5 of the EGL spec, ordered by
* Sort Priority.
*
* XXX To do: EGL 1.2 attribs
*/
static struct sort_info SortInfo[] = {
{ EGL_CONFIG_CAVEAT, EXACT, SPECIAL },

View File

@@ -160,6 +160,11 @@ _eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx,
case EGL_CONFIG_ID:
*value = GET_CONFIG_ATTRIB(c->Config, EGL_CONFIG_ID);
return EGL_TRUE;
#ifdef EGL_VERSION_1_2
case EGL_CONTEXT_CLIENT_TYPE:
*value = c->ClientAPI;
return EGL_FALSE;
#endif /* EGL_VERSION_1_2 */
default:
_eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
return EGL_FALSE;

View File

@@ -22,6 +22,9 @@ struct _egl_context
EGLBoolean IsBound;
EGLBoolean DeletePending;
#ifdef EGL_VERSION_1_2
EGLint ClientAPI; /* Either EGL_OPENGL_ES_API or EGL_OPENVG_API */
#endif /* EGL_VERSION_1_2 */
};

View File

@@ -181,7 +181,7 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
drv->API.WaitGL = _eglWaitGL;
drv->API.WaitNative = _eglWaitNative;
/* EGL_MESA_screen */
#ifdef EGL_MESA_screen_surface
drv->API.ChooseModeMESA = _eglChooseModeMESA;
drv->API.GetModesMESA = _eglGetModesMESA;
drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
@@ -193,6 +193,11 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_VERSION_1_2
drv->API.CreatePbufferFromClientBuffer = _eglCreatePbufferFromClientBuffer;
#endif /* EGL_VERSION_1_2 */
}
@@ -227,6 +232,11 @@ _eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
case EGL_EXTENSIONS:
_eglUpdateExtensionsString(drv);
return drv->Extensions.String;
#ifdef EGL_VERSION_1_2
case EGL_CLIENT_APIS:
/* XXX need to initialize somewhere */
return drv->ClientAPIs;
#endif
default:
_eglError(EGL_BAD_PARAMETER, "eglQueryString");
return NULL;
@@ -250,6 +260,13 @@ _eglWaitNative(_EGLDriver *drv, EGLDisplay dpy, EGLint engine)
/* just a placeholder */
(void) drv;
(void) dpy;
(void) engine;
switch (engine) {
case EGL_CORE_NATIVE_ENGINE:
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglWaitNative(engine)");
return EGL_FALSE;
}
return EGL_TRUE;
}

View File

@@ -34,6 +34,7 @@ struct _egl_driver
int ABIversion;
int APImajor, APIminor; /* returned through eglInitialize */
const char *ClientAPIs;
_EGLAPI API;

View File

@@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include "eglglobals.h"
@@ -18,9 +19,12 @@ _eglInitGlobals(void)
_eglGlobal.Surfaces = _eglNewHashTable();
_eglGlobal.FreeScreenHandle = 1;
_eglGlobal.Initialized = EGL_TRUE;
_eglGlobal.OpenGLESAPISupported = EGL_TRUE;
_eglGlobal.OpenVGAPISupported = EGL_FALSE;
/* XXX temporary */
_eglGlobal.ThreadInfo.CurrentContext = EGL_NO_CONTEXT;
_eglGlobal.ThreadInfo.LastError = EGL_SUCCESS;
_eglGlobal.ThreadInfo = _eglNewThreadInfo();
}
}
@@ -38,6 +42,33 @@ _eglDestroyGlobals(void)
}
/**
* Allocate and init a new _EGLThreadInfo object.
*/
_EGLThreadInfo *
_eglNewThreadInfo(void)
{
_EGLThreadInfo *t = (_EGLThreadInfo *) calloc(1, sizeof(_EGLThreadInfo));
if (t) {
t->CurrentContext = EGL_NO_CONTEXT;
t->LastError = EGL_SUCCESS;
t->CurrentAPI = EGL_NONE;
}
return t;
}
/**
* Delete/free a _EGLThreadInfo object.
*/
void
_eglDeleteThreadData(_EGLThreadInfo *t)
{
free(t);
}
/**
* Return pointer to calling thread's _EGLThreadInfo object.
* Create a new one if needed.
@@ -46,8 +77,10 @@ _eglDestroyGlobals(void)
_EGLThreadInfo *
_eglGetCurrentThread(void)
{
_eglInitGlobals();
/* XXX temporary */
return &_eglGlobal.ThreadInfo;
return _eglGlobal.ThreadInfo;
}

View File

@@ -12,6 +12,7 @@ struct _egl_thread_info
{
EGLint LastError;
_EGLContext *CurrentContext;
EGLenum CurrentAPI;
};
@@ -28,8 +29,12 @@ struct _egl_global
EGLScreenMESA FreeScreenHandle;
/* XXX temporary */
_EGLThreadInfo ThreadInfo;
/* XXX these may be temporary */
EGLBoolean OpenGLESAPISupported;
EGLBoolean OpenVGAPISupported;
/* XXX temporary - should be thread-specific data (TSD) */
_EGLThreadInfo *ThreadInfo;
};
@@ -44,6 +49,14 @@ extern void
_eglDestroyGlobals(void);
extern _EGLThreadInfo *
_eglNewThreadInfo(void);
extern void
_eglDeleteThreadData(_EGLThreadInfo *t);
extern _EGLThreadInfo *
_eglGetCurrentThread(void);

View File

@@ -27,6 +27,11 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
_EGLConfig *conf;
EGLint width = 0, height = 0, largest = 0;
EGLint texFormat = 0, texTarget = 0, mipmapTex = 0;
EGLint renderBuffer = EGL_BACK_BUFFER;
#ifdef EGL_VERSION_1_2
EGLint colorspace = EGL_COLORSPACE_sRGB;
EGLint alphaFormat = EGL_ALPHA_FORMAT_NONPRE;
#endif
EGLint i;
switch (type) {
@@ -35,12 +40,14 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
break;
case EGL_PIXMAP_BIT:
func = "eglCreatePixmapSurface";
renderBuffer = EGL_SINGLE_BUFFER;
break;
case EGL_PBUFFER_BIT:
func = "eglCreatePBufferSurface";
break;
case EGL_SCREEN_BIT_MESA:
func = "eglCreateScreenSurface";
renderBuffer = EGL_SINGLE_BUFFER; /* XXX correct? */
break;
default:
_eglLog(_EGL_WARNING, "Bad type in _eglInitSurface");
@@ -113,6 +120,55 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
return EGL_FALSE;
}
break;
#ifdef EGL_VERSION_1_2
case EGL_RENDER_BUFFER:
if (type == EGL_WINDOW_BIT) {
renderBuffer = attrib_list[++i];
if (renderBuffer != EGL_BACK_BUFFER &&
renderBuffer != EGL_SINGLE_BUFFER) {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
}
else {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
break;
case EGL_COLORSPACE:
if (type == EGL_WINDOW_BIT ||
type == EGL_PBUFFER_BIT ||
type == EGL_PIXMAP_BIT) {
colorspace = attrib_list[++i];
if (colorspace != EGL_COLORSPACE_sRGB &&
colorspace != EGL_COLORSPACE_LINEAR) {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
}
else {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
break;
case EGL_ALPHA_FORMAT:
if (type == EGL_WINDOW_BIT ||
type == EGL_PBUFFER_BIT ||
type == EGL_PIXMAP_BIT) {
alphaFormat = attrib_list[++i];
if (alphaFormat != EGL_ALPHA_FORMAT_NONPRE &&
alphaFormat != EGL_ALPHA_FORMAT_PRE) {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
}
else {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
break;
#endif /* EGL_VERSION_1_2 */
default:
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
@@ -134,6 +190,15 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
surf->MipmapTexture = mipmapTex;
surf->MipmapLevel = 0;
surf->SwapInterval = 0;
#ifdef EGL_VERSION_1_2
surf->SwapBehavior = EGL_BUFFER_DESTROYED; /* XXX ok? */
surf->HorizontalResolution = EGL_UNKNOWN; /* set by caller */
surf->VerticalResolution = EGL_UNKNOWN; /* set by caller */
surf->AspectRatio = EGL_UNKNOWN; /* set by caller */
surf->RenderBuffer = renderBuffer;
surf->AlphaFormat = alphaFormat;
surf->Colorspace = colorspace;
#endif
return EGL_TRUE;
}
@@ -232,6 +297,11 @@ _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf,
case EGL_CONFIG_ID:
*value = GET_CONFIG_ATTRIB(surface->Config, EGL_CONFIG_ID);
return EGL_TRUE;
/*XXX case EGL_LARGEST_PBUFFER:*/
case EGL_SURFACE_TYPE:
*value = surface->Type;
return EGL_TRUE;
#ifdef EGL_VERSION_1_1
case EGL_TEXTURE_FORMAT:
/* texture attributes: only for pbuffers, no error otherwise */
if (surface->Type == EGL_PBUFFER_BIT)
@@ -249,9 +319,30 @@ _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf,
if (surface->Type == EGL_PBUFFER_BIT)
*value = surface->MipmapLevel;
return EGL_TRUE;
case EGL_SURFACE_TYPE:
*value = surface->Type;
#endif /* EGL_VERSION_1_1 */
#ifdef EGL_VERSION_1_2
case EGL_SWAP_BEHAVIOR:
*value = surface->SwapBehavior;
return EGL_TRUE;
case EGL_RENDER_BUFFER:
*value = surface->RenderBuffer;
return EGL_TRUE;
case EGL_PIXEL_ASPECT_RATIO:
*value = surface->AspectRatio;
return EGL_TRUE;
case EGL_HORIZONTAL_RESOLUTION:
*value = surface->HorizontalResolution;
return EGL_TRUE;
case EGL_VERTICAL_RESOLUTION:
*value = surface->VerticalResolution;
return EGL_TRUE;
case EGL_ALPHA_FORMAT:
*value = surface->AlphaFormat;
return EGL_TRUE;
case EGL_COLORSPACE:
*value = surface->Colorspace;
return EGL_TRUE;
#endif /* EGL_VERSION_1_2 */
default:
_eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
return EGL_FALSE;
@@ -416,3 +507,24 @@ _eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval)
surf->SwapInterval = interval;
return EGL_TRUE;
}
#ifdef EGL_VERSION_1_2
/**
* Example function - drivers should do a proper implementation.
*/
EGLSurface
_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
EGLenum buftype, EGLClientBuffer buffer,
EGLConfig config, const EGLint *attrib_list)
{
if (buftype != EGL_OPENVG_IMAGE) {
_eglError(EGL_BAD_PARAMETER, "eglCreatePbufferFromClientBuffer");
return EGL_NO_SURFACE;
}
return EGL_NO_SURFACE;
}
#endif /* EGL_VERSION_1_2 */

View File

@@ -25,6 +25,15 @@ struct _egl_surface
/* If type == EGL_SCREEN_BIT: */
EGLint VisibleRefCount; /* number of screens I'm displayed on */
#ifdef EGL_VERSION_1_2
EGLint SwapBehavior; /* one of EGL_BUFFER_PRESERVED/DESTROYED */
EGLint HorizontalResolution, VerticalResolution;
EGLint AspectRatio;
EGLint RenderBuffer; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */
EGLint AlphaFormat; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */
EGLint Colorspace; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */
#endif /* EGL_VERSION_1_2 */
};
@@ -94,4 +103,15 @@ extern EGLBoolean
_eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval);
#ifdef EGL_VERSION_1_2
extern EGLSurface
_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
EGLenum buftype, EGLClientBuffer buffer,
EGLConfig config, const EGLint *attrib_list);
#endif /* EGL_VERSION_1_2 */
#endif /* EGLSURFACE_INCLUDED */

View File

@@ -35,8 +35,8 @@
/*
* glcurveval.c++
*
* $Date: 2004/05/12 15:29:36 $ $Revision: 1.6 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.6 2004/05/12 15:29:36 brianp Exp $
* $Date: 2006/03/29 18:46:46 $ $Revision: 1.7 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.7 2006/03/29 18:46:46 brianp Exp $
*/
/* Polynomial Evaluator Interface */
@@ -74,6 +74,7 @@ OpenGLCurveEvaluator::OpenGLCurveEvaluator(void)
em_normal.uprime = -1.0;
em_color.uprime = -1.0;
em_texcoord.uprime = -1.0;
output_triangles = 0; // don't output triangles by default
}
OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void)

View File

@@ -35,28 +35,28 @@
/*
* mystdio.h
*
* $Date: 2001/03/19 17:52:02 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.3 2001/03/19 17:52:02 pesco Exp $
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.4 2006/03/14 15:08:52 brianp Exp $
*/
#ifndef __glumystdio_h_
#define __glumystdio_h_
#ifdef STANDALONE
inline void dprintf( char *, ... ) { }
inline void _glu_dprintf( char *, ... ) { }
#endif
#ifdef LIBRARYBUILD
#ifndef NDEBUG
#include <stdio.h>
#define dprintf printf
#define _glu_dprintf printf
#else
inline void dprintf( char *, ... ) { }
inline void _glu_dprintf( char *, ... ) { }
#endif
#endif
#ifdef GLBUILD
inline void dprintf( char *, ... ) { }
inline void _glu_dprintf( char *, ... ) { }
#endif
#ifndef NULL

View File

@@ -156,9 +156,9 @@ void
Arc::show()
{
#ifndef NDEBUG
dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
_glu_dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
for( int i = 0; i < pwlArc->npts; i++ ) {
dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
_glu_dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
pwlArc->pts[i].param[1] );
}
#endif
@@ -175,14 +175,14 @@ Arc::print( void )
Arc_ptr jarc = this;
#ifndef NDEBUG
dprintf( "BGNTRIM\n" );
_glu_dprintf( "BGNTRIM\n" );
#endif
do {
jarc->show( );
jarc = jarc->next;
} while (jarc != this);
#ifndef NDEBUG
dprintf("ENDTRIM\n" );
_glu_dprintf("ENDTRIM\n" );
#endif
}
@@ -203,8 +203,8 @@ Arc::isDisconnected( void )
if( ((p0[0] - p1[0]) > ZERO) || ((p1[0] - p0[0]) > ZERO) ||
((p0[1] - p1[1]) > ZERO) || ((p1[1] - p0[1]) > ZERO) ) {
#ifndef NDEBUG
dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
_glu_dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
_glu_dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
#endif
return 1;
} else {
@@ -244,7 +244,7 @@ Arc::check( void )
if (jarc->prev == 0 || jarc->next == 0) {
#ifndef NDEBUG
dprintf( "checkjarc:null next/prev pointer\n");
_glu_dprintf( "checkjarc:null next/prev pointer\n");
jarc->print( );
#endif
return 0;
@@ -252,7 +252,7 @@ Arc::check( void )
if (jarc->next->prev != jarc) {
#ifndef NDEBUG
dprintf( "checkjarc: pointer linkage screwed up\n");
_glu_dprintf( "checkjarc: pointer linkage screwed up\n");
jarc->print( );
#endif
return 0;
@@ -271,7 +271,7 @@ Arc::check( void )
if( jarc->prev->pwlArc ) {
if( jarc->tail()[1] != jarc->prev->rhead()[1] ) {
#ifndef NDEBUG
dprintf( "checkjarc: geometric linkage screwed up 1\n");
_glu_dprintf( "checkjarc: geometric linkage screwed up 1\n");
jarc->prev->show();
jarc->show();
#endif
@@ -280,7 +280,7 @@ Arc::check( void )
if( jarc->tail()[0] != jarc->prev->rhead()[0] ) {
#ifndef NDEBUG
dprintf( "checkjarc: geometric linkage screwed up 2\n");
_glu_dprintf( "checkjarc: geometric linkage screwed up 2\n");
jarc->prev->show();
jarc->show();
#endif
@@ -290,7 +290,7 @@ Arc::check( void )
if( jarc->next->pwlArc ) {
if( jarc->next->tail()[0] != jarc->rhead()[0] ) {
#ifndef NDEBUG
dprintf( "checkjarc: geometric linkage screwed up 3\n");
_glu_dprintf( "checkjarc: geometric linkage screwed up 3\n");
jarc->show();
jarc->next->show();
#endif
@@ -298,7 +298,7 @@ Arc::check( void )
}
if( jarc->next->tail()[1] != jarc->rhead()[1] ) {
#ifndef NDEBUG
dprintf( "checkjarc: geometric linkage screwed up 4\n");
_glu_dprintf( "checkjarc: geometric linkage screwed up 4\n");
jarc->show();
jarc->next->show();
#endif

View File

@@ -35,8 +35,8 @@
/*
* arcsorter.c++
*
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
*/
#ifndef __gluarcsorter_c_
@@ -54,7 +54,7 @@ ArcSorter::ArcSorter(Subdivider &s) : Sorter( sizeof( Arc ** ) ), subdivider(s)
int
ArcSorter::qscmp( char *, char * )
{
dprintf( "ArcSorter::qscmp: pure virtual called\n" );
_glu_dprintf( "ArcSorter::qscmp: pure virtual called\n" );
return 0;
}

View File

@@ -335,7 +335,7 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps
REAL min_u, min_v, max_u,max_v;
min_u = max_u = bezierArc->cpts[0];
min_v = max_v = bezierArc->cpts[1];
for(i=1, j=2; i<bezierArc->order; i++, j+= bezierArc->stride)
for(i=1, j=bezierArc->stride; i<bezierArc->order; i++, j+= bezierArc->stride)
{
if(bezierArc->cpts[j] < min_u)
min_u = bezierArc->cpts[j];

View File

@@ -45,7 +45,7 @@ void
BasicCurveEvaluator::domain1f( REAL, REAL )
{
#ifndef NDEBUG
dprintf( "domain1f\n" );
_glu_dprintf( "domain1f\n" );
#endif
}
@@ -53,7 +53,7 @@ void
BasicCurveEvaluator::range1f( long , REAL *, REAL * )
{
#ifndef NDEBUG
dprintf( "range1f\n" );
_glu_dprintf( "range1f\n" );
#endif
}
@@ -61,7 +61,7 @@ void
BasicCurveEvaluator::enable( long )
{
#ifndef NDEBUG
dprintf( "enable\n" );
_glu_dprintf( "enable\n" );
#endif
}
@@ -69,7 +69,7 @@ void
BasicCurveEvaluator::disable( long )
{
#ifndef NDEBUG
dprintf( "disable\n" );
_glu_dprintf( "disable\n" );
#endif
}
@@ -77,7 +77,7 @@ void
BasicCurveEvaluator::bgnmap1f( long )
{
#ifndef NDEBUG
dprintf( "bgnmap1f\n" );
_glu_dprintf( "bgnmap1f\n" );
#endif
}
@@ -85,7 +85,7 @@ void
BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * )
{
#ifndef NDEBUG
dprintf( "map1f\n" );
_glu_dprintf( "map1f\n" );
#endif
}
@@ -93,7 +93,7 @@ void
BasicCurveEvaluator::mapgrid1f( long, REAL, REAL )
{
#ifndef NDEBUG
dprintf( "mapgrid1f\n" );
_glu_dprintf( "mapgrid1f\n" );
#endif
}
@@ -101,7 +101,7 @@ void
BasicCurveEvaluator::mapmesh1f( long, long, long )
{
#ifndef NDEBUG
dprintf( "mapmesh1f\n" );
_glu_dprintf( "mapmesh1f\n" );
#endif
}
@@ -109,7 +109,7 @@ void
BasicCurveEvaluator::evalcoord1f( long, REAL )
{
#ifndef NDEBUG
dprintf( "evalcoord1f\n" );
_glu_dprintf( "evalcoord1f\n" );
#endif
}
@@ -117,7 +117,7 @@ void
BasicCurveEvaluator::endmap1f( void )
{
#ifndef NDEBUG
dprintf( "endmap1f\n" );
_glu_dprintf( "endmap1f\n" );
#endif
}
@@ -125,7 +125,7 @@ void
BasicCurveEvaluator::bgnline( void )
{
#ifndef NDEBUG
dprintf( "bgnline\n" );
_glu_dprintf( "bgnline\n" );
#endif
}
@@ -133,6 +133,6 @@ void
BasicCurveEvaluator::endline( void )
{
#ifndef NDEBUG
dprintf( "endline\n" );
_glu_dprintf( "endline\n" );
#endif
}

View File

@@ -35,8 +35,8 @@
/*
* basiccurveeval.h
*
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
*/
#ifndef __glubasiccrveval_h_
@@ -48,6 +48,7 @@
class BasicCurveEvaluator : public CachingEvaluator {
public:
virtual ~BasicCurveEvaluator() { /* silence warning*/ }
virtual void domain1f( REAL, REAL );
virtual void range1f( long, REAL *, REAL * );

View File

@@ -49,7 +49,7 @@ void
BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL )
{
#ifndef NDEBUG
dprintf( "domain2f\n" );
_glu_dprintf( "domain2f\n" );
#endif
}
@@ -57,7 +57,7 @@ void
BasicSurfaceEvaluator::polymode( long )
{
#ifndef NDEBUG
dprintf( "polymode\n" );
_glu_dprintf( "polymode\n" );
#endif
}
@@ -65,7 +65,7 @@ void
BasicSurfaceEvaluator::range2f( long type, REAL *from, REAL *to )
{
#ifndef NDEBUG
dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
_glu_dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
type, from[0], from[1], to[0], to[1] );
#endif
}
@@ -74,7 +74,7 @@ void
BasicSurfaceEvaluator::enable( long )
{
#ifndef NDEBUG
dprintf( "enable\n" );
_glu_dprintf( "enable\n" );
#endif
}
@@ -82,7 +82,7 @@ void
BasicSurfaceEvaluator::disable( long )
{
#ifndef NDEBUG
dprintf( "disable\n" );
_glu_dprintf( "disable\n" );
#endif
}
@@ -90,7 +90,7 @@ void
BasicSurfaceEvaluator::bgnmap2f( long )
{
#ifndef NDEBUG
dprintf( "bgnmap2f\n" );
_glu_dprintf( "bgnmap2f\n" );
#endif
}
@@ -98,7 +98,7 @@ void
BasicSurfaceEvaluator::endmap2f( void )
{
#ifndef NDEBUG
dprintf( "endmap2f\n" );
_glu_dprintf( "endmap2f\n" );
#endif
}
@@ -108,7 +108,7 @@ BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long,
REAL * )
{
#ifndef NDEBUG
dprintf( "map2f\n" );
_glu_dprintf( "map2f\n" );
#endif
}
@@ -116,7 +116,7 @@ void
BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL )
{
#ifndef NDEBUG
dprintf( "mapgrid2f\n" );
_glu_dprintf( "mapgrid2f\n" );
#endif
}
@@ -124,7 +124,7 @@ void
BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long )
{
#ifndef NDEBUG
dprintf( "mapmesh2f\n" );
_glu_dprintf( "mapmesh2f\n" );
#endif
}
@@ -132,7 +132,7 @@ void
BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL )
{
#ifndef NDEBUG
dprintf( "evalcoord2f\n" );
_glu_dprintf( "evalcoord2f\n" );
#endif
}
@@ -140,7 +140,7 @@ void
BasicSurfaceEvaluator::evalpoint2i( long, long )
{
#ifndef NDEBUG
dprintf( "evalpoint2i\n" );
_glu_dprintf( "evalpoint2i\n" );
#endif
}
@@ -148,7 +148,7 @@ void
BasicSurfaceEvaluator::bgnline( void )
{
#ifndef NDEBUG
dprintf( "bgnline\n" );
_glu_dprintf( "bgnline\n" );
#endif
}
@@ -156,7 +156,7 @@ void
BasicSurfaceEvaluator::endline( void )
{
#ifndef NDEBUG
dprintf( "endline\n" );
_glu_dprintf( "endline\n" );
#endif
}
@@ -164,7 +164,7 @@ void
BasicSurfaceEvaluator::bgnclosedline( void )
{
#ifndef NDEBUG
dprintf( "bgnclosedline\n" );
_glu_dprintf( "bgnclosedline\n" );
#endif
}
@@ -172,7 +172,7 @@ void
BasicSurfaceEvaluator::endclosedline( void )
{
#ifndef NDEBUG
dprintf( "endclosedline\n" );
_glu_dprintf( "endclosedline\n" );
#endif
}
@@ -180,7 +180,7 @@ void
BasicSurfaceEvaluator::bgntfan( void )
{
#ifndef NDEBUG
dprintf( "bgntfan\n" );
_glu_dprintf( "bgntfan\n" );
#endif
}
@@ -194,7 +194,7 @@ void
BasicSurfaceEvaluator::bgntmesh( void )
{
#ifndef NDEBUG
dprintf( "bgntmesh\n" );
_glu_dprintf( "bgntmesh\n" );
#endif
}
@@ -202,7 +202,7 @@ void
BasicSurfaceEvaluator::swaptmesh( void )
{
#ifndef NDEBUG
dprintf( "swaptmesh\n" );
_glu_dprintf( "swaptmesh\n" );
#endif
}
@@ -210,7 +210,7 @@ void
BasicSurfaceEvaluator::endtmesh( void )
{
#ifndef NDEBUG
dprintf( "endtmesh\n" );
_glu_dprintf( "endtmesh\n" );
#endif
}
@@ -218,7 +218,7 @@ void
BasicSurfaceEvaluator::bgnqstrip( void )
{
#ifndef NDEBUG
dprintf( "bgnqstrip\n" );
_glu_dprintf( "bgnqstrip\n" );
#endif
}
@@ -226,7 +226,7 @@ void
BasicSurfaceEvaluator::endqstrip( void )
{
#ifndef NDEBUG
dprintf( "endqstrip\n" );
_glu_dprintf( "endqstrip\n" );
#endif
}

View File

@@ -35,8 +35,8 @@
/*
* basicsurfeval.h
*
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
*/
#ifndef __glubasicsurfeval_h_
@@ -48,6 +48,7 @@
class BasicSurfaceEvaluator : public CachingEvaluator {
public:
virtual ~BasicSurfaceEvaluator() { /* silence warning*/ }
virtual void range2f( long, REAL *, REAL * );
virtual void domain2f( REAL, REAL, REAL, REAL );

View File

@@ -35,8 +35,8 @@
/*
* bin.c++
*
* $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
*/
#include "glimports.h"
@@ -123,7 +123,7 @@ void
Bin::show( char *name )
{
#ifndef NDEBUG
dprintf( "%s\n", name );
_glu_dprintf( "%s\n", name );
for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
jarc->show( );
#endif
@@ -160,7 +160,7 @@ Bin::listBezier( void )
REAL t1 = pts[0].param[1];
REAL s2 = pts[1].param[0];
REAL t2 = pts[1].param[1];
dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
_glu_dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
#endif
}
}

View File

@@ -35,8 +35,8 @@
/*
* bufpool.h
*
* $Date: 2001/03/22 11:38:36 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.2 2001/03/22 11:38:36 joukj Exp $
* $Date: 2006/03/29 18:46:46 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.3 2006/03/29 18:46:46 brianp Exp $
*/
#ifndef __glubufpool_h_
@@ -128,6 +128,7 @@ public:
inline void * operator new( size_t s)
{ return ::new char[s]; }
inline void operator delete( void * ) { assert( 0 ); }
inline void operator delete( void *, Pool & ) { assert( 0 ); }
inline void deleteMe( Pool & );
};

View File

@@ -35,8 +35,8 @@
/*
* cachingeval.h
*
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
*/
#ifndef __glucachingval_h_
@@ -44,6 +44,7 @@
class CachingEvaluator {
public:
virtual ~CachingEvaluator() { /* silence warning*/ }
enum ServiceMode { play, record, playAndRecord };
virtual int canRecord( void );
virtual int canPlayAndRecord( void );

View File

@@ -35,8 +35,8 @@
/*
* ccw.c++
*
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
*/
#include "glimports.h"
@@ -70,7 +70,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
assert( v2 != v2last );
#ifndef NDEBUG
dprintf( "arc_ccw_turn, p = %d\n", 0 );
_glu_dprintf( "arc_ccw_turn, p = %d\n", 0 );
#endif
// the arcs lie on the line (0 == v1->param[0])
@@ -88,7 +88,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
while( 1 ) {
if( v1next->param[0] < v2next->param[0] ) {
#ifndef NDEBUG
dprintf( "case a\n" );
_glu_dprintf( "case a\n" );
#endif
assert( v1->param[0] <= v1next->param[0] );
assert( v2->param[0] <= v1next->param[0] );
@@ -101,12 +101,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return sgn;
} else {
#ifdef DEBUG
dprintf( "decr\n" );
_glu_dprintf( "decr\n" );
#endif
v1 = v1next--;
if( v1 == v1last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -117,7 +117,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
}
} else if( v1next->param[0] > v2next->param[0] ) {
#ifndef NDEBUG
dprintf( "case b\n" );
_glu_dprintf( "case b\n" );
#endif
assert( v1->param[0] <= v2next->param[0] );
assert( v2->param[0] <= v2next->param[0] );
@@ -130,12 +130,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return sgn;
} else {
#ifdef DEBUG
dprintf( "incr\n" );
_glu_dprintf( "incr\n" );
#endif
v2 = v2next++;
if( v2 == v2last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -146,7 +146,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
}
} else {
#ifndef NDEBUG
dprintf( "case ab\n" );
_glu_dprintf( "case ab\n" );
#endif
if( v1next->param[1] < v2next->param[1] )
return 0;
@@ -154,12 +154,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return 1;
else {
#ifdef DEBUG
dprintf( "incr\n" );
_glu_dprintf( "incr\n" );
#endif
v2 = v2next++;
if( v2 == v2last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -183,7 +183,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
assert( v2 != v2last );
#ifndef NDEBUG
dprintf( "arc_ccw_turn, p = %d\n", 0 );
_glu_dprintf( "arc_ccw_turn, p = %d\n", 0 );
#endif
// the arcs lie on the line (0 == v1->param[0])
@@ -201,7 +201,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
while( 1 ) {
if( v1next->param[0] > v2next->param[0] ) {
#ifndef NDEBUG
dprintf( "case c\n" );
_glu_dprintf( "case c\n" );
#endif
assert( v1->param[0] >= v1next->param[0] );
assert( v2->param[0] >= v1next->param[0] );
@@ -215,11 +215,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
else {
v1 = v1next--;
#ifdef DEBUG
dprintf( "decr\n" );
_glu_dprintf( "decr\n" );
#endif
if( v1 == v1last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -230,7 +230,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
}
} else if( v1next->param[0] < v2next->param[0] ) {
#ifndef NDEBUG
dprintf( "case d\n" );
_glu_dprintf( "case d\n" );
#endif
assert( v1->param[0] >= v2next->param[0] );
assert( v2->param[0] >= v2next->param[0] );
@@ -244,11 +244,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
else {
v2 = v2next++;
#ifdef DEBUG
dprintf( "incr\n" );
_glu_dprintf( "incr\n" );
#endif
if( v2 == v2last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -259,7 +259,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
}
} else {
#ifdef DEBUG
dprintf( "case cd\n" );
_glu_dprintf( "case cd\n" );
#endif
if( v1next->param[1] < v2next->param[1] )
return 1;
@@ -268,11 +268,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
else {
v2 = v2next++;
#ifdef DEBUG
dprintf( "incr\n" );
_glu_dprintf( "incr\n" );
#endif
if( v2 == v2last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -296,7 +296,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
assert( v2 != v2last );
#ifndef NDEBUG
dprintf( "arc_ccw_turn, p = %d\n", 1 );
_glu_dprintf( "arc_ccw_turn, p = %d\n", 1 );
#endif
// the arcs lie on the line (1 == v1->param[1])
@@ -314,7 +314,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
while( 1 ) {
if( v1next->param[1] < v2next->param[1] ) {
#ifndef NDEBUG
dprintf( "case a\n" );
_glu_dprintf( "case a\n" );
#endif
assert( v1->param[1] <= v1next->param[1] );
assert( v2->param[1] <= v1next->param[1] );
@@ -327,12 +327,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return sgn;
} else {
#ifdef DEBUG
dprintf( "decr\n" );
_glu_dprintf( "decr\n" );
#endif
v1 = v1next--;
if( v1 == v1last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -343,7 +343,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
}
} else if( v1next->param[1] > v2next->param[1] ) {
#ifndef NDEBUG
dprintf( "case b\n" );
_glu_dprintf( "case b\n" );
#endif
assert( v1->param[1] <= v2next->param[1] );
assert( v2->param[1] <= v2next->param[1] );
@@ -356,12 +356,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return sgn;
} else {
#ifdef DEBUG
dprintf( "incr\n" );
_glu_dprintf( "incr\n" );
#endif
v2 = v2next++;
if( v2 == v2last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -372,7 +372,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
}
} else {
#ifdef DEBUG
dprintf( "case ab\n" );
_glu_dprintf( "case ab\n" );
#endif
if( v1next->param[0] < v2next->param[0] )
return 1;
@@ -380,12 +380,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return 0;
else {
#ifdef DEBUG
dprintf( "incr\n" );
_glu_dprintf( "incr\n" );
#endif
v2 = v2next++;
if( v2 == v2last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -409,7 +409,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
assert( v2 != v2last );
#ifndef NDEBUG
dprintf( "arc_ccw_turn, p = %d\n", 1 );
_glu_dprintf( "arc_ccw_turn, p = %d\n", 1 );
#endif
// the arcs lie on the line (1 == v1->param[1])
@@ -427,7 +427,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
while( 1 ) {
if( v1next->param[1] > v2next->param[1] ) {
#ifndef NDEBUG
dprintf( "case c\n" );
_glu_dprintf( "case c\n" );
#endif
assert( v1->param[1] >= v1next->param[1] );
assert( v2->param[1] >= v1next->param[1] );
@@ -441,11 +441,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
else {
v1 = v1next--;
#ifdef DEBUG
dprintf( "decr\n" );
_glu_dprintf( "decr\n" );
#endif
if( v1 == v1last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -456,7 +456,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
}
} else if( v1next->param[1] < v2next->param[1] ) {
#ifndef NDEBUG
dprintf( "case d\n" );
_glu_dprintf( "case d\n" );
assert( v1->param[1] >= v2next->param[1] );
assert( v2->param[1] >= v2next->param[1] );
#endif
@@ -470,11 +470,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
else {
v2 = v2next++;
#ifdef DEBUG
dprintf( "incr\n" );
_glu_dprintf( "incr\n" );
#endif
if( v2 == v2last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -485,7 +485,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
}
} else {
#ifdef DEBUG
dprintf( "case cd\n" );
_glu_dprintf( "case cd\n" );
#endif
if( v1next->param[0] < v2next->param[0] )
return 0;
@@ -494,11 +494,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
else {
v2 = v2next++;
#ifdef DEBUG
dprintf( "incr\n" );
_glu_dprintf( "incr\n" );
#endif
if( v2 == v2last ) {
#ifdef DEBUG
dprintf( "no good results\n" );
_glu_dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}

View File

@@ -35,8 +35,8 @@
/*
* flistsorter.h
*
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
*/
#ifndef __gluflistsorter_h_
@@ -48,6 +48,7 @@
class FlistSorter : public Sorter {
public:
FlistSorter(void);
virtual ~FlistSorter() { /* silence warning*/ }
void qsort( REAL *a, int n );
protected:

View File

@@ -129,11 +129,11 @@ int Knotvector::validate( void )
void Knotvector::show( char *msg )
{
#ifndef NDEBUG
dprintf( "%s\n", msg );
dprintf( "order = %ld, count = %ld\n", order, knotcount );
_glu_dprintf( "%s\n", msg );
_glu_dprintf( "order = %ld, count = %ld\n", order, knotcount );
for( int i=0; i<knotcount; i++ )
dprintf( "knot[%d] = %g\n", i, knotlist[i] );
_glu_dprintf( "knot[%d] = %g\n", i, knotlist[i] );
#endif
}

View File

@@ -232,7 +232,7 @@ NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long t
}
if( i != count ) {
do_nurbserror( 37 );
dprintf( "point %d (%f,%f)\n", i, x, y );
_glu_dprintf( "point %d (%f,%f)\n", i, x, y );
isDataValid = 0;
return;
}
@@ -247,7 +247,7 @@ NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long t
}
if( i != count ) {
do_nurbserror( 37 );
dprintf( "point %d (%f,%f)\n", i, x, y );
_glu_dprintf( "point %d (%f,%f)\n", i, x, y );
isDataValid = 0;
return;
}
@@ -460,7 +460,7 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat )
mapdesc->setBboxsize( mat );
} else {
#ifndef NDEBUG
dprintf( "ERRORRORRORR!!!\n");
_glu_dprintf( "ERRORRORRORR!!!\n");
#endif
}
}
@@ -488,7 +488,7 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat,
mapdesc->setBmat( mat, rstride, cstride );
} else {
#ifndef NDEBUG
dprintf( "ERRORRORRORR!!!\n");
_glu_dprintf( "ERRORRORRORR!!!\n");
#endif
}
}

View File

@@ -35,8 +35,8 @@
/*
* nurbstess.c++
*
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
*/
#include "glimports.h"
@@ -79,7 +79,7 @@ void
NurbsTessellator::makeobj( int )
{
#ifndef NDEBUG
dprintf( "makeobj\n" );
_glu_dprintf( "makeobj\n" );
#endif
}
@@ -87,7 +87,7 @@ void
NurbsTessellator::closeobj( void )
{
#ifndef NDEBUG
dprintf( "closeobj\n" );
_glu_dprintf( "closeobj\n" );
#endif
}
@@ -95,7 +95,7 @@ void
NurbsTessellator::bgnrender( void )
{
#ifndef NDEBUG
dprintf( "bgnrender\n" );
_glu_dprintf( "bgnrender\n" );
#endif
}
@@ -103,7 +103,7 @@ void
NurbsTessellator::endrender( void )
{
#ifndef NDEBUG
dprintf( "endrender\n" );
_glu_dprintf( "endrender\n" );
#endif
}

View File

@@ -35,8 +35,8 @@
/*
* patch.c++
*
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.3 2002/11/01 23:35:07 brianp Exp $
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.4 2006/03/14 15:08:52 brianp Exp $
*/
#include <stdio.h>
@@ -439,7 +439,7 @@ Patch::getstepsize( void )
}
#ifdef DEBUG
dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
_glu_dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
pspec[0].sidestep[0], pspec[0].sidestep[1],
pspec[1].sidestep[0], pspec[1].sidestep[1],
pspec[0].stepsize, pspec[1].stepsize );

View File

@@ -35,8 +35,8 @@
/*
* quilt.c++
*
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
*/
#include "glimports.h"
@@ -91,12 +91,12 @@ Quilt::show( void )
for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) {
for( int j = 0; j!= qspec[1].order * qspec[1].width; j++ ) {
for( int k=0; k < nc; k++ )
dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
dprintf( "\n" );
_glu_dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
_glu_dprintf( "\n" );
}
dprintf( "\n" );
_glu_dprintf( "\n" );
}
dprintf( "\n" );
_glu_dprintf( "\n" );
#endif
}

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