Compare commits

...

2274 Commits

Author SHA1 Message Date
Brice Goglin
adcbe9af69 Prepare changelog for upload 2010-01-27 09:14:43 +01:00
Brice Goglin
527f2433fc New upstream snapshot 2010-01-27 09:14:16 +01:00
Brice Goglin
81f129113a Merge branch 'mesa_7_7_branch' of git://anongit.freedesktop.org/mesa/mesa into debian-experimental
Conflicts:
	progs/tests/getprocaddress.c
	progs/tests/vparray.c
	progs/trivial/tri-fbo-tex-mip.c
	progs/trivial/tri-fbo-tex.c
	scons/gallium.py
2010-01-27 09:12:04 +01:00
Brice Goglin
9abcffc1c6 Merge branch 'debian-unstable' into debian-experimental
Conflicts:
	debian/changelog
2010-01-27 09:09:36 +01:00
Dave Airlie
2f28ca0a27 radeon/r200/r300: don't clean non-emitted state.
So if we don't actually emit an atom to the hw because we don't
need it in the current state (e.g. lighting related atoms when
lighting is off) then don't mark it as clean, because when
lighting gets switched on we won't emit it at all.

This fixes funky gears colors.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-27 12:32:46 +10:00
Dave Airlie
0580e488da radeon: remove unused file 2010-01-27 12:32:44 +10:00
José Fonseca
5435f790fd python: Add missing library on debug builds. 2010-01-26 20:37:35 +00:00
Erik Wien
68ca19afd7 mesa: Don't bind DRAW/READ_FRAMEBUFFER separately without FBO blit support
If GL_EXT_framebuffer_blit was not supported _mesa_DeleteFramebuffersEXT
would raise an error when deleting the currently bound framebuffer. This
because it tried to bind the default DRAW- and READ_FRAMEBUFFER separately.
This patch binds the default FRAMEBUFFER instead in that case.

Encountered in the fbo/fbo-copyteximage piglit test on R600.

Patch cleaned up a bit by Brian Paul.
2010-01-26 13:19:32 -07:00
Brian Paul
cbecb8fc8e vbo: if 'end' is out of bounds, clamp it
If we determine that the 'end' parameter to glDrawElements() is out of
bounds, clamp it to the max legal index value.
2010-01-26 12:49:48 -07:00
Brian Paul
645e297a00 vbo: clamp DrawElements start/end to max possible values
Some apps are sloppy with their start/end values.  Clamp them to
max possible values to prevent problems later.
2010-01-26 12:47:54 -07:00
Brian Paul
af1e9403e7 mesa: remove redundant _MaxElement computation
Eric added some new code to check if offset < obj_size before computing
_MaxElement but my original code was still present afterward and it
clobbered the _MaxElement value.

Not sure if this came from a bad merge or what.
2010-01-26 10:53:40 -07:00
Brian Paul
1d8b308cbf docs: document Intel, R300 env vars 2010-01-26 09:12:32 -07:00
Jakob Bornecrantz
6749310d3f st/xorg: Fix crash on resize with libkms 2010-01-25 20:12:59 +01:00
Igor Oliveira
0d051af612 vega: fix incorrect samplers, textures indexes in blend_bind_samplers()
Fixes fd.o bug 25863.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-25 09:53:53 -07:00
Jakob Bornecrantz
6877c5de3c vmware/xorg: Do buffer round-robin logic differently 2010-01-25 12:27:47 +01:00
Jakob Bornecrantz
0b482c4fbe st/xorg: Improve options and print them to log
Set 2D acceleration to off by default
Get fallback debugging from the Xorg config
Also print if 3D acceleration is enabled
2010-01-25 11:24:56 +01:00
Jakob Bornecrantz
a3b783ea29 vmware/xorg: Export pci_probe function for ugly chain-loading 2010-01-25 11:24:55 +01:00
Jakob Bornecrantz
36fd55f9f0 st/xorg: Export helper function for detecting modesetting 2010-01-25 11:24:55 +01:00
Jakob Bornecrantz
16cf7e14a6 st/xorg: Fix warning 2010-01-25 11:24:55 +01:00
Brian Paul
47d30b0c2c st/mesa: fix int->uint conversion for negative scissor bound values
Based on a patch by Xavier Chantry <chantry.xavier@gmail.com>:

If x+width or y+height is negative, then maxx or maxy will get a bogus value
when converting that to unsigned. Fix this by setting 0 as minimal value.

This was also triggered by teeworlds, but only with some combination of
resolution and map section. For example upper part of dm2 at 1280x1024.
2010-01-24 18:18:17 -07:00
Brian Paul
e88d6fe299 mesa: move _mesa_debug() call earlier in _mesa_Scissor
Part of a patch from Xavier Chantry <chantry.xavier@gmail.com>
2010-01-24 17:54:47 -07:00
Xavier Chantry
fdfa4c8529 st/mesa: fix unsigned/signed breakage in scissor
commit 53174afeeb introduced a portability change that converted GLint x,y
to GLuint. That breaks when x and y are negative, which seems to be allowed,
and which at least one game uses : teeworlds.

Rather than simply reverting the change, it seems possible to convert the
16bit unsigned to GLint so that comparisons are made between signed integers
instead.  This hopefully does not break anything while keeping MSVC happy.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-24 16:45:49 -07:00
Vinson Lee
e85cb98a16 r200: Silence fprintf format warning. 2010-01-24 00:17:00 -08:00
Vinson Lee
e02dc13952 x86: Do not build read_rgba_span_x86.S on Mac OS X.
read_rgba_span_x86.S uses the pseudo-ops .hidden and .type which are
not recognized on Mac OS X.
2010-01-23 23:18:33 -08:00
Vinson Lee
f429b80fff x86: Do not use .hidden pseudo-op on Mac OS X.
The .hidden directive is an unknown pseudo-op on Mac OS X.
2010-01-23 23:12:34 -08:00
Vinson Lee
bc75ec0f38 glapi: Do not use .type pseudo-op on Mac OS X.
The .type directive is an unknown pseudo-op on Mac OS X.
2010-01-23 22:59:31 -08:00
Vinson Lee
6b55aacccb scons: Do not use ld options start-group and end-group on Darwin.
Mac OS X ld does not support these options.
2010-01-23 21:43:26 -08:00
Vinson Lee
d57ba16ae3 scons: Define _DARWIN_C_SOURCE on Darwin builds. 2010-01-23 21:05:58 -08:00
Vinson Lee
7f2f42dd80 progs/demos: Remove unnecessary header from shadowtex.c. 2010-01-23 20:56:49 -08:00
Vinson Lee
b62b524fee r300: Remove unnecessary headers. 2010-01-23 20:43:27 -08:00
Vinson Lee
fb6bff3712 intel: Remove unnecessary headers. 2010-01-23 14:33:29 -08:00
Vinson Lee
146a77af3f radeon: Remove unused variable. 2010-01-23 02:14:56 -08:00
Vinson Lee
4bad0aef40 tdfx: Remove unnecessary headers. 2010-01-23 01:54:53 -08:00
Vinson Lee
283d9565bf sis: Remove unnecessary headers. 2010-01-23 01:40:44 -08:00
Vinson Lee
09a142e5db savage: Remove unnecessary headers. 2010-01-23 00:38:14 -08:00
Vinson Lee
ca54a5b920 mga: Remove unnecessary headers. 2010-01-23 00:19:29 -08:00
Vinson Lee
634ec5c2ab i965: Remove unnecessary headers. 2010-01-22 23:53:39 -08:00
Vinson Lee
329c1b5910 i915: Remove unnecessary headers. 2010-01-22 23:22:16 -08:00
Julien Cristau
5aee9e344b Remove myself from Uploaders 2010-01-23 01:46:41 +01:00
Brian Paul
5e78903952 gallium/util: fix incorrect shift in a4r4g4b4_put_tile_rgba()
Fixes fd.o bug 23313.
2010-01-22 17:17:05 -07:00
Brian Paul
099e8ec54d mesa: re-implement _mesa_ProgramEnvParameter4fvARB() with memcpy()
This is faster and ensures that NaN floats get stored properly.
Before, NaN values (which might be used with UP2H, UP2US, UP4B and
UP4UB) weren't getting stored properly with gcc -O3.

This is the second part of the fix for the piglit fp-unpack-01 failure
(bug 25973).
2010-01-22 15:41:11 -07:00
Brian Paul
8d1a01d370 mesa: use new fetch_vector1ui() function for 'unpack' GPU instructions
The UP2H, UP2US, UP4B and UP4UB instructions interpret the float
registers as integers.  With gcc -O3 some bits were getting mixed up
somewhere.  This is part of the fix for the piglit fp-unpack-01 test
failure (bug 25973).
2010-01-22 15:36:38 -07:00
Brian Paul
efde2df114 xlib/softpipe: more buffer free fixes
The previous memory leak fix didn't always work properly.
Now check the xm_buffer::smh field (now documented!) to
see if the buffer points to shared memory.
2010-01-22 13:07:07 -07:00
Brian Paul
64871747bb gallium/draw: apply DRAW_PIPE_FLAG_MASK to all vertex elements
Depending on first/last provoking vertex either the first or last
element/index may have the extra DRAW_PIPE_x flags.  Mask off those
bits for all vertex elements to be safe (esp. for the quad case).
This may be overly cautious, but it's a cheap operation.

Fixes a segfault caused by large/bogus vertex indexes otherwise.
2010-01-22 11:49:51 -07:00
Brian Paul
5ab0d49a07 gallium/draw: added comments, whitespace fixes 2010-01-22 11:39:19 -07:00
Ruediger Oertel
96280c2a41 Fix PowerPC related typo in spantmp2.h
Signed-off-by: Matthias Hopf <mhopf@suse.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-22 08:07:41 -07:00
José Fonseca
383f460cf7 vmware/core: Update for pipebuffer changes.
In particular, delay patching GMR relocations until the buffers are
validated, since the buffers relative offset can only be established then.
2010-01-22 09:41:52 +01:00
Vinson Lee
3f6d732bfb st/mesa: Remove unnecessary header from st_cb_viewport.c. 2010-01-21 23:41:57 -08:00
Vinson Lee
8bc3c06d86 progs/trivial: Remove unnecessary header from tri-fbo-tex-mip.c. 2010-01-21 23:24:40 -08:00
Vinson Lee
a1c5d8f61d i915g: Remove unnecessary header. 2010-01-21 23:09:06 -08:00
Vinson Lee
cea9250ff0 pipebuffer: Remove unnecessary header. 2010-01-21 23:07:29 -08:00
Vinson Lee
dc544ad9c6 draw: Remove unnecessary headers. 2010-01-21 22:57:12 -08:00
Vinson Lee
e8b5203fbb svga: Remove unused variable. 2010-01-21 17:24:07 -08:00
José Fonseca
a626565178 vmware/core: Flush preemptively the FIFO commands to keep the GMR working set within reasonable bounds. 2010-01-21 15:51:37 -08:00
José Fonseca
beb8e8f2f2 vmware/core: Put GMR pool size in a define. 2010-01-21 15:47:52 -08:00
José Fonseca
e45579e50b vmw/wgl: Update for pipebuffer changes.
This is a minimum change to keep things building and running minimally -- it
might cause applications to fail to allocate buffers due to out of
GMR memory.

A proper update will be commited later.
2010-01-21 15:27:26 -08:00
José Fonseca
31e49dc54e svga: Remove duplicate code. 2010-01-21 15:18:40 -08:00
José Fonseca
50edefec2d svga: Remove unused code. 2010-01-21 15:18:40 -08:00
José Fonseca
9782d7cdf3 svga: Don't swap buffers to system memory -- winsys' responsibility. 2010-01-21 15:18:40 -08:00
José Fonseca
c4ceba1141 pipebuffer: Release the lock during map wait. Cleanups. 2010-01-21 15:18:40 -08:00
José Fonseca
3498616b03 pipebuffer: Swap buffers out to system memory when running out of memory. 2010-01-21 15:18:40 -08:00
José Fonseca
0bc8851884 svga: Avoid synchronization issues when doing SW TNL. 2010-01-21 15:18:40 -08:00
José Fonseca
8410f7cde3 mesa: Use pipe_buffer_write_nooverlap where appropriate. 2010-01-21 15:18:40 -08:00
José Fonseca
37246f854b util: Set DISCARD & UNSYNCHRONIZED when uploading vertices sequentially. 2010-01-21 15:18:40 -08:00
José Fonseca
1797494946 util: Use pipe_buffer_write_nooverlap in blits / mipmap generation. 2010-01-21 15:18:40 -08:00
José Fonseca
a8477fb00c gallium: New inline to write buffers which avoids synchronization. 2010-01-21 15:18:40 -08:00
José Fonseca
707b28136f gallium: Set PIPE_BUFFER_USAGE_DISCARD flag in pipe_buffer_write. 2010-01-21 15:18:40 -08:00
José Fonseca
13c2475339 gallium: Remove temporary hack for the absence of a discard flag.
PIPE_BUFFER_USAGE_DISCARD flag now exists.
2010-01-21 15:18:40 -08:00
José Fonseca
0ae076bf40 svga: Follow buffer usage semantics properly.
It's necessary to download buffers from the host always, except if the
buffer is undefined, because:
- just PIPE_BUFFER_USAGE_CPU_WRITE doesn't guarantee all data is written
  -- old contents may still pierce through
- PIPE_BUFFER_USAGE_DISCARD refers to a range, not the whole buffer, so
  unless we track which parts have been modified and not we still need
  to download the data.
2010-01-21 15:18:40 -08:00
Vinson Lee
efc08bddb7 st/xorg: Remove unnecessary headers. 2010-01-21 15:05:21 -08:00
Roland Scheidegger
2cf8164065 r200: fix CS section size mismatch
Partial fix for fdo bug 25544

The tex handling will still need CS drm changes,
see bug 25544 for more.
2010-01-21 17:33:51 -05:00
Vinson Lee
4222bf3d3c llvmpipe: Remove unnecessary headers. 2010-01-21 14:31:15 -08:00
Vinson Lee
c50fe2c55c svga: Remove unnecessary headers. 2010-01-21 12:12:11 -08:00
Vinson Lee
e19b3c01f4 mach64: Remove unnecessary headers. 2010-01-20 22:52:49 -08:00
Vinson Lee
7c66211b7d i810: Remove unnecessary headers. 2010-01-20 22:02:51 -08:00
Vinson Lee
0bc2cbf82a ffb: Remove unnecessary headers. 2010-01-20 16:27:44 -08:00
Brian Paul
a416123f5b xlib/softpipe: fix buffer memory leak
Fixes leak caused by window resize.
2010-01-20 10:34:45 -07:00
Brian Paul
65d2a26637 st/mesa: fix format logic in compatible_src_dst_formats()
We need to consider the user-requested formats, not the actual device-
chosen formats.  See code comments for more details.
2010-01-20 08:09:53 -07:00
Brian Paul
4e34c5d0b5 docs: updated Mesa mailing list info 2010-01-20 08:09:53 -07:00
Jakob Bornecrantz
9f728ed1c9 st/xorg: Fic bug and close drm_api at proper place 2010-01-20 14:55:07 +00:00
Vinson Lee
e3cb614f93 softpipe: Remove unnecessary headers. 2010-01-20 00:08:54 -08:00
Vinson Lee
ac2a665fd7 i915g: Remove unnecessary headers. 2010-01-19 22:47:03 -08:00
Jakob Bornecrantz
bea9ed4dc6 svga: Do a more propper creation of textures from handles 2010-01-19 23:30:31 +01:00
Jakob Bornecrantz
c78fe6e050 st/xorg: Don't leak BusID buffer 2010-01-19 23:30:30 +01:00
Jakob Bornecrantz
65354a7e3d st/xorg: Pass kernel driver name to drmOpen 2010-01-19 17:12:12 +01:00
Jakob Bornecrantz
a5fb5d6a54 st/drm: Expose kernel driver name
Based on patch by Chia-I Wu <olvaffe@gmail.com>

Expose the name of the kernel driver as accepted by drmOpenByName.
2010-01-19 17:10:04 +01:00
Ben Skeggs
116a02be22 st/dri: update dri2 drawables when viewport is changed
Fixes gnome-shell on nouveau, as well as window resize with various
other applications.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-19 17:06:22 +01:00
Luca Barbieri
e88294328c glx: Set GL context to null in __glXSetCurrentContextNull
__glXSetCurrentContextNull currently does not set the GL context to null
in the direct rendering case.

This can result in a segfault trying to flush an invalid old context
in glXMakeCurrent.

This fixes a crash starting the Unigine demos (they still don't work due
to missing extensions though).

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-19 08:59:37 -07:00
José Fonseca
7a39a5c1cb wgl: Check for PIPE_TEXTURE_USAGE_DISPLAY_TARGET support in exported color pixel formats.
Since all formats we export have PFD_DRAW_TO_WINDOW flag.
2010-01-19 06:14:12 -08:00
José Fonseca
5e870f4fe9 wgl: Don't export pure-stencil pixel formats.
They cause DCT's conform to always fail.
2010-01-19 06:14:12 -08:00
José Fonseca
e5da7b8548 softpipe: Fix vertex buffer memory leak. 2010-01-19 06:14:12 -08:00
Vinson Lee
faa99dd31d unichrome: Remove unnecessary headers. 2010-01-19 00:45:16 -08:00
Vinson Lee
45a27eacd6 mesa: Remove unnecessary header from attrib.c. 2010-01-18 22:50:08 -08:00
Vinson Lee
2613fa815a mesa: Remove unnecessary header from blend.c. 2010-01-18 22:45:23 -08:00
Vinson Lee
c4ad036ce1 mesa: Remove unnecessary headers from buffers.c. 2010-01-18 22:17:03 -08:00
Vinson Lee
7366d8e7d2 mesa: Remove unnecessary header from convolve.c. 2010-01-18 21:56:58 -08:00
Vinson Lee
08063ba449 mesa: Fix typo of 'unknown' in debug.c. 2010-01-18 21:41:31 -08:00
Vinson Lee
b36b85f9d0 mesa: Remove unnecessary headers from debug.c. 2010-01-18 21:37:18 -08:00
Vinson Lee
6deb8c9831 mesa: Remove unnecessary header from depthstencil.c. 2010-01-18 21:34:25 -08:00
Vinson Lee
2660511ea9 mesa: Remove unnecessary headers from dlist.c. 2010-01-18 21:31:02 -08:00
Vinson Lee
7395ab042a mesa: Remove unnecessary header from drawpix.c. 2010-01-18 21:22:47 -08:00
Vinson Lee
0b3109aa05 mesa: Remove unnecessary header from enable.c. 2010-01-18 21:17:45 -08:00
Vinson Lee
536e3c9168 mesa: Remove unnecessary headers from fbobject.c. 2010-01-18 21:14:04 -08:00
Vinson Lee
b6dce54214 mesa: Remove unnecessary header from formats.c. 2010-01-18 21:07:53 -08:00
Vinson Lee
2cbc3e0a20 mesa: Remove unnecessary header from image.c. 2010-01-18 21:02:19 -08:00
José Fonseca
65fa11959f softpipe: Skip depth testing for PIPE_S8_UNORM. 2010-01-18 20:34:19 -08:00
José Fonseca
8fb92e96e9 mesa: Handle PIPE_FORMAT_B8G8R8X8_UNORM. 2010-01-18 20:34:19 -08:00
José Fonseca
bcadde2068 pipebuffer: Ensure buffer size/alignment is not zero. 2010-01-18 20:34:19 -08:00
José Fonseca
dc298559c6 svga: Ensure buffer size/alignment is not zero. 2010-01-18 20:34:19 -08:00
Vinson Lee
ebd1075598 mesa: Remove unnecessary headers from lines.c. 2010-01-18 19:32:51 -08:00
Vinson Lee
d0125e3c29 mesa: Remove unnecessary header from mipmap.c. 2010-01-18 19:23:47 -08:00
Vinson Lee
ed5a116eb4 mesa: Remove unnecessary header from pixel.c. 2010-01-18 19:20:56 -08:00
Vinson Lee
2f83948370 mesa: Remove unnecessary headers from pixelstore.c. 2010-01-18 19:14:23 -08:00
Vinson Lee
419ae5a483 mesa: Remove unnecessary header from points.c. 2010-01-18 19:10:05 -08:00
Vinson Lee
80ea879cfa mesa: Remove unnecessary header from polygon.c. 2010-01-18 19:03:54 -08:00
Vinson Lee
6603550353 mesa: Remove unnecessary header from state.c. 2010-01-18 18:54:54 -08:00
Vinson Lee
ec29ba12a6 mesa: Remove unnecessary headers from texcompress.c. 2010-01-18 18:52:24 -08:00
Vinson Lee
f8db32acbd st/dri: Add comment for intentional fallthrough in case statement. 2010-01-18 18:14:03 -08:00
Brian Paul
28576c9ac5 st/mesa: change instruction count assertion to > 0
Shaders should at least have an END instruction.
2010-01-18 11:26:57 -07:00
Marcin Slusarz
e978b24c87 st/dri: fix optionCache memory leaks
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-18 10:48:06 -07:00
Marcin Slusarz
23ae318200 glxgears: unbind current context before "destroying" it
glXDestroyContext does not destroy the context if it's still
connected to some window. Unbind context from window to test it.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-18 10:44:53 -07:00
Julien Cristau
b1a8810204 Rename the build directory to not include DEB_BUILD_GNU_TYPE for no good reason. Thanks, Colin Watson! 2010-01-16 16:48:55 +00:00
Jakob Bornecrantz
ccc888c39e st/xorg: If dri2 version is 2 support version 1 as well
Thanks to X server commit 2e2c5b216cc1c7a9bc26bd2c68226aaed5fc52ca
it is possible to be ABI compatible in version 2 with version 1 of
the DRI2 interface.
2010-01-15 01:38:04 +00:00
Jakob Bornecrantz
3e1241d4f8 st/xorg: Set enforce version to 1 if not defined 2010-01-15 01:38:04 +00:00
Thomas Hellstrom
ae97520e37 ws/vmware: Check DRM version also when bootstrapping in dri2 mode.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-01-18 15:56:57 +01:00
Thomas Hellstrom
5f2d60a715 st/dri: Don't request a fake front if the server adds one automatically.
We use the presence of the getBuffersWithFormat extension function to
detect whether the server automatically adds a front.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-01-18 13:39:25 +01:00
Vinson Lee
d773f28ff2 mesa: Remove unnecessary headers from texformat.c. 2010-01-18 00:47:56 -08:00
Vinson Lee
39824945fa mesa: Remove unnecessary headers from texgetimage.c. 2010-01-18 00:14:51 -08:00
Vinson Lee
6938dccf1a mesa: Remove unnecessary header from teximage.c. 2010-01-17 22:31:53 -08:00
Vinson Lee
c847e7d07b mesa: Remove unnecessary header from texobj.c. 2010-01-17 20:50:15 -08:00
Vinson Lee
59eed7a201 mesa: Remove unnecessary header from texparam.c. 2010-01-17 16:21:11 -08:00
Vinson Lee
3e876431d0 mesa: Remove unnecessary headers from texstate.c. 2010-01-17 16:08:59 -08:00
Vinson Lee
6b6ac9aca0 mesa: Use preprocessor to comment out code. 2010-01-17 15:48:39 -08:00
Vinson Lee
ae943f8e20 mesa: Remove unnecessary headers from vtxfmt.c. 2010-01-17 01:49:16 -08:00
Vinson Lee
97e44cde17 mesa: Remove unnecessary headers from arbprogparse.c. 2010-01-16 23:41:05 -08:00
Vinson Lee
97fc7ae69f mesa: Remove unnecessary header from nvvertparse.c. 2010-01-16 16:15:37 -08:00
Vinson Lee
5a4d5b694c glsl: Remove unnecessary header from prog_execute.c. 2010-01-16 16:06:58 -08:00
Vinson Lee
148498d8cc glsl: Remove unnecessary header from prog_statevars.c. 2010-01-16 15:51:52 -08:00
Vinson Lee
0d62242082 glsl: Remove unnecessary headers from shader_api.c. 2010-01-16 15:35:56 -08:00
Vinson Lee
1f7762f62b glsl: Remove unnecessary header from slang_emit.c. 2010-01-16 15:00:29 -08:00
Vinson Lee
89950fbe24 st/mesa: Remove unnecessary header from st_cb_drawpixels.c. 2010-01-16 13:29:15 -08:00
Vinson Lee
59db91e2ee glsl: Remove unnecessary header from slang_builtin.c. 2010-01-16 02:20:51 -08:00
Vinson Lee
535084996b glsl: Remove unnecessary headers from slang_compile.c. 2010-01-16 02:16:24 -08:00
Vinson Lee
1d3bdc2090 glsl: Remove unnecessary header from slang_link.c. 2010-01-16 02:02:49 -08:00
Vinson Lee
10bd931949 glsl: Remove unnecessary header from slang_log.c. 2010-01-16 01:50:08 -08:00
Vinson Lee
533b6e8deb st/mesa: Remove unnecessary header from st_atom_framebuffer.c. 2010-01-16 01:39:04 -08:00
Vinson Lee
3eb85bf7d9 st/mesa: Remove unnecessary header from st_atom_pixeltransfer.c. 2010-01-16 00:52:34 -08:00
Vinson Lee
bc639f291b st/mesa: Remove unnecessary header from st_atom_sampler.c. 2010-01-16 00:45:36 -08:00
Vinson Lee
227fc5a308 st/mesa: Remove unnecessary header from st_atom_shader.c. 2010-01-16 00:36:31 -08:00
Vinson Lee
cc2f2268f5 st/mesa: Remove unnecessary headers from st_cb_accum.c. 2010-01-16 00:30:25 -08:00
Vinson Lee
e1d4781cd4 st/mesa: Remove unnecessary headers from st_cb_bitmap.c. 2010-01-16 00:08:54 -08:00
Vinson Lee
cc770c8409 st/mesa: Remove unnecessary headers from st_cb_blit.c. 2010-01-15 23:17:00 -08:00
Vinson Lee
6906bf08cc st/mesa: Remove unnecessary headers from st_cb_clear.c. 2010-01-15 23:02:07 -08:00
Vinson Lee
668d871d95 st/mesa: Remove unnecessary headers from st_cb_drawpixels.c. 2010-01-15 22:55:47 -08:00
Alex Deucher
adcde22952 r600: fill in some missing XRGB tex formats 2010-01-15 23:04:19 -05:00
Alex Deucher
81eed59a2c r600: set tiling correctly for texturing from depth buffer 2010-01-15 23:04:09 -05:00
Alex Deucher
114ab07aee r600: fix typo in SQ setup 2010-01-15 23:04:00 -05:00
Vinson Lee
56cd5806e8 st/mesa: Remove unnecessary header from st_cb_fbo.c. 2010-01-15 18:24:12 -08:00
Vinson Lee
a9f6255431 st/mesa: Remove unnecessary headers from st_cb_feedback.c. 2010-01-15 18:20:56 -08:00
Vinson Lee
2d2d890048 st/mesa: Remove unnecessary header from st_cb_program.c. 2010-01-15 16:28:56 -08:00
Vinson Lee
fbda223893 st/mesa: Remove unnecessary header from st_cb_queryobj.c. 2010-01-15 16:27:28 -08:00
Brian Paul
f595e72337 tgsi: fix detection of front-facing attribute
This code was not updated when we added TGSI_SEMANTIC_FACE a while ago.
2010-01-15 14:57:58 -07:00
Brian Paul
2c5aa02e20 swrast: add missing call to _swrast_depth_bounds_test()
We were calling this from the CI span function, but not the RGBA
span function.

I don't know of a test program for the GL_EXT_depth_bounds_test
extension...
2010-01-15 14:25:33 -07:00
Brian Paul
7385681797 swrast: fix broken _swrast_depth_clamp_span()
The integer Z clamping range depends on the number of bits
in the Z buffer because that's the scale factor used when we
transform NDC coords by the viewport/depth range.

Fixes fd.o bug #25972 but only for Z buffers up to a depth
of 30 bits.  Beyond that we get into messy integer overflow
issues and things fall apart.
2010-01-15 14:19:25 -07:00
Vinson Lee
79a5a28390 st/mesa: Remove unnecessary header from st_cb_rasterpos.c. 2010-01-14 23:05:42 -08:00
Vinson Lee
9c2ef74a76 st/mesa: Remove unnecessary headers from st_cb_readpixels.c. 2010-01-14 23:03:37 -08:00
Vinson Lee
cde041cd13 st/mesa: Remove unnecessary header from st_cb_strings.c. 2010-01-14 22:30:00 -08:00
Vinson Lee
644572a372 st/mesa: Remove unnecessary headers from st_cb_texture.c. 2010-01-14 22:27:13 -08:00
Vinson Lee
4f8baf7dce st/mesa: Remove unnecessary headers from st_cb_viewport.c. 2010-01-14 19:00:27 -08:00
Vinson Lee
53c6c38412 st/mesa: Remove unnecessary headers from st_context.c. 2010-01-14 18:53:51 -08:00
Vinson Lee
604e9ec2c4 st/mesa: Remove unnecessary header from st_draw_feedback.c. 2010-01-14 18:46:51 -08:00
Vinson Lee
9e7778d7aa st/mesa: Remove unnecessary header from st_extensions.c. 2010-01-14 18:34:59 -08:00
Vinson Lee
8a8a27b01a st/mesa: Remove unnecessary header from st_format.c. 2010-01-14 18:19:39 -08:00
Vinson Lee
eaedc1bb3e st/mesa: Remove unnecessary headers from st_framebuffer.c. 2010-01-14 18:10:06 -08:00
Vinson Lee
6890b06982 st/mesa: Remove unnecessary headers from st_gen_mipmap.c. 2010-01-14 17:54:47 -08:00
Vinson Lee
252812bf15 st/mesa: Remove unnecessary header from st_program.c. 2010-01-13 23:28:00 -08:00
Vinson Lee
c109ca9c49 st/mesa: Remove unnecessary header from st_texture.c. 2010-01-13 23:16:05 -08:00
Vinson Lee
6b39e8aeb0 swrast: Remove unnecessary header from s_accum.c. 2010-01-13 23:01:03 -08:00
Vinson Lee
78411881d3 swrast: Remove unnecessary header from s_atifragshader.c. 2010-01-13 22:58:07 -08:00
Vinson Lee
0a70868131 swrast: Remove unnecessary header from s_bitmap.c. 2010-01-13 22:45:54 -08:00
Vinson Lee
886cffb44e swrast: Remove unnecessary headers from s_copypix.c. 2010-01-13 22:43:16 -08:00
Vinson Lee
cf061c24e0 swrast: Remove unnecessary header from s_depth.c. 2010-01-13 22:36:01 -08:00
Vinson Lee
d1631f734a swrast: Remove unnecessary header from s_drawpix.c. 2010-01-13 22:30:04 -08:00
Vinson Lee
f649870c9b swrast: Remove unnecessary header from s_feedback.c. 2010-01-13 22:20:44 -08:00
Thomas Hellstrom
a9086f2d17 st/dri: Make sure we always request a fake front.
This should be the correct, but sub-optimal way to handle things on
pre-1.7 servers. For servers that automatically adds a fake front
we should never request the fake front and handle the reply differently.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-01-13 17:45:21 +01:00
José Fonseca
1b333453e4 svga: Fix compile_vs error code.
It could erroneously return PIPE_OK in some circumstances.

Make compile_fs code identical.
2010-01-13 13:40:09 +00:00
Vinson Lee
831764fa75 swrast: Remove unnecessary header from s_fragprog.c. 2010-01-12 23:54:15 -08:00
Vinson Lee
d6588a9372 swrast: Remove unnecessary header in s_lines.c. 2010-01-12 21:59:58 -08:00
Vinson Lee
7debc532d5 swrast: Remove unnecessary header from s_points.c. 2010-01-12 21:51:19 -08:00
Vinson Lee
11034bfa97 swrast: Remove unnecessary header from s_readpix.c. 2010-01-12 21:41:09 -08:00
Vinson Lee
a01b9eac04 swrast: Remove unnecessary header from s_texcombine.c. 2010-01-12 20:36:33 -08:00
Vinson Lee
c239f38709 tnl: Remove unnecessary header from t_context.c. 2010-01-12 20:14:36 -08:00
Vinson Lee
2c7cf3f9c9 tnl: Remove unnecessary headers from t_draw.c. 2010-01-12 20:02:44 -08:00
Vinson Lee
dffcbee8e7 tnl: Remove unnecessary header from t_pipeline.c. 2010-01-12 19:55:24 -08:00
Vinson Lee
a24d852630 tnl: Remove unnecessary header from t_rasterpos.c. 2010-01-12 19:49:19 -08:00
Vinson Lee
264f4101cd tnl: Remove unnecessary header from t_vb_program.c. 2010-01-12 19:45:25 -08:00
Vinson Lee
c631501003 vbo: Remove unnecessary headers from vbo_exec.c. 2010-01-12 17:07:24 -08:00
Vinson Lee
94d238e757 vbo: Remove unnecessary header from vbo_exec_array.c. 2010-01-12 16:55:36 -08:00
Vinson Lee
37d326503d vbo: Remove unnecessary header from vbo_exec_draw.c. 2010-01-12 16:37:30 -08:00
Vinson Lee
aee9a6f4e1 vbo: Remove unnecessary headers from vbo_save.c. 2010-01-12 00:50:05 -08:00
Vinson Lee
d2271d8a39 vbo: Remove unnecessary header from vbo_save_loopback.c. 2010-01-11 23:53:13 -08:00
Vinson Lee
083dae14bd vbo: Remove unnecessary header from vbo_split_copy.c. 2010-01-11 22:46:30 -08:00
Vinson Lee
0d65a68f51 x86: Remove unnecessary header from x86_xform.c. 2010-01-11 21:04:16 -08:00
Vinson Lee
8e9ceb8309 progs/xdemos: Remove unnecessary header from corender.c. 2010-01-11 20:24:57 -08:00
Vinson Lee
477d51537f progs/trivial: Remove unnecessary headers from tri-fbo-tex.c. 2010-01-11 20:21:50 -08:00
Vinson Lee
7241f5140f progs/trivial: Remove unnecessary header from tri-fbo-tex-mip.c. 2010-01-11 20:15:59 -08:00
Vinson Lee
ae8ed89f24 progs/tests: Remove duplicate included header in vparray.c. 2010-01-11 19:58:08 -08:00
Vinson Lee
6ed607cce6 progs/tests: Add newline to end of printf in vparray.c. 2010-01-11 19:56:04 -08:00
Vinson Lee
7bfa54c6a4 progs/redbook: Remove unnecessary header from aapoly.c. 2010-01-11 19:52:22 -08:00
Vinson Lee
2178abfba3 progs/glsl: Remove duplicate included header from shtest.c. 2010-01-11 19:42:55 -08:00
Vinson Lee
78ddce9fda progs/demos: Remove unnecessary header from morph3d.c. 2010-01-11 19:29:26 -08:00
Brian Paul
3fce8ad2de Revert "util: Build u_bitmask.o when using make."
This reverts commit 01eff0e6d2.

u_bitmask.c was already in the C_SOURCES list.
2010-01-11 20:19:30 -07:00
Vinson Lee
f07e87ffba progs/tests: Silence fprintf format warning. 2010-01-11 19:16:36 -08:00
Vinson Lee
b4bc208529 progs/demos: Remove unnecessary header from isosurf.c. 2010-01-11 19:03:18 -08:00
Zack Rusin
d880b64423 st/xorg: move exaMoveInPixmap before trying to fetch it
as Michel suggested, this is a cleaner way of fixing crashes caused
by exaGetPixmapDriverPrivate returning null since the data hasn't
been moved yet.
2010-01-11 18:27:59 -05:00
Zack Rusin
3447d545d9 st/xorg: fix a rare video crash
sometimes dst isn't present if a window is in a middle of a resize, stop
crashing in those cases and just ignore a frame.
2010-01-11 18:03:49 -05:00
Brice Goglin
2b5f0b8669 Prepare changelog for upload 2010-01-11 17:52:44 +01:00
Brice Goglin
5be25443dd Merge branch 'debian-unstable' of git+ssh://git.debian.org/git/pkg-xorg/lib/mesa into debian-experimental
Conflicts:
	ChangeLog
	debian/changelog
2010-01-11 17:52:13 +01:00
Brice Goglin
eb1cc8273b New upstream release 2010-01-11 17:49:26 +01:00
Brice Goglin
5144f580d0 Merge branch 'upstream-experimental' into debian-experimental
Conflicts:
	progs/egl/eglgears.c
	progs/egl/eglscreen.c
	progs/fp/Makefile
	progs/fp/SConscript
	progs/rbug/simple_server.c
	progs/tests/getprocaddress.c
	progs/tests/interleave.c
	progs/tests/texwrap.c
	progs/tests/vparray.c
	progs/vp/vp-tris.c
	src/glut/glx/win32_menu.c
2010-01-11 17:47:52 +01:00
Brice Goglin
4afc359cc3 Revert "Bump the libdrm build-dep to 2.4.17 because of the changed radeon API."
This reverts commit ed7cd35ba0.

Only libdrm 2.4.15 is uploaded in Debian for now.
2010-01-11 17:44:11 +01:00
Vinson Lee
6d6c9c6688 progs/demos: Remove unnecessary header from fbotexture.c. 2010-01-11 00:24:39 -08:00
Dave Airlie
efaba97eaa radeon: fix prediction for r100 inline vert/elt emits.
On r100 we emit the indices inline so we need to account
for that in the emission size.
2010-01-11 13:27:20 +10:00
Dave Airlie
1294df9ca4 radeon: fix bug in realloc code.
This bug was fixed in libdrm ages ago, port to non-kms
2010-01-11 13:27:14 +10:00
Vinson Lee
4fe51c7447 glu/sgi: Initialize members of class Mesher. 2010-01-10 16:09:41 -08:00
Vinson Lee
1111b38a1b glu/sgi: Initialize members of class Slicer. 2010-01-10 15:55:52 -08:00
Vinson Lee
b9bd96608c glu/sgi: Include missing header file. 2010-01-10 03:03:14 -08:00
Vinson Lee
199dedd6dd progs/demos: Check upper bounds of input in manywin.c. 2010-01-10 01:57:13 -08:00
Vinson Lee
0c7814fe23 progs/demos: Bounds check input to fire.c. 2010-01-10 00:40:46 -08:00
Vinson Lee
9e98c1fbf6 glu/sgi: Initialize members of class Renderhints. 2010-01-10 00:14:33 -08:00
Vinson Lee
a5815c36f7 glu/sgi: Initialize members of class StoredVertex. 2010-01-09 23:55:05 -08:00
Vinson Lee
61afd1158f glu/sgi: Include missing header file. 2010-01-09 23:53:54 -08:00
Vinson Lee
f8737bda37 glu/sgi: Initialize member of class O_pwlcurve. 2010-01-09 23:25:49 -08:00
Vinson Lee
683e3cb8db progs/tests: Silence 'missing initializer' warnings. 2010-01-08 23:08:57 -08:00
Vinson Lee
223c8482ca progs/glsl: Silence uninitialized variable warning. 2010-01-08 22:10:52 -08:00
Vinson Lee
3b82de92a0 progs/demos: Add missing initializers in engine.c. 2010-01-08 22:02:49 -08:00
Vinson Lee
4775723d2f r300g: Silence unused variable warnings. 2010-01-08 21:43:54 -08:00
Vinson Lee
20d6360db7 tgsi: Silence uninitialized variable warnings. 2010-01-08 20:24:05 -08:00
Timo Aaltonen
ed7cd35ba0 Bump the libdrm build-dep to 2.4.17 because of the changed radeon API. 2010-01-09 02:24:49 +02:00
Jakob Bornecrantz
61f7252448 Revert "pipebuffer: Multi-threading fixes for fencing."
This reverts commit 5b64d94390.
2010-01-07 05:14:20 +01:00
Thomas Hellstrom
cb51f02678 Revert "st/dri: no need to request fake front buffer, only handle it being returned"
This reverts commit 1336989ec6.

The commit breaks frontbuffer rendering and the possibility to do
on-demand frontbuffer requests on all Xservers prior to 1.7.

The commit should be conditioned on a dri2 version check.
I've submitted a patch to Xserver to bump dri2 minor, and it's acked by Ian.

To be able to check the version from within the state tracker, we will
probably need another dri2 extension function that returns the server
version. The protocol has support for it.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-01-11 21:36:51 +01:00
Thomas Hellstrom
01eff0e6d2 util: Build u_bitmask.o when using make.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-01-11 21:36:51 +01:00
Jakob Bornecrantz
de37a00d27 util: Add u_bitmask to make build 2010-01-06 15:32:42 +01:00
Dan Nicholson
674c76310f mesa: Ensure libmesagallium.a is finished building before descending
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-01-08 06:09:19 -08:00
Vinson Lee
3c42e403de r300: Move initial declaration outside for loop. 2010-01-08 01:13:46 -08:00
Brian Paul
5dd9e23d62 docs: document Gallium SSE codegen for XPD bug fix 2010-01-07 14:55:27 -07:00
Brian Paul
8647aa1d8d tgsi: fix SSE code emit for XPD
Rearrange things so that the writes to the dest registers happen
after we've fetched/used all src registers.

The problematic instruction was:  XPD TEMP[2].xyz, TEMP[0], TEMP[2];
Note that the dst reg is also a src reg.

This fixes bad shading with progs/glsl/bump.c since Eric's changes to the
Mesa program optimizer in commit d6690ce15f.
The optimizer rearranges some registers so we occasionally wind up with
something like the above.
2010-01-07 14:49:14 -07:00
Brian Paul
2b7a4b2c0e progs/fp: remove invalid tri-inv.c test
INV is not a valid instruction.
2010-01-07 08:22:39 -07:00
Vinson Lee
d42467687e progs/demos: Assert that input to malloc is valid. 2010-01-06 21:39:44 -08:00
Vinson Lee
45ac10fe6a progs/xdemos: Check for string overflow. 2010-01-06 18:19:46 -08:00
Vinson Lee
25ffd76278 progs/xdemos: Check for string overflow. 2010-01-06 18:08:41 -08:00
Vinson Lee
468f270f3f svga: Silence uninitialized variable warning. 2010-01-06 17:51:08 -08:00
Brian Paul
ef7eb62423 meta: remove F suffix from _mesa_Ortho() params
_mesa_Ortho() takes GLdoubles.
2010-01-06 18:22:06 -07:00
Brian Paul
73bd400016 docs: document a mipmap generation bug fix 2010-01-06 18:20:17 -07:00
Brian Paul
cb3cb96fbd meta: move destination vertex/projection setup out of _mesa_meta_GenerateMipmap
Based on a patch submitted by Pierre Willenbrock <pierre@pirsoft.de>
2010-01-06 18:20:17 -07:00
Brian Paul
06970b2ccb meta: set viewport and projection matrix in _mesa_meta_GenerateMipmap
This fixes mipmap levels being clipped to the last viewport.

Based on a patch submitted by Pierre Willenbrock <pierre@pirsoft.de>
2010-01-06 18:20:17 -07:00
Andre Maasikas
49653c01e8 r600: adjust after radeon mipmap changes in 7118db8700
R600_OUT_BATCH_RELOC doesn't really use offset so set it
in TEX_RESOURCE2
+ typo fix
2010-01-06 19:52:24 -05:00
Brian Paul
8485811f10 tnl: set FOGC result to (f,0,0,1)
Fixed FDO bug 23397.
2010-01-06 17:43:56 -07:00
Vinson Lee
4c45810d57 progs/xdemos: Remove comma at end of enumerator list. 2010-01-06 15:35:18 -08:00
Vinson Lee
96a4e4552d progs/xdemos: Use temporary variables.
This was missed from the previous commit to glxheads.c.
2010-01-06 15:33:13 -08:00
Vinson Lee
c1dad22d71 progs/glsl: Prevent possible string overflow. 2010-01-06 15:25:42 -08:00
Vinson Lee
f4952f040b progs/xdemos: Prevent possible string overflow. 2010-01-06 14:56:43 -08:00
Pierre Ossman
c9befda13a r600: float texture component ordering
The ordering of texture components was
backwards for the floating point textures.

Signed-off-by: Pierre Ossman <pierre@ossman.eu>
2010-01-06 12:42:49 -05:00
Roel Kluin
324568f79d mesa: test index bounds before array element
Check whether the index is within bounds before accessing the array.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-06 09:47:37 -07:00
Roel Kluin
5db710a823 win32_menu: add missing parentheses in mapMenu()
`|' has higher precedence than `?'.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-06 09:46:55 -07:00
Roel Kluin
2b4acd26b1 nv50: add missing parentheses in nv50_query_result()
NOUVEAU_BO_RD is defined (1 << 2), and `|' has higher precedence than `?'
so the second argument of nouveau_bo_map was always 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-06 09:46:53 -07:00
Brian Paul
e4b7d9ea35 i965: fix invalid assertion in emit_xpd(), again 2010-01-06 07:18:09 -07:00
José Fonseca
5b64d94390 pipebuffer: Multi-threading fixes for fencing.
I had this patch on my hard drive for long time. It doesn't fully
address SVGA multi-threading issues, but causes no regressions, so decided
to commit while it still applies cleanly.

Attention: merging this into master will cause issues due to recent
changes in reference counting to fix strict aliasing rules violation.
2010-01-06 12:18:16 +00:00
Brian Paul
e555146fa3 i965: fix invalid assertion in emit_xpd()
Invalid assertion found by Roel Kluin <roel.kluin@gmail.com>
2010-01-05 15:53:05 -07:00
Roel Kluin
766f3ccbda tdfx: condition always evaluates to false in SetupDoubleTexEnvVoodoo3()
This can never be true.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
2010-01-05 14:42:28 -07:00
Brian Paul
9f544394c1 st/mesa: fix broken translation of negative register indexes
A src register's index can be negative if we're doing indirect
addressing into the constant buffer.  Ex: MOV OUT[1], CONST[ADDR[0].x-3]

This fixes the piglit vp-arl-neg-array.vpfp test.

Before this change we were going out of bounds of the t->constants[]
array and getting garbage that later triggered an assertion.
2010-01-05 11:44:19 -07:00
Brian Paul
487a14b476 ARB prog parser: regenerated parser file 2010-01-05 11:44:19 -07:00
Brian Paul
f0f68b1e4c ARB prog parser: fix parameter binding type
References to program local and enviroment parameters are put into the
unified program parameters list as PROGRAM_STATE_VAR entries which point
into the local or environment arrays.  So the param_binding_type field
should be PROGRAM_STATE_VAR.

This fixes the piglit vpfp-generic vp-arl-env-array.vpfp and
vp-arl-local-array.vpfp test failures.
2010-01-05 11:44:19 -07:00
Brian Paul
e3514b7338 ARB prog parser: regenerated parser files 2010-01-05 11:44:19 -07:00
Brian Paul
7c6ae4c6c8 ARB prog parser: add allowSwizzle param to initialize_symbol_from_const()
We need to disable constant consolidation when building an array of
constants which might be indexed indirectly.

Fixes regression in piglit vpfp-generic vp-arl-constant-array.vpfp
test caused by earlier constant consolidation patch.
2010-01-05 11:44:19 -07:00
Brian Paul
37f6929d29 mesa: whitespace changes and comments 2010-01-05 11:44:19 -07:00
Brian Paul
f27e39aa4e mesa: change constant search behaviour in _mesa_add_unnamed_constant()
Only search for an existing, matching constant if swizzleOut is non-null.
We need to be able to disable constant consolidation when building an
array of constants which will be indexed indirectly.
2010-01-05 11:44:19 -07:00
José Fonseca
38d8b18003 svga: Remove stale references to delete shader results.
To ensure that a new result that happens to have the same address
of the old one will be detected as a change.
2010-01-05 17:56:26 +00:00
José Fonseca
8ebef37c7b svga: Rebind shaders when tokens change.
Even shader ID doesn't change. Otherwise the token change is not
effective.

This reverts regression from commit
cdb445f3a9. Regression could be seen in
Quake3's loading screen -- the upper right corner of the screen would
be black.
2010-01-05 17:32:53 +00:00
Brian Paul
ef1b942691 st/mesa: added PROGRAM_LOCAL_PARAM case in src_register()
Fixes piglit vpfp-generic arl.vpfp failure when using gallium.
2010-01-05 09:14:50 -07:00
Brian Paul
bd96b51303 mesa: bump version to 7.7.1-DEVEL 2010-01-05 07:59:29 -07:00
Brian Paul
6d84580858 mesa: add missing _mesa_lock_texture() call 2010-01-04 19:05:31 -07:00
Eric Anholt
b434a816d7 i915: Use _MaxLevel on principle in texture setup.
It was OK before because we proceed to clamp the value to hardware
limits, but given that other use of MaxLevel has been a trap, let's
avoid it.
2010-01-04 14:15:12 -08:00
Eric Anholt
19a26dfc47 intel: Fix CopyTexImage from tiled mipmap levels > 0.
Fixes piglit fbo-copyteximage.
2010-01-04 14:15:12 -08:00
Eric Anholt
63610fae4f i965: Fix the surface offset calculation for tiled buffers.
If we ever had a non-tile-aligned tiled renderbuffer, the math was all
off.  Use the existing x,y coordinates instead of trying to
reconstruct them from an incorrectly-calculated offset value.
2010-01-04 14:15:12 -08:00
Andre Maasikas
a160d1c27d r600: support vertex_array_bgra
Use vertex program key mechanism and swizzle during vertex fetch - is there
a better way?
2010-01-04 16:16:43 -05:00
Brian Paul
82421c549f mesa: added GL_DU8DV8_ATI in extract_float_rgba()
Fixes warning seen with Shadowgrounds.  See bug 24016.
2010-01-04 14:01:19 -07:00
Brian Paul
01bf004d8b docs: initial release notes for 7.7.1 2010-01-04 14:01:18 -07:00
Vinson Lee
6130bb1391 mesa: Prevent possible array out-of-bounds access by _mesa_light. 2010-01-04 12:06:04 -08:00
Brian Paul
e661bf5018 mesa: regenerated enums.c file 2010-01-04 11:30:03 -07:00
Brian Paul
707faf65c8 glapi: comment-out TIMEOUT_IGNORED
This is not really a GLenum value.
2010-01-04 11:30:03 -07:00
Brian Paul
f52dd2ab33 glsl: use varName variable in _slang_gen_assignment() 2010-01-04 11:30:03 -07:00
Michel Dänzer
1e414df894 st/mesa: Only call st_texture_image_unmap() if texImage->Data is non-NULL.
This was already done in st_TexImage() but was missed between incremental
changes to st_TexSubimage().
2010-01-04 16:54:29 +01:00
Michel Dänzer
acd1451393 svga: Fix debug build crash when rendering to depth/stencil renderbuffer only. 2010-01-04 13:05:43 +01:00
Michel Dänzer
c114f000df st/xorg: Proper calculation of screen pitch. 2010-01-04 13:04:05 +01:00
Michel Dänzer
8282185752 vmware/xorg: Fix SCons build. 2010-01-04 13:02:40 +01:00
Vinson Lee
d1e2fc19cc r300: Use C-style comments. 2010-01-03 23:33:32 -08:00
Vinson Lee
8a29e3f8e8 progs/egl: Silence uninitialized variable warnings. 2010-01-03 21:39:20 -08:00
Vinson Lee
3ea5a95078 progs/samples: Silence compiler warnings. 2010-01-03 21:29:33 -08:00
Vinson Lee
b14cbfaebc r300: Silence 'mixed declarations and code' warnings. 2010-01-03 20:51:23 -08:00
Vinson Lee
0214b7b3c1 r300: Silence 'mixed declarations and code' warning. 2010-01-03 20:16:59 -08:00
Vinson Lee
58531029e6 r300: Silence 'mixed declarations and code' warning. 2010-01-03 18:32:07 -08:00
Vinson Lee
3e196f433d r300g: Silence 'mixed declarations and code' warning. 2010-01-03 18:05:12 -08:00
Vinson Lee
fe3ea299bf r300g: Remove comma at end of enumerator list. 2010-01-03 15:07:35 -08:00
Vinson Lee
0bfc579bd4 llvmpipe: Remove comma at end of enumerator list. 2010-01-03 14:42:36 -08:00
José Fonseca
eb5d9e6f70 mesa: Cope with the degenerate case of zero length ranges.
Fixes assertion failures on glean's bufferObject test.
2010-01-03 20:00:19 +00:00
José Fonseca
f3739bdb60 gdi: Don't generate import libraries for opengl32.dll.
Both MinGW and MSVC include opengl32 import libraries, and its safer to
always use those.
2010-01-03 20:00:19 +00:00
Jeremy Huddleston
287cbba9b7 apple: Purge existing (not working) GLX_USE_APPLEGL from dated libGL on OSX
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-01-03 08:58:13 -05:00
Jeremy Huddleston
32305e3a9f glxcmds: Fix comment about __DRI_ALLOCATE
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-01-03 08:58:13 -05:00
Vinson Lee
1d95544446 trace: Remove comma at end of enumerator list. 2010-01-03 03:08:40 -08:00
José Fonseca
66c1de77ed rtasm: Play nicely with Windows's Data Execution Prevention. 2010-01-03 11:03:13 +00:00
Vinson Lee
1da47ac20e progs/vp: Ensure null-terminated byte string. 2010-01-03 02:38:22 -08:00
Vinson Lee
c9c6e9a39e progs/tests: Silence uninitialized variable warning. 2010-01-02 21:58:40 -08:00
Vinson Lee
32d18924df progs/tests: Silence warn_unused_result warning. 2010-01-02 21:52:51 -08:00
Vinson Lee
d27effbfd8 i810: Fix include recursion. 2010-01-02 21:05:06 -08:00
Vinson Lee
94c5faad26 sis: ifdef out unused variable.
Silences GCC warning.
2010-01-02 20:47:15 -08:00
Vinson Lee
d2758f3b74 st/xorg: Ensure null-terminated byte string. 2010-01-02 20:39:04 -08:00
Vinson Lee
be6fb5c083 r300g: Use C-style comments. 2010-01-02 20:17:43 -08:00
Vinson Lee
fe27b07b0f glu/sgi: Initialize members of struct O_curve. 2010-01-02 20:04:00 -08:00
José Fonseca
cdb445f3a9 svga: Use a shader id as low as possible. 2010-01-03 00:50:13 +00:00
José Fonseca
904917dcc6 util: Minor enhancements/corrections to the bitmask logic. 2010-01-03 00:50:13 +00:00
José Fonseca
da6a80301b svga: Rename error labels.
Make it easier to insert/remove error branches.
2010-01-03 00:50:12 +00:00
Vinson Lee
386f91eec3 glu/sgi: Initialize members of struct O_surface. 2010-01-02 15:46:11 -08:00
Vinson Lee
ba9dc26eec glu/sgi: Initialize member of struct O_trim. 2010-01-02 15:29:25 -08:00
Vinson Lee
37e5626111 glu/sgi: Initialize member of struct Property. 2010-01-01 23:01:03 -08:00
Vinson Lee
646c8ce032 progs/samples: 'Silence no previous prototype' warnings. 2010-01-01 17:54:11 -08:00
Vinson Lee
2c64e4c50e glu/sgi: Initialize member of struct Dlnode. 2010-01-01 17:25:16 -08:00
Vinson Lee
64a1961011 glu/sgi: Initialize members of struct O_nurbscurve. 2010-01-01 17:19:27 -08:00
Vinson Lee
fab161f287 x86: Silence printf format warnings. 2010-01-01 17:06:16 -08:00
Vinson Lee
ad9defdd9c progs/rbug: s/wait/rbug_wait/
wait conflicts with wait in /usr/include/sys/wait.h.
2010-01-01 16:25:37 -08:00
Vinson Lee
3ae37da611 llvmpipe: Silence uninitialized variable warning. 2010-01-01 16:03:53 -08:00
Vinson Lee
fd237a879f llvmpipe: Use C-style comment. 2010-01-01 15:38:19 -08:00
Vinson Lee
dac82c378a gallium/util: Silence format warnings. 2010-01-01 15:32:52 -08:00
Vinson Lee
88bd32383a ARB prog parser: Silence unused variable warnings. 2010-01-01 15:12:58 -08:00
Vinson Lee
7df06e7e9d gallium/util: Replace h_addr with h_addr_list[0].
Fixes compilation error on Mac OS.
2010-01-01 15:01:22 -08:00
Vinson Lee
a349687d49 glu/sgi: Initialize members of class Knotvector. 2010-01-01 14:46:30 -08:00
Vinson Lee
5d3d202ac9 glu/sgi: Initialize member of struct Property. 2010-01-01 14:39:16 -08:00
Brian Paul
195e7657e2 swrast: use different temp array in _swrast_get_dest_rgba()
When using multiple color drawbuffers with blending/logicop/masking we
were overwriting color values which we still needed.
2009-12-31 08:44:27 -07:00
Vinson Lee
6e0584932b mesa: Silence unused variable warning. 2009-12-31 00:07:47 -08:00
Vinson Lee
5b2713c92a progs/glsl: Provide a better fix for fgets warning. 2009-12-30 12:38:21 -08:00
Brian Paul
f00bf0598c st/mesa: add PIPE_FORMAT_Z24S8_UNORM in st_get_format_info()
Fixes progs/demos/fbotexture on Nouveau.
Patch submitted by Luca Barbieri <luca@luca-barbieri.com>.
2009-12-29 23:31:43 -07:00
Vinson Lee
de95e5768b glu/sgi: Initialize members of struct O_nurbssurface. 2009-12-29 22:29:53 -08:00
Vinson Lee
ac21edff1c tdfx: Silence uninitialized variable warning. 2009-12-29 21:34:06 -08:00
Vinson Lee
0ab29d2b35 progs/glsl: Silence compiler warnings. 2009-12-29 21:11:37 -08:00
Vinson Lee
70bbe22366 glu/sgi: Silence warn_unused_result warnings. 2009-12-29 21:03:23 -08:00
Vinson Lee
31263f41a0 st/xorg: Use C-style comments. 2009-12-29 20:56:47 -08:00
Vinson Lee
97b899374c glu/sgi: Initialize member of struct GridVertex. 2009-12-29 20:45:24 -08:00
Jakob Bornecrantz
5169775345 st/xorg: Fix warning and add a TODO comment 2009-12-30 05:08:41 +01:00
Jakob Bornecrantz
d34fdf149d st/xorg: On close wait on fences and then destroy the screen 2009-12-30 05:01:09 +01:00
Jakob Bornecrantz
5fdc4f732f st/xorg: Be proper with pipe pointers on close in exa 2009-12-30 05:00:30 +01:00
Jakob Bornecrantz
53e314cb80 st/xorg: Make sure we don't overrun the fence array in block handler 2009-12-30 04:22:12 +01:00
Vinson Lee
3bcf7d7d7b glu/sgi: Initialize member variables in class Varray. 2009-12-29 17:46:42 -08:00
Vinson Lee
a7db305c2f glu/sgi: Initialize member of class monoChain. 2009-12-29 17:35:22 -08:00
Vinson Lee
5060fb428d glu/sgi: Initialize members of class sampledLine. 2009-12-29 17:22:11 -08:00
Vinson Lee
495b8f8f7a glu/sgi: Initialize members of class directedLine. 2009-12-29 14:28:33 -08:00
Vinson Lee
62a0d4ef7f mesa: Initialize variable in get_tex_color_index. 2009-12-29 13:38:02 -08:00
Brian Paul
4f481cb87a glsl: added uniform initializer check
GLSL 1.10 disallows initializers for uniforms but GLSL 1.20 and later
allows them.  This patch uses the #version directive to allow/disallow
uniform initializers.

This addresses bug 25807, but piglit also needs to be fixed to specify
the GLSL version in the shader.
2009-12-29 10:11:29 -07:00
Brian Paul
639e7a140e ARB prog parser: use _mesa_add_unnamed_constant() to use fewer constant slots
This function will search the constant parameters in an effort to re-use
constant slots.  For example, {1,2,3,4} and {4,1,1,2} can be stored in
one constant slot and accessed with different swizzles.  The swizzle info
must be propogated though the parsing code in a few places.

Fixes Piglit "vpfp-generic tests/shaders/generic/big-param.vpfp" failure.
2009-12-29 09:08:02 -07:00
Julien Cristau
53d395336d Prepare changelog for upload 2009-12-29 10:42:29 +00:00
Julien Cristau
bc94d48259 Update patch stack
Drop hunk from 05_hurd-ftbfs.diff that was applied upstream.
Refresh other patches.
2009-12-29 10:40:05 +00:00
Julien Cristau
fabfd3eaca Bump linux-libc-dev build-dep to 2.6.31 for the r600 dri driver
fixes ftbfs on mips
2009-12-29 10:19:48 +00:00
Julien Cristau
089e2e656c Bump changelogs 2009-12-29 10:17:41 +00:00
Julien Cristau
7030b61d99 Merge branch 'mesa_7_6_branch' of git://anongit.freedesktop.org/mesa/mesa into debian-unstable
Conflicts:
	progs/tests/bug_texstore_i8.c
	progs/tests/crossbar.c
	progs/tests/cva.c
	progs/tests/fptest1.c
	progs/tests/invert.c
	progs/tests/packedpixels.c
	progs/tests/quads.c
	progs/tests/scissor-viewport.c
	progs/tests/scissor.c
	progs/tests/stencilwrap.c
	progs/tests/tex1d.c
	progs/tests/texcomp_image.h
	progs/tests/unfilledclip.c
	progs/tests/vpeval.c
	progs/trivial/clear-fbo-tex.c
	progs/trivial/createwin.c
	progs/trivial/dlist-begin-call-end.c
	progs/trivial/draw2arrays.c
	progs/trivial/drawarrays.c
	progs/trivial/tri-blend-max.c
	progs/trivial/tri-blend-min.c
	progs/trivial/tri-blend-revsub.c
	progs/trivial/tri-blend-sub.c
	progs/trivial/tri-blend.c
	progs/trivial/tri-fbo-tex.c
	progs/trivial/tri-fp.c
	progs/trivial/tri-logicop-none.c
	progs/trivial/tri-logicop-xor.c
	progs/trivial/tri-z.c
	progs/trivial/vbo-drawarrays.c
	progs/trivial/vbo-noninterleaved.c
	scons/gallium.py
	scons/generic.py
2009-12-29 10:16:21 +00:00
Vinson Lee
b4658dbf04 st/egl: Move declaration before code. 2009-12-28 19:09:33 -08:00
Vinson Lee
c67bb15d4e intel: Silence compiler warnings. 2009-12-28 18:46:15 -08:00
Vinson Lee
46c2196de3 llvmpipe: Fix assert. 2009-12-28 18:07:09 -08:00
Vinson Lee
e049ddb754 llvmpipe: Silence compiler warnings. 2009-12-28 18:05:30 -08:00
Keith Whitwell
f0ba7d897d util: better fix for unused variable warnings with asserts
Modify the non-debug (ie disabled) version of assert to expose the
value in the expression to the compiler (avoiding the unused variable
messages) while still expanding to a noop.
2009-12-28 11:06:11 +00:00
Vinson Lee
31d1822473 llvmpipe: Silence compiler warnings. 2009-12-28 00:44:30 -08:00
Vinson Lee
c441386b0c st/xorg: Silence unused variable warnings. 2009-12-27 23:02:55 -08:00
Vinson Lee
aa0437532e g3dvl: Silence compiler warnings. 2009-12-27 22:49:49 -08:00
Vinson Lee
bf63b9d7a9 st/vega: Silence compiler warnings. 2009-12-27 22:39:31 -08:00
Vinson Lee
9d3092d134 gallium/xlib: Silence unused variable warning. 2009-12-27 22:18:18 -08:00
Vinson Lee
d1f64fa72f trace: Silence unused variable warnings. 2009-12-27 18:12:58 -08:00
Vinson Lee
f31f9cf485 i915g: Silence unused variable warning. 2009-12-27 18:09:58 -08:00
Vinson Lee
3a2f96f18a softpipe: Silence unintialized variable warnings. 2009-12-27 18:06:02 -08:00
Vinson Lee
180ccffe55 softpipe: Silence unused variable warning. 2009-12-27 17:52:47 -08:00
Vinson Lee
0463ee64e3 tgsi/ureg: Silence uninitialized variable warnings. 2009-12-27 17:40:48 -08:00
Brian Paul
b0d5e44f24 docs: insert 7.7 release date 2009-12-27 15:33:25 -07:00
Brian Paul
d0b7ff551a Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	src/gallium/auxiliary/util/u_network.c
	src/gallium/auxiliary/util/u_network.h
	src/gallium/drivers/i915/i915_state.c
	src/gallium/drivers/trace/tr_rbug.c
	src/gallium/state_trackers/vega/bezier.c
	src/gallium/state_trackers/vega/vg_context.c
	src/gallium/state_trackers/xorg/xorg_crtc.c
	src/gallium/state_trackers/xorg/xorg_driver.c
	src/gallium/winsys/xlib/xlib_brw_context.c
	src/mesa/main/mtypes.h
2009-12-27 15:31:08 -07:00
Brian Paul
da876fa3a5 docs: insert 7.6.1 release date 2009-12-27 15:14:25 -07:00
Brian Paul
7831515e69 st/mesa: add missing case for PIPE_FORMAT_B8G8R8A8_UNORM 2009-12-27 10:09:24 -07:00
Vinson Lee
331e910b5c gallium/util: Remove comma at end of enumerator list. 2009-12-26 16:22:25 -08:00
Vinson Lee
3c2fd1bae0 rbug: Remove comma at end of enumerator list. 2009-12-26 16:18:47 -08:00
Vinson Lee
f8ca25e02f rbug: Remove comma at end of enumerator list. 2009-12-26 16:14:39 -08:00
Vinson Lee
fc11424bcd mesa: Remove comma at end of enumerator list. 2009-12-26 16:09:41 -08:00
Vinson Lee
309c156bae i915: Fix assert. 2009-12-26 15:55:38 -08:00
Vinson Lee
e81fe088f4 progs/demos: Silence warn_unused_result warnings. 2009-12-26 01:08:26 -08:00
Vinson Lee
cdc69e3469 progs/util: Silence warn_unused_result warnings. 2009-12-25 23:13:50 -08:00
Vinson Lee
cd59e6f553 intel: Silence implicit function declaration warning. 2009-12-25 22:34:35 -08:00
Vinson Lee
67a4abcc3b glu/sgi: Fix include recursion.
arcsorter.h should not include itself.
2009-12-25 14:23:10 -08:00
Julien Cristau
36461f0d66 Delete some files not present in tarballs 2009-12-25 19:48:46 +01:00
Julien Cristau
5e20a66515 Bump changelogs 2009-12-25 17:06:27 +01:00
Julien Cristau
12251b4915 Merge remote branch 'upstream/mesa_7_7_branch' into debian-experimental
Conflicts:
	progs/tests/bug_texstore_i8.c
	progs/tests/crossbar.c
	progs/tests/cva.c
	progs/tests/fptest1.c
	progs/tests/invert.c
	progs/tests/packedpixels.c
	progs/tests/quads.c
	progs/tests/scissor-viewport.c
	progs/tests/scissor.c
	progs/tests/stencilwrap.c
	progs/tests/tex1d.c
	progs/tests/unfilledclip.c
	progs/tests/vpeval.c
	progs/trivial/clear-fbo-tex.c
	progs/trivial/createwin.c
	progs/trivial/dlist-begin-call-end.c
	progs/trivial/draw2arrays.c
	progs/trivial/drawarrays.c
	progs/trivial/tri-blend-max.c
	progs/trivial/tri-blend-min.c
	progs/trivial/tri-blend-revsub.c
	progs/trivial/tri-blend-sub.c
	progs/trivial/tri-blend.c
	progs/trivial/tri-fbo-tex.c
	progs/trivial/tri-fp.c
	progs/trivial/tri-logicop-none.c
	progs/trivial/tri-logicop-xor.c
	progs/trivial/tri-z.c
	progs/trivial/vbo-drawarrays.c
	progs/trivial/vbo-noninterleaved.c
	src/glut/glx/glut_menu.c
2009-12-25 16:25:56 +01:00
Julien Cristau
addd04c255 Don't include GLUT sources since we don't use them. 2009-12-25 16:19:26 +01:00
Julien Cristau
2596bd88d7 Add freedesktop.org ftp to watch file since that's where newer upstream tarballs are. 2009-12-25 16:13:38 +01:00
Vinson Lee
2447786ed0 i965: Fix assert. 2009-12-24 22:58:05 -08:00
Vinson Lee
f5ad1d0d02 i965: Add missing va_end. 2009-12-24 16:26:09 -08:00
Vinson Lee
098f10c270 glsl: Initialize member a_obj of struct slang_operation. 2009-12-23 18:00:06 -08:00
Vinson Lee
261c3cd530 glu/sgi: Initialize variable in directedLine. 2009-12-23 17:50:02 -08:00
Vinson Lee
520955a0cd gallium/util: Initialize variable in util_clear. 2009-12-23 16:22:03 -08:00
Vinson Lee
6138145b35 glu/sgi: Silence compiler warnings. 2009-12-23 16:11:10 -08:00
Vinson Lee
51dcea2aac util: Ensure debug_dump_flags generates a null-terminated string. 2009-12-23 15:19:45 -08:00
Vinson Lee
2ea061509d st/xorg: Use C-style comments. 2009-12-23 14:52:06 -08:00
Vinson Lee
15ecd0337e st/vega: Move declaration outside for loop. 2009-12-23 14:43:53 -08:00
Vinson Lee
1b0ab3e3c9 st/egl: Use C-style comments. 2009-12-23 14:18:11 -08:00
Vinson Lee
6c8c1ce78b glx: Add XF86DRI[Open|Close]FullScreen prototypes to xf86dri.h. 2009-12-23 14:09:36 -08:00
Vinson Lee
cf3bb0cf31 glx: Move declaration outside for loop. 2009-12-23 12:42:38 -08:00
Tom Fogal
f42c861f02 Regenerate gl_mangle.h.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-12-23 11:38:14 -07:00
Maarten Maathuis
8e8502bc63 gallium: only create pipe buffer when size is nonzero
- This fixes a crash upon starting spring (a rts engine/game).

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
2009-12-23 16:33:54 +00:00
Vinson Lee
57b5ca5d11 glu/sgi: Silence uninitialized variable warnings. 2009-12-22 23:07:00 -08:00
Vinson Lee
19a40524d3 Add gallium to darwin config. 2009-12-22 18:21:41 -08:00
Vinson Lee
aae32df718 xlib: Use C-style comments. 2009-12-22 17:51:58 -08:00
Vinson Lee
b20382d477 trace: Silence uninitialized variable warnings. 2009-12-22 17:34:39 -08:00
Vinson Lee
f6ca26e5a7 trace: Add PIPE_OS_APPLE. 2009-12-22 17:17:28 -08:00
Vinson Lee
6ce28a755c gallium/util: Add PIPE_OS_APPLE to u_stream_stdc.c. 2009-12-22 16:23:00 -08:00
Vinson Lee
5e73bcb396 gallium/util: Add PIPE_OS_APPLE to u_network. 2009-12-22 15:59:50 -08:00
Vinson Lee
fb8bff341e i915g: Use C-style comment. 2009-12-22 15:19:48 -08:00
Vinson Lee
cf02484fb6 glx: Compile dri2.c only if GLX_DIRECT_RENDERING is defined. 2009-12-22 14:51:12 -08:00
Vinson Lee
c1033299e8 ffb: Silence compiler warnings. 2009-12-22 14:28:40 -08:00
Brian Paul
b5ddc7821a mesa: fix binary() function, printf format string
Need to use the constant 1ULL and 0xllx format string.  This fixes incorrect
results and a NULL pointer/parameter bug.
2009-12-22 13:33:40 -07:00
Vinson Lee
1bf2d78b11 progs/tests: Fix build. 2009-12-22 00:54:34 -08:00
Ian Romanick
82184970d3 Add MD5 checksums for 7.6.1 release 2009-12-21 18:43:09 -08:00
Ian Romanick
e9b5ed1c13 Add MD5 checksums for 7.6.1 release 2009-12-21 18:32:32 -08:00
Ian Romanick
6ffed19993 Add MD5 checksums for 7.7 release 2009-12-21 18:30:35 -08:00
Ian Romanick
7e210b9337 mesa: set version string to 7.7 2009-12-21 18:28:32 -08:00
Ian Romanick
164b583852 intel: Bump driver date to reflect status as final Q4 driver RC 2009-12-21 18:27:50 -08:00
Ian Romanick
48302e9b30 Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	scons/gallium.py
	scons/generic.py
	src/mesa/main/version.h
2009-12-21 18:27:24 -08:00
Ian Romanick
75ad099d3c mesa: set version string to 7.6.1 2009-12-21 18:25:30 -08:00
Vinson Lee
982acbddab progs/perf: Fix MSVC build.
(cherry picked from commit cbf46ed670)
2009-12-21 18:10:44 -08:00
José Fonseca
09415ca234 mesa: Fix missing finite symbol error on Windows.
Caused by some weird logic regarding the __WIN32__ define which made
the finite definition dependent on the header include order.
(cherry picked from commit 622bdecabd)
2009-12-21 17:56:25 -08:00
Michal Krol
de7021b71c mesa: Include <unistd.h> only when one is available.
(cherry picked from commit 970823978c)
2009-12-21 17:55:13 -08:00
Vinson Lee
2b7b2b90e3 scons: Define _USE_MATH_DEFINES on MSVC. 2009-12-21 17:25:03 -08:00
Brian Paul
b57abd3bea Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	configure.ac
	progs/demos/morph3d.c
	progs/demos/textures.c
	progs/glsl/shtest.c
	progs/glsl/texaaline.c
	progs/tests/packedpixels.c
	progs/xdemos/corender.c
	src/mesa/main/version.h
2009-12-21 18:23:53 -07:00
Fabio Pedretti
bf064ce0c3 configure.ac: fix for libdrm_radeon API changes. 2009-12-22 10:44:53 +10:00
Fabio Pedretti
e46ad402f1 configure.ac: fix for libdrm_radeon API changes. 2009-12-22 10:44:28 +10:00
Dave Airlie
bd9e0ebaff radeon/r600: use new libdrm_radeon api 2009-12-22 10:25:47 +10:00
Dave Airlie
bce03f7174 radeon: drop assert accessing cref which is meant to be hidden 2009-12-22 10:25:05 +10:00
Dave Airlie
34671efa29 radeon: drop unused members of radeon_state. 2009-12-22 10:24:57 +10:00
Dave Airlie
e77bfc436d r600: move structs for legacy cmdbuf into cmdbuf C file.
these really shouldn't be exposed here
2009-12-22 10:24:47 +10:00
Dave Airlie
9373287a1b radeon/r600: use new libdrm_radeon api 2009-12-22 10:23:41 +10:00
Dave Airlie
9d2910ee0f radeon: drop assert accessing cref which is meant to be hidden 2009-12-22 10:23:41 +10:00
Dave Airlie
43d8727301 radeon: drop unused members of radeon_state. 2009-12-22 10:23:40 +10:00
Dave Airlie
1703628011 r600: move structs for legacy cmdbuf into cmdbuf C file.
these really shouldn't be exposed here
2009-12-22 09:58:33 +10:00
Vinson Lee
07b54fe35b progs/redbook: Silence compiler warnings. 2009-12-21 15:20:01 -08:00
Brian Paul
fdae39c289 progs/perf: added check for GL_ARB_framebuffer_object 2009-12-21 13:49:25 -07:00
Brian Paul
79e74cda73 progs/demos: report pixel rate in million pixels / sec 2009-12-21 13:49:25 -07:00
Dave Airlie
753f0a1dea r600: fix glFrontFace(GL_CW)
fd.o bug #25290

Suggested fix from Rafael Monica
2009-12-21 10:40:19 -05:00
Younes Manton
ace937f165 st/mesa: Check for single level mipmap trees.
The assert in util_gen_mipmap() caught it, although
it does the right thing anyway.
2009-12-21 00:59:06 -05:00
Jeremy Huddleston
b96a5df514 darwin: mklib: Use lipo rather than file to figure out architectures of object files
(cherry picked from commit ad7f9d71e2)
2009-12-20 21:36:41 -08:00
Jeremy Huddleston
f926eff263 darwin: Cleanup CPPFLAGS a bit
(cherry picked from commit 4a1e103858)
2009-12-20 21:36:39 -08:00
Vinson Lee
0dd9513874 progs/tests: Silence compiler warnings. 2009-12-20 01:01:00 -08:00
Vinson Lee
d87d71036c progs/trivial: Use C-style comments. 2009-12-19 00:28:01 -08:00
Vinson Lee
3340fd65fb progs/xdemos: Use C-style comment. 2009-12-19 00:00:56 -08:00
Vinson Lee
695adf41e2 progs/demos: Silence compiler warning in morph3d.c. 2009-12-18 23:46:14 -08:00
Vinson Lee
121ff55d81 progs/glsl: Use C-style comments. 2009-12-18 23:38:15 -08:00
Vinson Lee
41377942d3 progs/demos: Use C-style comment. 2009-12-18 23:34:28 -08:00
Brian Paul
0478b745fe glsl: clear out shader code before compiling
When we start compiling a shader, first free the existing gl_program.
This (mostly) fixes the piglit glsl-reload-source test.
Without this change, we were actually appending the new GPU code
onto the previous program.
2009-12-18 11:57:17 -07:00
Alex Deucher
20ee275974 r600: Invert front face winding when rendering to FBO
fixes fdo bug 25679

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-12-16 16:18:22 -05:00
Ian Romanick
aeea8a07b8 mesa: set version string to 7.6.1-rc4 2009-12-16 10:13:41 -08:00
Brian Paul
8a09e6e2ad mesa: add missing semicolon
See bug 25663.
2009-12-16 10:39:26 -07:00
Brian Paul
35ff190a9c docs: document 7.6.1 BlueGene fixes 2009-12-16 08:17:43 -07:00
Brian Paul
138d639ec9 mesa: test for __blrts for CPU_TO_LE32()
See bug 25663.
2009-12-16 08:04:25 -07:00
Brian Paul
a43fc39585 mesa: no dlopen on BlueGene
See bug 25663.
2009-12-16 08:02:56 -07:00
Brian Paul
6f202b53b0 mesa: remove //-style comments 2009-12-16 07:58:54 -07:00
Brian Paul
ddfc2e7439 st/mesa: remove //-style comments 2009-12-16 07:58:54 -07:00
Vinson Lee
dc0a1ebc73 unichrome: Silence compiler warnings. 2009-12-15 17:39:30 -08:00
Vinson Lee
a60457b03b sis: Silence compiler warnings. 2009-12-15 17:06:01 -08:00
Vinson Lee
7e3825abdb savage: Silence compiler warnings. 2009-12-15 16:32:51 -08:00
Vinson Lee
ca02109e91 r128: Silence uninitialized variable warnings in r128_tris.c. 2009-12-15 13:12:12 -08:00
Vinson Lee
7430c3ac35 dri: Initialize variable in driBindContext. 2009-12-15 13:04:25 -08:00
Ian Romanick
f23d01e726 intel: Fallback to software if drawable size is > MaxRenderbufferSize
This prevents the mystery blank window if, for example, glxgears is
resized larger than 2048 wide on 915.  Since the Intel drivers in Mesa
7.6 lack GTT mapped fallbacks, the performance is a slideshow at
best.  On Mesa 7.7 and later the performance is much better.
2009-12-15 12:37:09 -08:00
Vinson Lee
987e9188d2 x86: ifdef out unused function cptr. 2009-12-15 12:32:48 -08:00
Matthew Bell
22d2547ad1 mesa: Add missing $(DESTDIR) support to src/gallium/winsys/xlib/Makefile 2009-12-14 21:58:19 -07:00
Vinson Lee
0a8d508854 progs/trivial: Silence compiler warnings. 2009-12-14 18:11:57 -08:00
Vinson Lee
6e5fe39f50 mga: Silence uninitialized variable warnings. 2009-12-14 17:30:15 -08:00
Vinson Lee
b18fa9f448 mach64: Silence uninitialized variable warnings. 2009-12-14 17:20:34 -08:00
Brice Goglin
35994294ea Bump libdrm build dependency to 2.4.15 2009-12-14 09:20:38 +01:00
Vinson Lee
6c9870b54c i810: Silence uninitialized variable warnings in i180tris.c 2009-12-13 00:14:31 -08:00
Vinson Lee
555dc25c4c swrast: Silence uninitialized variable warnings in s_triangle.c 2009-12-12 23:47:32 -08:00
Vinson Lee
aa44efb045 st/mesa: Silence uninitialized variables warnings in st_draw.c. 2009-12-12 22:17:16 -08:00
Vinson Lee
0aef54ba62 swrast: Silence uninitialized variable warnings in ss_tritmp.h. 2009-12-12 22:00:19 -08:00
Vinson Lee
89d85e8170 glut: Prevent potential double free in menuVisualSetup. 2009-12-12 21:46:13 -08:00
Vinson Lee
20590b9733 t_dd_dmatmp.h: Silence unused value warning in render_poly_elts. 2009-12-12 20:20:02 -08:00
Vinson Lee
cd1a09e3bb glsl: Initialize member label of struct slang_operation to NULL. 2009-12-12 18:42:18 -08:00
Vinson Lee
f8d4ac56f7 softpipe: Initialize source in blend_quad. 2009-12-12 18:34:15 -08:00
Vinson Lee
7ea452dd35 t_dd_dmatmp2.h: Silence unused value warnings. 2009-12-12 16:56:07 -08:00
Vinson Lee
75e8dbb235 i915g: Silence unused value warning in intel_drm_get_device_id. 2009-12-12 16:24:25 -08:00
Vinson Lee
9dc018618d t_dd_dmatmp.h: Silence unused value warnings in render_line_loop_elts. 2009-12-12 16:18:08 -08:00
Vinson Lee
af4e4a73f7 t_dd_dmatmp.h: Silence unused value warning in render_tri_fan_elts. 2009-12-12 16:02:09 -08:00
Vinson Lee
588e9f69c4 progs/trivial: Silence compiler warnings in tri-blend-min.c. 2009-12-12 15:47:17 -08:00
Vinson Lee
de9132f274 t_dd_dmatmp.h: Silence unused value warning in render_poly_verts. 2009-12-12 15:27:30 -08:00
Vinson Lee
1e444c9960 swrast: Initialize tex_coords in handle_sample_op. 2009-12-12 15:08:01 -08:00
Vinson Lee
c1d361bd0b t_dd_dmatmp.h: Silence unused value warning in render_quads_verts. 2009-12-12 14:41:35 -08:00
Vinson Lee
786899f153 progs/trivial: Silence compiler warnings in tri-blend-max.c 2009-12-12 14:20:17 -08:00
Vinson Lee
7d529736b9 t_dd_dmatmp.h: Silence unused value warning in render_tri_fan_verts. 2009-12-12 13:39:39 -08:00
Vinson Lee
c2cee7741e t_dd_dmatmp.h: Silence unused value warning in render_line_loop_verts. 2009-12-12 12:52:02 -08:00
Brice Goglin
bb1193ca83 Prepare Changelog for upload 2009-12-12 13:03:07 +01:00
Brice Goglin
14cc33508c Do not build s3v and trident anymore 2009-12-12 13:02:44 +01:00
Brice Goglin
890a0f155f New upstream release candidate 2009-12-12 12:35:13 +01:00
Brice Goglin
6640b46db9 Merge branch 'upstream-experimental' into debian-experimental
Conflicts:
	doxygen/gallium.doc
	progs/egl/demo1.c
	progs/egl/demo2.c
	progs/egl/demo3.c
	progs/egl/eglgears.c
	progs/egl/eglinfo.c
	progs/slang/cltest.c
	progs/slang/vstest.c
	progs/tests/arbgpuprog.c
	progs/tests/getprocaddress.c
	progs/tests/getteximage.c
	progs/tests/mipmap_limits.c
	progs/tests/packedpixels.c
	progs/tests/sharedtex.c
	progs/tests/texcmp.c
	progs/tests/texcomp_image.h
	progs/tests/texcompsub.c
	progs/tests/zreaddraw.c
	scons/crossmingw.py
	scons/dxsdk.py
	scons/gallium.py
	scons/generic.py
	scons/llvm.py
	scons/winddk.py
	src/gallium/state_trackers/xorg/xvmc/tests/.gitignore
	src/gallium/state_trackers/xorg/xvmc/tests/test_context.c
	src/gallium/state_trackers/xorg/xvmc/tests/test_rendering.c
	src/gallium/state_trackers/xorg/xvmc/tests/testlib.c
	src/gallium/state_trackers/xorg/xvmc/tests/xvmc_bench.c
	src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
	windows/VC7/mesa/mesa/mesa.vcproj
2009-12-12 12:31:27 +01:00
Vinson Lee
15c6558a2e progs/xdemos: Silence compiler warnings in glxinfo.c. 2009-12-12 02:06:51 -08:00
Vinson Lee
d5be33477e progs/tests: Silence compiler warnings in vpeval.c. 2009-12-12 01:34:33 -08:00
Vinson Lee
44d6ab6de5 progs/tests: Silence compiler warnings in cva.c. 2009-12-12 01:11:56 -08:00
Vinson Lee
9e2eee4ab2 progs/redbook: Silence compiler warnings in aaindex.c. 2009-12-12 01:02:16 -08:00
Vinson Lee
81dcf8bdf2 t_dd_dmatmp.h: Silence unused value warning in render_line_loop_verts. 2009-12-12 00:33:42 -08:00
Brian Paul
e128cc205e Merge branch 'mesa_7_6_branch' into mesa_7_7_branch 2009-12-11 09:51:27 -07:00
Brian Paul
b605f4ff11 Merge branch 'mesa_7_6_branch' into mesa_7_7_branch 2009-12-11 09:22:00 -07:00
José Fonseca
da3bc492d2 scons: Tweak MSVC release options.
Enable whole program optimizations and fast math.
2009-12-11 15:16:22 +00:00
José Fonseca
ffae1f938d svga: Add a missing dependency from the prescale state.
Thanks for Keith to finding this.

Fixes Jedi Knight 2 menus.
2009-12-11 14:14:03 +00:00
José Fonseca
8469baf41b svga: Always pass SVGA3D_SURFACE_HINT_DYNAMIC.
Since we're reusing buffers we're effectively transforming all
of them into dynamic buffers.

It would be nice to not cache long lived static buffers. But there
is no way to detect the long lived from short lived ones yet. A
good heuristic would be buffer size.
2009-12-11 13:15:12 +00:00
José Fonseca
16876b8328 svga: Keep tight control of texture handle ownership.
The texture owns the surface handle. All derivatives need to keep
a reference to texture.

This fixes several assertions failures starting up Jedi Knight 2.

Should cause no change for DRM surface sharing -- reference count still
done as before there.
2009-12-11 12:29:02 +00:00
José Fonseca
770323e33e svga: Fix mixed signed comparisons. 2009-12-11 12:28:53 +00:00
José Fonseca
a2937a2f4e scons: Pass -fno-strict-aliasing to gcc.
Strict aliasing tule violations were fixed on master, but
they're still causing problem in this branch, so disable this assumptions.

Do not apply this fix to master (revert when you merge).
2009-12-11 12:28:53 +00:00
José Fonseca
8c981b94dc scons: Make it work with MinGW build of LLVM 2.6.
LLVM 2.5 is no longer supported on windows.
2009-12-11 12:28:53 +00:00
Ian Romanick
e624b77eb2 intel: Remove ARGB internal_format == GL_RGB hacks
Now that XRGB is supported, we don't need to hack around cases of an RGBA
format buffer with an internal format of GL_RGB.
2009-12-10 15:12:31 -08:00
Ian Romanick
b4a6169412 intel: Make RGB textures use XRGB8888 2009-12-10 15:12:30 -08:00
Ian Romanick
cbdeb33209 intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. 2009-12-10 15:12:30 -08:00
Ian Romanick
eadd9b8e16 i965: Fix handling of drawing to MESA_FORMAT_XRGB8888
It turns out that 965 and friends cannot actually render to an xRGB
surfaces.  Instead, the surface has to be RGBA with writes to alpha
disabled and the blend function modified to always use 1.0 for
destination alpha.
2009-12-10 15:12:30 -08:00
Ian Romanick
4f2b2032f4 intel: Use spantmp2 GL_BGR / GL_UNSIGNED_INT_8_8_8_8_REV for XRGB8888 2009-12-10 15:12:30 -08:00
Ian Romanick
ffc1f299e9 spantmp2: Add support for GL_BGR / GL_UNSIGNED_INT_8_8_8_8_REV
This is really for MESA_FORMAT_XRGB8888.  Clearly spantmp2.h needs some
re-work.  Any volunteers?
2009-12-10 15:12:30 -08:00
Ian Romanick
430876cd3a intel: name in intel_create_renderbuffer was always 0, remove 2009-12-10 15:12:30 -08:00
Ian Romanick
0f01674a58 intel: Use texformat accessor to get bytes-per-pixel 2009-12-10 15:12:30 -08:00
Ian Romanick
4eee46efcb intel: softwareBuffer in intel_alloc_renderbuffer_storage was always false, remove 2009-12-10 15:12:30 -08:00
Ian Romanick
3078bd136d intel: Axe intel_renderbuffer::texformat
Since the texformat branch merge, the value of intel_renderbuffer::texformat
is just a copy of gl_renderbuffer::Format.
2009-12-10 15:12:30 -08:00
Eric Anholt
539a14a1dd intel: Flush the render/texture cache when finishing render to texture.
Back when we were flushing the entire batch at BindFramebuffer, the kernel
would notice the domain transition when someone went to texture from it and
flush for us.  We no longer do the batch flushing every time, so we get to
do aggressive flushing until we move batchbuffer handling to libdrm.

Fixes piglit fbo-flushing.  Bug #25377.  No noticeable performance loss
on cairo-gl (so this is better than batch flushing).
2009-12-10 14:47:09 -08:00
Zack Rusin
967e6e2009 st/xorg: fix yv12 plus some cleanups in the upload code 2009-12-10 13:04:26 -05:00
Zack Rusin
690d888416 st/xorg: enable yv12 for xv 2009-12-10 13:04:05 -05:00
Vinson Lee
05b6296092 mesa: Fix SCons build.
Commit cd6b8dd9e8 deleted
src/mesa/state_tracker/st_cb_get.c.
2009-12-09 22:35:32 -08:00
Jakob Bornecrantz
5e2a86cb1b vmware/xorg: Properly detect overlay support 2009-12-09 09:51:05 +01:00
Jakob Bornecrantz
b7cf8a1f93 vmware/core: Update vmwgfx_drm.h 2009-12-09 09:51:04 +01:00
Ian Romanick
e3fa700c17 meta: Bind texture to unit 0 for mipmap generation
If the active texture unit on entry to mipmap generation is not zero, bind the
texture to unit zero.

Fixes bug #24219.
2009-12-09 11:05:15 -08:00
Eric Anholt
cd6b8dd9e8 mesa: Move OES_read_format support from drivers into the core.
The assertion is that the correct read type to be using is the native
type of the underlying read renderbuffer.  For some fallback paths, this
may be worse than GL_RGBA/GL_UNSIGNED_BYTE for reads today, but it gets
all drivers the expected GL_BGRA/GL_UNSIGNED_BYTE for ARGB8888 or
GL_BGR//GL_UNSIGNED_SHORT_5_6_5_REV for rgb565 with no work.

This fixes the intel (and other) DRI drivers to report read formats that
should hit blit PBO readpixels paths.
2009-12-09 10:37:36 -08:00
Eric Anholt
dd9eb8774a i965: Enable the accelerated ReadPixels path on gen4 along with pre-gen4.
Passes piglit pbo-read-argb8888, and doesn't otherwise regress quick.tests.
2009-12-08 16:35:05 -08:00
Thomas Hellstrom
f44f6473e6 st/xorg Fail early if we don't intend to accelerate.
Saves a number of unneeded computations and log noise.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2009-12-08 12:50:27 +01:00
Jeremy Huddleston
189ee75abb darwin: mklib: Use lipo rather than file to figure out architectures of object files
(cherry picked from commit ad7f9d71e2)
2009-12-20 21:36:58 -08:00
Jeremy Huddleston
da5741cf53 darwin: Cleanup CPPFLAGS a bit
(cherry picked from commit 4a1e103858)
2009-12-20 21:36:56 -08:00
Eric Anholt
6785d6741d i915: Fix GL_TEXTURE_MAX_LEVEL support (piglit levelclamp test). 2009-12-18 20:35:57 -08:00
Eric Anholt
b51e0fafdf i915: Clean up some unnecessary x/y miptree code.
The base of the texture is always the base of the miptree.  If it wasn't,
we'd have issues with this code due to miptrees not walking the same
direction for all LODs.
2009-12-18 20:35:57 -08:00
Eric Anholt
f06c8bd8dd i965: Add support for OPCODE_CMP in the VS to fix GLSL sqrt()
Bug #25628.  Fixes piglit case glsl-vs-sqrt-zero.
2009-12-18 20:35:57 -08:00
Keith Whitwell
325f045c04 st/mesa: move assert on nr vs insns until after pos_invarient expansion
It is possible to have a 1-instruction vertex shader before expanding
pos_invarient.  Not sure what this assert achieved, but at least move
it where it is correct.
2009-12-18 18:39:44 +00:00
Jakob Bornecrantz
6f1db18f14 vmware/xorg: Also stop ports on close 2009-12-04 16:50:26 +01:00
Jakob Bornecrantz
124f4bc977 vmware/xorg: Stop video ports on leave vt 2009-12-04 16:50:20 +01:00
Jakob Bornecrantz
f2e3fc1814 st/xorg: Add enter/leave vt hooks for winsys 2009-12-04 16:50:16 +01:00
Jakob Bornecrantz
c33520b360 st/xorg: Fix leave enter vt cycle in crtc code 2009-12-04 16:50:12 +01:00
Jakob Bornecrantz
d5b94b49f6 st/xorg: New libkms destroy api 2009-12-04 16:50:08 +01:00
Michel Dänzer
32ccc9b0bb vmware/xorg: Fix SCons build.
Not sure how vmw_screen.c could build at all though...
2009-12-08 11:45:19 +01:00
Michel Dänzer
9e42683fb3 vmware/xorg: Avoid warning about HAVE_STDINT_H being redefined. 2009-12-08 11:43:22 +01:00
Andre Maasikas
0d4a05445c Merge branch 'mesa_7_6_branch' into mesa_7_7_branch 2009-12-08 10:16:14 +02:00
Ian Romanick
ba167f812c mesa: set version string to 7.7-rc1
Also modify the Makefile to use the correct version for the tarballs.
2009-12-07 17:18:56 -08:00
Ian Romanick
8fc433fa0f Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	progs/demos/projtex.c
	progs/xdemos/glxinfo.c
	src/mesa/main/version.h

To fix the confilicts in projtex.c and glxinfo.c I just took the code from
mesa_7_6_branch.  The conflicts seem to have occured from cherry-picks from
mesa_7_7_branch to mesa_7_6_branch followed by commmits just to
mesa_7_6_branch.
2009-12-07 17:16:10 -08:00
Ian Romanick
bb64c9bcdf Revert "intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers."
This reverts commit 4598942b1b.

XRGB8888 doesn't work as intended.  Revert this for now, and we'll revisit it
for 7.8 or something.
2009-12-07 17:06:07 -08:00
Maciej Cencora
9921b3048e radeon: fix cases when only first image where put directly into miptree.
Make sure that minimal width, height and depth of texture image is 1.
2009-12-07 22:33:11 +01:00
Maciej Cencora
013cf1d63d radeon: fix image migration for small compressed textures
memcpy would give incorrect results if src rowstride != dst rowstride
2009-12-07 22:29:11 +01:00
Jakob Bornecrantz
1ef8c493b2 vmware/xorg: Use Write instead of WriteRead for cursor bypass 2009-12-04 10:33:34 +01:00
Jakob Bornecrantz
cd4d806a47 vmware/xorg: Give kernel infromation about cursor bypass 2009-12-04 09:54:51 +01:00
Jakob Bornecrantz
12fdef20b0 vmware/xorg: Handle no init of video in vmw_video_close 2009-12-04 09:54:50 +01:00
Jakob Bornecrantz
47e128331a vmware/core: Update vmwgfx_drm.h to include cursor bypass 2009-12-04 09:54:50 +01:00
Jakob Bornecrantz
bc0532b0ed gallium: DRI drivers enabled by default, Xorg drivers auto by default.
This change enabled gallium dri drivers by default under the
configure build system. Xorg drivers are built automaticaly
if a Xorg dev enviroment is installed and the Xorg version
is higher then 1.6.0.
2009-12-04 19:02:41 +00:00
Jakob Bornecrantz
8ac2503397 i915g: Do not build winsys and binaries by default
Using a hack in the configure script the gallium intel
drivers have 3 options. Off, nothing is built. On, the
driver and binaries are built. Auto, only the driver but
not the binaries and winsys is built.

Since the i915g driver builds everywhere its can enable
the driver per default, so we can get build coverage.
But building the binaries per default is a pain for
distributions and testers since they conflict on the
install target with the old mesa drivers. Which are more
stable/faster/better.

So this change gives us the best of both worlds.
2009-12-04 16:01:41 +00:00
Maciej Cencora
6c41bb25a2 radeon: workaround an FBO issue
Fixes #21501
2009-12-03 20:23:22 +01:00
Maciej Cencora
8cde43eb19 radeon: properly check if image should be placed in the miptree
Fixes #25355
2009-12-03 20:23:22 +01:00
Jakob Bornecrantz
0c75854cc1 Merge commit 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	src/mesa/main/version.h
2009-12-02 14:52:51 +01:00
Eric Anholt
4598942b1b intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. 2009-12-02 16:19:37 -08:00
Eric Anholt
db352f58fa mesa: Fix bad conversion in AL1616_REV texstore. 2009-12-02 16:19:36 -08:00
Eric Anholt
b47f7316da mesa: Fix copy'n'paste problem in al1616 texel fetch. 2009-12-02 16:19:36 -08:00
Jakob Bornecrantz
77ff3a5619 vmware/xorg: Add video support
By using the hooks st/xorg provides us we can create a driver
specific implementation that uses the svga overlay engines.
2009-12-01 17:29:42 +01:00
Jakob Bornecrantz
64102a5625 vmware/xorg: Create a small driver that sits ontop of st/xorg 2009-12-01 17:29:42 +01:00
Jakob Bornecrantz
bb80a93c9e st/xorg: Create winsys hooks that we call into 2009-12-01 17:29:41 +01:00
Jakob Bornecrantz
232e59ca6f vmware/core: Update vmwgfx_drm.h to latest version 2009-12-01 17:29:41 +01:00
Jakob Bornecrantz
9077ddaa25 svga: Add header files for overlay support 2009-12-01 17:29:40 +01:00
Eric Anholt
a7e4a311e9 intel: Fix more front-buffer rendering after Brian's less flushing patch.
bcbfda71b0 left out many blit paths.
This fixes up more of them to get Blender to work again.

Bug #25030.
2009-12-02 11:58:57 -08:00
José Fonseca
b2581dcab4 wgl: Call st_swapbuffers instead of st_notify_swapbuffers.
This will get single buffer, double buffer, and
joint single/double buffer (typical in CAD applications) done right,
at least as far as the frambuffer is concerned.

There are still problems with multiple contexts using the same
framebuffer because st_framebuffer_* calls assume the framebuffer
is bound to a single context.
2009-12-02 17:05:20 +00:00
Dave Airlie
e84dddde9b Revert "radeon/r300: no need to flush the cmdbuf when changing scissors state in KMM mode"
This reverts commit 286bf89e5a.

This doesn't appear to be correct, regression so revert it.
http://bugs.freedesktop.org/show_bug.cgi?id=25193
2009-12-02 11:03:22 +10:00
Brian Paul
c8cdce6657 vbo: make flush recursion check code per-context
This fixes invalid failed assertions when running multi-threaded apps.
2009-12-01 13:27:32 -07:00
Brian Paul
8c26cefec7 st/mesa: updated emit_swz() comment 2009-12-01 12:23:28 -07:00
Ian Romanick
f17dbe256b mesa: set version string to 7.7-rc1 2009-11-30 17:56:07 -08:00
Ian Romanick
650e02003f Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	progs/util/shaderutil.c
	src/mesa/drivers/dri/r600/r600_context.c
	src/mesa/main/version.h
2009-11-30 17:47:07 -08:00
Vinson Lee
270d36da14 mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
_mesa_TexParameterf calls set_tex_parameterf, which uses the params
argument as an array.
2009-11-29 21:17:44 -05:00
Vinson Lee
a201dfb6bf mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
_mesa_TexParameterf calls set_tex_parameteri, which uses the params
argument as an array.
2009-11-29 18:18:23 -05:00
Maciej Cencora
63c00c53a3 radeon: update miptree code a little
Simplify gl image level <-> miptree level mapping (are equal now).
Don't allocate miptree for images that won't fit in it (fixes #25230).
2009-11-29 17:27:48 +01:00
Maciej Cencora
2773556d55 radeon: don't check the same miptree many times when looking for matching miptrees 2009-11-29 17:27:47 +01:00
Maciej Cencora
e8f0c8ab9d radeon: add some debugging info 2009-11-29 17:27:47 +01:00
Vinson Lee
ca5a7aadb4 mesa: Fix array out-of-bounds access by _mesa_TexGenf.
_mesa_TexGenf calls _mesa_TexGenfv, which uses the params argument
as an array.
2009-11-29 00:50:48 -05:00
Vinson Lee
d55fb7c835 mesa: Fix array out-of-bounds access by _mesa_TexGeni.
_mesa_TexGeni calls _mesa_TexGeniv, which uses the params argument
as an array.
2009-11-28 23:47:23 -05:00
Vinson Lee
919898e92f dri: Fix potential null pointer dereference in driBindContext. 2009-11-28 23:22:31 -05:00
Vinson Lee
a11d60d14c mesa: Fix array out-of-bounds access in _mesa_TexEnvf.
_mesa_TexEnvf calls _mesa_TexEnvfv, which uses the param argument
as an array.
2009-11-28 22:08:20 -05:00
Maciej Cencora
e5159996a4 radeon: need to flush cs when moving images between mipmap trees 2009-11-28 21:36:59 +01:00
José Fonseca
2348f6d490 scons: Promote pointer arithmetic to error.
All code covered by scons is being built on multiple OSes, so pointer
arithmetic must really be addressed when spotted.
2009-11-27 17:06:12 +00:00
José Fonseca
5976d8e6f1 configs: Warn about pointer arithmetic.
It's not portable. Warn to help catching it early.
2009-11-27 17:06:12 +00:00
José Fonseca
f62f976e3f mesa: Avoid void pointer arithmetic. 2009-11-27 17:06:12 +00:00
Keith Whitwell
4236493899 st/xorg: proper fix for compositing after rounding up
Basically don't round up shared textures.  This fixes compiz,
but I'm afraid that rounding up texture sizes here in the driver
is doomed, as it will inevitably break texture wrap modes.
2009-11-27 15:30:18 +00:00
José Fonseca
1310811469 rbug: Mention where the GUI can be found. 2009-11-27 14:55:20 +00:00
José Fonseca
6dd9676a8f svga: Re-add shader dumping. 2009-11-27 14:04:47 +00:00
Keith Whitwell
6810ce005a Revert "st/xorg: fix composite after texture size changes"
This reverts commit 124ae59680.

Pushed by mistake
2009-11-27 14:03:10 +00:00
Keith Whitwell
124ae59680 st/xorg: fix composite after texture size changes 2009-11-27 13:59:22 +00:00
José Fonseca
dc86f4a20b wgl: Fix copy'n'paste typo in comment. 2009-11-27 13:35:04 +00:00
José Fonseca
135d7e1299 svga: Handle comment tokens when dumping. 2009-11-27 13:34:13 +00:00
José Fonseca
d3f26a8420 svga: Use consistent names for public symbol names of shader dumping facilities. 2009-11-27 13:34:07 +00:00
José Fonseca
178407f33c svga: Use consistent file names for dumping facilities. 2009-11-27 13:34:04 +00:00
Keith Whitwell
cf3cdda5cc st/xorg: speculatively round textures up to nearest POT
I'm not sure if this is a great change, but helps with caching.
Probably we want to turn this on/off on a driver-by-driver basis.
2009-11-27 12:24:57 +00:00
Keith Whitwell
e595dd4c17 st/xorg: free last fence 2009-11-27 12:24:57 +00:00
Keith Whitwell
b84b7f19df svga: flush our command buffer after the 8th distinct render target
This helps improve the surface cache behaviour in the face of the
large number of single-use render targets generated by EXA and the xorg
state tracker.  Without this we can reference hundreds of individual
render targets from a command buffer, which leaves little scope for
sharing or reuse of those targets.

Flushing early means we can start reusing textures much sooner.

This shouldn't have much effect on normal 3d rendering as it's pretty
rare to have a command buffer with >8 different render targets in that
world.
2009-11-27 12:24:57 +00:00
Keith Whitwell
b911688b87 svga: add DEBUG_CACHE option 2009-11-27 12:24:57 +00:00
Vinson Lee
69671df74c svga: Prevent potential null pointer dereference in vmw_surface.c. 2009-11-26 23:03:53 -05:00
Jakob Bornecrantz
949d95e88a vmware/xorg: Remove gem include 2009-11-25 02:22:35 +01:00
Michel Dänzer
42db8c8cdb st/xorg: Use pipe clear hook for solid fills of whole pixmaps.
Can give a little boost e.g. for anti-aliased text rendering.
2009-11-26 16:46:13 +01:00
Keith Whitwell
b96218c656 svga: hash the whole key, not just the first four bytes 2009-11-26 15:25:42 +00:00
Michel Dänzer
3eb3bfb7c7 st/xorg: Make sure DRI2 blits use GPU copy contents even for software fallback.
Fixes 3D apps not updating with a non-GL compositing manager and Option
"2DAccel" "off".

Also clean up a little pixmap vs. drawable mess.
2009-11-26 16:00:06 +01:00
Keith Whitwell
ecfe1352cc st/xorg: fix refcounting bugs introduced in earlier commit 2009-11-26 14:23:24 +00:00
Keith Whitwell
dfb871d403 st/xorg: formatting
This directory needs indent run over it.
2009-11-26 14:23:07 +00:00
Keith Whitwell
41423c01b2 st/xorg: remove debugging flush
Accidentally committed in 7fbdbad5c0
('st/xorg: consolidate some dest surface state setting')
2009-11-26 12:53:36 +00:00
José Fonseca
c783f5cfd8 svga: Remove spurious argument to SVGA_DBG. 2009-11-26 12:02:59 +00:00
Keith Whitwell
7b0e4adaf2 st/xorg: render throttling in block handler
Similar to the classic swapbuffer throttling in GL drivers, put an
upper bound on the number of outstanding chunks of rendering the state
tracker can generate -- where calling the block handler denotes a
chunk.

Currently that number is set at around 4 "chunks", but could be
tweaked up or down.  If a better measure for the amount of outstanding
rendering is found, that would be fine too.

As it stands, this improves interactivity by preventing the X server
from queueing up arbitary amounts of rendering.
2009-11-26 11:55:47 +00:00
Keith Whitwell
8544c309d0 st/xorg: split copy operation into prepare/copy/done phases
Any high-overhead one-off tasks are moved into the prepare hook.
2009-11-26 11:23:37 +00:00
Keith Whitwell
91a5131e6b st/xorg: don't set up constant buffer for non-xv fragment shaders
These currently don't reference any constants.  Can add this back
if newer shaders need them, but in the meantime don't create
a new constant buffer every time we do a blit.
2009-11-26 11:23:36 +00:00
Keith Whitwell
fa799f81de st/xorg: split up shared Done call
The two users of composite (Composite and Solid) now call a new
xorg_composite_done() from their Done functions, while CopyDone
is directly implemented on top of xorg_renderer.c.
2009-11-26 11:23:36 +00:00
Keith Whitwell
b4ea1eb871 st/xorg: set up rasterizer state in init 2009-11-26 11:23:36 +00:00
Keith Whitwell
86ba5139a8 st/xorg: remove redundant clipping code 2009-11-26 11:23:36 +00:00
Keith Whitwell
899d20cfaa st/xorg: don't bother with cso save and restore in copy func 2009-11-26 11:23:36 +00:00
Keith Whitwell
7fbdbad5c0 st/xorg: consolidate some dest surface state setting 2009-11-26 11:23:36 +00:00
Vinson Lee
808f037660 glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore. 2009-11-26 00:35:31 -05:00
Jakob Bornecrantz
45d9ea3619 vmware/xorg: Link against libkms
If the system doesn't have libkms installed it wont try to link against it.
2009-11-24 19:20:59 +01:00
Jakob Bornecrantz
77529a2cf2 vmware/xorg: Clean Makefile a bit 2009-11-24 19:16:37 +01:00
Jakob Bornecrantz
522e840a91 vmware/xorg: Don't link against libdrm_intel 2009-11-24 18:47:15 +01:00
Jakob Bornecrantz
eca5d6944a vmware/xorg: Stage driver in lib/gallium 2009-11-24 18:46:40 +01:00
Jakob Bornecrantz
7fac8ce73b st/xorg: Pass mode types from the kernel to X 2009-11-24 14:53:03 +01:00
Jakob Bornecrantz
ee40b20e7a st/xorg: Add libkms integration 2009-11-24 12:57:32 +01:00
Jakob Bornecrantz
1a19b9dbc2 st/xorg: Touch up xorg_crtc.c 2009-11-24 12:57:32 +01:00
Jakob Bornecrantz
def9b0e586 st/xorg: Rename driver functions 2009-11-24 12:57:32 +01:00
Jakob Bornecrantz
431e85f894 st/xorg: Rename output functions 2009-11-24 12:57:31 +01:00
Jakob Bornecrantz
6713a83bb8 st/xorg: Rename dri2 functions 2009-11-24 12:57:31 +01:00
Jakob Bornecrantz
26f9eeddf4 st/xorg: Standardise all function names defined in xorg_tracker.h 2009-11-24 12:57:31 +01:00
Keith Whitwell
2946aea110 svga: try harder to make the cachable flag work
It doesn't though.
2009-11-25 17:14:07 +00:00
Zack Rusin
c712f33746 st/xorg: accelerate src luminance 2009-11-25 10:20:08 -05:00
Zack Rusin
d228e3cc8e util: also print out memory statistics 2009-11-25 10:20:08 -05:00
Keith Whitwell
55b0157860 svga: revert packing of surface key
Over-ambitious packing of values broke my cursor.
2009-11-25 11:45:20 +00:00
Dave Airlie
92c6a26a8a radeon: fix context destroy needing lock for flushing.
Thanks to Intel code which I've just stolen pretty much as usual.

This fixes fdo bug 22851 which is a dri1 regression since rewrite.

Tested by: fpiobaf (Fabio) on #radeon
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-11-25 20:40:15 +10:00
Vinson Lee
94bcb9f1a4 glu/sgi: Fix memory leak in gluBuild1DMipmapLevelsCore. 2009-11-25 00:39:37 -05:00
Vinson Lee
0d89f3dc7f glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore. 2009-11-25 00:28:56 -05:00
Vinson Lee
f895abbd97 glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore. 2009-11-25 00:18:49 -05:00
Keith Whitwell
f1ce37f74a svga: cache textures as well as buffers 2009-11-24 21:15:35 +00:00
Keith Whitwell
4509f3cbad st/xorg: use surface_copy for blits if available
Even if its not available, we really want to be coalescing blit
operations better.
2009-11-24 21:15:35 +00:00
Jakob Bornecrantz
acc51ac0ac svga: Filter out pendantic and ansi flags
Rather have the driver compile without the flags then
having to disable them.
2009-11-24 01:16:17 +01:00
Vinson Lee
326b66d724 glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore. 2009-11-24 01:23:12 -05:00
Vinson Lee
364070b1f2 dri: Fix potential null pointer deference in dri_put_drawable. 2009-11-24 00:57:55 -05:00
Maciej Cencora
960464e42d radeon: fix errors in miptree related function
- typo
- memory leak
- off by one (spotted by airlied)
2009-11-23 21:59:08 +01:00
Maciej Cencora
635823d267 Merge branch 'mesa_7_7_branch' of http://anongit.freedesktop.org/git/mesa/mesa into mesa_7_7_branch 2009-11-23 21:28:22 +01:00
Jakob Bornecrantz
86710c3334 svga: Scrub Makefiles a bit
Remove x86 specific hacks. Not that they will ever be used on
none x86 arches, but they are built by default. And the way the
flags where added was a hack.
2009-11-23 20:09:00 +01:00
Vinson Lee
67125c7f9a mesa: Initialize variable in _mesa_get_texel_fetch_func. 2009-11-23 01:52:59 -05:00
Vinson Lee
4b0b250aae glx: Prevent potential null pointer deference in driCreateContext. 2009-11-23 01:30:32 -05:00
Vinson Lee
5b925b7daa glu/sgi: Fix memory leak in bitmapBuild2DMipmaps. 2009-11-23 01:09:06 -05:00
Vinson Lee
b611f639b4 glu/sgi: Fix memory leak in gluScaleImage3D. 2009-11-23 00:57:37 -05:00
Maciej Cencora
e0fda04013 r300: fix VP source conflict resolution on 64-bit machines
On 32bit machines we were lucky because the sizeof(reg) == sizeof(rc_src_register).
On 64bit machines pointers are 8 bytes long, so we were overwriting other data.
2009-11-22 15:08:46 +01:00
Maciej Cencora
dfe440c856 r300: fix SIN/COS/SCS instructions for R300 fp 2009-11-22 14:13:18 +01:00
Vinson Lee
a9c540f5de glu/sgi: Fix memory leak in gluScaleImage. 2009-11-22 01:57:35 -05:00
Vinson Lee
d3b4c99c70 glu: Fix memory leak in __gl_meshMakeEdge. 2009-11-22 01:45:53 -05:00
Vinson Lee
57d389aab5 svga: Prevent potential null pointer deference in vmw_surface.c. 2009-11-22 01:26:32 -05:00
Vinson Lee
b62a74d3b9 svga: Fix memory leak in vmw_screen_ioctl.c 2009-11-22 01:20:07 -05:00
Vinson Lee
88aab56a26 st/xorg: Prevent potential null pointer deference in xorg_xv.c. 2009-11-22 01:10:38 -05:00
Vinson Lee
46feb7db71 st/xorg: Reorder cases in switch statement.
Silences missing break statement warning.
2009-11-22 00:55:52 -05:00
Maciej Cencora
563fe6e8f6 radeon: fix compressed mipmapped textures
Tested on r300 only, other cards may require adjusting texture_compressed_row_align.
2009-11-21 16:49:18 +01:00
Maciej Cencora
1d1f81af93 radeon: fix glCompressedTexSubImage 2009-11-21 16:49:18 +01:00
Maciej Cencora
d20b79172d radeon: fix compressed mipmapped textures
Tested on r300 only, other cards may require adjusting texture_compressed_row_align.
2009-11-21 16:30:48 +01:00
Maciej Cencora
df87877636 radeon: fix glCompressedTexSubImage 2009-11-21 16:30:41 +01:00
Roland Scheidegger
465fee75ee intel: make CopyTex[Sub]Image fallback debug messages more consistent 2009-11-21 04:41:43 -08:00
Roland Scheidegger
c367f4d46e mesa: handle different RowStride in _mesa_get_compressed_teximage
drivers storing compressed textures with non-native stride but relying on
_mesa_get_compressed_teximage for GetCompressedTexImage otherwise won't
work correctly (for instance i965 compressed mipmaps).
2009-11-21 04:41:43 -08:00
Eric Anholt
8451b29d96 i965: Fix several memory leaks on exit.
Bug #25194.
2009-11-21 13:33:57 +01:00
Vinson Lee
052b127842 st/egl: Fix memory leak in egl_tracker.c. 2009-11-20 16:33:25 -08:00
Vinson Lee
ea98e9820d draw: Initialize variable in draw_pt.c. 2009-11-20 16:03:48 -08:00
Vinson Lee
e19195c185 progs/xdemos: Fix memory leak in pbinfo.c. 2009-11-20 15:52:53 -08:00
Vinson Lee
e0857962b9 progs/xdemos: Fix memory leak in pbdemo.c. 2009-11-20 15:48:29 -08:00
Vinson Lee
538a8df652 progs/xdemos: Fix memory leak in glxpbdemo.c. 2009-11-20 15:18:19 -08:00
Vinson Lee
a4720a1a32 progs/xdemos: Remove duplicate code in glxinfo.c. 2009-11-20 15:06:56 -08:00
Vinson Lee
66a4ec14c3 progs/xdemos: Add assert in corender.c. 2009-11-20 15:03:16 -08:00
Vinson Lee
f6541773c4 i915g: Add missing break statement in i915_debug.c. 2009-11-20 14:31:42 -08:00
Vinson Lee
36e2074b63 gallium/util: Initialize variables in u_pack_color.h. 2009-11-20 14:20:15 -08:00
Jakob Bornecrantz
5109484bd9 st/xorg: Flush any pending operations on upload 2009-11-18 17:49:38 +01:00
Jakob Bornecrantz
8d6da811d4 st/xorg: Unbind any textures in solid
Helps debuging with rbug
2009-11-18 17:49:37 +01:00
Alan Hourihane
910b58039a Fix vega compilation. 2009-11-20 21:15:25 +00:00
Alan Hourihane
1dbf3642b9 Fix memory leak. 2009-11-20 21:15:22 +00:00
Vinson Lee
8556fad751 progs/xdemos: Silence unused value warnings in sharedtex_mt.c. 2009-11-20 13:09:42 -08:00
Vinson Lee
f080567f4c progs/xdemos: Fix memory leak in glxinfo.c. 2009-11-20 13:01:22 -08:00
Vinson Lee
02c3e0b82d progs/tests: Silence unused value warnings in sharedtex.c. 2009-11-20 12:49:50 -08:00
Eric Anholt
c4e8918cd2 mesa: Fix NULL deref in optimizer when NumInstructions == 0.
Bug #24984.
2009-11-20 21:46:48 +01:00
Vinson Lee
48deddaa6f progs/tests: Initialize variable in getprocaddress.c. 2009-11-20 12:34:21 -08:00
Vinson Lee
e26135a744 progs/util: Exit RawImageGetData early if malloc fails.
Prevents a null pointer deference later on.
2009-11-20 12:11:55 -08:00
Vinson Lee
c88b18a4df progs/slang: Check for ftell failure in vstest.c. 2009-11-20 11:34:21 -08:00
Vinson Lee
d36cb2396c progs/util: Fix memory leak if malloc fails in RawImageOpen. 2009-11-20 11:22:13 -08:00
Vinson Lee
08cb1d0ce4 st/xorg: Fix type of 'unknown'. 2009-11-20 00:03:10 -08:00
Vinson Lee
b98db7bf69 progs/vpglsl: Fix psiz-mul.glsl compilation error on Mac OS. 2009-11-19 23:56:07 -08:00
Vinson Lee
760cf71572 progs/vp: Fix memory leak in vp-tris.c. 2009-11-19 22:59:01 -08:00
Vinson Lee
9553a42f63 progs/trivial: Redraw upon keypress. 2009-11-19 22:52:05 -08:00
Vinson Lee
881f55236a progs/glsl: Redraw upon keypress. 2009-11-19 22:46:19 -08:00
Dave Airlie
f8ea531820 r100: fix texture_from_pixmap and compiz.
r100 state emission has separate rect and non-rect states,
if we are doing TFP for a TEXTURE_2D we shouldn't use the rect
states as they won't get emitted properly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-11-20 11:47:00 +10:00
Vinson Lee
8b808d50e2 st/xorg: Fix infinite loop in copy_packed_data. 2009-11-19 14:40:00 -08:00
Vinson Lee
4ab8dbe593 progs/xdemos: Add missing break statement in offset.c. 2009-11-19 14:20:26 -08:00
Brian Paul
4e6c79ac16 st/mesa: replace st_flush() with pipe->flush()
We only need to flush the gallium driver in this case.
Fixes a recursive state validation bug.
2009-11-19 15:18:23 -07:00
Brian Paul
2198497203 vbo: added recursion check in vbo_exec_FlushVertices() 2009-11-19 15:17:56 -07:00
Brian Paul
dc41d62250 st/mesa: get rid of compressed_num_bytes() code 2009-11-19 14:35:38 -07:00
Brian Paul
92863109af st/mesa: remove is_compressed_mesa_format() 2009-11-19 14:17:31 -07:00
Brian Paul
273f4d6b5f st/mesa: remove pointless assertion 2009-11-19 14:17:31 -07:00
Brian Paul
3f40166500 softpipe: whitespace/indentation fixes 2009-11-19 14:17:31 -07:00
Vinson Lee
3790c6a13b progs/trivial: Redraw upon keypress. 2009-11-19 13:03:12 -08:00
Brian Paul
367cfca808 softpipe: add missing check in softpipe_is_texture_referenced()
Check if the named texture is referenced by the texture cache.
2009-11-19 11:39:24 -07:00
Michel Dänzer
31ea323b4d st/xorg: Replace compile-time acceleration switch with Option "2DAccel".
This option can be used to disable 2D acceleration. DRI2 and XVideo blits will
still be accelerated, at least to some degree even with compositing.
2009-11-19 17:52:55 +01:00
Michel Dänzer
10c67f9381 st/xorg: Miscellaneous XVideo fixes.
* Make sure the destination pixmap has a texture to render into.
* Fix damage reporting so the EXA migration code can do the right thing.
* Fix destination coordinates for redirected windows.
2009-11-19 17:47:21 +01:00
Michel Dänzer
34145fc3b7 st/xorg: Try harder to ensure a shared texture has valid contents right away. 2009-11-19 17:30:32 +01:00
Michel Dänzer
012d0193cc st/xorg: Don't complain about convolution filter being 'unknown'.
Also add a newline to the complaint so it'll be a little less annoying if we
actually encounter an unknown filter value again.
2009-11-19 17:25:05 +01:00
Michel Dänzer
10dbdee056 st/xorg: Remove superfluous flushes from the EXA WaitMarker hook.
Thanks to Thomas Hellström for pointing this out.
2009-11-19 10:54:49 +01:00
Michel Dänzer
ea114345a6 st/xorg: Don't initialize non-existing fields. 2009-11-19 10:38:08 +01:00
Vinson Lee
e3cfd78969 progs/tests: Fix memory leak in texdown.c if malloc fails. 2009-11-18 17:30:50 -08:00
Jakob Bornecrantz
e12c9a6f3a st/xorg: Init all functions and fix spelling 2009-11-18 10:59:42 +01:00
Vinson Lee
cde6643724 progs/fp: Redraw upon keypress. 2009-11-18 14:41:40 -08:00
Jakob Bornecrantz
9ab3c70f65 st/xorg: Make the #if more easier to read 2009-11-18 10:44:07 +01:00
Jakob Bornecrantz
e73553bff7 st/xorg: Use the correct DRI2BufferPtr struct on 1.6.4 servers 2009-11-18 10:44:07 +01:00
Vinson Lee
4b3ec2acf2 progs/glsl: Fix trirast GLSL compilation errors on Mac OS. 2009-11-18 14:02:20 -08:00
Vinson Lee
0d31990b47 progs/glsl: Fix noise GLSL compilation error on Mac OS. 2009-11-18 13:50:49 -08:00
Maciej Cencora
3bf12c8bea r300: allow disabling s3tc support if libtxc_dxtn is available 2009-11-18 22:19:25 +01:00
Maciej Cencora
cefee4e327 Merge branch 'radeon-texrewrite-clean' into mesa_7_7_branch 2009-11-18 22:09:33 +01:00
Maciej Cencora
7118db8700 r600: align for mipmap tree changes 2009-11-18 22:02:48 +01:00
Vinson Lee
d4dc2e30da progs/glsl: Fix multinoise GLSL compilation errors on Mac OS. 2009-11-18 12:49:31 -08:00
Vinson Lee
04442841fb progs/glsl: Fix mandelbrot GLSL compilation error on Mac OS. 2009-11-17 23:15:25 -08:00
Ian Romanick
70dca0c273 AL1616: Fix cut-and-paste bug
One of the PACK_COLOR_88 cases was left over from copying
_mesa_texstore_al88 to _mesa_texstore_al1616.
2009-11-17 22:53:06 -08:00
Brian Paul
89e20ab3ae progs/glsl: use ShadersSupported() 2009-11-17 19:22:29 -07:00
Brian Paul
6acb82dab0 progs/util: warn when GLSL not supported 2009-11-17 19:22:11 -07:00
Ian Romanick
5606dfb572 Merge branch 'outputswritten64'
Add a GLbitfield64 type and several macros to operate on 64-bit
fields.  The OutputsWritten field of gl_program is changed to use that
type.  This results in a fair amount of fallout in drivers that use
programs.

No changes are strictly necessary at this point as all bits used are
below the 32-bit boundary.  Fairly soon several bits will be added for
clip distances written by a vertex shader.  This will cause several
bits used for varyings to be pushed above the 32-bit boundary.  This
will affect any drivers that support GLSL.

At this point, only the i965 driver has been modified to support this
eventuality.

I did this as a "squash" merge.  There were several places through the
outputswritten64 branch where things were broken.  I foresee this
causing difficulties later for bisecting.  The history is still
available in the branch.

Conflicts:
	src/mesa/drivers/dri/i965/brw_wm.h
2009-11-17 16:25:38 -08:00
Ian Romanick
b43887cf7e ARB_fbo: Enable extensions related to GL_ARB_framebuffer_object for GLX 2009-11-17 16:25:38 -08:00
Ian Romanick
4e7476f601 ARB_fbo: Add missing GLX render opcode for glFramebufferTextureLayerEXT
Also regenerate the GLX protocol files from this change.
2009-11-17 16:25:38 -08:00
Ian Romanick
5fbfd88338 Add missing XML files to API_XML
When the files missing from the list were modified, the generated files
weren't regenerated.
2009-11-17 16:25:38 -08:00
Ian Romanick
4d6ec21439 ARB_fbo: Enable GL_EXT_framebuffer_multisample
All of this functionality is already included in ARB_fbo.  This just
enables the string.

I was a bit lazy in using FEATURE_ARB_framebuffer_object for this
feature as well.  I don't think it makes much difference in the long run.
2009-11-17 16:25:38 -08:00
Ian Romanick
7fd44005ae ARB_fbo: Regenerate files from previous commits. 2009-11-17 16:25:37 -08:00
Ian Romanick
50b05e7c1f ARB_fbo: Move EXT_fb_blit to EXT_framebuffer_object.xml
This extension is layered on GL_EXT_framebuffer_object, so it should
live in the same XML file.
2009-11-17 16:25:37 -08:00
Ian Romanick
afab8d9958 ARB_fbo: Add GL_EXT_framebuffer_multisample
Add GL_EXT_framebuffer_multisample.  Make
glRenderbufferStorageMultisampleEXT in GL_EXT_framebuffer_object alias
glRenderbufferStorageMultisample.  Also add the missing GLX render
opcode to glRenderbufferStorageMultisample.

Since this extension is layered on GL_EXT_framebuffer_object, I put it
in EXT_framebuffer_object.xml.
2009-11-17 16:25:37 -08:00
Ian Romanick
daad31d527 EXT_pds: Alias GL_NV_packed_depth_stencil to GL_EXT_packed_depth_stencil
GL_EXT_packed_depth_stencil is a functional superset of
GL_NV_packed_depth_stencil.   If a driver enables EXT_pds, make NV_pds
available as well.
2009-11-17 16:25:37 -08:00
Ian Romanick
b244b702b3 EXT_pds: Add GL_EXT_packed_depth_stencil 2009-11-17 16:25:37 -08:00
Ian Romanick
92b38bc305 EXT_fbo_blit: Add missing GLX protocol render opcode 2009-11-17 16:25:37 -08:00
Ian Romanick
30f09573ed ARB_fbo: Add missing protocol "Get" information 2009-11-17 16:25:37 -08:00
Ian Romanick
c185ff96c9 ARB_fbo: Remove _EXT from enum names 2009-11-17 16:25:37 -08:00
Brian Paul
4440d8adb6 docs: libGL documentation, from the xorg-docs tree
This is pretty old and needs some updating but might be useful or
interesting to some people.
2009-11-17 16:33:22 -07:00
Vinson Lee
773de83d3c progs/tests: Fix memory leak in arbgpuprog.c. 2009-11-17 15:24:40 -08:00
Brian Paul
a54033bedb mesa: remove old comment 2009-11-17 16:18:29 -07:00
Brian Paul
133501bef2 mesa: fix assorted compiler warnings 2009-11-17 16:16:30 -07:00
Brian Paul
bc8fb028c6 mesa: fix incorrect type in store_texel_al1616() 2009-11-17 16:16:30 -07:00
Brian Paul
7e3955d8e8 i915g: replace //-style comments 2009-11-17 16:16:30 -07:00
Brian Paul
c4c11eb456 gallium/util: replace //-style comments 2009-11-17 16:16:30 -07:00
Brian Paul
845ddbc9aa i915g: remove trailing commas in enum lists to silence warnings 2009-11-17 16:16:30 -07:00
Brian Paul
fc3c5ffcc8 progs/xdemos: change //-style comments 2009-11-17 16:16:30 -07:00
Brian Paul
b08f447547 progs/glsl: change //-style comments 2009-11-17 16:16:30 -07:00
Brian Paul
1888a72765 progs/demos: silence warnings 2009-11-17 16:16:30 -07:00
Brian Paul
0422053eca mesa: remove trailing comment to silence warning 2009-11-17 16:16:30 -07:00
Brian Paul
e36751ec81 mesa: remove a bit of old code 2009-11-17 16:16:30 -07:00
Vinson Lee
e8eec93854 progs/slang: Fix potential null pointer dereference in cltest.c. 2009-11-17 14:22:35 -08:00
Vinson Lee
47b5f584a6 progs/redbook: Fix memory leak in quadric.c. 2009-11-17 14:10:35 -08:00
Maciej Cencora
afe84fa698 r200: align for mipmap tree changes 2009-11-17 19:46:59 +01:00
Maciej Cencora
93eb2ab8c3 radeon: align for mipmap tree changes 2009-11-17 19:46:37 +01:00
Jakob Bornecrantz
46492f11f6 svga: More -Werror removal 2009-11-17 12:09:19 +01:00
Vinson Lee
d9508e8df9 progs/util: Fix memory leak if fopen fails in RawImageOpen. 2009-11-17 13:49:31 -08:00
Jakob Bornecrantz
8c5a108dc3 svga: Remove -Werror for now as GCC 4.4.x raises a bunch of warnings 2009-11-17 11:24:39 +01:00
Maciej Cencora
aef769207d r300: fix reads and writes for MESA_FORMAT_S8Z24 buffer
Regression was introduced by texformat-rework branch merge.
2009-11-17 13:40:43 -07:00
Brian Paul
d888bbc45a progs/xdemos: added -lX11 -lpthread for GNU gold linker 2009-11-17 13:40:00 -07:00
Vinson Lee
11905da883 progs/util: Fix memory leak if fread returns 0 in CompileShaderFile. 2009-11-17 12:00:22 -08:00
Brian Paul
6418ce7df6 mesa: move -ansi -pedantic to CFLAGS 2009-11-17 12:47:54 -07:00
Vinson Lee
b8dcb79c53 progs/glsl: Change tangentAttrib from GLuint to GLint in bump.c.
tangentAtrrib is assigned the result of glGetAttribLocation.
The assertion 'assert(tangentAtrrib >= 0)' would be a no-op if
tangentAttrib is a GLuint.
2009-11-17 11:37:48 -08:00
Vinson Lee
786d539511 progs/util: Fix memory leak if malloc fails in tkRGBImageLoad. 2009-11-17 11:04:24 -08:00
Patrice Mandin
b353106467 nouveau: nv30: Check for NULL front (happens with DRI2) 2009-11-17 19:50:37 +01:00
Patrice Mandin
49289f1d25 nouveau: nv30: Add missing include to fix warning 2009-11-17 19:49:56 +01:00
Michel Dänzer
52be96b7fe Remove unconditional use of glibc specific bswap_16() macro.
Fixes unresolved symbol bswap_16 on non-glibc or little endian glibc platforms.
2009-11-17 19:41:29 +01:00
Brian Paul
63bc736f90 docs: list the new VMware SVGA Gallium driver in release notes 2009-11-17 11:23:19 -07:00
Dan Nicholson
cf65d81cf1 dri: Ensure subdirs have finished before linking driver
Recursive make is hard. If there are subdirectories in the DRI drivers,
it's pretty certain we want to finish building in them before linking
the driver. Add a new target to serialize the rules.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-11-17 11:23:19 -07:00
Vinson Lee
041cd0e110 progs/util: Fix memory leak if LoadRGBImage fails. 2009-11-17 10:11:50 -08:00
Michel Dänzer
33e93f4277 r600: More span breakage fixes.
At least now the compiler doesn't complain about implicitly declared functions
anymore...
2009-11-17 19:02:03 +01:00
Vinson Lee
0e783c7d03 progs/glsl: Fix memory leak in deriv.c. 2009-11-17 09:54:54 -08:00
Michel Dänzer
29f3e7e1d1 r600: Attempt to fix span breakage introduced by big endian fixes.
Only compile tested; I happened to notice people on IRC reporting

.../r600_dri.so: undefined symbol: radeon_ptr_2byte_8x2
2009-11-17 18:47:24 +01:00
Vinson Lee
28b8e4bcd7 progs/util: Fix memory if LoadRGBMipmaps2 fails. 2009-11-17 08:29:36 -08:00
Michel Dänzer
081bf9563f radeon: Depth/stencil span code fixes for big endian.
Fixes e.g. text in progs/demos/arbocclude.
2009-11-17 11:09:09 +01:00
Michel Dänzer
592ce48ce9 radeon: Fix occlusion queries on big endian. 2009-11-17 11:08:21 +01:00
Michel Dänzer
2262765425 radeon: Fix software fallbacks with KMS on big endian. 2009-11-17 08:05:23 +01:00
Michel Dänzer
f2651264d3 radeon: FBO fixes for big endian. 2009-11-17 08:05:22 +01:00
Michel Dänzer
2d0c295256 Add MESA_FORMAT_XRGB8888_REV. 2009-11-17 08:05:22 +01:00
Dave Airlie
e015a4c29b radeon: rn50's have no 3D engine so don't try and init 3D driver. 2009-11-17 16:06:26 +10:00
Vinson Lee
0e790ac353 progs/util: Fix memory leak if LoadYUVImage fails. 2009-11-16 18:24:06 -08:00
Jakob Bornecrantz
60769b232c svga: Build svga driver 2009-11-17 03:18:06 +01:00
Jakob Bornecrantz
f7109aaf6c svga: Add vmwgfx_drm.h file from vmwgfx kernel driver
Add the vmwgfx_drm.h header for now, this allows the svga driver
to be enabled by default without forcing people to install the
vmwgfx_drm.h header on their system.

To be removed once vmwgfx_drm.h is in libdrm.
2009-11-17 03:18:05 +01:00
Jakob Bornecrantz
3192633d4a svga: Add svga driver 2009-11-17 03:18:04 +01:00
Vinson Lee
6b480dc21d progs/demos: Fix memory leak in ray.c. 2009-11-16 18:06:40 -08:00
Jakob Bornecrantz
648e8b4c46 st/xorg: Fix copy-pasto
Thanks Alan.
2009-11-17 01:48:53 +01:00
Vinson Lee
ee555e3d69 progs/demos: Fix memory leak in projtex.c. 2009-11-16 16:31:34 -08:00
Vinson Lee
a1afe303de progs/demos: Fix memory leak in ipers.c. 2009-11-16 15:44:52 -08:00
Ian Romanick
fdfbae3381 i965: Use MESA_FORMAT_AL1616 when appropriate 2009-11-16 15:23:17 -08:00
Ian Romanick
b1616b2a81 Move 'static' to start of declaration to silence compiler warning 2009-11-16 15:23:16 -08:00
Ian Romanick
12982e381d AL1616: Enable MESA_FORMAT_AL1616 for software paths 2009-11-16 15:23:16 -08:00
Ian Romanick
3325dc91be AL1616: Add TexImage storage path 2009-11-16 15:23:16 -08:00
Ian Romanick
975871b4d5 AL1616: Add texel fetch / store routines 2009-11-16 15:23:16 -08:00
Ian Romanick
eb437fabe0 AL1616: Add formats for GL_LUMINANCE16_ALPHA16 textures 2009-11-16 15:23:16 -08:00
Ian Romanick
5fb07a4046 AL1616: Add macros to pack two GLushorts into a texel 2009-11-16 15:23:16 -08:00
Vinson Lee
aef3218f0b progs/demos: Fix memory leak in fslight.c. 2009-11-16 14:56:07 -08:00
Jakob Bornecrantz
cb060f3b98 st/xorg: Fix comp alpha code and deal with luminance masks
There are two fixes in here one is a one liner that fixes
component alpha logic. The other deals better with luminance
formats used for masks, sources not yet implemented.

Fixes component alpha text and icons in gnome. There are a one
or two cases that this code misses. Like if src_luminance is set
but no mask image is given.
2009-11-16 23:33:45 +01:00
Jakob Bornecrantz
5438ee3ecf st/xorg: Incase of format missmatch swizzle channels and set alpha
This path is only hit for icons in gnome so far
2009-11-16 23:33:44 +01:00
Alex Deucher
d683acb101 r600: don't force Z order
Let the hw decide (early vs late Z)
fixes fdo bug 25092

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-16 15:03:48 -05:00
Corbin Simpson
0f060250fc docs: Update r300g status. 2009-11-16 10:46:20 -08:00
Brian Paul
664b7303c2 docs: fixes, changes for Mesa 7.7 2009-11-16 11:33:45 -07:00
Brian Paul
fcf8dea36c progs/tests: silence warning 2009-11-16 11:33:45 -07:00
Brian Paul
f549f4c4b6 mesa: remove unused vertex array driver hooks 2009-11-16 11:33:44 -07:00
Brian Paul
652828ec0e mesa: check BaseLevel, MaxLevel in _mesa_GenerateMipmapEXT() 2009-11-16 08:25:17 -07:00
Brian Paul
a719395b45 mesa: use _mesa_get_current_tex_object() 2009-11-16 08:21:28 -07:00
Brian Paul
ecb03d75a2 mesa: added another check in check_gen_mipmap()
We don't need to call ctx->Driver.GenerateMipmap() if we're updating
a texture level >= MAX_LEVEL.
2009-11-16 08:18:03 -07:00
Michel Dänzer
d3a37d93ab st/xorg: Only reference new picture formats when they're defined.
Fixes http://bugs.freedesktop.org/show_bug.cgi/?id=25094 .
2009-11-16 11:59:39 +01:00
Brian Paul
afae49cc15 st/mesa: comments for st_draw.c 2009-11-15 16:22:53 -07:00
Brian Paul
4581f70578 st/egl: add some basic comments 2009-11-15 16:22:52 -07:00
Francisco Jerez
abefd7dcdf nv20: Fix build for the last nouveau_class.h changes.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-11-15 18:20:19 +02:00
Francisco Jerez
ed9c4933af nv10: Fix build for the last nouveau_class.h changes.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-11-15 18:20:19 +02:00
Vinson Lee
a420056750 progs: Ignore Mac OS dSYM directories. 2009-11-14 21:39:31 -08:00
Maciej Cencora
ad83aeccdc radeon: return false on texture validation if texture isn't complete 2009-11-14 18:11:16 +01:00
Maciej Cencora
23ec7c4574 radeon: rework mipmap tree 2009-11-14 16:55:39 +01:00
Maciej Cencora
8f88cf3938 radeon: more texture code refactoring 2009-11-14 16:55:38 +01:00
Maciej Cencora
9d0af686b2 radeon: minor refactoring of texture code
Also properly set dstImageOffsets for TexSubImage case.
2009-11-14 16:55:38 +01:00
Maciej Cencora
7628b06ba3 radeon: rework mipmap tree reference counting 2009-11-14 16:55:34 +01:00
Maciej Cencora
6e5d473cc1 r300: fix regression introduced in 1d5a06a1f7
Spotted by Dave Airlie
2009-11-14 14:43:34 +01:00
Maciej Cencora
aa19561158 radeon: use radeon_bo_is_referenced_by_cs for query objects 2009-11-14 14:43:18 +01:00
Maciej Cencora
d3fa67c9b8 radeon/r300: don't flush cmdbuf if not necessary 2009-11-14 14:43:10 +01:00
Maciej Cencora
286bf89e5a radeon/r300: no need to flush the cmdbuf when changing scissors state in KMM mode 2009-11-14 14:42:48 +01:00
Maciej Cencora
f6d0993212 radeon: fix glBufferSubData 2009-11-14 14:42:34 +01:00
Maciej Cencora
084f43c150 radeon: add radeon_bo_is_referenced_by_cs function 2009-11-14 14:42:26 +01:00
Maciej Cencora
49876ab6a7 radeon: remove unnecessary call to radeonEmitState
fixes bo space accounting errors
2009-11-14 14:42:19 +01:00
Maciej Cencora
0aad2aee66 r300: add missing texformat 2009-11-14 14:42:10 +01:00
Maciej Cencora
e92492295b r300: remove unneeded includes 2009-11-14 14:42:01 +01:00
Eric Anholt
57f40b1837 i965: Share OPCODE_TXB between brw_wm_emit.c and brw_wm_glsl.c
This should fix TXB on G45 and older in the GLSL case.
2009-11-13 16:04:13 -08:00
Eric Anholt
1be0efcbdc i965: Share OPCODE_TEX between brw_wm_emit.c and brw_wm_glsl.c.
New comments should explain some of the confusion about how this message
works.
2009-11-13 16:04:10 -08:00
Eric Anholt
a0fd49b334 i965: Clean up emit_tex a bit. 2009-11-13 15:17:24 -08:00
Eric Anholt
3d36d6b4cf Merge remote branch 'origin/mesa_7_6_branch' 2009-11-13 14:45:29 -08:00
Eric Anholt
99077e7792 i965: Flag BRW_NEW_CONTEXT on some context state.
Fixing this is a prereq for avoiding flagging all state at new
batch time.  Eliminating that still causes problems, though (notably
glean logicOp fails on my GM965).
2009-11-13 14:39:09 -08:00
Eric Anholt
1ffd0a7789 intel: Remove some dead context structure fields. 2009-11-13 13:18:57 -08:00
Eric Anholt
3727858ceb i965: Remove an unused cache_item field. 2009-11-13 13:18:57 -08:00
Eric Anholt
b54f8eeae8 i965: Remove long dead structures for ffvertex_prog.c. 2009-11-13 13:18:57 -08:00
Eric Anholt
ded0ec1ea5 i965: Use bo_map instead of subdata to upload the bits of constant buffer.
Saves CPU time, resulting in a 2.5% FPS win on ETQW.
2009-11-13 13:18:57 -08:00
Eric Anholt
8e8586e626 i965: Validate the number of URB entries selected for the VS. 2009-11-13 13:18:56 -08:00
Eric Anholt
3c05c1eb63 intel: When subdataing a busy buffer, use a temporary and blit in.
This cuts a massive number of waits in ET:QW, which uses a VBO ringbuffer.
Unfortunately it doesn't BufferData when wrapping back to 0, so we can't
be clever with tracking what's been initialized.
2009-11-13 13:18:56 -08:00
Eric Anholt
4e50ce35ee i965: Clean up Ironlake sampler type definitions.
They're the same regardless of execution width for 8, 4x2, and 16.
2009-11-13 13:18:56 -08:00
Eric Anholt
91bd593109 i965: Avoid moving the current value back into the accumulator for MAD.
This is a 2.9% (+/-.3%) performance win for my GL demo, which hits MAD
sequences for matrix transforms.
2009-11-13 13:18:56 -08:00
Eric Anholt
d6690ce15f mesa: Improve the eliminate-move-use to work across multiple instructions.
This shaves more instructions off of the VS of my GL demo, but no
performance difference this time at n=6.  This also fixes a regression
that was in this path, which is now piglit's glsl-vs-mov-after-deref.
2009-11-13 13:18:22 -08:00
Zack Rusin
654122ba7b st/xorg: try to fix non-uniform transforms 2009-11-13 14:58:35 -05:00
Vinson Lee
43080e40aa progs/glsl: Add missing break statement in multinoise.c. 2009-11-12 16:21:49 -08:00
Ian Romanick
b6b753f727 intel: Don't check for context pointer to be NULL during extension init
Thanks to Chia-I Wu's changes to the extension function
infrastructure, we no longer have to tell the loader which extensions
the driver might enable.  This means that intelInitExtensions will
never be called with a NULL context pointer.  Remove all the NULL checks.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2009-11-12 15:43:09 -08:00
Ian Romanick
a736d3f439 intel: Remove unused enable_imaging parameter to intelInitExtensions 2009-11-12 15:43:09 -08:00
Zack Rusin
4d72f8f520 st/xorg: use an immediate instead of a full blown const 2009-11-11 21:47:28 -05:00
Zack Rusin
72b4a7d67f st/xorg: don't use flow control 2009-11-11 21:43:40 -05:00
Brian Paul
0a39620d6d swrast: handle additional Z24 formats in read_depth_pixels() 2009-11-11 19:38:19 -07:00
Vinson Lee
7dfea5c072 demos/glsl: Add missing break statement to noise test. 2009-11-11 17:39:58 -08:00
Zack Rusin
2cfbbc76e4 st/xorg: implement repeatnone and make some code smell less like ass 2009-11-11 19:55:50 -05:00
Zack Rusin
493d599af4 st/xorg: fallback until daddy can implement you properly 2009-11-11 19:55:50 -05:00
Brian Paul
2ff4f5a7fe progs/tests: add alpha/blend testing to packedpixels.c 2009-11-11 12:25:08 -07:00
Corbin Simpson
cbee31a1f8 r300, r300g: Add missing registers. 2009-11-11 10:24:19 -08:00
Corbin Simpson
d030ce6a84 dri-st: Add some required GL 2.0 extensions.
Two-sided stencil and NPOT textures.
2009-11-11 10:24:06 -08:00
Jakob Bornecrantz
e4a19ffb13 st/xorg: Fallback if picture format doesn't match texture format 2009-11-10 10:05:40 +01:00
Jakob Bornecrantz
3201c655e4 st/xorg: Don't segfault when debug printing 2009-11-10 10:00:04 +01:00
Zack Rusin
fca8b2c3ae st/xorg: wrap to border color 2009-11-10 20:30:48 -05:00
brian
b81f213157 swrast: update renderbuffer format assertions 2009-11-10 18:23:59 -07:00
brian
a65b84d955 mesa: fix some begin/end render-to-texture logic
Before, we weren't aggressive enough in checking for the start or end
of render-to-texture.  In particular, if only the ctx->ReadBuffer had
texture attachments, we were treating that as a render-to-texture case.

This fixes a regression from commit 75bdbdd90b
"intel: Don't validate in a texture image used as a render target."
2009-11-10 18:09:13 -07:00
brian
bc569cd6be mesa: move check_begin/end_texture_render() calls 2009-11-10 18:09:13 -07:00
brian
d96e55fa7b mesa: new vars: oldDrawFb, oldReadFb in _mesa_BindFramebufferEXT() 2009-11-10 18:09:13 -07:00
brian
e6f60d3037 mesa: rename vars in _mesa_BindFramebufferEXT() 2009-11-10 18:09:13 -07:00
brian
a492ab765a mesa: added comment for check_begin_texture_render() 2009-11-10 18:09:12 -07:00
Jakob Bornecrantz
4c54f8e9aa st/egl: Probe hardware for depth stencil format 2009-11-10 08:29:41 +01:00
Zack Rusin
d2c886c8ca st/xorg: cleanup the naming 2009-11-10 19:42:03 -05:00
Zack Rusin
e08512f3d4 st/xorg: print ouf the picture formats when compositing 2009-11-10 19:42:02 -05:00
Eric Anholt
e42b156fac Merge remote branch 'origin/mesa_7_6_branch' 2009-11-10 16:01:28 -08:00
Eric Anholt
c5413839b3 i965: avoid memsetting all the BRW_WM_MAX_INSN arrays for every compile.
For an app that's blowing out the state cache, like sauerbraten, the
memset of the giant arrays ended up taking 11% of the CPU even when only a
"few" of the entries got used.  With this, the WM program compile drops back
down to 1% of CPU time.

Bug #24981 (bisected to BRW_WM_MAX_INSN increase).
2009-11-10 16:00:30 -08:00
Eric Anholt
eb6a1f8a00 i965: Add a note explaining the data cache domain. 2009-11-10 16:00:30 -08:00
Vinson Lee
520b6abdec i915g: Fix memory leak when pci id is unknown. 2009-11-10 12:39:42 -08:00
Eric Anholt
56ab92bad8 i965: Unalias src/dst registers for SGE and friends.
Fixes piglit vp-sge-alias test, and the googleearth ground shader.  \o/

Bug #22228
2009-11-10 10:54:15 -08:00
Eric Anholt
d52d78b4bc i965: Allow use of PROGRAM_LOCAL constants in ARB_vp.
Fixes piglit arl.vp.
2009-11-10 10:46:57 -08:00
Michal Krol
28039ffdc8 slang: Fix return value check. 2009-11-10 19:25:51 +01:00
Michel Dänzer
5e17c89ead st/xorg: Fix SCons build.
Check for new DPMS header and add xorg_renderer.c source file.
2009-11-10 10:09:56 -08:00
Michal Krol
413e933fd5 slang: Check OOM conditions for alloc_node_storage(). 2009-11-10 18:30:10 +01:00
José Fonseca
eef5a0b3a3 llvmpipe: Fix derived blend color state. 2009-11-10 05:22:15 -08:00
Michal Krol
cc470bf0ca slang: Check return value from new_instruction(). 2009-11-10 04:03:55 +01:00
Michal Krol
b2a29ad309 slang: Fix signed/unsigned int handling in _slang_free_temp(). 2009-11-10 03:25:06 +01:00
Michal Krol
b5d8a7b6dc tgsi/exec: Exit early on error. 2009-11-10 03:12:02 +01:00
Michal Krol
e44c77028c tgsi/ureg: Simplify logic in tokens_expand(). 2009-11-10 03:08:21 +01:00
Michal Krol
83760d961f slang: Handle OOM condition in new_instruction(). 2009-11-10 02:46:24 +01:00
Zack Rusin
031fbb9681 st/xorg: remove deprecated rendering code 2009-11-09 18:04:21 -05:00
Zack Rusin
a6d527d7b8 st/xorg: fix composite batching
quite a large performance optimization (text demo from 1.6fps to 9fps)
2009-11-09 18:04:21 -05:00
Jerome Glisse
216319fc0f r600/r700: typo, fix mask of DB_ALPHA_TO_MASK 2009-11-09 22:37:41 +01:00
Alex Deucher
66d6f9e860 r600: rework DB render setup
- consolidate DB render setup
- only enable perfect ZPASS counts and cull disable
when OQ is active
- enable early Z
2009-11-09 12:20:47 -05:00
Alex Deucher
37676b396a r600: don't emit htile regs
These are needed for HiZ which is not currently used and
the _BASE reg requires a reloc which is not currently supported
in the drm.
2009-11-09 12:16:55 -05:00
Alex Deucher
a9035f3dc3 r600: add missing ZPASS setup bits for r7xx+ 2009-11-09 12:16:55 -05:00
José Fonseca
bc9d51bb0e llvmpipe: Ensure stack variables in unit tests are properly aligned. 2009-11-09 07:26:08 -08:00
Christoph Bumiller
7204b92101 nv50: clarify data for method 0x121c 2009-11-09 14:30:32 +01:00
Corbin Simpson
c9167d868c r300g: Fix up SW TCL rendering functions.
They don't work, but at least they're clean now.
2009-11-08 14:53:29 -08:00
Corbin Simpson
fe89863808 r300g: Protect against possibly missing Draw pointer.
Part of the SW TCL revival.
2009-11-08 14:53:29 -08:00
Corbin Simpson
11d9edf4c9 r300g: Unify context names for counts.
From the SW TCL fixups.
2009-11-08 14:53:29 -08:00
Corbin Simpson
b6f93e2607 r300g: Enable PSC/RS dump with new debugging flags. 2009-11-08 14:53:15 -08:00
Corbin Simpson
0525cb1273 r300g: Fix is_buffer_referenced. 2009-11-08 09:56:02 -08:00
Corbin Simpson
ee28a69188 r300g: Fix build error on old compilers.
This dead code was still getting compiled, causing a bad ref in the lib.
2009-11-08 09:35:07 -08:00
Corbin Simpson
a12fc1a9c4 r300g: Organize inlined state. 2009-11-07 14:32:31 -08:00
Corbin Simpson
547e939afb r300g: DCE.
This must never have been called before; it's completely wrong.
2009-11-07 14:14:19 -08:00
Corbin Simpson
9f49db6f84 r300g: Minor code cleanup to avoid confusion. 2009-11-07 13:37:07 -08:00
Corbin Simpson
fa6916cfef r300g: Remove do-nothing functions. 2009-11-07 13:12:15 -08:00
Corbin Simpson
c4fa0e4caa r300g: Remove faulty assert. 2009-11-07 13:07:52 -08:00
Corbin Simpson
b7322fd874 Merge branch 'r300g-vbo'
This is an experimental HW TCL fastpath for r300g. It should run alright.

Thanks to osiris for making this possible.
2009-11-07 12:03:04 -08:00
Corbin Simpson
0fe5f0c09a r300g: Be more verbose in what's killing us WRT vert formats. 2009-11-07 11:55:29 -08:00
Corbin Simpson
cd5b2a93d5 r300g: Comments. 2009-11-07 11:55:29 -08:00
Corbin Simpson
ef513776b5 r300g: Don't assert on oversized VBOs, just return FALSE. 2009-11-07 11:55:25 -08:00
Corbin Simpson
746c01b3b2 r300g: Moar vbo cleanup. 2009-11-07 11:53:14 -08:00
Corbin Simpson
b6c3954138 r300g: s/false/FALSE/
Also s/true/TRUE/
2009-11-07 11:53:14 -08:00
Corbin Simpson
7da3cc4241 r300g: Clean up indexbuf render, switch to RELOC macro. 2009-11-07 11:53:14 -08:00
Corbin Simpson
7518d9b1b7 r300g: Clean up r300_setup_vertex_buffers. 2009-11-07 11:53:14 -08:00
Corbin Simpson
96b729f926 r300g: Don't pass hw_prim around in the context.
And some other fixes.
2009-11-07 11:53:14 -08:00
Corbin Simpson
24c6fdbd32 r300g: Use common state funcs for translating vert formats. 2009-11-07 11:53:14 -08:00
Maciej Cencora
1ef0341ea7 r300g: don't hang GPU on misbehaving apps 2009-11-07 11:53:13 -08:00
Maciej Cencora
3445f47697 r300g: VBOs WIP 2009-11-07 11:53:13 -08:00
Maciej Cencora
d8592d1724 r300g: add missing flush 2009-11-07 11:53:13 -08:00
Maciej Cencora
c7dfffc5d5 r300g: enable CS dumping 2009-11-07 11:53:13 -08:00
Maciej Cencora
6acb26eadf r300g: move vborender context function to seperate file
r300g: Un-migrate r300_draw_render.

It'll make maintaining the SW TCL path easier.
2009-11-07 11:53:06 -08:00
Jakob Bornecrantz
57d77c6a44 i915g: Fix comment in is buffer referenced 2009-11-07 19:31:18 +00:00
brian
18768393d1 mesa: move code after decl
Fixes bug 24967.
2009-11-07 08:18:07 -07:00
Christoph Bumiller
44cb5b5c66 nv50: enable all 32 threads of a warp
This should be the default setting.
See also 7d967b9b7c.
2009-11-07 10:48:36 +01:00
Eric Anholt
8baee3d25b i965: Use Compr4 instruction compression mode on G4X and newer.
No statistically significant performance difference at n=3 with either
openarena or my GL demo, but cutting program size seems like a good
thing to be doing for the hypothetical app that has a working set near
icache size.
2009-11-06 21:24:22 -08:00
Eric Anholt
ec66644ed0 i965: Share min/max between brw_wm_emit.c and brw_wm_glsl.c 2009-11-06 21:08:55 -08:00
Eric Anholt
cfa927766a i965: Share emit_fb_write() between brw_wm_emit.c and brw_wm_glsl.c
This should fix issues with antialiased lines in GLSL.
2009-11-06 21:08:55 -08:00
Eric Anholt
2b58c31257 i965: Share most of the WM functions between brw_wm_glsl.c and brw_wm_emit.c
The PINTERP code should be faster for brw_wm_glsl.c now since brw_wm_emit.c's
had been improved, and pixel_w should no longer stomp on a neighbor to dst.
2009-11-06 21:08:55 -08:00
Eric Anholt
1e5400c575 i965: Share math functions between brw_wm_glsl.c and brw_wm_emit.c. 2009-11-06 21:08:54 -08:00
Eric Anholt
7059aa0eff i965: Share the sop opcodes between brw_wm_glsl.c and brw_wm_emit.c. 2009-11-06 21:08:54 -08:00
Eric Anholt
726ad15606 i965: Share OPCODE_MAD between brw_wm_glsl.c and brw_wm_emit.c 2009-11-06 21:08:54 -08:00
Eric Anholt
bad5b120be i965: Share the DP3, DP4, and DPH between brw_wm_glsl.c and brw_wm_emit.c 2009-11-06 21:08:54 -08:00
Eric Anholt
06c1bc8a22 i965: Add generic GLSL code for unaliasing a 3-arg opcode, and share LRP code. 2009-11-06 21:08:54 -08:00
Eric Anholt
90629704ef i965: Use a normal alu1 emit for OPCODE_TRUNC. 2009-11-06 21:08:54 -08:00
Eric Anholt
71af508072 i965: Share basic ALU ops between brw_wm_glsl and brw_wm_emit.c
This drops support for get_src_reg_imm in these, but the prospect of getting
brw_wm_pass*.c onto our GLSL path is well worth some temporary pain.
2009-11-06 21:08:54 -08:00
Eric Anholt
0f34cdf621 i965: Collect GLSL src/dst regs up in generic code.
This matches brw_wm_emit.c, which we'll be using shortly.  There's a
possible penalty here in that we'll allocate registers for unused channels,
since we aren't doing ref tracking like brw_wm_pass*.c does.  However, my
measurements on GM965 don't show any for either OA or UT2004 with the GLSL
path forced.
2009-11-06 21:08:54 -08:00
Zack Rusin
e521bf7706 st/xorg: implement batching for the composite op
something is broken so disabled for now
2009-11-06 22:08:21 -05:00
Zack Rusin
4322346f3f st/xorg: batch solid fill requests
instead of lots of very small transfers, one larger is a lot better
for performance
2009-11-06 22:08:21 -05:00
Zack Rusin
e1730632aa st/xorg: start accumulating vertices in a common buffer 2009-11-06 22:08:21 -05:00
Zack Rusin
3f7df23ff5 st/xorg: use quads instead of triangle fans
easier to split, accumulate and batch those
2009-11-06 22:08:21 -05:00
Zack Rusin
6c44d399bd st/xorg: make the buffer size global 2009-11-06 22:08:21 -05:00
Eric Anholt
6b0bcfafab mesa: Reduce the source channels considered in optimization passes.
Depending on the writemask or the opcode, we can often trim the source
channels considered used for dead code elimination.  This saves actual
instructions on 965 in the non-GLSL path for glean glsl1, and cleans up
the writemasks of programs even further.
2009-11-06 14:27:35 -08:00
Eric Anholt
f3cacfe216 mesa: Fix remove_instructions to successfully remove when removeFlags[0].
This fixes the dead code elimination to work on the particular code
mentioned in the previous commit.
2009-11-06 13:16:49 -08:00
Eric Anholt
e4e312d493 mesa: Add an optimization path to remove use of pointless MOVs.
GLSL code such as:
	vec4 result = {0, 1, 0, 0};
	gl_FragColor = result;

emits code like:
  0: MOV TEMP[0], CONST[0];
  1: MOV OUTPUT[1], TEMP[0];

and this replaces it with:
  0: MOV TEMP[0], CONST[0];
  1: MOV OUTPUT[1], CONST[0];

Even when the dead code eliminator fails to clean up a now-useless MOV
instruction (since it doesn't do live/dead ranges), this should at reduce
dependencies.
2009-11-06 13:16:49 -08:00
Eric Anholt
ee0a9e6e10 mesa: Fix up the remove_dead_code pass to operate on a channel basis.
This cleans up a bunch of instructions in GLSL programs to have limited
writemasks, which would translate to wins in shaders that hit the i965
brw_wm_glsl.c path by depending less on in-driver optimizations.  It will
also help hit other optimization passes I'm looking at.
2009-11-06 13:16:49 -08:00
Brian Paul
3105f3aa88 intel: better front color buffer test in intelClear() 2009-11-06 13:52:48 -07:00
Eric Anholt
8395da2e8a i965: Always pass the size argument to brw_cache_data.
This keeps the individual state files from having to export their
structures for brw_state_cache initialization.
2009-11-06 11:37:32 -08:00
Eric Anholt
1166294d1d intel: Finish removing the fallback code for bug #16697.
I fixed it properly as of 7216679c19.
2009-11-06 11:37:32 -08:00
Eric Anholt
75bdbdd90b intel: Don't validate in a texture image used as a render target.
Otherwise, we could lose track of rendering to that image, which could
easily happen during mipmap generation.
2009-11-06 11:37:32 -08:00
Eric Anholt
6b68482e68 mesa: Attempt to pair up Driver.RenderTexture and FinishRenderTexture()
This is probably not 100% complete (bind vs unbind may still not pair up
exactly), but it should help out drivers which are relying on
FinishRenderTexture to be called when we're done rendering to a particular
texture level, not just when we're done rendering to the object at all.
This is the case for the one consumer of FinishRenderTexture() so far: the
gallium state tracker.  Noticed when trying to make use of FRT() in the intel
driver.
2009-11-06 11:37:32 -08:00
Eric Anholt
8df81bca17 intel: Clean up some extra struct indirection in finalize. 2009-11-06 11:37:32 -08:00
Eric Anholt
ee7dfbbd6c intel: Use _mesa_get_current_tex_object() to clean up TFP path. 2009-11-06 11:37:31 -08:00
Eric Anholt
8f30ceaaef intel: Remove duplicated arguments from intel_miptree_match_image(). 2009-11-06 11:37:31 -08:00
Eric Anholt
2bc8bcdcd3 i965: Remove an XXX comment for testing some code that seems to work. 2009-11-06 11:37:31 -08:00
Eric Anholt
bb2dd50be0 intel: Remove obsolete comment about GEM in the spans code. 2009-11-06 11:37:31 -08:00
Eric Anholt
8e0f40d287 intel: Use PIPE_CONTROL on gen4 hardware for doing pipeline flushing.
This should do all the things that MI_FLUSH did, but it can be pipelined
so that further rendering isn't blocked on the flush completion unless
necessary.
2009-11-06 11:37:31 -08:00
Eric Anholt
caf3038123 Make a convenient int for what chipset generation we're on.
gen2/3/4 are easier to say than "8xx, 915-945/g33/pineview, 965/g45/misc",
and compares on generation are often easier than stringing together a bunch
of chipset checks.
2009-11-06 11:37:31 -08:00
Ian Romanick
4e4c2ee1fd Merge branch 'mesa_7_6_branch'
This should fix the memory leaks in the assembly parser without the
regressions.

The conflicts in program_lexer.l were related to changes in returning
strings between the branches (always return IDENTIFIER vs. returing
either IDENTIFIER or USED_IDENTIFIER).

The conflicts in program_parse.y were related to two changes in master
One change prints a variable name in an error message.  The other
change adds outputVarSize to the OUTPUT_statement rule.  The cause the
position of the IDENTIFIER to change from $2 to $3.

Conflicts:
	src/mesa/shader/lex.yy.c
	src/mesa/shader/program_lexer.l
	src/mesa/shader/program_parse.tab.c
	src/mesa/shader/program_parse.y
2009-11-06 11:17:00 -08:00
José Fonseca
96e938f62c llvmpipe: Fix build with llvm 2.6.
Fixes bug 24949.
2009-11-06 15:08:05 +00:00
Brian Paul
38d3c156dc intel: call intel_check_front_buffer_rendering() in intelClear()
fixes bug 24953.
2009-11-06 08:00:38 -07:00
José Fonseca
577a598dc9 mesa: Export S3_s3tc as well.
Used in Quake3.
2009-11-06 12:06:45 +00:00
José Fonseca
f611425101 mesa: Translate MAP_UNSYNCHRONIZED_BIT. 2009-11-06 12:06:44 +00:00
José Fonseca
244591ae7b gallium: Add UNSYNCHRONIZED cpu access flag. Document others. 2009-11-06 12:06:44 +00:00
Zack Rusin
25728860fc st/xorg: unify vertex buffer handling
first step on our way to batching
2009-11-06 00:19:54 -05:00
Brian Paul
d971069fc6 mesa: fix infinite loop bug in _mesa_drawbuffers()
Fixes bug 24946.
This regression came from 8df699b3bb.
2009-11-05 13:17:21 -07:00
José Fonseca
67034b9efc softpipe: Implement PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE for destination.
It is a valid and tested combination on D3D9.
2009-11-05 19:44:07 +00:00
Cooper Yuan
e0590159ce g3dvl: remove a debug line 2009-11-05 16:06:01 +08:00
Cooper Yuan
c621c100b2 g3dvl: add scissor setting 2009-11-05 15:59:27 +08:00
Marek Olšák
c2e47191d7 r300g: add polygon mode
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-11-04 18:19:34 -08:00
Marek Olšák
4671005a43 r300g: fix the size of CS when emitting the fragprog constant buffer
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-11-04 18:19:34 -08:00
Marek Olšák
07190888bd r300g: set the correct offset in a colorbuffer surface
Suggested by Joakim Sindholt.

Also, put flushing of colorbuffers _before_ the framebuffer state setup,
suggested by docs.

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-11-04 18:19:34 -08:00
Marek Olšák
ad96c0d851 r300g: add color channel masking
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-11-04 18:19:34 -08:00
Brian Paul
898de4a9d5 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/drivers/windows/gdi/mesa.def
2009-11-04 17:57:20 -07:00
Brian Paul
fe86f8d732 ARB prog parser: include variable name in error text 2009-11-04 17:27:49 -07:00
Zack Rusin
4c5a758d06 st/xorg: these flushes shouldn't be necessary
performance optimization
2009-11-04 18:10:33 -05:00
Alex Deucher
9fce12b894 r600: rework draw functions
Seems INDX_OFFSET doesn't work properly on some cards,
so change back to immediate mode indices.  Seems to only
affect DRI1.  Needs more investigation.

Rework and clean up the draw functions.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-04 16:59:13 -05:00
Alex Deucher
70dade8afe r600: fix count prediction for IB case
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-04 14:43:24 -05:00
Alan Hourihane
3040b2ee9d Fix YTILE spantmp functions 2009-11-04 14:48:25 +00:00
José Fonseca
0b4ea45e8a util: Remove homegrown Windows KM profiler.
It's not sampling based so its results are biased towards functions called
many times.
2009-11-04 12:15:29 +00:00
Michal Krol
767bc8eb5a tgsi/ureg: Allow for multiple extended instruction tokens.
For example, we would like to have a predicate and texture token
in one instruction to do predicated texture sampling.
2009-11-04 11:47:10 +00:00
Christoph Bumiller
618e3b89f6 nv50: fix shader emit_tex for cube textures 2009-11-04 00:53:52 +01:00
Christoph Bumiller
317ccfe0df nv50: add abs-modifier for emit_minmax 2009-11-04 00:53:51 +01:00
Christoph Bumiller
040e1d008f nv50: add 3d texture tiling and mip-mapping
Mip-mapped 3D textures are not arrays of 2D layers
with a mip-map layout like 2D textures, therefore we
cannot use image_nr == depth for them.

Making use of "volume tiling" modes now, the allowed
modes are 0xZY where Z <= 5 and y <= 5.
2009-11-04 00:53:51 +01:00
Vinson Lee
c475079ef2 progs/util: Fix memory leak if fail to load/compile shader
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-11-03 14:49:41 -07:00
Michal Krol
ceb6728725 llvmpipe: Sanitise shader semantic and interpolator handling.
Handle the remaining semantic names and indices.
Respect color interpolator when not flatshading.

Based on Michal's softpipe commit
eb699d64ec.
2009-11-03 17:12:34 +00:00
Keith Whitwell
026cf84bbb llvmpipe: remove old prim_setup draw stage
Everything now goes through the draw_vbuf handler, the same as
regular drivers.

Based on Keith's commit 4fe0fc3eba.
2009-11-03 17:12:34 +00:00
José Fonseca
677a055fa0 llvmpipe: Respect gl_rasterization_rules in primitive setup.
Based on Michal's identical commit for softpipe
(ca9c413647).
2009-11-03 17:12:34 +00:00
José Fonseca
3e8f665c1e python/retrace: Cope with null constant buffers. 2009-11-03 17:12:33 +00:00
José Fonseca
a2e868b977 python/retrace: Add missing colon. 2009-11-03 17:12:33 +00:00
Brian Paul
a017ad2861 progs/tests: debug code for getting texture component sizes 2009-11-03 10:01:10 -07:00
Michal Krol
7ccf60ae40 tgsi: Up tgsi_exec's control flow nesting to 32. 2009-11-03 16:56:50 +00:00
Brian Paul
4bced42341 Merge branch 'mesa_7_6_branch' 2009-11-03 09:54:09 -07:00
Brian Paul
800e553e7a mesa: clean-up, remove some flushing in FBO functions
Remove some unneeded flushes.
Replace FLUSH_CURRENT w/ FLUSH_VERTICES in other places.
2009-11-03 09:52:25 -07:00
Brian Paul
4de18fb093 mesa: fix indentation 2009-11-03 09:52:25 -07:00
Brian Paul
5698d7cd75 mesa: clean-up formatting 2009-11-03 09:52:25 -07:00
Brian Paul
18af75e501 mesa: avoid extraneous _NEW_BUFFER changes in _mesa_BindFramebufferEXT() 2009-11-03 09:52:25 -07:00
Brian Paul
c7048f9d9f mesa: use FLUSH_VERTICES() in _mesa_drawbuffers() 2009-11-03 09:52:25 -07:00
Brian Paul
8df699b3bb mesa: avoid extraneous _NEW_BUFFER state in _mesa_drawbuffers() 2009-11-03 09:52:25 -07:00
Brian Paul
b28c637382 mesa: use ffs() to shorten loop in _mesa_drawbuffers() 2009-11-03 09:52:25 -07:00
Brian Paul
2d11c48223 mesa: added assertion, another comment 2009-11-03 09:52:25 -07:00
Brian Paul
bcbfda71b0 intel: avoid unnecessary front buffer flushing/updating
Before, if we just called glXMakeCurrent() and didn't render anything we'd
still trigger a flushFrontBuffer() call.

Now only set the intel->front_buffer_dirty field at state validation time
just before we draw something.

NOTE: additional calls to intel_check_front_buffer_rendering() might be
needed if I missed some rendering paths.
2009-11-03 09:52:25 -07:00
Brian Paul
644d8fd363 mesa: added comment 2009-11-02 19:38:35 -07:00
Brian Paul
7157479b25 mesa: use _mesa_get_current_tex_object() 2009-11-02 19:38:35 -07:00
Brian Paul
1afe60e802 mesa: use _mesa_get_current_tex_object() 2009-11-02 19:38:35 -07:00
Brian Paul
b8fdb900fb mesa: make _mesa_get_current_tex_objec() public 2009-11-02 19:38:35 -07:00
Ian Romanick
731810f854 ARB prog parser: Fix a couple issues with previous merge from mesa_7_6_branch
Since the addition of support for Nvidia condition codes, the lexer internally
uses handle_ident to select between returning IDENTIFIER and USED_IDENTIFIER.
Also, use return_string instead of strdup.

Fixes bug #24809.
2009-11-02 12:44:14 -08:00
Pierre Ossman
213ec8251c r600: implement LOG op in compiler 2009-11-02 11:30:00 -05:00
Pierre Ossman
d00cbba403 r600: implement EXP op in compiler 2009-11-02 11:29:54 -05:00
Michal Krol
c379fbbe24 tgsi/ureg: Add negate and swizzle for predicates. 2009-11-02 14:59:52 +00:00
Brian Paul
c02cd82b46 mesa: fix incorrect approx bits/channel for fxt1 formats
See bug 24806.
2009-11-02 06:52:10 -07:00
Brian Paul
a40055f4b6 gallium/util: add casts to silence warnings 2009-11-02 06:51:47 -07:00
Michal Krol
962ece9540 tgsi/ureg: Update for gallium interface changes. 2009-11-02 09:44:21 +00:00
Michal Krol
aa2b2e5d7d tgsi: Update for gallium interface changes. 2009-11-02 09:44:20 +00:00
Michal Krol
0a7d50ed7e gallium: Cleanup predicate and condition code TGSI tokens.
There is little point in having a special TGSI token just to handle
predicate register updates. Remove tgsi_dst_register_ext_predicate token
and instead use a new PREDICATE register file to update predicates.
Actually, the contents of the obsolete token are being moved
to tgsi_instruction_ext_predicate, where they should be
from the very beginning.

Remove the NVIDIA-specific condition code tokens -- nobody uses them
and they can be emulated with predicates if needed.

Introduce PIPE_CAP_SM3 that indicates whether a driver supports
SM3-level instructions, and in particular predicates.

Add PIPE_CAP_MAX_PREDICATE_REGISTERS that can be used to query the driver
how many predicate registers it supports (currently it would be 1).
2009-11-02 09:44:18 +00:00
Michal Krol
eb699d64ec softpipe: Sanitise shader semantic and interpolator handling.
Handle the remaining semantic names and indices.
Respect color interpolator when not flatshading.
2009-11-02 09:44:16 +00:00
Younes Manton
87d7c1aa15 nouveau: Assume all texture blankets are linear for now. 2009-11-01 18:27:47 -05:00
Corbin Simpson
1f630fa016 r300g: Miscellania. Avoid draw segfaults, s/true/TRUE/, etc.
Cleared out my git stash.
2009-11-01 11:54:52 -08:00
Maciej Cencora
3d73852121 r300g: fix geometry corruptions
PVS flush is needed before changing the vertex shader or vertex shader constants.
2009-11-01 11:02:02 -08:00
Maciej Cencora
2db46af875 r300g: split constant buffer and shader emittion 2009-11-01 11:01:40 -08:00
Corbin Simpson
cab749a1d0 r300g: Adopt osiris' PSC data and swizzle.
A fair amount more flexible and easier to maintain.
2009-11-01 09:24:02 -08:00
Christoph Bumiller
5de8f97440 nv50: handle TGSI_SEMANTIC_FACE 2009-11-01 14:28:08 +01:00
Christoph Bumiller
496c9eaacf nv50: make IF condition safe
Don't assume that a SET that writes to IF's argument
directly precedes the IF.
2009-11-01 14:28:04 +01:00
Christoph Bumiller
99e308a0e0 nv50: implement TGSI_OPCODE_AND/OR/XOR
Will use AND for gl_FrontFacing, the face input
is either 0 or 0xffffffff.
2009-11-01 14:27:35 +01:00
Christoph Bumiller
1cc16e1b83 nv50: fix textures with block size != cpp
First, using width * block size as pitch is evidently
wrong if a block contains more than 1 texel.

For tiled textures, since a block occupies a contiguous
area of memory, y addressing in m2mf has to be done by
block index, not the y coordinate itself.

This should fix compressed textures.
2009-10-31 20:51:09 +01:00
Younes Manton
91232b7004 nouveau: Support X8R8G8B8 textures on nv30, nv40 and RTs on nv10-nv40. 2009-10-31 09:42:49 -04:00
Christoph Bumiller
9831e1f76c nv50: use SIFC also for shader upload
Adds a more generic SIFC transfer function.
2009-10-31 13:40:33 +01:00
Christoph Bumiller
525f529d13 nv50: make MRTs work
We have to indicate to the hw whether the FP exports
multiple colour results.
Method 0x121c is used to specify the number of RTs.
Also deactivate zeta explicitly if there's no zsbuf.
2009-10-31 13:40:33 +01:00
Dave Airlie
73b45b0669 radeon: add missing include 2009-10-31 21:24:50 +10:00
Marek Olšák
c9928ac3ee r300g: correct the pitch calculation for smaller mipmaps 2009-10-31 07:30:48 +01:00
Marek Olšák
3f60130b87 r300g: pretend NPOT support
It's requires to get GL2.1, therefore, much more piglit tests can be used
for testing. Figure out later how to emulate this.
2009-10-31 07:30:48 +01:00
Marek Olšák
a8f85dceb5 r300g: fix reading from the destination buffer in blending 2009-10-31 07:30:48 +01:00
Marek Olšák
63c9450ae7 r300g: add precalculating of pixel pitch, add a new NPOT flag 2009-10-31 07:30:48 +01:00
Marek Olšák
11180b4471 r300g: remove unnecessary assertions
Also, correct typos in comments.
2009-10-31 07:30:48 +01:00
Marek Olšák
ace78d90de r300g: fix crash in r300_is_texture_referenced
Also, a subtle fix in emitting a texture state
2009-10-31 07:30:47 +01:00
Dave Airlie
5cf7c8e2d5 radeon: use _mesa_get_current_tex_unit 2009-10-31 15:50:12 +10:00
Brian Paul
5e9f97f0ea ARB prog parser: regenerated files 2009-10-30 19:08:19 -06:00
Brian Paul
df5615de1f ARB prog parser: new set_src_reg(), set_dst_reg() helpers
These functions do sanity checks on the register file and index.
2009-10-30 19:08:18 -06:00
Brian Paul
a71edc9455 mesa: better error message 2009-10-30 19:08:18 -06:00
Eric Anholt
7c8bed62e0 intel: Use GTT mapping when available for swrast.
This improves piglit quick.tests runtime from 19:33 minutes to 6:06 on
my GM45.  It should also hide most of the A17 swizzling issues, though
they'll still exist when swapping occurs (which is the kernel's problem
either way).
2009-10-30 17:35:12 -07:00
Eric Anholt
d63c29ef20 x86: Fix the test for negative pixel count in optimized rgb565 spans.
There's a bunch of bogus looking stuff the count handling in this code, but
this fixes the testcases we have.
2009-10-30 17:35:11 -07:00
Eric Anholt
21a3a79371 intel: Fix up z24_x8 depth spans since the texformat merge. 2009-10-30 17:35:11 -07:00
Vinson Lee
9c3197ef0a prog/tests: Fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-30 15:30:13 -06:00
Eric Anholt
cb132406de i965: Add an index assert on get_fp_inst array like other compiler arrays. 2009-10-30 13:28:44 -07:00
Eric Anholt
2c30ee9bd6 i965: Fix BRW_WM_MAX_INSN to reflect current limits.
Part of fixing bug #24355.
2009-10-30 13:20:34 -07:00
Eric Anholt
2073006c95 intel: Set the texture format in the TFP path.
This fixes a regression in piglit's tfp test as of
11caea687e.  Additionally, set the texture
format for the RGB textures to MESA_FORMAT_XRGB8888 and support it in the
hw paths so that hopefully sw fallbacks involving TFP get better alpha
behavior.

The radeon drivers appear to need the same fix.

Bug #24803
2009-10-30 12:41:28 -07:00
Alex Deucher
b568a2c808 r600: remove duplicate line 2009-10-30 15:08:09 -04:00
Alex Deucher
703a836d40 r600: fill in some missing tex formats
This improves shadowtex since the component ordering
is at least correct now, but I'm not sure how to
deal with texturing from a depth surface yet due to
differences in depth and color tile layouts.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-10-30 15:02:34 -04:00
Alex Deucher
57864f6e04 r600: fix a warning, update comments 2009-10-30 11:52:02 -04:00
Vinson Lee
a8ed066858 progs/tests: fix MSVC build.
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-30 09:40:04 -06:00
Andre Maasikas
5f7d5d3ea3 r600: use AUTO_INDEX for draw - saves cmd buffer space
also seems we can use INDX_OFFSET if start != 0
2009-10-30 17:18:00 +02:00
Brian Paul
409469fb70 intel: fix up some XRGB breakage
We weren't choosing the right XRGB span functions for reading the
framebuffer.  XRGB formats still aren't turned on yet though.
2009-10-30 09:13:04 -06:00
Brian Paul
730a3de9f9 mesa: fix inverted buffer object test
Fixes bug 24799.
2009-10-30 08:31:01 -06:00
Brian Paul
71cd40bccf mesa: fix incorrect format info for MESA_FORMAT_SL8
Fixes bugs 24798 and 24801.
2009-10-30 08:21:16 -06:00
Michal Krol
ca9c413647 softpipe: Respect gl_rasterization_rules in primitive setup. 2009-10-30 08:05:40 +00:00
Brian Paul
4a253431ab intel: update intel_create_renderbuffer(format), add XRGB support
Pass a gl_format to intel_create_renderbuffer() instead of GLenum.
Add cases for MESA_FORMAT_XRGB8888 textures and renderbuffers.
However, we don't yet create any renderbuffers or textures with that
format.  It seems the default alpha value is zero instead of one.
Need to investigate that first.
2009-10-29 19:12:50 -06:00
Brian Paul
f920d496e1 mesa: fix _mesa_texstore_argb8888() for MESA_FORMAT_XRGB8888
If we hit the general path and call _mesa_make_temp_chan_image() we
always want to get a GL_RGBA texture.  We were getting a 3-channel
GL_RGB texture before and that messed up the memory layout.
2009-10-29 17:52:01 -06:00
Alex Deucher
c243e8dd23 r600: remove the no rrb messages 2009-10-29 19:44:35 -04:00
Alex Deucher
b924579bd4 r600: Add support for ARB_depth_clamp 2009-10-29 19:42:52 -04:00
Brian Paul
d0b6147291 intel: remove memcpy_get_tex_image() code
This has been lifted into core Mesa where it can be used for all drivers
that use the _mesa_get_teximage() fallback for ctx->Driver.GetTexImage().
2009-10-29 16:31:57 -06:00
Brian Paul
fcbf663640 mesa: lift memcpy_get_tex_image() code from intel driver into core Mesa
The code should work for any driver.
2009-10-29 16:31:57 -06:00
Brian Paul
bde7874317 mesa: refactor _mesa_get_teximage() code
Break different formats into different functions to make it easier to read.
2009-10-29 16:31:57 -06:00
Brian Paul
217a40d8d9 i965: indentation fix 2009-10-29 16:31:57 -06:00
Brian Paul
26d22b094b i965: make brw_sf_prog_key::sprite_origin_lower_left one bit
Shrinks size of key to 8 bytes from 12.
Note that progs/demos/spriteblast.c is still broken.
2009-10-29 16:31:56 -06:00
Brian Paul
035b21f365 i965: make brw_wm_prog_key a little smaller
GLushort is big enough for the swizzle and origin fields.
The key could probably be made smaller still by re-ordering things.
I'll hold off on that until after the outputswritten64 branch is merged.
The key will get a little larger again with the GLbitfield64 fields.
2009-10-29 16:31:56 -06:00
Eric Anholt
8a9afe71b8 i915: Fix 1D texture mapping in the t coordinate.
Fixes piglit tex1d-2dborder test.
2009-10-29 14:56:52 -07:00
Eric Anholt
4b377ae292 i915: Correct and make use of the defines for 32-bit depth texture modes.
Previously, S8_Z24 depth textures would always be treated as intensity.
Fixes piglit depth-tex-modes.
2009-10-29 14:56:52 -07:00
Brian Paul
861fec163c i965: avoid shader translation on window resize
If the fragment shader doesn't use FRAG_ATTRIB_WPOS (gl_FragCoord) we
don't need to worry about the window size and origin in
brw_wm_populate_key().

This avoids re-generating the i965 shader code when a window is resized.

Issue spotted by Keith Whitwell.
2009-10-29 15:33:43 -06:00
Brian Paul
198ec96d36 i965: define, use BRW_MAX_DRAW_BUFFERS
i965 might support more than 4 color draw buffers.  But if not, this protects
from breakage if the Mesa limit is raised.
2009-10-29 15:33:43 -06:00
Brian Paul
7648c80ac8 i965: remove unused var 2009-10-29 15:33:43 -06:00
Brian Paul
9ef33b8685 i965: don't use context state in emit_fb_write()
Put the state that we care about in the hash key.
Issue spotted by Keith Whitwell.
2009-10-29 15:33:43 -06:00
Brian Paul
a8d233e509 i965: use macros to get/set prog_instruction::Aux field
This makes things a bit easier to remember/understand.
2009-10-29 15:33:43 -06:00
Brian Paul
a0959bcee5 i965: minor code reformatting 2009-10-29 15:33:43 -06:00
José Fonseca
c6164ff155 mesa: Add MESA_FORMAT_Z24_X8. 2009-10-29 20:03:51 +00:00
Zack Rusin
a7fa56a64b st/xorg: fix scaling ov xv data, plus some cleanups 2009-10-29 15:13:17 -04:00
Eric Anholt
f8f40b53a6 i915: Implement min/max LOD clamping with the hardware.
This gets us expected behavior for clamping between mipmap levels, and
avoids relayout of textures for doing clamping.

Fixes piglit lodclamp-between.
2009-10-29 12:06:04 -07:00
Eric Anholt
3744472441 i965: Replace a MIN(MAX()) with CLAMP(). 2009-10-29 12:06:03 -07:00
Brian Paul
ea414e3318 intel: check for single memcpy() in memcpy_get_tex_image() 2009-10-29 11:04:24 -06:00
Eric Anholt
92e7c6a258 i965: Fix fallout from ARB_depth_clamp enablement that broke glDepthRange.
If a backwards glDepthRange was supplied (as with the old Quake no-z-clearing
hack), the hardware would have always clamped because we weren't clamping to
the min of near/far and the max of near/far.  Also, we shouldn't be clamping
to near/far at all when not in depth clamp mode (this usually didn't matter
since near/far are usually the same as the 0.0, 1.0 clamping you do for
fixed-point depth).

This should fix funny depth issues in PlaneShift, and fixes piglit
depth-clamp-range
2009-10-29 10:01:17 -07:00
Eric Anholt
32ec3f2673 mesa: Mostly fix swrast's ARB_depth_clamp support.
I'd written a testcase for the hard part of the extension enablement, so
naturally the easy stuff was completely broken.  There are still issues,
as I'm seeing FLOAT_TO_UINT(max_f) == 0x0 when max_f == 1.0, but it gets
piglit depth-clamp-range closer to success.
2009-10-29 10:01:17 -07:00
Eric Anholt
6eb6a0e9cb intel: Don't bother MI_FLUSHing on glFlush in the DRI2 case.
We only need it when drawing to the front buffer, which we never do for
DRI2.  No significant performance difference, but the flush is definitely
gone from the end of every batchbuffer.
2009-10-29 10:01:17 -07:00
Eric Anholt
fb0084e69e intel: Clean up merge leftover from the DRI2 swap throttling. 2009-10-29 10:01:16 -07:00
Brian Paul
1596f714d2 intel: remove debug code 2009-10-29 10:56:13 -06:00
Brian Paul
2b628d43c0 mesa: consolidate some code in _mesa_GetCompressedTexImageARB() 2009-10-29 10:53:26 -06:00
Brian Paul
dcb4716802 intel: added fast memcpy path for glGetTexImage() 2009-10-29 10:50:26 -06:00
Brian Paul
1e2c517026 progs/tests: also test GL_BGRA format in getteximage.c 2009-10-29 10:50:26 -06:00
Brian Paul
01ee5c63d3 mesa: move pixels==NULL check in glGetTexImage() 2009-10-29 10:50:26 -06:00
Brian Paul
99bbf4b4f5 mesa: consolidate some code in _mesa_GetTexImage() 2009-10-29 10:50:26 -06:00
Brian Paul
67df4fb56b mesa: move, clean-up _mesa_print_texture() 2009-10-29 10:50:26 -06:00
Brian Paul
d580c0c8f7 mesa: fix some tests in subtexture_error_check2()
Don't use hard-coded compressed block sizes.
Update comments and error strings.
2009-10-29 10:50:26 -06:00
Brian Paul
cf7040594e mesa: remove unneedded is_srgb_teximage() function
Use _mesa_get_format_color_encoding() function instead.
2009-10-29 10:50:26 -06:00
Brian Paul
c89f5b6ac8 glsl: make shader substitution a little better 2009-10-29 10:50:26 -06:00
David Heidelberger
41892e9b17 st/mesa: fix PIPE_FORMAT_X8Z24 <> MESA_FORMAT_X8_Z24 conversion
Signed-off-by: David Heidelberger <d.okias@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-29 10:14:41 -06:00
David Heidelberger
10a509564f st/mesa: Add conversion from PIPE_FORMAT_X8Z24_UNORM to MESA_FORMAT_S8_Z24.
Fix glxgears and openarena for Nouveau (no more asserts and crash).

Signed-off-by: David Heidelberger <d.okias@gmail.com
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-29 09:56:14 -06:00
David Heidelberger
c2f5eb7148 st/mesa: Fix nouveau glxinfo after merging texformat-rework.
Signed-off-by: David Heidelberger <d.okias@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-29 09:54:38 -06:00
Brian Paul
1f1bfe8cb5 mesa: move declaration to prevent unused var warning 2009-10-29 07:54:44 -06:00
Chia-I Wu
9927d7f31c mesa: Fix compilation errors and warnings when features are disabled.
Some of the fixes are cherry-picked from opengl-es branch.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-29 07:52:58 -06:00
Chia-I Wu
59798cd886 mesa/main: Make FEATURE_texture_s3tc follow feature conventions.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-29 07:52:58 -06:00
Chia-I Wu
20e20fc5af mesa/main: Make FEATURE_texture_fxt1 follow feature conventions.
Also remove the unused initialization and GLchan fetch functions.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-29 07:52:58 -06:00
Chia-I Wu
920f023e8b mesa/main: Never return NULL in _mesa_get_texstore_func.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-29 07:52:58 -06:00
Brian Paul
e2131e0171 radeon: fix incorrect Z format in radeon_alloc_renderbuffer_storage()
And update error message.
2009-10-29 07:47:41 -06:00
Cooper Yuan
da1fb3be82 r300g: Fix bytes_per_line calculation error while displaying surface 2009-10-29 20:20:59 +08:00
Chia-I Wu
59b29516af swrast: added braces 2009-10-28 22:14:01 -06:00
Brian Paul
c6bd5fae0c mesa: remove old, unused #define 2009-10-28 21:52:37 -06:00
Brian Paul
bd36ca9b76 mesa: re-remove s3v and trident driver files
These were removed from master but a few files came back from the
texformat-rework branch.
2009-10-28 21:46:37 -06:00
Brian Paul
960d49b387 mesa: move some gl_texture_image and gl_renderbuffer fields around 2009-10-28 21:43:50 -06:00
Brian Paul
bc143b1a9f mesa: minor code movement 2009-10-28 21:25:56 -06:00
Brian Paul
1f196b786d Merge branch 'texformat-rework'
Conflicts:
	src/mesa/drivers/dri/radeon/radeon_fbo.c
	src/mesa/drivers/dri/s3v/s3v_tex.c
	src/mesa/drivers/dri/s3v/s3v_xmesa.c
	src/mesa/drivers/dri/trident/trident_context.c
	src/mesa/main/debug.c
	src/mesa/main/mipmap.c
	src/mesa/main/texformat.c
	src/mesa/main/texgetimage.c
2009-10-28 21:24:11 -06:00
Brian Paul
086f9fc0e2 swrast: fix RGB, RGBA texturing code
Fix backward component ordering for RGB textures.
Only optimize RGBA texture case if running little endian.  This restriction
could be lifted with a little work.
2009-10-28 19:46:28 -06:00
Brian Paul
88bb4b5935 swrast: check for single texture unit in _swrast_choose_triangle() 2009-10-28 19:41:24 -06:00
Brian Paul
0103d7a47a swrast: clean up and remove dead code in triangle functions 2009-10-28 19:40:56 -06:00
Brian Paul
1e7517f059 swrast: fix texel decoding in opt_sample_rgba_2d() 2009-10-28 19:38:12 -06:00
Brian Paul
7ac233ec15 mesa: choose texture format in _mesa_get_fallback_texture() 2009-10-28 19:33:48 -06:00
Brian Paul
0ea575d721 Merge branch 'mesa_7_6_branch' 2009-10-28 18:27:25 -06:00
Zack Rusin
24c61c8c2e st/xorg: fix src coordinates in the video acceleration paths 2009-10-28 16:53:50 -04:00
Alex Deucher
660acd60d0 r600: add occlusion query support
Based on initial patch from Stephan Schmid <stephan_2303@gmx.de>.

Basic idea is to dump the zpass count at the start and end of the query
and subtract to get the total number of visible fragments.  HW writes
alternating qwords for up to 4 DBs.  On the first pass, we start at
buffer address + 0; on the second pass, we start at buffer address + 8
(bytes). The resulting buffer at the end of the query looks like:

qw[0]: db0 start
qw[1]: db0 end
...
qw[6]: db3 start
qw[7]: db3 end

The MSB of each qword is the valid bit and the lower 63 bits are
the zpass count for that DB.

OQ on RV740 is disabled at the moment as it only seems to report
results for half of its DBs.  This needs further investigation.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-10-28 15:53:24 -04:00
Corbin Simpson
f3d8d534e6 r300g: Use u_trim_pipe_prim to prevent lockups from incorrect vert counts.
Adapted from osiris' version on his tree.
2009-10-28 12:15:35 -07:00
Corbin Simpson
23d8d15bed r300g: Keep texture formats organized. 2009-10-28 12:15:35 -07:00
Maciej Cencora
e7c8a27638 r300g: add some texture formats 2009-10-28 12:15:35 -07:00
Corbin Simpson
6007e2e008 r300g: Clear up a bit of the buffer reference stuff.
Still need to actually get reference info from winsys somehow. Doing added
buffers is easy, but knowing whether a flush has happened is a bit tricky.
2009-10-28 12:15:34 -07:00
Corbin Simpson
81c51bb67f r300g: Fix XXX.
Nothing strange here.
2009-10-28 12:15:34 -07:00
Marek Olšák
bcfde42913 r300g: fix emitting the stencil-ref and alpha-ref values
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>

DSA really needs its head examined someday. ~ C.
2009-10-28 12:15:34 -07:00
Marek Olšák
a1d726aae8 r300g: fix the WRAP_T mode when using 1D textures
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-10-28 12:15:34 -07:00
Marek Olšák
0e44884aad r300g: fix blending and do some optimizations
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-10-28 12:15:34 -07:00
Marek Olšák
c451011d99 mesa/st: fix crash in st_texture_image_copy
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-10-28 12:15:33 -07:00
Brian Paul
7d56caabe4 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/shader/lex.yy.c
	src/mesa/shader/program_lexer.l
2009-10-28 11:33:51 -06:00
José Fonseca
182ff3e47a llvmpipe: Make sure the JIT engine and X86 target are linked on MSVC build.
Basically mimic the llvm 2.6 way of linking execution engines and
targets.
2009-10-28 11:26:26 +00:00
José Fonseca
5eba607db6 util: Drop return value from cpuid(). 2009-10-28 11:26:26 +00:00
José Fonseca
0426227b68 util: Fix cpuid on MSVC. 2009-10-28 11:26:26 +00:00
José Fonseca
095e66f695 llvmpipe: Implement round() for MSVC. 2009-10-28 11:26:26 +00:00
Brian Paul
6bc1e9fd69 mesa: consolidate _mesa_CompressedTexSubImage[123]DARB() functions 2009-10-27 21:39:44 -06:00
Brian Paul
f3c29bd74f mesa: consolidate CompressedTexSubImage1/2/3DARB() error checking 2009-10-27 21:15:48 -06:00
Brian Paul
9519603f74 mesa: simplify teximage code with get_current_tex_object() 2009-10-27 21:15:36 -06:00
Brian Paul
dd5691e802 mesa: code refactoring to eliminate a switch stmt in bind_buffer_object() 2009-10-27 20:10:59 -06:00
Brian Paul
b44304efde glsl: avoid redundant state changes in _mesa_use_program() 2009-10-27 20:10:59 -06:00
Zack Rusin
2947d14202 st/xorg: fix xv 2009-10-27 21:00:47 -04:00
Brian Paul
52374d7e4c radeon: add case for MESA_FORMAT_X8_Z24 in radeon_create_renderbuffer() 2009-10-27 17:05:08 -06:00
Brian Paul
f8155ef51f intel: silence warning 2009-10-27 17:01:26 -06:00
Brian Paul
21f8d31cfd mesa: debug code for glBlitFramebuffer() 2009-10-27 17:00:31 -06:00
Brian Paul
507cf530b9 via: silence unused var warnings 2009-10-27 17:00:31 -06:00
Brian Paul
3c71666921 intel: minor clean-up, comments 2009-10-27 17:00:31 -06:00
Brian Paul
7fd8c6ca2a intel: use _mesa_get_current_tex_unit() helper 2009-10-27 17:00:31 -06:00
Brian Paul
05ec586851 mesa: s/Bilt/Blit 2009-10-27 17:00:31 -06:00
Brian Paul
403181b913 mesa: more texture debug code changes, improvements 2009-10-27 17:00:31 -06:00
Brian Paul
58a4328e96 mesa: minor code clean-up in client_state() 2009-10-27 17:00:31 -06:00
Brian Paul
72cb441c2f mesa: avoid redundant state setting in glClientActiveTexture
Plus add code for verbose/debugging.
2009-10-27 17:00:31 -06:00
Brian Paul
33531614de intel: fix comment, formatting 2009-10-27 17:00:31 -06:00
Brian Paul
3bee7610be progs/tests: added new blitfb.c test
Tests glBlitFramebuffer() between two texture/renderbuffer surfaces.
In particular, blit from level[1] of a cube map face to a 2D texture.

Used to find/fix bug in intel do_copy_texsubimage().
See commit aef1ab1073f3e30d699b99dae17518ed48b57c72
2009-10-27 17:00:31 -06:00
Brian Paul
3e45788d5d intel: fix src offset bug in do_copy_texsubimage()
Use src->draw_offset intead of zero.  Zero usually worked, except when
the src renderbuffer is actually a texture mipmap level higher than zero.
Fixes progs/test/blitfb.c test.
2009-10-27 17:00:31 -06:00
Brian Paul
4c2a7bc438 glsl: fix memory leak
A slightly modified version of a patch from Vinson Lee.
2009-10-27 17:00:30 -06:00
Eric Anholt
4f9f5a7840 i915: Fix driver for the miptree x/y offset changes.
Bug #24734.
2009-10-27 17:00:30 -06:00
Brian Paul
e9b17d6477 i965: be clear that the Fallback field is a boolean, not a bitfield 2009-10-27 16:59:44 -06:00
Brian Paul
755161b888 Revert "i965: fix hacked Fallback usage in brw_prepare_vertices()"
This reverts commit 8810b8f671.

It turns out the i965 driver uses the intel->Fallback field as a boolean,
not as a bitmask.  The intelFallback() function is a no-op in the i965
driver.  It would have been nice if there were some comments about this.
I'll fix that next...
2009-10-27 16:59:44 -06:00
Vinson Lee
b7ab7d3627 draw: Fix memory leak.
This would only be hit if we got and invalid index_size.
2009-10-27 16:59:44 -06:00
Brian Paul
b73c4ad98b docs: document Intel glBitmap fixes 2009-10-27 16:59:44 -06:00
Brian Paul
fe818ea797 intel: fix GL state bugs in intel_texture_bitmap()
Need to push texture state and polygon state too.
Fixes rendering glitches seen in progs/demos/engine when changing
the rendering mode (wireframe, texture modes).
This makes bitmap rendering a little slower, unfortunately.
2009-10-27 16:59:43 -06:00
Christoph Bumiller
7d967b9b7c nv50: activate more lanes in a warp
Some cards have crippling defaults set and use only 4
of 32 lanes. This should activate 16 on these.
Those that allow 32 by default should still do so.

Found out by Marcin Kościelnicki.
2009-10-28 00:57:18 +01:00
Jakob Bornecrantz
8a1f239ca9 st/xorg: Adopt to new dirty clip rect type 2009-10-27 17:40:55 +01:00
Vinson Lee
50e113e375 progs/tests: Fix MSVC build. 2009-10-26 15:03:52 -06:00
José Fonseca
ad0975f701 scons: Define _USE_MATH_DEFINES on MSVC. 2009-10-26 15:17:26 +00:00
Brian Paul
87127c83dc windows: added remap.[ch] to project files
Untested.  Other updates may be needed to reflect the current source files.
2009-10-26 09:06:00 -06:00
Chia-I Wu
c9d715da39 mesa: Add remap.c to SConscript.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-26 09:01:29 -06:00
Zack Rusin
b5fb60041e st/xorg: initialize indexes before reswizzling for yuv 2009-10-26 08:15:48 -04:00
Zack Rusin
0b069d648b st/xorg: stop overflowing yuv buffers 2009-10-26 08:15:48 -04:00
Zack Rusin
a9f8baf00b st/xorg: add yuv vertex shader
plus some general fixes
2009-10-26 08:15:48 -04:00
Zack Rusin
6b8ce4cc4f st/xorg: add yuv shaders 2009-10-26 08:15:48 -04:00
Marek Olšák
5241b9568c r300g: read occlusion query results from both Z pipes on RV530 2009-10-26 02:07:32 +01:00
Marek Olšák
827002f5ff r300g: add cubemap support
Also, set a pitch for rectangles only.
2009-10-26 02:07:26 +01:00
Brian Paul
d8ded352ec progs/tests: disable blending while drawing text 2009-10-25 18:10:45 -06:00
Brian Paul
11caea687e mesa: choose texture format in core mesa, not drivers
Call the ctx->Driver.ChooseTextureFormat() function from core Mesa's
_mesa_[Copy]TexImage functions instead of in the driver functions.
One less thing for drivers to do.
2009-10-25 18:06:24 -06:00
Brian Paul
355b5bde50 mesa: remove _mesa_compressed_texture_size_glenum() stub 2009-10-25 17:32:56 -06:00
Brian Paul
20c6c58532 mesa: remove _mesa_compressed_row_stride() 2009-10-25 17:25:46 -06:00
Brian Paul
e3f2efc4f1 mesa: remove calls to _mesa_compressed_row_stride() 2009-10-25 17:23:37 -06:00
Brian Paul
c83b758760 glide: remove _mesa_compressed_row_stride() calls
And fix incorrect first parameter.
2009-10-25 17:21:27 -06:00
Brian Paul
253e7fee5d mesa: remove _mesa_compressed_row_stride() calls 2009-10-25 17:21:11 -06:00
Brian Paul
2594168e9f mesa: begin removing _mesa_compressed_row_stride() calls
Use equivalent _mesa_format_row_stride() function instead.
2009-10-25 17:20:24 -06:00
Brian Paul
82bcc1c5d2 mesa: simplify texture_row_stride() helper 2009-10-25 17:15:02 -06:00
Brian Paul
07ad6393cb mesa: fix-up error checking related to compressed texture block size 2009-10-25 17:07:27 -06:00
Brian Paul
54bb414e00 mesa: clean-up, simplify compressed texture size checking 2009-10-25 16:59:08 -06:00
José Fonseca
3a49497f10 gallium: Move enum pipe_error into p_defines.h.
It's really just another define. No need for its own header.
2009-10-25 21:11:54 +00:00
José Fonseca
88e08d7c6d llvmpipe: Human friendlier sampler state dump. 2009-10-25 12:27:14 +00:00
José Fonseca
47f0529806 util: Human readable output of texture states. 2009-10-25 12:26:39 +00:00
José Fonseca
5fcb75758c llvmpipe: Dump the sampler state of the shader key. 2009-10-25 11:49:01 +00:00
José Fonseca
e4c5e01c10 llvmpipe: Immediate multiplication. 2009-10-25 11:48:17 +00:00
José Fonseca
e1342f871b llvmpipe: Fast path for sampling rgba8 textures with linear filtering.
Implement Keith's suggestion of doing most of the sampling with 16x8
and 8x16 AoS, and only doing the conversion to floating point SoA at
the very last step.

Improves gloss performance by 10%.
2009-10-25 09:53:49 +00:00
José Fonseca
f3893ca9c8 llvmpipe: Make lerping work for 8.8 fixed point values. 2009-10-25 09:53:49 +00:00
José Fonseca
bfd7a9ca96 llvmpipe: New module to help make assertions about formats. 2009-10-25 09:53:49 +00:00
José Fonseca
47d241be9f llvmpipe: New function to unpack rgba8 formats into 4 x u8n AoS. 2009-10-25 09:53:49 +00:00
José Fonseca
abff4214ef llvmpipe: Split the format swizzling step from the unpacking. 2009-10-25 09:53:48 +00:00
José Fonseca
8d80fd3f55 llvmpipe: Allow different signs when unpacking. 2009-10-25 09:53:48 +00:00
José Fonseca
b544ab7299 llvmpipe: Add inlines to quickly generate types matching the native SIMD register bitwidth. 2009-10-25 09:53:48 +00:00
José Fonseca
a55b305c5b llvmpipe: Merge lp_build_load_rgba_soa into lp_build_sample_texel. 2009-10-25 09:53:48 +00:00
José Fonseca
bc93e9181c llvmpipe: Factor our pixel offset computation. 2009-10-25 09:53:48 +00:00
José Fonseca
fedd054d53 llvmpipe: Share testing infrastructure with lp_test_format. 2009-10-25 09:53:48 +00:00
José Fonseca
17afb6dd69 llvmpipe: Eliminate lp_build_store_rgba_aos. 2009-10-25 09:53:48 +00:00
José Fonseca
232b586464 llvmpipe: Eliminate lp_build_load_rgba_aos. 2009-10-25 09:53:48 +00:00
José Fonseca
b4f6907b8d llvmpipe: Move a few format/sampling functions into better space. 2009-10-25 09:53:47 +00:00
Marek Olšák
c2df759cd7 r300g: fix redefining mipmaps and fetching from them 2009-10-25 10:16:59 +01:00
Marek Olšák
118dfe1688 r300g: added support for 3D textures
Mipmaps not tested. Also, I am not sure why piglit/texturing/tex3d needs
to have color tolerance +-1 to pass. The classic Mesa driver doesn't
need that.
2009-10-25 08:06:19 +01:00
Brian Paul
d6ee86c77a mesa: remove _mesa_compressed_texture_size()
Use _mesa_format_image_size() instead.
2009-10-24 16:50:00 -06:00
Brian Paul
4c00981b22 mesa: remove ctx->Driver.CompressedTextureSize() hook
It always just called _mesa_compressed_texture_size() anyway.
2009-10-24 16:34:25 -06:00
Brian Paul
35efc6a1b3 mesa: change compressed texture size calls
Replace calls to ctx->Driver.CompressedTextureSize with calls to
_mesa_format_image_size.  The former always called the later.
2009-10-24 16:28:27 -06:00
Brian Paul
bea245ac2f mesa: minor clean-ups in _mesa_store_compressed_texsubimage2d() 2009-10-24 12:04:09 -06:00
Brian Paul
5c82827696 mesa: simplify _mesa_compressed_row_stride(), _mesa_compressed_image_address()
_mesa_compressed_row_stride() can go away soon.
_mesa_compressed_image_address() can be generalized and moved to formats.c
2009-10-24 11:52:36 -06:00
Brian Paul
1ad9671db7 mesa: s/GLuint/gl_format/ 2009-10-24 11:41:25 -06:00
Brian Paul
2c3787f513 mesa: move assertion after declaration 2009-10-24 11:34:27 -06:00
Brian Paul
d255aaf54f mesa: remove hard-coded block sizes 2009-10-24 11:33:58 -06:00
Brian Paul
7b16c43e43 mesa: added _mesa_get_format_block_size() 2009-10-24 11:33:10 -06:00
Brian Paul
51bc12d623 progs/tests: fix sub texture offsets 2009-10-24 11:08:01 -06:00
Brian Paul
bee6794eb1 mesa: added _mesa_get_format_name() 2009-10-24 08:43:16 -06:00
Brian Paul
eb732b1bbb mesa: additional comments in format code 2009-10-24 08:41:08 -06:00
Joakim Sindholt
94a63dccdd r300g: fix scons build yet again 2009-10-24 02:43:21 +02:00
Brian Paul
46a784b7fd Merge branch 'mesa_7_6_branch' 2009-10-23 18:38:43 -06:00
Brian Paul
26f1ad65b9 mesa: simplify att->CubeMapFace assignment 2009-10-23 18:31:03 -06:00
Brian Paul
346250b190 mesa: refactor, new print_shader_info() 2009-10-23 18:31:03 -06:00
Brian Paul
81a4d34f07 mesa: rework error checking code for glGetCompressedTexImage()
Do all error checking in new getcompressedteximage_error_check() func.
Move some additional PBO checks out of the driver fallbacks into the
error checking functions.
2009-10-23 18:31:03 -06:00
Brian Paul
d66965c9a1 mesa: remove misplaced VERBOSE_TEXTURE tests 2009-10-23 18:31:02 -06:00
Brian Paul
9b50ceac03 mesa: more detailed error messages in fbo code 2009-10-23 18:31:02 -06:00
Zack Rusin
b17c885a8a st/xorg: fix text with component alpha rendering 2009-10-23 19:39:16 -04:00
Eric Anholt
49d402e275 Merge remote branch 'origin/mesa_7_6_branch'
Conflicts:
	src/mesa/drivers/dri/intel/intel_fbo.c
	src/mesa/drivers/dri/intel/intel_mipmap_tree.c
	src/mesa/drivers/dri/intel/intel_mipmap_tree.h
	src/mesa/drivers/dri/intel/intel_tex_copy.c
	src/mesa/drivers/dri/intel/intel_tex_image.c
2009-10-23 15:21:05 -07:00
Eric Anholt
bfd51dc34d i965: Annotate _NEW_COLOR dependency for brw_update_renderbuffer_surface(). 2009-10-23 14:13:57 -07:00
Christoph Bumiller
683722740c nv50: do SIGN_SET as one instruction 2009-10-23 22:24:13 +02:00
Christoph Bumiller
99e728a13e nv50: fix saturation outside of tx_insn case 2009-10-23 22:24:09 +02:00
Christoph Bumiller
ad67326f12 nv50: allow all 127 TEMP regs
We should really learn to not waste so many though.
2009-10-23 22:24:03 +02:00
Christoph Bumiller
c738c9ab67 nv50: fix address reg code
Contained some rather obvious thinking errors before,
and didn't consider offsets from TGSI ADDRESS regs.
2009-10-23 22:17:44 +02:00
Christoph Bumiller
255a90a7bd nv50: add depth texture formats, and a few others, too 2009-10-23 22:17:34 +02:00
Vinson Lee
952bf63e2c progs/tests: Fix MSVC build. 2009-10-23 13:49:13 -06:00
Patrice Mandin
d9014a13e7 nouveau: nv30: Relax some limits. We can render to z24s8 buffer even if color buffer is 16 bits. 2009-10-23 18:42:21 +02:00
Patrice Mandin
c84a056764 nouveau: nv30: use r5g6b5 as z16 format 2009-10-23 18:40:13 +02:00
Chia-I Wu
6e99e6ddbf glapi: Always build libglapi.a.
This is made possible by making glapioffsets.h and glapidispatch.h
internal headers of glapi.  They should only be included indirectly
through dispatch.h by mesa.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Chia-I Wu
22884db174 glapi: Move dispatch marcos to glapidispatch.h.
dispatch.h is kept as a wrapper to glapidispatch.h.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Chia-I Wu
3d16088ff0 mesa/dri: Remove extension_helper.h.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Chia-I Wu
17ef1f6074 mesa: Enable remap table in core.
This enables the remap table in core.  driInitExtensions is adapted to
use the remap table.  All uses of extension_helper.h are replaced by
remap_helper.h.  The chicken-egg problem of the DRI drivers is also
solved.

It is now also possible to pass NULL extensions to driInitExtensions.
It will cause driInitExtensions to map all known functions.  This
functionality is used by software drivers and EGL_i915.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Chia-I Wu
d7d3fb925b mesa/main: Add support for remap table.
This commit only adds the source files.  It is supposed to replace the
remap table in DRI drivers.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Zack Rusin
bec5230a1f st/xorg: lots of fixes related to compositing
fixes transformations, rendering with multiple bound textures, xrender
matrix conversions plus some cleanups
2009-10-23 11:11:00 -04:00
Andre Maasikas
d4d4733e6c r600: remove duplicate stride setting
Stride is set already in r700SetVertexFormat and there it works
correctly for 0 also
2009-10-23 17:16:46 +03:00
Andre Maasikas
738b394769 r600: for position invariant programs reading vert_pos is not always known at this point 2009-10-23 17:16:23 +03:00
Keith Whitwell
da253319f9 gallium: remove extended negate also, and also the ExtSwz token
Likewise, the extended negate functionality hasn't been
used since mesa switched to using tgsi_ureg to build programs,
and has been translating the SWZ opcode internally to a single MAD.
2009-10-23 14:50:02 +01:00
Keith Whitwell
8a571b809a cell: typo from ExtSwizzle commit 2009-10-23 14:38:30 +01:00
Keith Whitwell
b9cb74c7f8 gallium: remove the swizzling parts of ExtSwizzle
These haven't been used by the mesa state tracker since the
conversion to tgsi_ureg, and it seems that none of the
other state trackers are using it either.

This helps simplify one of the biggest suprises when starting off with
TGSI shaders.
2009-10-23 14:31:24 +01:00
Keith Whitwell
4e1d51786e gallium: remove noise opcodes
Provide a dummy implementation in the GL state tracker (move 0.5 to
the destination regs).

At some point, a motivated person could add a better
implementation of noise.  Currently not even the nvidia
binary drivers do anything more than this.  In any case, the
place to do this is in the GL state tracker, not the poor
driver.
2009-10-23 13:56:07 +01:00
Keith Whitwell
19403935aa progs/demos: add fps to multiarb 2009-10-23 13:56:07 +01:00
Cooper Yuan
9b6c86b8be r300g: last changes's typo, miss a include file 2009-10-23 16:40:31 +08:00
Cooper Yuan
6df12aad2f r300g: add flush_frontbuffer function to display video surface 2009-10-23 14:46:29 +08:00
Cooper Yuan
0072a26662 g3dvl: pass display and screen to g3dvl when creating video private context 2009-10-23 14:44:27 +08:00
Alex Deucher
45eb9d2f6d r600: remove remains of old tnl pipeline 2009-10-23 01:01:19 -04:00
Alex Deucher
fc38a3cfe8 r600: fix render size prediction 2009-10-23 01:01:19 -04:00
Alex Deucher
614e8f2203 r600: remove old tnl pipeline 2009-10-23 01:01:19 -04:00
Alex Deucher
95328c7cf9 r600: clean up context creation
Make it more consistent with other radeon drivers.
2009-10-23 01:01:18 -04:00
Ian Romanick
286611d990 Revert "Store clipping distance for user clip planes as part of vertex processing"
This reverts commit f058b25881.

This change is completely wrong in so many ways.  When clip distances
are generated as part of vertex processing, they must be interpolated
to perform clipping.  Geometric clipping goes right out the window.
2009-10-22 19:21:21 -07:00
Brian Paul
1160acbfea dri/drivers: update driNewRenderbuffer() to take a gl_format
Now pass a specific MESA_FORMAT_x token to indicate the renderbuffer's
format.  This is better than passing a GLenum and having to guess the
specific format.

I'm unable to test all the drivers, but any issues should be easy to fix.
2009-10-22 19:57:32 -06:00
Brian Paul
cf0e25d4c8 radeon: simplify radeon_create_renderbuffer() 2009-10-22 19:57:06 -06:00
Brian Paul
ab9d1011f5 Merge branch 'mesa_7_6_branch' 2009-10-22 18:38:19 -06:00
Brian Paul
347fb3737b docs: document 'useprog' debug option 2009-10-22 18:35:13 -06:00
Brian Paul
fdce832437 mesa: fix up vbo comments 2009-10-22 18:35:13 -06:00
Brian Paul
488e67bab2 mesa: added _mesa_dump_texture() 2009-10-22 18:35:12 -06:00
Zack Rusin
fb22e80169 st/xorg: fix the makefile when used with new xextproto 2009-10-22 19:33:04 -04:00
Corbin Simpson
04ec113e09 r300g: Enable more stuff in r300_screen, cleanup comments.
Also enable 24-bit depth buffers without stencil.
2009-10-22 14:29:48 -07:00
Corbin Simpson
ff9e1c0198 r300g: Cleanup PSC setup math a bit and stop using Draw formats. 2009-10-22 14:29:48 -07:00
Christoph Bumiller
198925caa1 nv50: handle PIPE_TEX_FILTER_ANISO case
Set the same bits as for linear filtering (in addition
to max anisotropy), and 2 unknown bits I've seen set.
2009-10-22 23:05:12 +02:00
Patrice Mandin
4b8de9bd7c nouveau: nv30: rewrite so we can render only in depth buffer 2009-10-22 22:01:53 +02:00
Patrice Mandin
f9a69c0f04 nouveau: nv30: use a8r8g8b8 as depth texture format for z24s8 2009-10-22 22:00:46 +02:00
Corbin Simpson
fd7ee2bcb7 Kill off trident.
Hm. I could have said "chew trident and spit it out," or perhaps
"spear trident," instead. Dohoho.
2009-10-22 12:57:13 -07:00
Corbin Simpson
8e4657a9d4 Nuke s3v.
As per FDO #17889.
2009-10-22 12:29:30 -07:00
Corbin Simpson
06e464c2d5 r300g: Clean up duplicate code in r300_render. 2009-10-22 11:50:51 -07:00
Corbin Simpson
1f7f9bab81 r300g: Move render functions to r300_render.
Part of the fastpath cleanup.
2009-10-22 11:50:51 -07:00
Alex Deucher
dd36006a4e r600: fix depth span macros for format changes 2009-10-22 14:48:45 -04:00
Brian Paul
eb1b8ed148 radeon: fix some renderbuffer format bugs 2009-10-22 12:26:17 -06:00
José Fonseca
bf48447caf scons: Hack LLVM support on Windows.
Doesn't quite work yet though, as small differences in the compilation flags
used when building LLVM and Mesa cause link failures for STL symbols.
2009-10-22 19:12:14 +01:00
José Fonseca
719984afca llvmpipe: Avoid yet another variable size array. 2009-10-22 19:12:14 +01:00
José Fonseca
ba8c11923a llvmpipe: Define rdtsc for MSVC. 2009-10-22 19:12:14 +01:00
José Fonseca
9aafa1fbd2 llvmpipe: Avoid variable size arrays.
Not really variable size, but MSVC still doesn't like them.
2009-10-22 19:12:14 +01:00
José Fonseca
01b85e2923 llvmpipe: Use the pack/unpack functions for 8bit unsigned norm multiplication. 2009-10-22 19:12:13 +01:00
José Fonseca
4458695bda llvmpipe: Utility function to double the bit width of a type. 2009-10-22 19:12:13 +01:00
José Fonseca
421507de06 llvmpipe: Factor vector packing/unpacking to a separate source file.
These functions will be needed to implement many of the 8bit operations,
and they are quite complex on its own.
2009-10-22 19:12:13 +01:00
José Fonseca
a07437f8a6 llvmpipe: Call util_cpu_detect() from the unit tests. 2009-10-22 19:12:13 +01:00
José Fonseca
4797ce0d19 util: Set cpu endianness too. 2009-10-22 19:12:13 +01:00
José Fonseca
1acd891ed3 scons: Disable more MSVC pedantic security warnings. 2009-10-22 19:12:12 +01:00
Alex Deucher
f8bee0e412 Merge branch 'master' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa 2009-10-22 12:29:36 -04:00
Zack Rusin
1f5b568fbe st/xorg: cleanup the checks for whether the op is accelerated 2009-10-22 12:21:35 -04:00
Alex Deucher
5e77b61e39 Merge branch 'mesa_7_6_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa 2009-10-22 12:02:31 -04:00
Zack Rusin
c4af8ce69e st/xorg: lots of render fixes
fixes all the blend modes, fixes flushing/finishing semantics, adds
acceleration for the component alpha modes that we can support, fixes
src in mask shader and general cleanups
2009-10-22 11:53:10 -04:00
Chia-I Wu
4e2bdd6635 progs/egl: Add support for pixmap and pbuffer surface to xeglgears.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
60cf250d47 egl_glx: Add support for eglWaitClient and eglWaitNative.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
7ffe64a7ae egl_glx: Clean up eglGetProcAddress.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
a206436577 egl_glx: Clean up context functions.
This lifts the requirement that a context must be direct.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
c407c70244 egl_glx: Clean up surface functions.
Separete Drawable and GLXDrawable.  Add support for pbuffer and pixmap
surfaces on GLX <= 1.3.  Remove surface binding code that will never
work.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
78c3a351bc egl_glx: Clean up the initialization code.
Proper detection of GLX extensions.  Convert fbconfigs or visuals in a
more unified way and validate the resulting configs.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Chia-I Wu
326baecd75 egl: Correct conversion of native visual type.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-22 09:33:27 -06:00
Ben Skeggs
eebf4b5299 nv50: support 3D class 0x8597, remove redundant unknown chipset detection 2009-10-22 21:56:32 +10:00
Corbin Simpson
511bd5f32b r300g: Check for NULL Draw during flush.
Split from the fastpath WIP.
2009-10-22 00:21:08 -07:00
Corbin Simpson
0a8cd4862c r300g: Update comments, function names in r300_state_inlines. 2009-10-21 23:26:02 -07:00
Corbin Simpson
034db65f08 r300g: Update comments, asserts, indents in r300_texture.
I wish I knew enough about textures to really really REALLY fix that file.
2009-10-21 23:23:37 -07:00
Corbin Simpson
5a653ada41 r300g: Remove unused debug flag. 2009-10-21 22:54:52 -07:00
Corbin Simpson
40247d87d2 r300g: Cleanup old static shader state. 2009-10-21 22:53:37 -07:00
Brian Paul
82ffc5884c progs/tests: draw Z values as luminance, no pixel zoom 2009-10-21 21:51:19 -06:00
Brian Paul
3c68560866 i915: replace MESA_FORMAT_Z24_S8 with MESA_FORMAT_S8_Z24
And change parameter type.
2009-10-21 21:48:03 -06:00
Brian Paul
6e1ddd34c6 radeon: get rid of z24s8 <-> s8z24 conversions in span code
Can just use s8z24 everywhere.
Note: the WRITE_DEPTH macro for R600 may need to be fixed.
2009-10-21 21:20:05 -06:00
Brian Paul
c18b022d0d radeon: replace MESA_FORMAT_Z24_S8 with MESA_FORMAT_S8_Z24
Core Mesa deals with MESA_FORMAT_S8_Z24 everywhere it should so
we shouldn't have to use MESA_FORMAT_Z24_S8 anymore.
2009-10-21 21:14:44 -06:00
Brian Paul
68d94a608a intel: use MESA_FORMAT_S8_Z24 format and avoid z24s8/s8z24 conversions 2009-10-21 20:02:33 -06:00
Brian Paul
4bd70b5cff i965: change parameter type to gl_format 2009-10-21 20:00:43 -06:00
Brian Paul
c55b355fd4 mesa: use MESA_FORMAT_X8_Z24 2009-10-21 19:58:00 -06:00
Brian Paul
832f29770d mesa: use MESA_FORMAT_X8_Z24 format 2009-10-21 19:56:18 -06:00
Brian Paul
e4c700dbbf mesa: added MESA_FORMAT_X8_Z24 format
24-bit Z in 32-bit pixel.  We could probably use the MESA_FORMAT_S8_Z24
format but this there's a few places where we explicitly don't want stencil.
This format may go away at some point in the future.
2009-10-21 19:55:44 -06:00
Marc Dietrich
b2b239691d gallium/util: fix cpu detection on ppc
As we are compiling with -D_BSD_SOURCE, sigjmp_buf and siglongjmp
should be replaced by the non-sig functions (see man 3 setjmp).
Tested on linux/cell.
2009-10-21 15:15:03 -06:00
Brian Paul
2cc5a0e6bb mesa: added _mesa_dump_renderbuffers() debug code 2009-10-21 15:14:30 -06:00
Patrice Mandin
d364f662c6 nouveau: nv30: Do not use assert to return NULL 2009-10-21 22:01:03 +02:00
Patrice Mandin
cb351bdd6e nouveau: nv30: check number of colour buffers to bind 2009-10-21 21:56:09 +02:00
José Fonseca
ce98860012 llvmpipe: Remove extraneous name in lp_type pre-declaration. 2009-10-21 15:53:37 +01:00
Corbin Simpson
3b8dad47f8 r300g: No debug in r300_state. 2009-10-21 06:52:25 -07:00
Corbin Simpson
6a448a525b r300g: Cleanup header includes. 2009-10-21 06:52:25 -07:00
Corbin Simpson
babadb8bb9 r300g: Don't use getenv; use debug_get_*_option instead. 2009-10-21 06:52:24 -07:00
Corbin Simpson
5a0598f235 r300g: Don't use the hashtable internally.
As osiris pointed out, glxgears slowly gets slower for some reason
when it's enabled, and it's not helping at the moment, so just turn
it off.
2009-10-21 06:52:24 -07:00
Corbin Simpson
b589e39809 r300g: Examine vertex attribute type on HW TCL too. 2009-10-21 06:52:23 -07:00
Corbin Simpson
b21df2620e r300g: Also kill r300_shader_inlines with fire. 2009-10-21 06:52:23 -07:00
Corbin Simpson
58abfebaad r300g: Kill r300_surface with fire.
If you really want to see it again, check the history.
2009-10-21 06:52:22 -07:00
Eric Anholt
d56125a298 intel: Fix flipped condition in ARB_sync GetSYnciv(GL_SYNC_STATUS).
Bug #24435
2009-10-20 14:52:58 -07:00
Eric Anholt
cbd20e18a0 meta: Fix the BufferSubData in meta clear to be BufferData.
Fixes a 3.4% +/- 1.3% performance regression in my GL demo (n=3).  The
other meta code could probably also use the same treatment.
2009-10-20 13:07:49 -07:00
Jakob Bornecrantz
478332b0c1 st/xorg: Move drm init to own function 2009-10-20 18:11:51 +02:00
Jakob Bornecrantz
fc07ca004a trace: Check for destroy before calling it 2009-10-20 17:19:05 +02:00
Jakob Bornecrantz
a9f71b3bba st/xorg: Cleanly shutdown 2009-10-20 17:19:04 +02:00
Jakob Bornecrantz
5f8f14e5ca st/xorg: Remove output functions not used 2009-10-19 07:52:16 +02:00
Zack Rusin
b7fbcfdb3b st/xorg: makefile garbage 2009-10-19 23:48:38 -04:00
Zack Rusin
a39a3cc14e st/xorg: implement basic src/mask transformations
plus fix filters
2009-10-19 23:45:31 -04:00
Corbin Simpson
e5f1f6a0be r300g: Demonstratory kludge to unbreak glxgears.
We *must* recalculate something in vformat every rebind; let's see
if we can't narrow it down a bit.
2009-10-19 14:43:33 -07:00
Corbin Simpson
973aab1a52 dri-st: Add EXT_provoking_vertex.
Hm, I could have sworn I did this before?
2009-10-19 14:43:32 -07:00
Jakob Bornecrantz
e1b39c673d st/xorg: Switch to set_mode_major 2009-10-18 15:46:25 +02:00
Jakob Bornecrantz
846da0bfda st/xorg: Massivly redo root pixmap creation 2009-10-18 15:46:25 +02:00
Jakob Bornecrantz
e9e6152cb3 st/xorg: Clean up cursor functions a bit 2009-10-18 15:46:25 +02:00
Jakob Bornecrantz
b8843c6056 st/xorg: Support more then one output of a given type 2009-10-18 15:46:24 +02:00
Jakob Bornecrantz
68b5dc9634 st/xorg: Change how disable accel is handled 2009-10-18 15:46:24 +02:00
Christoph Bumiller
ec5c23551c nv50: add support for address regs
Allow indirect uniform access and increase the
limit on parameters from 128 to 512.
2009-10-19 18:25:09 +02:00
Christoph Bumiller
eb7ea97e7f nv50: cleanup emit_kil 2009-10-19 18:25:09 +02:00
Christoph Bumiller
2eef2017ac nv50: implement TGSI_OPCODE_CMP 2009-10-19 18:25:09 +02:00
Christoph Bumiller
f204eb1842 nv50: quick fix for insn src negation
We only have a per nv50_reg negation flag, if an
nv50_reg is used more than once in a TGSI op with
different sign modes, we'd generate wrong code.

We probably can't do much better without more
invasive changes.
2009-10-19 18:25:09 +02:00
Christoph Bumiller
1635e8d6f4 nv50: add support for DDX and DDY opcodes 2009-10-19 18:25:09 +02:00
Christoph Bumiller
c0e80cf0e9 nv50: submit user vbo data through the fifo
Requesting a new real buffer from the kernel and
copying all the data is wasteful e.g. if only a
few (but widely spread) vertices are accessed.
2009-10-19 18:25:08 +02:00
Christoph Bumiller
fba2eabe13 nv50: use SIFC for TIC, TSC upload
Add proper flushes for TIC and TSC and remove
the costly 2D.0110 flush in nv50_flush.

Correct TIC and TSC bo sizes.
2009-10-19 18:25:08 +02:00
Christoph Bumiller
6ab2fcca9d nv50: nicer texture format switch
Similar to nv40.
2009-10-19 18:25:08 +02:00
Alex Deucher
620270c76e Merge branch 'mesa_7_6_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa
regenerated lex.yy.c
2009-10-19 12:10:59 -04:00
Ben Skeggs
35b98e2884 nouveau: implement is_{texture,buffer}_referenced properly 2009-10-19 09:49:02 +10:00
Ben Skeggs
869d3eea37 drm/nv50: write tic/tsc setup to correct slots when skipping units 2009-10-19 09:49:02 +10:00
Corbin Simpson
16a06fea73 r300g: Fix up a bunch of warnings. 2009-10-18 16:09:01 -07:00
Corbin Simpson
d2e29b502e r300g: Add another ZTOP condition.
I don't even know if texkill works right now.
2009-10-18 10:30:18 -07:00
José Fonseca
838da1d4ae llvmpipe: Allocate texture storage for whole quads. 2009-10-18 14:31:58 +01:00
Corbin Simpson
bb567357bc gallium: Permit surface_copy and surface_fill to be NULL.
Uf. Lots of files touched. Would people with working vega, xorg, dri1, etc.
please make sure you are not broken, and fix yourself up if you are.

There were only two or three places where the code did not have painful
fallbacks, so I would advise st maintainers to find less painful workarounds,
or consider overhauling util_surface_copy and util_surface_fill.

Per ymanton, darktama, and Dr_Jakob's suggestions, clear has been left as-is.

I will not add PIPE_CAP_BLITTER unless it is deemed necessary.
2009-10-17 21:32:56 -07:00
Corbin Simpson
bfd877e470 r300g: Squash format warning.
Won't ever be supported.
2009-10-17 20:53:19 -07:00
Corbin Simpson
11056ca86f r300g: Use a dirty test to bring framerate back up.
This is just split out from the next commit, that's all.
2009-10-17 20:47:45 -07:00
Corbin Simpson
51173e4e53 r300g: Also have rs_block keyed to the current shader combo.
Eliminates part of the glxgears corruption here. Need to clean up PSC more,
to get rid of the rest of it.
2009-10-17 20:29:27 -07:00
Corbin Simpson
ce9ae4a483 r300g: Fix u_hash_table rename. 2009-10-17 20:05:23 -07:00
Corbin Simpson
4a98d19d1b Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2009-10-17 19:58:23 -07:00
Patrice Mandin
114417a2f5 nouveau: nv40: Use same workaround as i915 for segfault related to vbo 2009-10-17 20:49:18 +02:00
Patrice Mandin
66aab9a1f6 nouveau: nv30: Remove duplicate case. Was a typo for X8R8G8B8, but that will never be use for front buffer. 2009-10-17 20:46:19 +02:00
Patrice Mandin
67356ae047 nouveau: nv30: Use same workaround as i915 for segfault related to vbo 2009-10-17 20:27:24 +02:00
José Fonseca
5d42e3988d util: Rename from u_* to util_* while we're at it.
To be consistent with the rest.
2009-10-17 11:45:04 +01:00
Chris Wilson
60a39b6799 intel: Disallow relocations to the byte beyond the end of the buffer 2009-10-17 08:26:54 +01:00
Brian Paul
a335d334d4 mesa: fix/update some comments 2009-10-16 13:07:43 -06:00
Brian Paul
f094b86bb5 mesa: lift default symlinks target into Makefile.template
Driver Makefiles can still add symlink dependencies/rules if needed.
2009-10-16 13:07:43 -06:00
Brian Paul
db2046580f mesa: use EXTRA_MODULES and SUBDIRS to build r300 compiler
This is a bit cleaner and avoids rebuilding the r300_dri.so library all
the time.
2009-10-16 13:07:43 -06:00
Brian Paul
d9fd207133 mesa: added SUBDIRS support in dri/Makefile.template 2009-10-16 13:07:43 -06:00
Brian Paul
f0503726bf mesa: move a comma 2009-10-16 13:07:43 -06:00
Brian Paul
2ee7fd8d58 mesa: added MESA_GLSL=useprog debug flag
This logs glUseProgram() calls to stderr.
2009-10-16 13:07:43 -06:00
Corbin Simpson
3e56bef5a5 radeon-gallium: Use debug_get_bool_option instead of getenv. 2009-10-16 09:45:07 -07:00
Corbin Simpson
fc8a156cfc r300g: Use a hash table to look up vertex info.
Need to move rs_block to this, too.

Also, I'm getting massive amounts of flicker for some reason; I bet we've gotta
re-re-examine PSC and friends. :C
2009-10-16 08:43:02 -07:00
Corbin Simpson
3924d86115 util: Change function names to begin with u_.
Avoids link-time clashes with Mesa's internal hash table.
2009-10-16 08:43:02 -07:00
José Fonseca
166957abeb progs/tests: Use rand() instead of random().
Forgot these on previous commit.
2009-10-16 11:42:13 +01:00
José Fonseca
699260b195 progs/tests: Use rand() instead of random().
More portable. Same implementation on Linux.
2009-10-16 11:39:29 +01:00
Vinson Lee
60b6c74583 prog/tests: Fix MSVC build. 2009-10-16 11:36:09 +01:00
Corbin Simpson
e4f21be13a r300g: Set logical ID for each emitted texture/sampler.
multitexarray works on my r300, but texrect doesn't.
2009-10-15 16:58:26 -07:00
Brian Paul
fa3046431a dri/common: updated #includes 2009-10-15 14:57:45 -06:00
Brian Paul
a37c9ac8ee dri/common: use _mesa_little_endian() and update comments 2009-10-15 14:54:32 -06:00
Brian Paul
9bf2aa3329 dri/common: fix broken _dri_texformat_* initializations 2009-10-15 14:49:53 -06:00
Patrice Mandin
a5a05fd782 nouveau: nv30: Hack to enforce same number of bits as front buffer, for render targets 2009-10-15 22:41:09 +02:00
Patrice Mandin
13580aa3d1 nouveau: nv30: refuse binding a colour buffer with a zeta buffer with different bits, till the backend can tell Mesa not to do that. 2009-10-15 21:58:44 +02:00
Zack Rusin
108273c5ed st/xorg: refix source over 2009-10-15 15:23:04 -04:00
Brian Paul
5b7d9053a0 progs/egl: put declarations before code 2009-10-15 13:00:03 -06:00
Chia-I Wu
6c21c8862b egl: Rework the synchronization primitives.
This adds error checking to the synchronization primitives.  And
eglWaitGL is now implemented by eglWaitClient.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:54:00 -06:00
Chia-I Wu
57da499d7b egl: Rework eglSwapInterval.
This adds error checking to eglSwapInterval and clamps the swap
interval.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:54:00 -06:00
Chia-I Wu
bbfd0e2615 egl: Rework error checking in eglSwapBuffers.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:58 -06:00
Chia-I Wu
aaa1253b09 egl: Update comments about eglapi.c.
Mention that opaque handles are looked up and checked.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:57 -06:00
Chia-I Wu
6190663120 egl: Rework error checking in eglGetCurrentSurface.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:57 -06:00
Chia-I Wu
8bb2485ed0 egl: Include GL header in eglconfigutil.h.
This is just a cosmetic change.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:56 -06:00
Chia-I Wu
29d115092e egl: Fix GLX_USE_TLS build.
Remove an extraneous semicolon.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:56 -06:00
Chia-I Wu
2fc1614e7a egl: Fix eglCheckConfigHandle.
A stupid bug by me made the check void.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-15 12:53:55 -06:00
Brian Paul
c47b03ebeb radeon: initialize renderbuffer Format field in radeon_create_renderbuffer()
Plus, use MESA_FORMAT_S8_Z24 everywhere.
2009-10-14 13:15:05 -06:00
Jakob Bornecrantz
72fd1cf292 trace: Handle transfer returning null 2009-10-14 11:44:09 +02:00
Zack Rusin
074e069910 st/xorg: fix most of the composition modes 2009-10-15 00:06:43 -04:00
Corbin Simpson
a82fc97c64 r300g: Move ZTOP to its own state atom.
It may seem pointless, but this avoids a fair amount of predicted CSO pain.
2009-10-14 20:06:38 -07:00
Brian Paul
91bd87c06e progs/demos: try different depth formats in fbo_firecube.c 2009-10-14 19:13:32 -06:00
Brian Paul
85fb3e4027 docs: document more MESA_GLSL env var options 2009-10-14 19:09:08 -06:00
Brian Paul
24e2f61469 mesa: assorted top-level Makefile clean-ups 2009-10-14 19:09:08 -06:00
Brian Paul
2fd5cb7133 mesa: added VERBOSE_SWAPBUFFERS 2009-10-14 19:08:39 -06:00
Brian Paul
f9784072fe vbo: clean-ups, reformatting 2009-10-14 19:08:38 -06:00
Brian Paul
ade1cc9924 mesa: added MESA_VERBOSE option 'draw' to debug glDrawArrays/Elements, etc. 2009-10-14 19:08:38 -06:00
Brian Paul
d9099f8602 mesa: rename VERBOSE_IMMEDIATE->VERBOSE_MATERIAL to reflect what it does 2009-10-14 19:08:38 -06:00
Brian Paul
73fc0ca4c3 mesa: remove unused ctx->Driver.PrioritizeTextures() hook 2009-10-14 19:08:38 -06:00
Brian Paul
0187e042b6 mesa: remove unused ctx->Driver.TextureMatrix() hook 2009-10-14 19:08:38 -06:00
Jakob Bornecrantz
ef067b5f01 st/xorg: Fix dpms include problems 2009-10-13 19:16:21 +02:00
Jakob Bornecrantz
5c4bdbd825 autoconf: Fix case for not having package 2009-10-15 01:25:48 +01:00
Zack Rusin
59cf40059a st/xorg: get transparency on fills working (fixes Qt/KDE apps) 2009-10-14 19:04:29 -04:00
Jakob Bornecrantz
96c9b39a6a i915g: Fix warnings 2009-10-14 23:05:55 +01:00
Alex Deucher
f22c427bd6 r600: enable EXT_vertex_array_bgra extensions 2009-10-14 14:19:12 -04:00
José Fonseca
3ce3c03257 util: Fix cpu detection on Windows. Cleanup. 2009-10-14 17:27:06 +01:00
José Fonseca
4046c3bab4 llvmpipe: Use ALIGN_STACK. 2009-10-14 17:24:22 +01:00
José Fonseca
68edb4eac5 gallium: New ALIGN_STACK macro to tell gcc to align stack pointer. 2009-10-14 17:24:22 +01:00
José Fonseca
5ba645f0fb scons: Disable SSE intrinsics on MinGW.
-mstackrealign causes stack corruption on MinGW. And without it the ability
to use SSE instrinsics goes down the drain. Even if we use
__attribute__((force_align_arg_pointer)) for the functions we explicitly
use SSE instrinsics, the SSE code automatically generated by gcc will
cause assertion failures. What a nightmare.

Thankfully LLVM gets this right, so all runtime generated SSE code just
works. rtasm code doesn't assume 16byte alignment. Therefore the bulk of
our performance sensitive code is not affected by this.

Still, intrinsics can be convenient, and it would be nice
to get this working again some day, sp will try to get a reduced test
case.
2009-10-14 17:24:21 +01:00
Brian Paul
9fd7e9ef05 Merge branch 'mesa_7_6_branch' 2009-10-14 09:40:05 -06:00
Brian Paul
ce3801ab87 Merge branch 'mesa_7_6_branch' 2009-10-14 09:22:30 -06:00
Brian Paul
98eb7a14a4 mesa: remove left-over debug printf 2009-10-14 07:52:39 -06:00
Vinson Lee
ea862ec8ff prog/tests: Fix MSVC build. 2009-10-14 07:52:39 -06:00
Corbin Simpson
fd63f89e95 r300g: Move ztop to derived state.
Need to get it into its own atom instead of piggybacking on DSA.
2009-10-14 03:09:41 -07:00
Corbin Simpson
f13e507798 r300g: Compiler warning cleanup. 2009-10-14 01:58:18 -07:00
Dave Airlie
88b697fb0a r300g: remove buffer add that should be unnecessary.
This should be handled in the emit fine
2009-10-14 18:24:34 +10:00
Dave Airlie
fa581580b1 r300g: add QUERY to KITCHEN_SINK
I missed this, thanks to Corbin for pointing it out.
2009-10-14 18:24:05 +10:00
Dave Airlie
ce5cba040c r300g: add one more ZTOP disable bit.
Still missing the frag uses kill support, hopefully nha can point that out.
2009-10-14 18:05:14 +10:00
Dave Airlie
51d1cf55da r300g: port over last parts of oq support.
Add support for begin/end in each CS so we don't get any other
processes rendering in between.

TODO:
blame other parts of driver for this not working like Z.
2009-10-14 17:44:19 +10:00
Dave Airlie
47791697ab r300g: convert query to a state for emitting.
This means we don't emit in the begin query but when we have
to flush. Similiar to classic.

TODO:
make query object actually work.
2009-10-14 17:14:43 +10:00
Dave Airlie
c1bee7bdea r300g: fixup arb occulsion query support.
1: add rv530 support
   - num z pipes cap
   - add proper start/finish query options for rv530

2: convert to use linked list properly.

3: add flushing required check.

4: initial Z top disabling support.

TODO:
make it actually work on my rv530.
2009-10-14 16:53:12 +10:00
Dave Airlie
210481ae16 r300g: attempt to make bo space check sane.
This attempts to make r300g do proper bo space checking as opposed
to whatever it was doing now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-10-14 15:13:25 +10:00
Dave Airlie
23c0c820e2 r300g: fix case where texture unit 0 is disabled but unit 1 is enabled.
to reproduce, start texrect, disable 0 texture in menu.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-10-14 11:42:05 +10:00
Brian Paul
220f72a8d0 mesa: minor tweak to printf string 2009-10-13 16:33:36 -06:00
Brian Paul
435623b3f0 mesa: rework _mesa_read_shader() debug hook
Look for shaders named "newshader_<CHECKSUM>" to replace the incoming
shader text.  For debug purposes.
2009-10-13 16:33:36 -06:00
Brian Paul
dfefde38c7 mesa: don't print pointer in _mesa_fprint_parameter_list() 2009-10-13 16:33:36 -06:00
Ian Romanick
f058b25881 Store clipping distance for user clip planes as part of vertex processing
Once the clipping distance is calculated and stored per vertex, the
distances can be re-used when clipping is actually performed.  This
doesn't have any immediate benefit, but it paves the way for
implementing gl_ClipDistance in vertex shaders and result.clip[] in
vertex programs.

This has not produces any oglconform regressions on my G31 system
which uses software TNL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2009-10-13 15:15:20 -07:00
Patrice Mandin
cf33aaf8fe nouveau: nv30: use texture width,height for render target dimensions 2009-10-13 22:53:32 +02:00
Chia-I Wu
f1c5cab552 egl: Improve logging facility.
Add _eglSetLogger and _eglSetLogLevel to allow drivers to change the
message logger or report level.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:37 -06:00
Chia-I Wu
310c76812e egl: Allow binding to any client API.
As a result, EGL_NONE is no longer a valid client API.  And it is
possible that no config supports the current bound API.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Chia-I Wu
e787ffcd02 egl: Preload a driver if eglGetProcAddress is called early.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Chia-I Wu
9061d733d3 egl: Remove core functions from eglGetProcAddress.
eglGetProcAddress may not be used to query core (non-extension)
functions.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Chia-I Wu
5541988578 egl: Add support for driver built-in.
This allows an EGL driver to be compiled together with libEGL.so.  It
eliminates the need to specify a driver, or support module loading on
new platforms.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-13 12:00:36 -06:00
Zack Rusin
1cc1c3a033 st/xorg: solid fills with masks are supported
gradients are supported, but not enabled by default due to little
testing they got
2009-10-13 13:04:00 -04:00
Brian Paul
83f4e72009 intel: fix broken sw generate mipmap path
Need to restore code that fixed up the intel_texture_image state.
2009-10-13 10:38:34 -06:00
Zack Rusin
89bb33fb20 st/xorg: fix and enable by default xrender acceleration
src in mask was broken
2009-10-13 12:25:13 -04:00
Brian Paul
eefecf5d2a mesa: whitespace fixes 2009-10-13 09:05:02 -06:00
Brian Paul
c8413351c3 mesa: do RTT check in _mesa_meta_check_generate_mipmap_fallback()
We need to check that we can actually render to the texture's format
before doing mipmap generation.

This may fix bug 24219.
2009-10-13 09:05:02 -06:00
Corbin Simpson
ca8cafda0b r300g: More debug flags. 2009-10-12 21:48:08 -07:00
Corbin Simpson
a4a4f7abc2 r300g: Surface debug.
It gets really annoying watching r300g tell me how it's filling surfaces.
Or falling back during filling surfaces.
2009-10-12 21:48:08 -07:00
Corbin Simpson
95a05621eb r300g: Fallback on surfaces we can't render to or from.
Still not sure why st keeps handing down things we can't render to.
2009-10-12 21:48:07 -07:00
Corbin Simpson
36ccdf09b8 r300g: Prevent multiple-use textures from getting incorrectly approved. 2009-10-12 21:48:07 -07:00
Corbin Simpson
05fc9cdfdf r300g: Clean up texture formats. 2009-10-12 21:48:07 -07:00
Brian Paul
3f928b3552 mesa: save/set/restore texture base/wrap state in blitframebuffer_texture() 2009-10-12 18:12:01 -06:00
Brian Paul
b5d6a8e88f mesa: minor clean up in check_begin_texture_render() 2009-10-12 18:12:01 -06:00
Brian Paul
47a7535f41 intel: whitespace/formatting clean-up 2009-10-12 18:12:00 -06:00
Brian Paul
3732d0a77d intel: replace extern decl with #include 2009-10-12 18:12:00 -06:00
Brian Paul
b9c2897957 intel: added INLINE keyword to minify()
This is mainly just to silence some warnings.
2009-10-12 18:12:00 -06:00
Brian Paul
c932e21fa8 intel: code clean-ups 2009-10-12 18:12:00 -06:00
Brian Paul
e6594a22f2 intel: pass zslice to intel_miptree_image_offset()
This lets us get rid of intel_miptree_depth_offsets() and simplify all
of the calling code.
2009-10-12 18:12:00 -06:00
Brian Paul
15d2ef6024 i965: remove unused var 2009-10-12 18:12:00 -06:00
Vinson Lee
96fd13c1a0 prog/tests: Fix MSVC build. 2009-10-12 18:05:23 -06:00
Brian Paul
6c1cd4c558 mesa: print program Id when printing 2009-10-12 18:05:23 -06:00
Patrice Mandin
a5348d435d Add support for more 8 and 16 bits formats 2009-10-12 21:03:26 +02:00
Andre Maasikas
7a32c0a19e r600: implement ProgramStringNotify
need this to properly test with piglit/glean vert/fragprog tests
copied mostly from r300, many thanks to osiris, nha, airlied, others...
2009-10-12 16:28:36 +03:00
Andre Maasikas
da66d9e12d r600: LIT dst.y gets value from src.x
seems I overlooked this when removing hardcoded swizzles for this
one previously
2009-10-12 16:28:25 +03:00
Andre Maasikas
97dd35bd6f r600: DPH adds w comp of second operand, so set first one to 1 instead 2009-10-12 16:28:16 +03:00
Zack Rusin
150d4968e3 st/xorg: initialize pipe in the renderer 2009-10-11 21:52:10 -04:00
Zack Rusin
319a588238 st/xorg: lots of rendering and xv changes
extract all the rendering code to xorg_rendedrer, make both exa and xv
share that code. in the process cleanup the rendering code and implement
a lot more of the xv infrastructure.
2009-10-11 20:02:47 -04:00
Zack Rusin
59ae3d5155 configs: fix some remains of the i915simple driver 2009-10-11 20:02:47 -04:00
Zack Rusin
4969d014e5 st/xorg: implement basics of xv 2009-10-11 20:02:47 -04:00
Nicolai Hähnle
f096cc7dc1 r300g: Fix fragment program constants upload on R300
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-11 12:41:18 +02:00
Dave Airlie
3611d01a44 r300g: fix blending default state + alpha separate.
this makes the default state same as r300
2009-10-11 19:30:23 +10:00
Vinson Lee
cbf46ed670 progs/perf: Fix MSVC build. 2009-10-10 10:45:16 -06:00
Brian Paul
57e3eb1b17 Merge branch 'mesa_7_6_branch' 2009-10-10 09:25:34 -06:00
Brian Paul
39daa763b5 softpipe: fix multi-drawbuffers regression
This is part of the fix for bug 24401.
2009-10-10 09:24:22 -06:00
Cooper Yuan
a74e53ddba r300g: add video surface create and destroy functions 2009-10-10 14:41:44 +08:00
Brian Paul
45e76d2665 mesa: remove a bunch of gl_renderbuffer fields
_ActualFormat is replaced by Format (MESA_FORMAT_x).
ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are
all replaced by MESA_FORMAT_x queries.
2009-10-08 20:27:27 -06:00
Jakob Bornecrantz
db828ed758 st/xorg: Old X servers don't deal well with failing accesses 2009-10-08 14:54:38 +02:00
Jakob Bornecrantz
6d629d4aa2 st/xorg: More fallback debugging
Change the fallback debugging around a bit and do the old commit correctly
2009-10-08 14:50:40 +02:00
Jakob Bornecrantz
992b143b25 Revert "st/xorg: Debug fallbacks for composite as well"
This commit included a change that should have been in
its own commit, and turns out that you can do what was
suposed to go in it in much better way as well.

This reverts commit 5080e8bea6.
2009-10-08 14:46:29 +02:00
Jakob Bornecrantz
5080e8bea6 st/xorg: Debug fallbacks for composite as well 2009-10-08 13:42:44 +02:00
Jakob Bornecrantz
552efdae06 st/xorg: Use A8 textures for depth 8 pixmaps
There is no hardware out there that can render to I8 textures.
2009-10-08 13:42:40 +02:00
Jakob Bornecrantz
a31d16cbfa st/xorg: Fix depth stencil buffers on old X servers
Sanity checking is for the weak.
2009-10-08 13:42:31 +02:00
Vinson Lee
76d2ec3a0a progs/tests: Add tests to Makefile. 2009-10-09 07:24:37 -06:00
Brian Paul
f36123323c softpipe: restore/fix print_vertex() debug helper 2009-10-09 07:24:37 -06:00
Jakob Bornecrantz
023bab675a progs/perf: Ignores! 2009-10-09 14:00:15 +01:00
José Fonseca
c595dea23c util: Force ESI register for cpuid's ebx result.
Fixes a segfault and better code. Unfortunately using an arbitrary
register ("=r") causes the gcc to abort when the code is optimized saying
it can't satisfy the constraint. Setting seems to do the trick.
2009-10-09 13:22:42 +01:00
José Fonseca
69588d7ed5 llvmpipe: Eliminate constant mapping/unmapping. 2009-10-09 11:29:33 +01:00
José Fonseca
d54e9f54d0 progs: Remove unused empty file. 2009-10-09 11:08:17 +01:00
José Fonseca
b858257ca6 gdi: Fix the build when llvmpipe is requested (the default) but llvm is not present. 2009-10-09 11:08:17 +01:00
Andre Maasikas
44c6c20b69 r600: fixup KIL instruction a bit
- KILLGT takes 2 arguments
- arb KIL has no dst register
- add TODO about clause ending but currently piglit fp-kil passes and
  does not hang the card
2009-10-09 11:52:48 +03:00
Brian Paul
90692486aa docs: bump libdrm version requirement
Probably need to bump other version requirements too...
2009-10-08 20:49:36 -06:00
Eric Anholt
859828cc4f mesa: Bump the required libdrm version to reflect reality.
Not all drivers require the latest version, but distros are good at
tracking it since we've got a good record as far as not regressing, and
it sure beats having a weird compile failure in someone else's driver
later on.
2009-10-08 17:18:12 -07:00
Eric Anholt
9b8d2e76c3 i965: Use bo_references for the state cache delete function.
This appears to shave about 3% off the CPU usage in cairo-gl for firefox.
2009-10-08 17:12:23 -07:00
Eric Anholt
193dddb04e intel: Use new drm_intel_bo_references() to avoid flushing. 2009-10-08 17:12:23 -07:00
Brian Paul
f49d53594c mesa: free display list state after freeing shared state
Fixes bug 24402.
2009-10-08 12:50:44 -06:00
Brian Paul
f67bc2e872 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/drivers/common/meta.c
2009-10-08 09:28:07 -06:00
Vinson Lee
f7455ad7af progs/tests: Fix MSVC build. 2009-10-08 08:08:11 -06:00
Brian Paul
f001cc0981 mesa: clean up extended opcode code 2009-10-07 16:51:26 -06:00
Brian Paul
33e9ac20e3 mesa: move gl_list_instruction and gl_list_extensions to dlist.c 2009-10-07 16:41:18 -06:00
Brian Paul
15f05e97aa mesa: added _mesa_free_display_list_data() 2009-10-07 16:32:25 -06:00
Brian Paul
fc995c7298 mesa: clean-up display list mem allocation, fix NULL handling
The -1 term in alloc_instruction() foiled later NULL pointer checks.
2009-10-07 16:22:24 -06:00
Brian Paul
77be195cf6 main: replace ALLOC_INSTRUCTION macro with regular function 2009-10-07 16:12:26 -06:00
Brian Paul
6e1697bee7 mesa: rename display list functions
_mesa_alloc_instruction() sounded like it was related to vertex/fragment
program instructions, but it wasn't.
2009-10-07 16:03:09 -06:00
Vinson Lee
0083d2e40a i915g: Fix MSVC build. 2009-10-07 14:29:23 -06:00
Brian Paul
2b9418b278 softpipe: new comments 2009-10-07 13:30:48 -06:00
Brian Paul
0fb71be217 softpipe: whitespace and comment fixes 2009-10-07 13:21:57 -06:00
Brian Paul
9a0ff33ad6 softpipe: prefix non-static functions with sp_ 2009-10-07 13:17:20 -06:00
Joakim Sindholt
cf6209b274 r300compiler: fix scons build again 2009-10-07 21:02:18 +02:00
Nicolai Hähnle
7ca7220ea1 Merge branch 'master' into r300g-glsl
Conflicts:
	src/gallium/drivers/r300/r300_tgsi_to_rc.c

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-07 20:45:08 +02:00
Nicolai Hähnle
5b4c0b864a Merge branch 'mesa_7_6_branch' 2009-10-07 20:39:22 +02:00
Keith Whitwell
3f5a316f36 util: do some more util_blit_pixels cases without temporaries
When the source surface is pointing at a 2d texture with only one
mipmap level, use that directly rather than creating a temporary.
Probably want to cover more cases, but this is a start.
2009-10-07 18:15:21 +01:00
Keith Whitwell
c0de2ed505 mesa/st: add missing mesa constant file name
There are many different names for constants in mesa, we were missing
one since the ureg rewrite.
2009-10-07 18:15:20 +01:00
Brian Paul
2ef1aae163 st/mesa: pass pipe_screen, not pipe_context to st_choose_format() functions
These don't depend on context state, but use a screen pointer.
2009-10-07 09:58:34 -06:00
Michel Dänzer
de81b2cf0a st/dri: Add missing front buffer case in dri_get_buffers().
This seems to help for compiz at least with some drivers.

Also add an assert(0) to catch unhandled cases in the future.
2009-10-07 16:36:39 +02:00
Jakob Bornecrantz
0f0127f6f9 i915g: Use buffer write instead of map for lit vertices 2009-10-07 14:04:48 +01:00
Jakob Bornecrantz
f8ba93aefd i915g: Change order of buffer_write arguments
They now follow the pipe_buffer_write style,
	its the gallium driver that sets the interface not
	the winsys.
2009-10-07 13:48:32 +01:00
Jakob Bornecrantz
030723fc5d i915g: Disable vbuf fifo and minor commenting of vbuf code
The vbuf fifo doesn't appear to help once the libdrm
	reuse flag has been set.
2009-10-07 13:48:32 +01:00
Brian Paul
74d61d03b5 mesa: added MESA_FORMAT_XRGB8888 2009-10-06 22:30:01 -06:00
Younes Manton
aec2c010f6 nv04-nv40: Fix swizzle transfers for NPOT sizes.
Workarounds not necessary, SIFM can handle NPOT, we just weren't setting
dst dimensions properly. SIFM can't handle odd w,h though, that still
needs fixing.
2009-10-06 22:11:07 -04:00
Brian Paul
c5b7254892 mesa: added case for MESA_FORMAT_SIGNED_RGBA_16 2009-10-06 19:01:43 -06:00
Brian Paul
c13b9a141d mesa: added MESA_FORMAT_SIGNED_RGBA_16 for accum buffers 2009-10-06 19:00:09 -06:00
Brian Paul
f7b5e616e0 mesa: added _mesa_get_format_color_encoding() 2009-10-06 18:56:29 -06:00
Brian Paul
edfd2f7c4f mesa: accept more pnames in _mesa_get_format_bits() 2009-10-06 18:54:13 -06:00
Vinson Lee
9c778a90ea progs/tests: fix MSVC build. 2009-10-06 16:02:47 -06:00
Nicolai Hähnle
57abb76e10 r300/compiler: Fix R300 vertex program dumps
The source register field has 8 bits.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-06 21:24:44 +02:00
Nicolai Hähnle
bcfba138cc r300/compiler: Fix yet another regression in register allocation
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-06 21:13:27 +02:00
Nicolai Hähnle
a09bd685da r300/compiler: Fix a really stupid logic inversion in the generic dataflow code
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-06 20:25:07 +02:00
Nicolai Hähnle
9e42f0ebc7 r300/compiler: Fix regression in pair scheduling
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-06 20:08:32 +02:00
Vinson Lee
017fae04ec progs/perf: Fix MSVC build. 2009-10-06 09:13:14 -06:00
Andre Maasikas
ec58dac86d r600: r700PredictRenderSize can flush, so move index buffer setup after it 2009-10-06 16:17:03 +03:00
Ben Skeggs
340436d8d2 nv50: fix segfault when there's gaps in enabled texture units
Tested with progs/demos/multiarb.
2009-10-06 13:57:51 +10:00
Ben Skeggs
4911443d36 nouveau: fix buffer object leak
Very apparent with resizing windows on DRI2.
2009-10-06 13:31:43 +10:00
Jakob Bornecrantz
db8b363eb9 i915g: Add more defines to tweek batchbuffer 2009-10-06 03:09:16 +01:00
Jakob Bornecrantz
ce3c2b51a2 i915g: Tweek vertexbuffer size 2009-10-06 03:09:01 +01:00
Brian Paul
3e34a2a2b9 drivers: don't include texformat.h
And remove other unneeded #includes while we're at it.
2009-10-05 18:11:37 -06:00
Brian Paul
90cd968300 mesa: don't include texformat.h 2009-10-05 17:56:31 -06:00
Brian Paul
019bc97bd9 mesa: move _mesa_format_to_type_and_comps() to formats.c 2009-10-05 17:54:20 -06:00
Brian Paul
be0765cd6e mesa: move gl_format_info struct to formats.c
This is a private datatype.
2009-10-05 17:50:36 -06:00
Brian Paul
7e7f38a67d mesa: remove feature tests 2009-10-05 17:48:22 -06:00
Brian Paul
6ec3db6cab mesa: use FetchTexelf() instead of FetchTexelc() 2009-10-05 17:28:39 -06:00
Brian Paul
41bee4cff5 mesa: add parenthesis 2009-10-05 17:27:50 -06:00
Brian Paul
1a2bb37264 mesa: lift _mesa_set_fetch_functions() calls out of drivers
Call it from in the main Mesa glTexImage functions.
2009-10-05 17:12:40 -06:00
Brian Paul
bbbf55fa84 mesa: make _mesa_get_texel_fetch_func() static 2009-10-05 16:52:26 -06:00
Brian Paul
722ae91722 i965g: remove 965/brw files from XLIB_WINSYS_SOURCES 2009-10-05 14:43:38 -06:00
Brian Paul
55770d09c1 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/gallium/auxiliary/util/u_cpu_detect.c
2009-10-05 14:42:08 -06:00
Jakob Bornecrantz
f00da2a3ff i915g: Drop the simple sufix
None of the other driver have a silly sufix,
	so just drop it. Nothing new added in this commit
	or any other commit but this is better marketing.
2009-10-05 19:48:08 +01:00
Jakob Bornecrantz
c4b821a4c6 i965g: Drop i965simple
The driver never work with real hardware and has
bitrotted for quite some time now, might as well
drop it. If somebody wants to look at it just use git.
2009-10-05 19:48:03 +01:00
Joakim Sindholt
1f39d59a29 r300g: fix scons build
So I didn't touch r300compiler, but r300g now compiles after having
declarations and code untangled. As nha so gently points out, we shouldn't
have to do this just to comply with MSVC compilers.
2009-10-05 19:25:04 +02:00
José Fonseca
6971be783b util: Improve the cpuid assembly.
No need to save ebx on 64bit. Use just xchgl. Refer to gcc's cpuid.h header.

Thanks to Uros Bizjak for pointing this out.
2009-10-05 16:49:21 +01:00
José Fonseca
75e0a376cd mesa: Copy textures' base format into wrapper renderbuffer.
Otherwise st_copy_texsubimage will fallback to software blit due to
inconsistent base formats.
2009-10-05 16:49:21 +01:00
Keith Whitwell
b02ef740b9 mesa/st: add ST_DEBUG environment variable
At last it's possible to turn on tgsi dumps and other debugging in the
state tracker without modifying sources...
2009-10-05 15:51:55 +01:00
Keith Whitwell
6a085184eb util: add lost code to util_make_fragment_tex_shader_writemask()
This got ported to ureg at some point, but lost the code that
distinguishes it from regular util_make_fragment_tex_shader().
2009-10-05 15:51:55 +01:00
Andre Maasikas
0b032eabc7 r600: update vertex program selection for draw path 2009-10-05 13:38:53 +03:00
Ben Skeggs
d47de50540 st/dri: avoid segfault if we can't get a pixmap's buffers
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:52:33 +10:00
Ben Skeggs
7bfc3172e8 nv50: support PIPE_FORMAT_X8R8G8B8_UNORM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:36:06 +10:00
Ben Skeggs
5313f1be11 nouveau: return pitch value from local_handle_from_texture()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:36:02 +10:00
Ben Skeggs
7aeaca33c3 mesa: fix return value when clipping {Read,Draw}Pixels height <= 0
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:35:40 +10:00
Ben Skeggs
1336989ec6 st/dri: no need to request fake front buffer, only handle it being returned
The previous behaviour was incorrect, and resulted in EXT_tfp being broken
for DDX drivers that implement the correct behaviour (intel/radeon/nouveau).

In the cases where a fake front buffer is required, the X server will
return one when requesting __DRI_BUFFER_FRONT_LEFT.

The Xorg state tracker (aka modesetting_drv) is likely broken now until
it's modified to match the other drivers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-05 15:32:55 +10:00
José Fonseca
7a2271c659 util: Make assert a no-op on non-debug builds.
This ensures that an assertion like

  assert(expensive_test());

won't have any penalty on release builds. It also implies that no vital
code should be in assert expressions.
2009-10-04 22:03:16 +01:00
José Fonseca
77ef705058 llvmpipe: Ensure tile cache transfers are mapped before flushing it. 2009-10-04 22:03:16 +01:00
José Fonseca
589ec337f0 llvmpipe: Autogenerate lp_tile_soa.c from u_format.csv.
This is just a temporary change until we code generate the tile read/write
functions in runtime. The new code avoids an extra memcpy that exists in
u_tile.c functions, from which lp_tile_soa.c was originally based.

This achieves up to 5% improvement, particularly in frames with
little geometry overlap.
2009-10-04 22:03:16 +01:00
José Fonseca
7a7dfb09aa util: Fix cpuid invocation for x86_64. 2009-10-04 22:03:15 +01:00
José Fonseca
eb2e41f0c6 llvmpipe: Remove loop testing from format testing.
Loop building will be rewritten.
2009-10-04 22:03:15 +01:00
José Fonseca
10981c0a76 llvmpipe: Match header's protection macro with filename. 2009-10-04 22:03:15 +01:00
José Fonseca
cd0a396813 llvmpipe: Adjust format assertion.
We support array layout too -- if it has a single channel.
2009-10-04 22:03:15 +01:00
Nicolai Hähnle
a6b300ac98 r300/compiler Add support for more of the Sxx set instructions
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 18:31:18 +02:00
Nicolai Hähnle
12e89e0e51 r300/compiler: Emit flow control instructions and ALU result writes on R500
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 18:30:52 +02:00
Corbin Simpson
2a929a08ab r300g: xRGB and RGBx formats.
We now have 48 GLX visuals. Pretty soon, we'll have 90+ visuals,
only five of which ever get tested. :3
2009-10-04 09:30:30 -07:00
Nicolai Hähnle
a30560e6f0 r300/compiler: Refactor the radeon_pair code to support control flow instructions
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 16:50:07 +02:00
Nicolai Hähnle
995135479d r300/compiler: Refactor to allow different instruction types
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 11:41:03 +02:00
Nicolai Hähnle
e6b137dcce r300/compiler: Introduce aluresult register for branch operation support
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-04 11:13:13 +02:00
Chris Wilson
f194d2737b intel: Suppress a compiler warning for an pointer->int cast
intel_pixel_read.c: In function ‘do_blit_readpixels’:
intel_pixel_read.c:221: warning: cast from pointer to integer of
different size

Cast via an intermediate (GLintptr) instead and hope the result fits
within GLuint... [It should as we simply do not support textures *that*
large!]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-03 23:08:39 +01:00
Chris Wilson
470ec8d42e intel: Assert that relocation offsets are within the target
This should catch the common programming error where we attempt to
emit a relocation to beyond the end of the target buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-03 23:06:39 +01:00
Nicolai Hähnle
b7cf887ca7 r300/compiler: Introduce control flow instructions and refactor dataflow
Note that control flow instruction support isn't actually fully functional yet.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 23:37:16 +02:00
José Fonseca
cbb57bf726 llvmpipe: Fetch tile only if a color buffer is bound. 2009-10-03 19:42:22 +01:00
Nicolai Hähnle
6d25b9125e Merge branch 'master' into r300-compiler 2009-10-03 19:30:48 +02:00
Nicolai Hähnle
7d2699aedc prog_parameter: Document the fact that Size may be > 4
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 19:30:05 +02:00
Nicolai Hähnle
81e5188f66 r300g: Do not abort on fragment program compiler error
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 19:29:48 +02:00
Nicolai Hähnle
59b20b760d r300g: Fix memory leak in radeon_texture_from_shared_handle
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 18:07:34 +02:00
Sedat Dilek
aa6aa77a1b r300g: Build in the trace and softpipe driver for xorg state tracker
Same as in src/gallium/winsys/drm/intel/xorg/Makefile

Thanks MrCooper for explanations on IRC

[ Summary amended by Michel Dänzer to clarify that this is related to the xorg
  state tracker ]
2009-10-03 18:01:58 +02:00
Michel Dänzer
b330cebe01 radeon: Cope better with texture images with no miptrees.
Fixes crash with compiz magnifier plugin.
2009-10-03 18:01:58 +02:00
Michel Dänzer
f741c1eed4 swrast: Move up state validation in _swrast_ReadPixels.
This ensures the driver won't map the wrong set of textures.
2009-10-03 18:01:58 +02:00
Michel Dänzer
4a6759b778 meta: Make sure texImage->TexFormat is valid for CopyTex(Sub)Image. 2009-10-03 18:01:57 +02:00
Nicolai Hähnle
26df8af4fe r300g: Remove an unnecessarily created pipe buffer (and thus fix a leak)
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 17:51:09 +02:00
Nicolai Hähnle
fce2095a90 st/dri: Install APPLE_vertex_array_object functions
Besides from being necessary to use that extension, it also fixes a crash
when deleting the currently bound vertex array object.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 17:42:50 +02:00
Nicolai Hähnle
751aa58e01 r300g: Reset vbo_offset after allocation of a new buffer
This fixes the glxgears bug, among other things.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 17:27:50 +02:00
Nicolai Hähnle
ebbd65eb06 st/dri: Install ARB_vertex_array_object functions
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 11:45:19 +02:00
Brian Paul
be16acaafa mesa: optimized _mesa_meta_BlitFramebuffer() for src=texture case
If the src renderbuffer is actually a texture, we can directly use that
texture as the src and avoid a copy.
2009-10-02 14:00:02 -06:00
Eric Anholt
4182b58169 i965: Use a little stack space to avoid a malloc in wm_get_binding_table. 2009-10-02 11:42:19 -07:00
Eric Anholt
6d0fc3cfde mesa: Remove another unexplained Flush call, this time from BindFramebuffer.
Combined with the previous fix, it takes cairo-gl firefox-talos-gfx time
from 120 seconds to 90 seconds on my GM45.
2009-10-02 11:42:07 -07:00
Eric Anholt
f019577f0c Revert "Flush driver, not just tnl module."
This reverts commit df058298e1.  It didn't
explain why it was required, doesnt appear to be required, and is a
significant performance penalty for cairo-gl firefox.

Conflicts:

	src/mesa/main/fbobject.c
2009-10-02 11:41:29 -07:00
Eric Anholt
3d78a86cd7 intel: Remove an unexplained flush from intelClearWithBlit. 2009-10-02 11:38:36 -07:00
Alex Deucher
3f623cfffe r600: remove support for host-based ibs
no longer used now that the hw supports this natively.

Also, clean up some formatting.
2009-10-02 14:34:28 -04:00
Keith Whitwell
918199fb0f mesa/st: don't reuse vertex buffers for bitmap, clear quads
Currently using max_slots > 1 will cause synchronous rendering
if the driver flushes its command buffers between one bitmap and the
next.

Need to improve buffer_write to allow NO_WAIT (as well as no_flush)
updates to buffers where we know there is no conflict with previous
data.
2009-10-02 19:03:15 +01:00
Michel Dänzer
316b4ddcf7 st/xorg: Use PIPE_TRANSFER_MAP_DIRECTLY flag in EXA PrepareAccess hook.
Propagate NULL return value.

This also allows removing the DRM_MODE_FEATURE_DIRTYFB specific pixmap
management hacks.
2009-10-02 18:13:26 +02:00
Michel Dänzer
9db647bb7a gallium: Add PIPE_TRANSFER_MAP_DIRECTLY usage flag.
Asks the driver to map the texture storage directly or return NULL if that's
not possible.
2009-10-02 18:13:26 +02:00
Michel Dänzer
47e41b024e gallium: Preparations for adding more PIPE_TRANSFER_* usage flags.
Always test for PIPE_TRANSFER_READ/WRITE using the bit-wise and operator, and
add a pipe_transfer_buffer_flags() helper for getting the buffer usage flags
corresponding to them.
2009-10-02 18:13:26 +02:00
Brian Paul
7d4b348c67 intel: wrap _mesa_meta_GenerateMipmap()
Need to check if we'll take the software path so which requires mapping the
src texture image.

Fixes crash in piglit gen-compressed-teximage, bug 24219.  However, the
test still does not pass (it may never have).
2009-10-02 09:03:27 -06:00
Brian Paul
f1cab802b8 mesa: added _mesa_meta_check_generate_mipmap_fallback() 2009-10-02 09:03:27 -06:00
Brian Paul
32aa40eee4 mesa: removed gl_texture_image::CompressedSize field
Just call ctx->Driver.CompressedTextureSize() when we need to get
the compressed image size.
2009-10-01 21:13:34 -06:00
Younes Manton
f9f7646fe6 g3dvl: Formatting. 2009-10-01 22:57:39 -04:00
Younes Manton
577f12fbba g3dvl: Delete state_trackers/g3dvl, other unused files. 2009-10-01 22:57:39 -04:00
Younes Manton
fcb595c04f g3dvl: Copyright blocks. 2009-10-01 22:53:00 -04:00
Younes Manton
62db9b21da st/xvmc: Set default CSC matrix to BT.601, no ProcAmp, full range RGB. 2009-10-01 22:52:59 -04:00
Younes Manton
e00da1476f g3dvl: Color space conv interface & vl impl.
Interface is pipe_video_context::set_csc_matrix().

vl_csc.h defines some helpers to generate CSC matrices based on one of
the color standard and a user defined ProcAmp (brightness, contrast,
saturation, hue).
2009-10-01 22:52:59 -04:00
Brian Paul
8c92a531fb mesa: reformatting 2009-10-01 19:01:02 -06:00
Brian Paul
bb659f6e53 progs/tests: additional debug code 2009-10-01 16:43:22 -06:00
Brian Paul
4ca9ba2544 mesa: move mesa_set_fetch_functions() 2009-10-01 16:42:37 -06:00
Brian Paul
073d55f584 radeon: fix tx_table[] entry
XXX need to still verify that the table entries are in correct order.
2009-10-01 16:41:52 -06:00
Brian Paul
4208a8c026 savage: s/Xfree/_mesa_free/ 2009-10-01 16:41:24 -06:00
Brian Paul
354d66e2f5 mesa: simplify _mesa_compressed_texture_size() 2009-10-01 16:30:47 -06:00
Brian Paul
b6bdafdf2c mesa: remove gl_texture_image::IsCompressed field
Use _mesa_is_format_compressed() instead.
2009-10-01 16:29:44 -06:00
Brian Paul
040fd7ed44 mesa: added _mesa_format_row_stride() 2009-10-01 16:27:23 -06:00
Brian Paul
1c7ec97ec4 mesa: added _mesa_format_image_size() 2009-10-01 15:59:13 -06:00
Eric Anholt
81aa5d717b i915: Add stub ARB_occlusion_query support under a driconf debug option.
This is useful for enabling our GLSL testcases using the 2.0 entrypoints
even though we don't have full GL 2.0.
2009-10-01 14:54:15 -07:00
Eric Anholt
862a2a55b3 i915: Add optional support for ARB_fragment_shader under a driconf option.
Other vendors have enabled ARB_fragment_shader as part of OpenGL 2.0
enablement even on hardware like the 915 with no dynamic branching or
dFdx/dFdy support.  But for now we'll leave it disabled because we don't
do any flattening of ifs or loops, which is rather restrictive.

This support is not complete, and may be unstable depending on your shaders.
It passes 10/15 of the piglit glsl tests, but hangs on glean glsl1.
2009-10-01 14:52:44 -07:00
Eric Anholt
67f4d626d3 i915: Add support or fallbacks for GLSL fragment shader opcodes. 2009-10-01 14:31:04 -07:00
Eric Anholt
f9f31b2574 i915: Add support for varying inputs. 2009-10-01 14:31:04 -07:00
Eric Anholt
7d4b7460b0 i915: Enable ARB_vertex_shader for both i915 and i830.
Since the TNL is all done in software anyway, it should be the same to
the user who's probably using ARB_vertex_program otherwise, but gives them
a nicer programming environment.
2009-10-01 14:31:03 -07:00
Eric Anholt
96a3c69d48 i915: Increase maximum program size to the hardware limits.
This fixes potential heap trashing if the program of choice exceeds limits,
and fixes the native instructions limit being lower than what can be
used by valid programs.
2009-10-01 14:31:03 -07:00
Eric Anholt
61b512c47c i915: Update and translate the fragment program along with state updates.
Previously, we were doing it in the midst of the pipeline run, which gave
an opportunity to enable/disable fallbacks, which is certainly the wrong
time to be doing so.  This manifested itself in a NULL dereference for PutRow
after transitioning out of a fallback during a run_pipeline in glean glsl1.
2009-10-01 14:31:03 -07:00
Eric Anholt
d6fbf87575 Revert "i915: don't validate PS program when falling back to software"
This reverts commit e7044d552c.  It
prevented the driver from ever recovering from a software fallback due
to a program error.  The original bug it claimed to fix doesn't appear to
exist post-revert.
2009-10-01 14:31:03 -07:00
Eric Anholt
4ff816751f i915: Bail when the fragment program has too many total instructions.
Previously, we'd go trashing the heap.
2009-10-01 14:31:03 -07:00
Eric Anholt
994d1db079 i915: Let i915_program_error take a format string, and don't use _mesa_problem.
It's misleading to report things like the program having too many native
instructions as a Mesa implementation error, when the program may just be
too big for the hardware.
2009-10-01 14:31:03 -07:00
Brian Paul
5d2413fca4 Merge branch 'mesa_7_6_branch' 2009-10-01 13:35:42 -06:00
Brian Paul
15c57648cd objviewer: remove disabled code 2009-10-01 13:14:50 -06:00
Brian Paul
9745e26adb objviewer: mouse/keyboard info in README file 2009-10-01 13:14:50 -06:00
Brian Paul
d622c4ddba docs: added objviewer to release notes 2009-10-01 13:14:50 -06:00
Brian Paul
24f31ab861 mesa: add objviewer to PROGRAM_DIRS 2009-10-01 13:14:50 -06:00
Brian Paul
0b1de63ad8 mesa: add progs/objviewer to tarball list 2009-10-01 13:14:50 -06:00
Brian Paul
8d93a4c639 objview: clean up drawing VBO code 2009-10-01 13:14:50 -06:00
Brian Paul
c7c62521fb objview: set skybox texture filter 2009-10-01 13:14:50 -06:00
Brian Paul
336994e54c objview: check GL version/extension 2009-10-01 13:14:49 -06:00
Brian Paul
ca1bda552d progs/objviewer: Wavefront .obj file loader/viewer demo
Adapted from code written by Nate Robins.  See README.txt.
2009-10-01 13:14:48 -06:00
Michel Dänzer
e32a341be6 st/xorg: Check that ms->api->destroy is not NULL before calling it.
Fixes potential crash on X server shutdown.
2009-10-01 16:45:11 +02:00
Robert Noland
0b466c8705 util: Enable sockets on BSD
I think this should be safe for all of the BSDs.

Signed-off-by: Robert Noland <rnoland@2hip.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-10-01 08:42:48 -06:00
Robert Noland
908ecb3faa util: define PIPE_OS_FREEBSD to correct u_cpu_detect on FreeBSD.
Since the various BSDs use some different features here,
define PIPE_OS_OPENBSD and PIPE_OS_NETBSD as well

Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-10-01 08:40:30 -06:00
Brian Paul
f8d8f45278 mesa: better debug message 2009-10-01 08:38:38 -06:00
Keith Whitwell
4456006ba6 gallium: remove depth.occlusion_count flag
This was redundant as drivers can just keep track of whether they are
inside a begin/end query pair.  We want to add more query types later
and also support nested queries, none of which map well onto a flag like
this.  No driver appeared to be using the flag.
2009-10-01 14:34:23 +01:00
Cooper Yuan
ae2daacbac st/mesa: fix non-mipmap lastLevel calculation.
reviewed by Brian Paul.
2009-10-01 17:54:27 +08:00
Brian Paul
8c36ca707c swrast: fix some texformat regressions
Need to be careful with component ordering for MESA_FORMAT_RGB888
and MESA_FORMAT_RGBA8888.
2009-09-30 22:50:08 -06:00
Brian Paul
3d6a20e5b6 mesa: rename texformat_tmp.h to texfetch_tmp.h 2009-09-30 21:08:06 -06:00
Brian Paul
60843e3ee5 mesa: remove MESA_FORMAT_RGBA4444
Not used by any hardware driver.  ARGB4444 and ARGB4444_REV remain.
2009-09-30 21:04:17 -06:00
Brian Paul
3fa7dbf368 mesa: remove GLchan-based formats; use hw 8-bit/channel formats instead
Removed: MESA_FORMAT_RGBA, RGB, ALPHA, LUMINANCE, LUMINANCE_ALPHA, INTENSITY.
2009-09-30 21:00:16 -06:00
Brian Paul
74ae14a2bd mesa: move texel fetch/store into new texfetch.[ch] files 2009-09-30 20:47:54 -06:00
Brian Paul
884d1abb2a st/mesa: update comment 2009-09-30 20:36:25 -06:00
Brian Paul
bdc761b0f9 mesa: remove gl_texture_format 2009-09-30 20:35:32 -06:00
Brian Paul
1f7c914ad0 mesa: replace gl_texture_format with gl_format
Now gl_texture_image::TexFormat is a simple MESA_FORMAT_x enum.
ctx->Driver.ChooseTexture format also returns a MESA_FORMAT_x.
gl_texture_format will go away next.
2009-09-30 20:28:45 -06:00
Michel Dänzer
81a62edc08 st/xorg: Fix debug option function call typo. 2009-09-30 18:01:46 +02:00
Chia-I Wu
cef97267d6 mesa/main: New feature FEATURE_beginend.
This feature corresponds to the Begin/End paradigm.  Disabling this
feature also eliminates the use of GLvertexformat completely.
2009-09-30 08:31:56 -06:00
Chia-I Wu
a73ba2d31b mesa/main: Make FEATURE_dlist follow feature conventions.
As shown in mfeatures.h, this allows users of dlist.h to work without
knowing if the feature is available.
2009-09-30 08:31:56 -06:00
Chia-I Wu
aefa1f6ab1 mesa/main: Make FEATURE_evaluators follow feature conventions.
As shown in mfeatures.h, this allows users of eval.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
42fac11d43 mesa/main: New feature FEATURE_queryobj.
It merges FEATURE_ARB_occlusion_query and FEATURE_EXT_timer_query, and
follows the feature conventions.
2009-09-30 08:31:55 -06:00
Chia-I Wu
80630d1fed mesa/main: New feature FEATURE_arrayelt.
This allows the removal of AEcontext.
2009-09-30 08:31:55 -06:00
Chia-I Wu
cc95de82e5 mesa/main: Make FEATURE_texgen follow feature conventions.
As shown in mfeatures.h, this allows users of texgen.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
301a510092 mesa/main: Make FEATURE_feedback follow feature conventions.
As shown in mfeatures.h, this allows users of feedback.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
67a2a4e901 mesa/main: Make FEATURE_drawpix follow feature conventions.
As shown in mfeatures.h, this allows users of drawpix.h to work
without knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
d25080074f mesa/main: New feature FEATURE_rastpos.
It is separated from FEATURE_drawpix and made to follow the feature
conventions.
2009-09-30 08:31:55 -06:00
Chia-I Wu
cab7ea0368 mesa/main: Make FEATURE_histogram follow feature conventions.
As shown in mfeatures.h, this allows users of histogram.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
2b36db496d mesa/main: Make FEATURE_attrib_stack follow feature conventions.
As shown in mfeatures.h, this allows users of attrib.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
a833ff0f53 mesa/main: Make FEATURE_accum follow feature conventions.
As shown in mfeatures.h, this allows users of accum.h to work without
knowing if the feature is available.
2009-09-30 08:31:55 -06:00
Chia-I Wu
e82b02c7e8 progs/egl: Make demo3 work again.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
28c2190336 progs/egl: Check EGL_MESA_screen_surface is supported in demo2.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
e0b2848f4f progs/egl: Fix a crash in demo1.
The variable "configs" in main() is used without initialization.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
4b95481e95 st/egl: Fix a double free in drm_destroy_context.
st_destroy_context has destroyed the pipe context for us.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
dd81cc885c st/egl: Fix a crash when unbinding current context.
This fixes a NULL-pointer dereference when
eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)
is called.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Chia-I Wu
fa8df0c40d progs/egl: Replace EGL_i915 by EGL_DEFAULT_DISPLAY.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-30 08:15:30 -06:00
Brian Paul
cb0de06301 mesa: added nopfrag/nopvert options for MESA_GLSL
These options can be used to force vertex/fragment shaders to be no-op
shaders (actually, simple pass-through shaders).  For debug/test purposes.
2009-09-29 10:38:02 -06:00
Brian Paul
c7aee65bb9 mesa: added _mesa_nop_vertex/fragment_program()
For debug/test purposes.
2009-09-29 10:38:02 -06:00
José Fonseca
baddcbc522 llvmpipe: Workaround for bug in llvm 2.5.
The combination of fptosi
and sitofp (necessary for trunc/floor/ceil/round implementation)
somehow becomes invalid code.

Skip the instruction combining pass when SSE4.1 is not available.
2009-09-29 17:28:15 +01:00
José Fonseca
a02ecdf8c2 llvmpipe: First verify LLVM IR, only then run optimizing passes. 2009-09-29 17:28:15 +01:00
José Fonseca
754f48871c llvmpipe: Runtime cpu checks for lp_build_min_simple too. 2009-09-29 17:28:15 +01:00
José Fonseca
741c40a232 llvmpipe: Implement non SSE4.1 versions of floor and round. 2009-09-29 17:28:15 +01:00
Brian Paul
124f5875ea Merge branch 'mesa_7_6_branch'
Conflicts:

	Makefile
	configs/default
	docs/relnotes.html
	src/gallium/drivers/softpipe/sp_context.c
	src/gallium/drivers/softpipe/sp_tile_cache.c
	src/mesa/main/version.h
2009-09-29 09:46:49 -06:00
Chia-I Wu
170bd0c882 egl_xdri: Report full list of supported configs.
Call _eglConfigFromContextModesRec to convert __GLcontextModes to
_EGLConfig.  Single-buffered configs are no longer skipped.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:48 -06:00
Chia-I Wu
d845f2754b egl: Add support for querying render buffer.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:48 -06:00
Chia-I Wu
55893b9439 egl: Add a function to convert __GLcontextModes to _EGLConfig.
_eglConfigFromContextModesRec is used to convert a __GLcontextModes to a
_EGLConfig.  Note that the config is not validated.  An invalid mode
is likely to give an invalid config.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:47 -06:00
Chia-I Wu
56822b0812 egl: Rework config lookup.
Make it similiar to how contexts and surfaces are looked up.  It should
be slightly faster, and work better with multiple displays.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:47 -06:00
Chia-I Wu
95cdd697e7 egl: Rework configuration management.
This mainly implements the algorithms for configuration selection and
sorting, described in the spec.  User errors should also be correctly
detected and reported.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:47 -06:00
Chia-I Wu
358c5a8fd1 egl: Introduce config keys.
Config keys are almost config attributes.  A valid config attribute is a
valid config key, but a valid config key may not be a valid config
attribute.

This commit does not distinguish the differences.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-29 08:10:47 -06:00
José Fonseca
7cda8ea44c llvmpipe: Emit SSE intrinsics based on runtime cpu capability check.
Note that llvmpipe still doesn't run on any processor yet: if you don't
have a recent processor with SSE4.1 you will still likely end up
hitting a code path for which a generic non-sse4 version is not
implemented yet.
2009-09-29 13:59:16 +01:00
José Fonseca
a81fb2a0d2 util: Cleanup u_cpu_detect, build. Support X86_64 and detect SSE4.1 too.
I was waiting for the need to use this code to arise, and it finally came.

I've tested building this on Linux and Windows, both x86 and x64_64. But
it might break other platforms. Please bear with me and help me fix it.

Many thanks to Dennis Smit who submitted this, and Eric Anholt whose
work this was based on.
2009-09-29 13:59:16 +01:00
José Fonseca
8210abb113 gallium: New PIPE_OS_UNIX to simplify code that is portable to all unices. 2009-09-29 13:59:16 +01:00
Vinson Lee
60f3f22a52 i915: Fix MSVC build. 2009-09-29 11:10:42 +01:00
José Fonseca
57d0fcba67 python: Update for surface_buffer_create change. 2009-09-29 11:09:55 +01:00
José Fonseca
bd2e36a38f g3dvl: assert.h -> util/u_debug.h 2009-09-29 11:09:55 +01:00
José Fonseca
7db33440a8 g3dvl: Define PIPE_VIDEO_CODEC_UNKNOWN for failures.
gcc 4.4 seems particularly picky with int -> enum conversions.
2009-09-29 11:09:55 +01:00
Andre Maasikas
ac9c8b6359 r600: use CB_TARGET_MASK instead of CB_SHADER_MASK for setting color mask
makes blend functions work better

Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-09-29 19:24:35 +10:00
Andre Maasikas
7c5f3c3d8a r600: user correct alpha blend factor
Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-09-29 19:24:34 +10:00
Andre Maasikas
a230ad2bc4 r600: clear position enable bit when when wpos is not used by FP
Makes doom3 alot nicer..
2009-09-29 16:02:00 +08:00
Jakob Bornecrantz
3a8d525373 st/xorg: Add debug for fallbacks 2009-09-28 21:34:45 -07:00
Jakob Bornecrantz
e226bf8a5d st/xorg: Make debug printing optional 2009-09-28 21:26:13 -07:00
Brian Paul
e2e7bd6c1f mesa: move StoreTexImageFunc typedef to .c file 2009-09-28 21:55:47 -06:00
Brian Paul
0a306daf71 mesa: use _mesa_texstore() 2009-09-28 21:52:43 -06:00
Brian Paul
6480210b89 st/mesa: use _mesa_texstore() 2009-09-28 21:52:23 -06:00
Brian Paul
49263e0856 mesa: make individual texstore functions static 2009-09-28 21:49:38 -06:00
Brian Paul
cb0ef0cbf8 glide: use _mesa_texstore() 2009-09-28 21:49:10 -06:00
Brian Paul
b436d729d1 drivers: use _mesa_texstore 2009-09-28 21:46:34 -06:00
Brian Paul
0b1f4dc0fa drivers: use new _mesa_texstore() function 2009-09-28 21:41:11 -06:00
Brian Paul
660ca9c5a2 mesa: new _mesa_texstore() function 2009-09-28 21:40:50 -06:00
Eric Anholt
d492e7b017 meta: Fix invalid PBO access from DrawPixels when trying to just alloc.
This whole reuse of buffers (TexSubImage instead of TexImage, SubData
instead of Data) is bad for hardware drivers, but it's even worse when
we accidentally try to access the 2x2 PBO to fill the new 16x16 texture
we're creating, producing GL errors.

Fixes piglit pbo-drawpixels.  Bug #14163.
2009-09-28 14:12:15 -07:00
Eric Anholt
e885cb48a0 intel: Drop my generatemipmap code in favor of the new shared code. 2009-09-28 14:12:15 -07:00
Eric Anholt
8b23755ce9 intel: Remove some dead metaops code. 2009-09-28 14:12:09 -07:00
Ian Romanick
41865d991f Merge branch 'mesa_7_6_branch'
Conflicts:
	Makefile
	src/mesa/main/version.h
2009-09-28 12:03:23 -07:00
Brian Paul
05bad193f5 st/mesa: check gl_texture_object::GenerateMipmap field when allocating texmem
In guess_and_alloc_texture() use the gl_texture_object::GenerateMipmap
field as another hint as to whether to allocate space for a whole mipmap.
2009-09-28 10:03:58 -06:00
Brian Paul
8fda97afb8 Merge branch 'mesa_7_6_branch' 2009-09-28 10:02:20 -06:00
Brian Paul
eb82373abb mesa: use _mesa_get_current_tex_unit() helper 2009-09-28 09:22:33 -06:00
Vinson Lee
6920a355c1 progs/perf: Include local headers before installed headers.
Fixes compilation errors on platforms with older installed GL headers.
2009-09-28 09:03:26 -06:00
Brian Paul
653ae04bea progs/tests: print usage info upon SPACE/u 2009-09-28 08:44:43 -06:00
Brian Paul
c8de476189 progs/tests: re-indent mipmap_limits.c 2009-09-28 08:44:43 -06:00
Younes Manton
9871521b30 llvmpipe: Grab a ref when the fb is set.
Based on softpipe commit a77226071f.
2009-09-28 15:35:29 +01:00
José Fonseca
5687053480 softpipe: Fix MSVC build. 2009-09-28 13:03:03 +01:00
José Fonseca
22658c1650 g3dvl: Fix MSVC build.
pipe/p_compiler for integer types. No declarations out of scope.
2009-09-28 13:02:42 +01:00
Cooper Yuan
99e1745af9 r300g: fix r300g cause GPU hang issue.
why there are two input position semantic tags is that ureg doesn't
set vs input semantic due to commit: 6d8dbd3d1e

so use vs input index instead of semantic name.
2009-09-28 17:55:38 +08:00
Younes Manton
70c44073ad xvmc: Fail on unsupported formats, operations. 2009-09-28 00:17:33 -04:00
Younes Manton
c0745670d8 g3dvl: Missing semicolon. 2009-09-27 23:54:36 -04:00
Brian Paul
729ff875f4 mesa: change _mesa_format_to_type_and_comps() format parameter type 2009-09-27 21:32:12 -06:00
Brian Paul
bd00a7fa4b mesa: sort texstore_funcs[] array, remove search loop 2009-09-27 21:22:57 -06:00
Younes Manton
d52d51ab8a g3dvl: Formatting and cleanups. 2009-09-27 23:14:52 -04:00
Brian Paul
749e50442a mesa: fix render buffer _BaseFormat assignment 2009-09-27 21:14:43 -06:00
Brian Paul
ef089604a9 mesa: use texture format functions 2009-09-27 21:14:12 -06:00
Brian Paul
4fc344790d mesa: update comments 2009-09-27 21:13:46 -06:00
Brian Paul
e987ea9d21 mesa: use more mesa format functions 2009-09-27 21:07:57 -06:00
Brian Paul
5767a677a0 mesa: fix GL_TEXTURE_LUMINANCE_SIZE query 2009-09-27 20:59:28 -06:00
Brian Paul
a2b663fe38 mesa: use more mesa format functions 2009-09-27 20:58:05 -06:00
Brian Paul
af0adb5852 mesa: use more mesa format functions 2009-09-27 20:56:04 -06:00
Brian Paul
5cf5d4be21 mesa: use more format helper functions 2009-09-27 20:51:18 -06:00
Brian Paul
5978cbdf77 mesa: code movement 2009-09-27 20:40:53 -06:00
Brian Paul
ddffe4546a drivers: use more mesa format functions 2009-09-27 20:40:35 -06:00
Brian Paul
9fbb8884f0 mesa/drivers: use _mesa_get_format_bytes() 2009-09-27 20:24:59 -06:00
Brian Paul
e0bc4533eb mesa/drivers: use _mesa_get_format_bytes() 2009-09-27 20:07:41 -06:00
Brian Paul
b58bc12ed4 via: use mesa texture format helper functions 2009-09-27 19:58:18 -06:00
Younes Manton
97c28bb63a g3dvl: Move XvMC under the Xorg state tracker. 2009-09-27 21:54:20 -04:00
Brian Paul
21db8959c1 glide: use _mesa_get_format_bytes() 2009-09-27 19:53:54 -06:00
Brian Paul
2de7683280 mesa: use _mesa_get_format_base_format() 2009-09-27 19:51:45 -06:00
Brian Paul
db8aca3a39 mesa: use _mesa_get_format_bytes() 2009-09-27 19:49:51 -06:00
Brian Paul
5ab5f16919 mesa: added _mesa_get_format_datatype() 2009-09-27 19:42:36 -06:00
Brian Paul
b64d478a5b mesa: use _mesa_get_format_bits() 2009-09-27 19:38:21 -06:00
Brian Paul
c28d78f832 mesa: added _mesa_get_format_bits() 2009-09-27 19:07:44 -06:00
Brian Paul
a608257a02 mesa: remove unused gl_texture_format fields 2009-09-27 18:57:02 -06:00
Brian Paul
e8eed5003b mesa: added MESA_FORMAT_NONE 2009-09-27 18:53:22 -06:00
Brian Paul
cccdc43fa9 mesa: move StoreTexImageFunc to texstore.h 2009-09-27 18:50:04 -06:00
Brian Paul
27e201e9c4 mesa: rework null texel fetch/store funcs 2009-09-27 18:49:14 -06:00
Brian Paul
05e73cc8e2 mesa: replace function pointer types with void *
These fields are no longer used and will be removed soon.
2009-09-27 18:39:52 -06:00
Brian Paul
adce34e23b st/mesa: use _mesa_get_texstore_func() 2009-09-27 18:39:17 -06:00
Brian Paul
f782f90c45 mesa: use _mesa_get_texstore_func() 2009-09-27 18:38:50 -06:00
Brian Paul
d73cd70316 glide: use _mesa_get_texstore_func() 2009-09-27 18:34:12 -06:00
Brian Paul
9525b92efb mesa: NULL-out unused texformat field initializers 2009-09-27 18:28:48 -06:00
Brian Paul
f76cbac04a mesa: use _mesa_get_texstore_func() 2009-09-27 18:28:22 -06:00
Brian Paul
e07862d2c9 st/mesa: use _mesa_get_texstore_func() 2009-09-27 18:27:59 -06:00
Brian Paul
8abb984dc9 mesa: null-out StoreTexImageFunc fields 2009-09-27 18:19:24 -06:00
Younes Manton
e44c85637a g3dvl: Implement XvMC using pipe_video_context. 2009-09-27 20:18:02 -04:00
Brian Paul
431ba64222 mesa: use _mesa_get_texel_store_func() 2009-09-27 18:17:32 -06:00
Brian Paul
da5722bea6 mesa: use new look-up table to get texel fetch/store funcs 2009-09-27 18:09:23 -06:00
Brian Paul
7116ae857c mesa: make some s3tc/fxt1 functions public 2009-09-27 18:08:49 -06:00
Brian Paul
6c6896bd25 progs/tests: disable texturing before printing text 2009-09-27 18:02:02 -06:00
Younes Manton
f547472bfa g3dvl: pipe_video_context interface, softpipe impl, auxiliary libs 2009-09-27 19:49:06 -04:00
Younes Manton
da793b7434 util: Add util_next_power_of_two() for rounding a uint up to a POT. 2009-09-27 19:25:57 -04:00
Brian Paul
0f91e4461f mesa: minor clean-up in _mesa_texstore_srgb8() 2009-09-27 17:07:22 -06:00
Brian Paul
722b761564 mesa: use _mesa_get_texstore_func() to get texture image store func 2009-09-27 17:01:41 -06:00
Maciej Cencora
540039887a r300g: fix erroneous condition 2009-09-27 22:44:29 +02:00
Maciej Cencora
98f6bea168 r300g: don't force vertex position for HW TCL path
It could be generated by vertex shader.
2009-09-27 22:44:28 +02:00
Maciej Cencora
bedc6b7bdf r300g: add some assertions
Not sure why we are getting a shader with two inputs with position semantic, but we don't know how to handle it correctly so it's better to stop the app than lock the machine.
2009-09-27 22:44:28 +02:00
Maciej Cencora
8c8b77a5f3 r300g: plug memory leak 2009-09-27 22:44:27 +02:00
Maciej Cencora
a6eb593072 r300g: add some debugging info 2009-09-27 22:44:27 +02:00
Dave Airlie
d85fe842b8 r300g: fix r300 rs path 2009-09-28 06:42:25 +10:00
Dave Airlie
b1252c7a34 r300g: rewrite RS state setup.
Not 100% sure this is correct, but its more correct than what was here previous
however it may require changes in the input routing for the frag shader.
2009-09-28 06:28:32 +10:00
Dave Airlie
225c3375fd r300g: silence compiler warning 2009-09-28 06:28:31 +10:00
Jakob Bornecrantz
48c45959ee i915g: Submit direct vertex buffers 2009-09-27 13:19:49 -07:00
Jakob Bornecrantz
2d71b541d7 i915g: Fix warning 2009-09-27 13:19:49 -07:00
Jakob Bornecrantz
973e9a774a i915g: Tile shared buffers as well 2009-09-27 13:19:49 -07:00
Jakob Bornecrantz
5aecddc153 i915g: Make sure to map tiled buffers via the gtt 2009-09-27 13:19:49 -07:00
Jakob Bornecrantz
60d72d9e45 i915g: Use boolean 2009-09-27 13:19:48 -07:00
Jakob Bornecrantz
c3663bdc35 i915g: Enable reuse of buffers 2009-09-27 13:19:48 -07:00
Jakob Bornecrantz
dd586078be st/egl: Remove buffer from screen
It is no longer needed since the new drm api code,
	and it incorrectly checked if the buffer where there
	for testing completeness when it should have checked
	the texture instead.
2009-09-27 13:19:48 -07:00
Richard Li
eea30906de r600 : Enable draw_prim. 2009-09-27 14:47:12 -04:00
Younes Manton
a77226071f softpipe: Grab a ref when the fb is set.
Nasty bug when the surface is freed and another is allocated right on
top of it. The next time we set the fb state SP thinks it's the same
surface and doesn't flush, and when the flush eventually happens the
surface belongs to a completely different texture.
2009-09-27 10:56:42 -04:00
Jakob Bornecrantz
bcca927562 progs/rbug: Link to math 2009-09-26 12:36:01 -07:00
Brian Paul
485105ed18 mesa: move _mesa_get_texstore_func() to texstore.c 2009-09-26 12:32:13 -06:00
Brian Paul
22108bb571 mesa: begin removing dependencies on gl_texture_format in texstore code 2009-09-26 12:26:18 -06:00
Brian Paul
a7455f9fc6 mesa: added formats.c to build 2009-09-26 12:25:02 -06:00
Brian Paul
9e7b56c980 mesa: include formats.h 2009-09-26 12:24:17 -06:00
Brian Paul
813870fd95 mesa: initial check-in of new formats.[ch] files 2009-09-26 12:21:03 -06:00
Dave Airlie
eb5dd947fb r300g: add tx depth support in register.
also enable cube/3d bits in txformat reg
2009-09-26 19:32:46 +10:00
Dave Airlie
9bf85f6b95 r300g: only pass complete texture state to hw setup function
No point passing things twice here, also allows more state
to be setup properly.
2009-09-26 18:39:54 +10:00
Dave Airlie
ec9c02187e r300g: add missing break in OQ emit 2009-09-26 18:39:54 +10:00
José Fonseca
1df539ce87 llvmpipe: Allow building with LLVM 2.6 too. 2009-09-26 09:37:43 +01:00
Dave Airlie
28f531e3fe r300g: report GL1.5, enable cap bits for OQ and shadow.
Its not like it works well on 1.3 so may as well reach for greater
heights.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-09-26 18:25:00 +10:00
Dave Airlie
20d3c85128 r300g: add z16 unorm texture format 2009-09-26 18:24:34 +10:00
Dave Airlie
07183b73eb r300g: fix texture pitch to correct value.
pitch is pixels - 1, not bytes.
2009-09-26 16:39:13 +10:00
Ian Romanick
8130375e77 Merge branch 'asm-shader-rework-2'
Conflicts:
	src/mesa/shader/program_parse.tab.c
2009-09-25 16:57:38 -07:00
Michel Dänzer
c19482b16f st/xorg: Re-enable accelerated fills and copies.
These seem to work well enough now with the new code. Composite acceleration
isn't quite there yet and thus remains disabled in xorg_composite_bind_state()
for now.
2009-09-25 20:49:53 +02:00
Michel Dänzer
07e2d6edfa st/xorg: Flush render cache if but only if a source has pending write operations. 2009-09-25 20:49:53 +02:00
Michel Dänzer
626553f327 st/xorg: Reject Composite acceleration for some cases not working yet. 2009-09-25 20:49:53 +02:00
Michel Dänzer
9c449502a2 st/xorg: Make sure struct is fully initialized.
gcc complained about a missing initializer.
2009-09-25 20:49:00 +02:00
Michel Dänzer
b0ddfe8a3d st/xorg: Use generic semantic for Composite mask coordinates. 2009-09-25 20:38:49 +02:00
Michel Dänzer
ac2e0ddcd8 st/xorg: Flesh out EXA PrepareComposite hook a little.
Check that the formats are supported, and don't crash with source-only
pictures.
2009-09-25 20:38:49 +02:00
Michel Dänzer
b97547027e st/xorg: Use I8 format instead of A8 for depth 8 pixmaps.
Seems to work better for Composite acceleration.
2009-09-25 20:38:49 +02:00
Michel Dänzer
67fb13ba68 st/xorg: Bind rasterizer state for copies. 2009-09-25 20:38:49 +02:00
Michel Dänzer
7edda9350a st/xorg: Source-only pictures always have format PICT_a8r8g8b8.
See xserver/render/picture.c:createSourcePicture(). This both simplifies the
code and avoids a crash because pFormat is NULL.
2009-09-25 20:38:49 +02:00
Michel Dänzer
07f107467e st/xorg: Better checks for unsupported component alpha pictures. 2009-09-25 20:38:49 +02:00
Michal Krol
69c7fc128c softpipe: Grab fs output z from the correct file. 2009-09-25 18:52:13 +02:00
Michal Krol
a0fbc01cea softpipe: Do not advertise support for L16 and YCBCR formats. 2009-09-25 18:52:12 +02:00
Michal Krol
02b81187dc radeon: Fix newlines. 2009-09-25 18:51:55 +02:00
Brian Paul
ecf3091cc7 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/drivers/dri/intel/intel_clear.c
2009-09-25 09:00:19 -06:00
Christoph Bumiller
5f4f7ad965 nv50: fix TEX for WriteMask not equal 0xf
If you e.g. only need alpha, it ends up in the first reg,
not the last, as it would when reading rgb too.
2009-09-25 11:01:45 +02:00
Christoph Bumiller
513cadf5af nv50: actually enable view volume clipping
Until now, only primitives wholly outside the view volume
were not drawn.
This was only visibile when using a viewport smaller than
the window size, naturally.
2009-09-25 11:01:45 +02:00
Christoph Bumiller
001daf78c8 nv50: RCP and RSQ cannot load from VP inputs 2009-09-25 11:01:45 +02:00
Christoph Bumiller
ef6805710d nv50: fix CEIL and TRUNC
Separated the integer rounding mode flag for cvt.
2009-09-25 11:01:45 +02:00
Christoph Bumiller
e2b8dc3e38 nv50: implement BGNLOOP, BRK, ENDLOOP
There's a good chance a loop won't execute correctly
though since our TEMP allocation assumes programs to
be executed linearly. Will fix later.
2009-09-25 11:01:44 +02:00
Christoph Bumiller
1196f9fbd6 nv50: implement IF, ELSE, ENDIF opcodes 2009-09-25 11:01:44 +02:00
Cooper Yuan
16a6ca9b2b r300g: add texture format for xvmc 2009-09-25 15:15:20 +08:00
Chia-I Wu
5a1e25afac mesa/main: Make FEATURE_convolve follow feature conventions.
As shown in mfeatures.h, this allows users of convolve.h to work without
knowing if the feature is available.
2009-09-24 21:48:39 -06:00
Chia-I Wu
cb4f24e51d mesa/main: Make FEATURE_colortable follow feature conventions.
As shown in mfeatures.h, this allows users of colortab.h to work
without knowing if the feature is available.
2009-09-24 21:48:22 -06:00
Chia-I Wu
dbb8fb8de9 mesa/main: Make FEATURE_pixel_transfer follow feature conventions.
As shown in mfeatures.h, this allows users of pixel.h to work without
knowing if the feature is available.
2009-09-24 21:48:05 -06:00
Chia-I Wu
17099f5e19 mesa/main: Add comments to mfeatures.h.
The comments document the conventions that a feature may follow.
2009-09-24 21:47:45 -06:00
Brian Paul
c9ddd6f810 progs/perf: glGenerateMipmap() test 2009-09-24 19:38:04 -06:00
Brian Paul
0876618a8d mesa: _mesa_meta_GenerateMipmap() now working
Handles GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP.
But GL_TEXTURE_3D and texture borders not supported yet.
2009-09-24 19:36:20 -06:00
Brian Paul
e33ea11c14 mesa: remove: unused gl_vertex_program::TnlData field 2009-09-24 19:34:19 -06:00
Ian Romanick
09af58d7ed NV fp lexer: Add UP4B and UP4UB instructions that were previously missing 2009-09-24 18:27:20 -07:00
Zack Rusin
228aa45fcb st/xorg: start working on the Xv acceleration code 2009-09-24 19:20:41 -04:00
Zack Rusin
80965fca74 st/xorg: fills are supported plussome minor clenups 2009-09-24 19:20:41 -04:00
Zack Rusin
53d2fa46e7 st/xorg: add easier way of disabling/enabling acceleration 2009-09-24 19:20:41 -04:00
Brian Paul
01249c6d56 llvmpipe: add missing __FUNCTION__ parameter to debug_printf() calls 2009-09-24 16:08:47 -06:00
Brian Paul
a665a3416e llvmpipe: increase max 3D texture size to 256 2009-09-24 16:07:45 -06:00
Brian Paul
29d27229a9 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/vbo/vbo_exec_array.c
2009-09-24 16:06:21 -06:00
Pauli Nieminen
fd56bee6c4 Merge branch 'mesa_7_6_branch' 2009-09-24 20:39:16 +03:00
Brian Paul
c9f7a23ef0 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/mesa/drivers/dri/r600/r700_assembler.c
	src/mesa/drivers/dri/r600/r700_chip.c
	src/mesa/drivers/dri/r600/r700_render.c
	src/mesa/drivers/dri/r600/r700_vertprog.c
	src/mesa/drivers/dri/r600/r700_vertprog.h
	src/mesa/drivers/dri/radeon/radeon_span.c
2009-09-24 11:03:16 -06:00
Brian Paul
6be2bc56af gallium/trace: casts to silence warnings 2009-09-24 10:47:42 -06:00
Brian Paul
f85816354c tgsi/sse: remove old comments 2009-09-24 10:45:36 -06:00
Brian Paul
35cd0bbfb1 tgsi/sse: implement SEQ, SGT, SLE, SNE 2009-09-24 10:45:35 -06:00
Keith Whitwell
09a23ac3c1 progs/perf: fix warnings in readpixels test 2009-09-24 16:52:14 +01:00
Keith Whitwell
d93f022936 progs/perf: fix typo in sconscript 2009-09-24 16:50:27 +01:00
Keith Whitwell
90dcfb3b47 trace: fix printf warnings 2009-09-24 16:49:40 +01:00
Keith Whitwell
d3beaf2f32 softpipe: fix compiler warnings 2009-09-24 16:49:27 +01:00
Keith Whitwell
fca7f38441 pipebuffer: fix printf warnings 2009-09-24 16:49:05 +01:00
Keith Whitwell
0c55dd8094 pipebuffer: fix warnings 2009-09-24 16:48:49 +01:00
Keith Whitwell
cd362334ad draw: fix warning 2009-09-24 16:44:58 +01:00
Keith Whitwell
6e0b56edf8 progs/perf: accept GL3.x also 2009-09-24 16:43:15 +01:00
Richard Li
5f06064b61 r600 : fix draw_prim bug: vertex fetcher setting. 2009-09-24 11:29:44 -04:00
José Fonseca
9659aa6482 softpipe: Use portable INLINE macro. 2009-09-24 15:28:55 +01:00
José Fonseca
e8e6d8853d softpipe: Update SConscript. 2009-09-24 15:28:54 +01:00
Richard Li
41c5f113b5 r600 : disable draw_prim for now. 2009-09-24 10:15:19 -04:00
José Fonseca
86962d6f6e gdi: Update for WGL state tracker interface changes. 2009-09-24 13:12:51 +01:00
José Fonseca
4e5ed05b02 wgl: DWM integration. 2009-09-24 13:12:51 +01:00
José Fonseca
9ea277ba7a scons: Don't require -liberty on MinGW.
Not always present.
2009-09-24 13:12:50 +01:00
José Fonseca
622bdecabd mesa: Fix missing finite symbol error on Windows.
Caused by some weird logic regarding the __WIN32__ define which made
the finite definition dependent on the header include order.
2009-09-24 13:12:50 +01:00
Alex Deucher
1bf0651d9b r600: fix up ordering of functions in draw prims path
Shaders and IB need to be updated and allocated before
calling validatebuffers.
2009-09-23 19:42:07 -04:00
Alex Deucher
20e7738293 r600: fix r700PredictRenderSize for draw prims path 2009-09-23 16:54:12 -04:00
Richard Li
8a2b0f6415 r600 : add hw index buffer draw support. 2009-09-23 16:16:11 -04:00
Brian Paul
fa0816b17c progs/perf: added glReadPixels benchmark 2009-09-23 14:05:05 -06:00
Brian Paul
489f8bc86f progs/perf: also request a stencil buffer 2009-09-23 14:05:05 -06:00
Adam Jackson
8abe77a75a Finish removing glcore 2009-09-23 15:22:19 -04:00
Alex Deucher
53051b8cb5 r600: fix copy/paste typo 2009-09-23 15:02:19 -04:00
Alex Deucher
ec205bbd57 r600: fix some warnings 2009-09-23 14:58:46 -04:00
Andre Maasikas
2d2f49c919 r600: add support for CUBE textures, also TXP
seems to work here ...
2009-09-23 14:58:46 -04:00
Michal Krol
a0549f6634 progs/perf: Actually bind the newly created vbo. 2009-09-23 20:24:35 +02:00
Brian Paul
35af3f94a3 llvmpipe: move tile cache datatypes into .c file since they're private 2009-09-23 11:53:12 -06:00
Brian Paul
b4a40d1052 softpipe: replace macros with inline functions
And update comments.
2009-09-23 11:51:52 -06:00
Brian Paul
e2329f2795 softpipe: white-space/formatting fixes and updated comments 2009-09-23 11:35:33 -06:00
Brian Paul
5244ce786a llvmpipe: added max texture/surface size sanity check
Carried over from softpipe driver.
2009-09-23 11:05:00 -06:00
Brian Paul
b26f1df920 llvmpipe: increase MAX_WIDTH/HEIGHT to match max texture size 2009-09-23 11:04:07 -06:00
Brian Paul
de25f82067 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/gallium/drivers/softpipe/sp_tile_cache.c
2009-09-23 11:00:04 -06:00
Keith Whitwell
890679d432 Merge branch 'softpipe-opt'
Conflicts:
	progs/demos/cubemap.c
	src/gallium/drivers/softpipe/sp_tex_sample.c
	src/gallium/drivers/softpipe/sp_texture.c
2009-09-23 17:37:28 +01:00
Keith Whitwell
a1fa770c01 gallium/include: update some comments 2009-09-23 17:04:48 +01:00
Zack Rusin
1ddb217d8e st/xorg: fix a typo
it'd be too easy, eh
2009-09-23 12:05:13 -04:00
Zack Rusin
5a7f708530 st/xorg: keep the user buffer contents around
Michel noticed that they were getting out of scope
2009-09-23 12:03:35 -04:00
Brian Paul
aae77319c0 progs/perf: set TexSubImage4=FALSE 2009-09-23 08:06:37 -06:00
José Fonseca
31f1571d1f wgl: Eliminate the shared layer; implement WGL API on top of the ICD callbacks.
While the WGL API has been stale for decades now, the ICD interface has
been updated with new Windows versions, so it is much easier to define
everything in terms of the ICD interfaces, which is pretty much what
Microsoft's opengl32.dll does anyway.
2009-09-23 10:32:52 +01:00
José Fonseca
f8c11526c0 gdi: Update for WGL statetracker source reorg. 2009-09-23 10:32:51 +01:00
José Fonseca
f724036f00 wgl: Flatten the source tree.
It is easier to have the WGL API on top of the ICD callbacks as
Microsoft's own implementation does, than to have a seperate shared
entity. This source reorganization is in antecipation of that.
2009-09-23 10:32:51 +01:00
José Fonseca
8d1af5991d wgl: Fix debug_printf format specifiers. 2009-09-23 10:32:51 +01:00
José Fonseca
21a949365d gallium: Update vendor string. 2009-09-23 10:32:50 +01:00
root
75276ea316 softpipe: fix bugs in POT texture sampling when texture is not square
Before, if level was greater than the logbase2(base size) we were
doing a negative bit shift and winding up with garbage values.
2009-09-22 20:14:10 -06:00
Brian Paul
5dbedf3d7e softpipe: additional assertions 2009-09-22 16:59:28 -06:00
Brian Paul
0670df5cb2 softpipe: disable a _debug_printf() 2009-09-22 16:42:15 -06:00
Brian Paul
02f2bcdf1d Merge branch 'mesa_7_6_branch' 2009-09-22 16:06:18 -06:00
Brian Paul
d04fa73cec progs/perf: added glCopyTex[Sub]Image2D test 2009-09-22 15:39:05 -06:00
Richard Li
98d5ec10d0 r600 : add draw_prim support, make up one lost change. 2009-09-22 17:26:23 -04:00
Richard Li
81283b0bf0 r600 : add draw_prim support. 2009-09-22 17:04:49 -04:00
Keith Whitwell
fe9ca0f718 softpipe: need to write depth/stencil values even when stencil fails 2009-09-22 20:47:37 +01:00
Keith Whitwell
207764894b softpipe: set quad->facing value 2009-09-22 20:47:07 +01:00
Keith Whitwell
b1139e9ad8 softpipe: fix polygon stipple 2009-09-22 19:38:34 +01:00
Brian Paul
da0e4e557b progs/perf: test glGetTexImage() also 2009-09-22 12:26:12 -06:00
Keith Whitwell
b626176f06 softpipe: fix occlusion counting 2009-09-22 19:26:08 +01:00
Jakob Bornecrantz
bade906ed1 st/xorg: Fix two leeks
We where leaking both surfaces in the composit code
	and textures from pixmaps.
2009-09-22 11:06:57 -07:00
Jakob Bornecrantz
19798e17fe i915g: Activate trace 2009-09-22 11:06:57 -07:00
Jakob Bornecrantz
e369294f76 i915g: Do propper references of surfaces in context 2009-09-22 11:06:56 -07:00
Brian Paul
67d7021ae0 progs/perf: add missing texture enable in fbobind.c 2009-09-22 11:15:11 -06:00
Brian Paul
ed113da12e progs/perf: added fbobind.c test to test FBO binding speed 2009-09-22 11:15:11 -06:00
Brian Paul
cfb0f2489d progs/perf: added PerfExtensionSupported() helper 2009-09-22 11:15:11 -06:00
Keith Whitwell
0ec26cce36 teximage: add more tests, image formats
Add a test which creates a new texture from scratch before uploading.
Add more image formats.
Don't run all tests on all image formats.
2009-09-22 18:00:11 +01:00
Brian Paul
bae2d58827 progs/perf: add another VBO test for Create/Draw/Destroy pattern
Report both MB/sec and draw/sec.
2009-09-22 09:53:35 -06:00
Brian Paul
7e5004b298 progs/perf: simplify the code 2009-09-22 09:43:08 -06:00
Brian Paul
aa80851e16 progs/perf: fix comment 2009-09-22 09:29:27 -06:00
Brian Paul
32979ae15f progs/perf: updated comments 2009-09-22 07:50:12 -06:00
Keith Whitwell
6a09c9d2d8 progs/perf: make teximage results easier to read, more reproducible
Always run the same tests on different drivers, give zero results
where test image is too big for driver.

Add a newline between groups of tests.
2009-09-22 12:35:56 +01:00
Keith Whitwell
89f2799dac progs/perf: reset row_length after subimage test
Also test fewer sizes in teximage generally.
2009-09-22 11:58:09 +01:00
Keith Whitwell
bf014d03fe progs/perf: clean up swapbuffers test a bit 2009-09-22 11:27:18 +01:00
Keith Whitwell
ac6a5107e2 progs/perf: break up long runs of fullscreen quads
Not all drivers cope gracefully with command-buffers with zillions of
fullscreen quads.
2009-09-22 11:21:10 +01:00
Keith Whitwell
a7b2659f02 progs/perf: add first attempt at a swapbuffers rate test
This is pretty ugly as the original framework assumed you'd set
a single window size at startup and keep it throughout, but for
swapbuffers you want to test the rate at various window sizes.

With luck a nicer solution can be found, but this at least lays out
a marker.
2009-09-22 11:21:09 +01:00
Brian Paul
94a020cfe6 vbo: added comment about max array index 2009-09-21 16:54:35 -06:00
Brian Paul
9a3333f436 vbo: restore some lost warning output 2009-09-21 16:51:34 -06:00
Brian Paul
972e995b14 vbo: disable the GL_ARB_draw_elements_base_vertex rebase path
This was introduced with commit 92d7ed8a20.
It causes rendering of stray polygons (with sw rendering at least) when
running the OGL Distilled / Picking demo (click on an object).

This needs additional debugging to fix/restore.

Found one suspect thing: in _tnl_draw_prims() there's some mixed signed/
unsigned arithmetic/comparing at line 422 that may be incorrect.
2009-09-21 16:10:50 -06:00
Adam Jackson
83019ffc07 selinux: Fix mmap() return value check 2009-09-21 17:04:22 -04:00
Brian Paul
40603526f4 mesa: refine the error checking vbo_exec_DrawRangeElements()
If the 'end' index is out of bounds issue a warning as before.  But instead
of just no-op'ing the draw call, examine the actual array indices to see
if they're OK.  If the max array index is out of bounds, issue another
warning and no-op the draw call.  Otherwise, draw normally.  This is a
debug build-only feature since it could impact performance.

This "fixes" the missing torus in the OGL Distilled / Picking demo.
2009-09-21 14:56:58 -06:00
Brian Paul
e5d29ebb5e mesa: make max_buffer_index() a non-static function 2009-09-21 14:56:40 -06:00
Maciej Cencora
4916a5a2e7 radeon: update buffer map/unmap code for changes introduced in 92033a9516 and 822c796481 2009-09-21 14:56:11 -06:00
Maciej Cencora
d100cbf721 mesa: add some debug info to teximage.c 2009-09-21 14:56:11 -06:00
Maciej Cencora
b1c9c5a800 r300: fix a typo 2009-09-21 14:56:11 -06:00
Brian Paul
d504a7669d swrast: fix cube face selection
If arx and ary are equal, we still want to choose from one of them,
and not arz.

This is the same as Michal's softpipe fix.
2009-09-21 14:56:10 -06:00
Alex Deucher
c63e78b3e5 r600: fix typo in the last commit
128 gprs, 256 reg-based consts
2009-09-21 16:48:55 -04:00
Alex Deucher
1869bdabba r600: various cleanups
- max texture size is 8k, but mesa doesn't support
that at the moment.
- attempt to set shader limits to what the hw actually
supports
- clean up some old r300 cruft
- no need to explicitly disable irqs.  This is fixed
in the drm now.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-09-21 16:33:11 -04:00
José Fonseca
734a498ed4 mesa: Ensure TGSI tokens are freed with gallium's free.
To avoid breaking the gallium's builtin malloc debugging.
2009-09-21 20:12:03 +01:00
Brian Paul
9297e6968a progs/perf: added fill-rate test
Many more fill modes could be tested, but this hits the basics including
blending, texturing and shaders.
2009-09-21 12:17:49 -06:00
Brian Paul
05bce08980 progs/perf: added helpers for creating simple textures and shader programs 2009-09-21 11:58:03 -06:00
Brian Paul
83fbee6e0b progs/perf: offsetof() should be defined in stddef.h, include it
If this breaks mingw, feel free to revert this.
2009-09-21 11:09:47 -06:00
Nicolai Hähnle
9ca94f91a3 r300g: Fix bad formatting parameters in calls to debug_printf
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-21 17:41:54 +02:00
Nicolai Hähnle
496137d8eb gallium debug: Add gcc printf hint to debug_printf
This causes gcc to issue warnings when format parameters do not match up
with the format string in calls to debug_printf.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-21 17:41:54 +02:00
Keith Whitwell
7ce0421fb7 progs/perf: a few more vbo upload modes
Some tests, eg small SubData are probably overwhelmed by the cost of
performing the draw after each upload.  Add a varient which does a lot
of subdata uploads and then a single draw.

Also try to avoid cache-artifacts in the upload timings.
2009-09-21 15:57:14 +01:00
Keith Whitwell
25a580c841 progs/perf: human-readable drawoverhead output 2009-09-21 15:57:14 +01:00
Keith Whitwell
6ab7c127f7 progs/perf: human-format vertexrate output 2009-09-21 15:57:14 +01:00
Keith Whitwell
ed63bd62d8 progs/perf: add human-readable float formatter 2009-09-21 15:57:13 +01:00
Vinson Lee
d17af7d1e1 progs/glsl: Include local headers before installed headers during compilation.
Fixes compilation errors on platforms with insufficient older installed
GL headers.
2009-09-21 08:44:56 -06:00
Andre Maasikas
2d729e6e3b r600: fix some issues with LIT instruction
- MUL_LIT is ALU.Trans instruction
- some Trans instructions can take 3 arguments
- don't clobber dst.x, use dst.z as temp, it'll get written correct
  value in last insn
- respect source swizzles
2009-09-21 10:14:25 -04:00
Nicolai Hähnle
81c7561d9d Merge branch 'master' into r300-compiler
There were additional non-textual conflicts.

Conflicts:
	src/gallium/drivers/r300/r300_tgsi_to_rc.c
	src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
	src/mesa/drivers/dri/r300/compiler/radeon_program.c
	src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
2009-09-21 13:26:50 +02:00
Nicolai Hähnle
3083ba38f4 Merge branch 'mesa_7_6_branch' 2009-09-21 13:08:34 +02:00
Michel Dänzer
c67bb22fe7 Merge branch 'mesa_7_6_branch' 2009-09-21 10:48:32 +02:00
Ben Skeggs
774db70506 nouveau: allow building modesetting_drv.so 2009-09-21 14:51:39 +10:00
Ben Skeggs
344e2fd1f2 nouveau: drm_api create_screen()'s 'arg' argument can be NULL 2009-09-21 14:46:50 +10:00
Brian Paul
e3384a0d53 windows: call _mesa_meta_init/free() 2009-09-20 22:19:28 -06:00
Brian Paul
2c1937480a xlib: always call _mesa_meta_init/free() 2009-09-20 22:19:06 -06:00
Brian Paul
4a4914e414 dri/swrast: call _mesa_meta_init/free() 2009-09-20 22:13:28 -06:00
Brian Paul
1741bc1a79 osmesa: call _mesa_meta_init/free() 2009-09-20 22:13:09 -06:00
Brian Paul
a1cf9b6abe Revert "st/mesa: Compile in meta.c."
This reverts commit 6c5726cd39.
2009-09-20 22:08:30 -06:00
Brian Paul
1eda10d073 Revert "scons: add meta.c to sources"
This reverts commit 41fefe88c5.
2009-09-20 22:08:21 -06:00
Brian Paul
da9d8f1924 Revert "mesa: move _mesa_meta_init/free() calls to core Mesa"
This reverts commit 651cffd626.

The commit inadvertantly introduced a new gallium dependency on the meta code.
2009-09-20 22:06:03 -06:00
Brian Paul
41fefe88c5 scons: add meta.c to sources 2009-09-20 21:31:45 -06:00
Chia-I Wu
6c5726cd39 st/mesa: Compile in meta.c.
meta was moved to core Mesa since
651cffd626.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-20 21:31:45 -06:00
Chia-I Wu
81bac6e2a8 intel: meta clear has a new name.
It was renamed to _mesa_meta_Clear.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-09-20 21:31:45 -06:00
Dave Airlie
e9d6ab72be xorg/st: fixup builds against later dpms headers. 2009-09-21 13:26:48 +10:00
José Fonseca
1a9eec84bd scons: Drop gprof support for profile builds; tweak optimization flags instead.
gprof is useful for shared libraries, hence our drivers. Nevertheless
profilers like oprofile can benefit from disabling some relatively
minor optimizations for more accurate / complete results.
2009-09-20 18:09:34 +01:00
José Fonseca
911a7a82cd llvmpipe: Fix lp_get_cached_tile.
Align coordinates to tile boundaries.
2009-09-20 18:09:34 +01:00
José Fonseca
76c2e34b22 llvmpipe: Update tile status on flush. 2009-09-20 18:09:34 +01:00
Brian Paul
ebf2710b2f Merge branch 'mesa_7_6_branch'
Conflicts:
	src/mesa/drivers/dri/intel/intel_clear.c
2009-09-20 10:36:45 -06:00
Brian Paul
ed4076b5b8 mesa: remove redundant readbuffer check 2009-09-19 17:26:14 -06:00
Brian Paul
4de8e2123e mesa: rename functions to be more consistant with rest of mesa 2009-09-19 17:06:15 -06:00
Brian Paul
232fc7d333 swrast: remove obsolete s_imaging.c file 2009-09-19 16:43:18 -06:00
Brian Paul
7e0f2ce941 swrast: remove prototypes for obsolete functions 2009-09-19 16:43:17 -06:00
Brian Paul
58e843dda0 mesa: remove s_imaging.c from build 2009-09-19 16:43:17 -06:00
Brian Paul
32e4b6c607 windows: replace old ColorTable, Convolution functions with new 2009-09-19 16:43:17 -06:00
Brian Paul
bc1c8d4af7 mesa: use new meta functions 2009-09-19 16:43:17 -06:00
Brian Paul
3e5a35269b mesa: meta functions for glCopyColorTable, glCopyConvolutionFilter, etc 2009-09-19 16:43:17 -06:00
Brian Paul
dc3839ef3d mesa: move readbuffer tests 2009-09-19 16:43:17 -06:00
Brian Paul
883dd9d770 mesa: use _mesa_get_current_tex_unit() helper 2009-09-19 16:43:17 -06:00
Brian Paul
3ed9dab19c mesa: use _mesa_get_current_tex_unit() helper 2009-09-19 16:43:16 -06:00
Brian Paul
b0e9ea6084 mesa: fix some glCopyTex[Sub]Image regressions related to convolution 2009-09-19 16:43:16 -06:00
Brian Paul
651cffd626 mesa: move _mesa_meta_init/free() calls to core Mesa 2009-09-19 16:43:16 -06:00
Alex Deucher
b8477f079b r600: fix point sizes
registers takes radius
2009-09-19 15:18:42 -04:00
Alex Deucher
368fb578f8 r600: fix polygon offset 2009-09-19 14:48:44 -04:00
Brian Paul
67cad78e08 swrast: remove obsolete s_texstore.c
Replaced by new, simpler meta functions.
2009-09-19 11:09:25 -06:00
Brian Paul
2f89044e6f swrast: remove prototypes for obsolete functions 2009-09-19 11:08:49 -06:00
Brian Paul
14869c0984 mesa: remove s_texstore.c from makefile/project files 2009-09-19 11:08:20 -06:00
Brian Paul
a9c64daf02 glapi: replace old TexCopy functions w/ new 2009-09-19 11:05:54 -06:00
Brian Paul
41a171b714 windows: replace old TexCopy functions w/ new 2009-09-19 11:03:33 -06:00
Brian Paul
e2e0735e0e gldirect: remove refs to soon-to-be-obsolete functions
I don't know if this driver is anywhere near build-able, but anyway.
2009-09-19 11:01:27 -06:00
Brian Paul
6f9dbe7739 mesa: use new _mesa_meta_CopyTex[Sub]Image() functions 2009-09-19 10:58:11 -06:00
Brian Paul
af69346446 intel: use new _mesa_meta_CopyTex[Sub]Image() functions 2009-09-19 10:58:07 -06:00
Brian Paul
22f02509f2 glapi: regenerated files 2009-09-19 10:00:55 -06:00
Brian Paul
c9a87ff441 glapi: added tokens, function for GL_ARB_provoking_vertex 2009-09-19 10:00:19 -06:00
Michal Krol
18d0f9a7a3 llvmpipe: Respect input interpolators for the shader.
Cherry-picked from fb2c7b6743
2009-09-19 14:57:24 +01:00
José Fonseca
fdd605e446 mesa: Allow BlitFramebuffer from a texture.
Although GL_EXT_framebuffer_blit does not mention textures, it doesn't
forbid them either, and some thirdparty driver appear to support this.
2009-09-19 14:33:35 +01:00
Michal Krol
de685b37a9 softpipe: Fix cube face selection.
If arx and ary are equal, we still want to choose from one of them,
and not arz.
2009-09-18 14:36:59 +01:00
Michal Krol
fb2c7b6743 softpipe: Respect input interpolators for the shader. 2009-09-17 16:06:11 +01:00
Michal Krol
5f0b49e7a9 tgsi: Scan input interpolators, too. 2009-09-17 16:06:09 +01:00
Keith Whitwell
2884c31d94 progs/perf: convert some DOS line-endings
It seems like some of these files were committed with CRLF initially.
2009-09-17 12:09:16 +01:00
Keith Whitwell
e95a3a23dc progs/perf: add scons support, get working under mingw 2009-09-17 12:08:04 +01:00
Brian Paul
21caa29fbd mesa: begin some texstore code refactoring
Next step will be to move the calls to ctx->Driver.ChooseTextureFormat()
into the teximage.c functions so drivers don't have to do it.
2009-09-16 21:50:04 -06:00
Brian Paul
1d8fbef4f2 mesa: meta driver functions for glCopyTex[Sub]Image()
Implement in terms of glReadPixels + glTex[Sub]Image().
This will allow us to get rid of some swrast texture code.
2009-09-16 20:09:07 -06:00
Brian Paul
9abbedad09 progs/perf: initial set of simple performance test programs
Initial tests include:
  drawoverhead - measure overhead of state changes w.r.t drawing commands
  teximage - measure glTexImage2D() and glTexSubImage2D() speed
  vbo - measure glBufferData() and glBufferSubData() speed
  vertexrate - measure vertex rate for immediate mode, glDrawArrays, VBOs, etc.
2009-09-16 19:33:01 -06:00
Brian Paul
4df2f7af5e progs/glsl: minor Makefile clean-ups 2009-09-16 19:28:55 -06:00
Brian Paul
8d47b4906b swrast: remove mipmap generation checks (done in core Mesa now) 2009-09-16 19:28:55 -06:00
Brian Paul
4e84b96d92 s3v: remove unneeded initializations 2009-09-16 19:28:54 -06:00
Brian Paul
1b1125c239 ffb: remove disabled code 2009-09-16 19:28:54 -06:00
José Fonseca
f911d196cf llvmpipe: Don't assert due to unsupported texture wrap modes.
Issue a warning and fallback to clamping.
2009-09-16 20:42:09 +01:00
Ian Romanick
5ce72c559c Merge branch 'mesa_7_6_branch' 2009-09-16 08:05:36 -07:00
Brian Paul
aabcc6cb23 gallium: remove incorrect 'return' stmt 2009-09-16 08:59:32 -06:00
José Fonseca
c29905aa31 gallium: Deprecate PIPE_CAP_S3TC.
No longer used. S3TC support is queried via
pipe_screen::is_format_supported.
2009-09-16 14:33:52 +01:00
Michal Krol
ec48396e0f softpipe: Do not advertise Z32_UNORM as a supported format. 2009-09-16 13:56:58 +01:00
José Fonseca
b60e1d7630 gdi: Integrate with llvmpipe where available. 2009-09-16 11:35:23 +01:00
José Fonseca
459ea0095c llvmpipe: Make the code portable for MinGW. 2009-09-16 11:35:23 +01:00
Dave Airlie
858a2a2ac7 radeon: cleanup compile defines mess.
I inherited this and really it stayed around far too long,
make it nice and simple.
2009-09-16 13:48:45 +10:00
Dave Airlie
a6a21eb00d radeon: oops remove debugging left on in previous patch 2009-09-16 13:25:02 +10:00
Dave Airlie
2fdb0e5d3b radeon: use txformat to decide to emit rect tex state.
This is more logical, and fixes a TFP issue.
2009-09-16 13:13:43 +10:00
Brian Paul
2914f2b7fd mesa: move generate mipmap calls
Per the suggestion in the Intel driver, move the calls to
ctx->Driver.GenerateMipmap() into core Mesa so that drivers don't
have to worry about it.
2009-09-15 18:17:43 -06:00
Brian Paul
ef6ee07fc7 mesa: minor clean-up 2009-09-15 18:17:43 -06:00
Brian Paul
a31ac84d74 mesa: remove last of gotos 2009-09-15 18:17:43 -06:00
Brian Paul
c352566933 mesa: more goto removal 2009-09-15 18:17:43 -06:00
Brian Paul
ecf6f37fc2 mesa: remove some gotos
This will make some subsequent changes easier...
2009-09-15 18:17:42 -06:00
Brian Paul
c26c2006df mesa: clean-up fbo debug code 2009-09-15 18:17:42 -06:00
Brian Paul
0b0fc4072f progs/demos: use non-default texobj in cubemap.c 2009-09-15 18:17:42 -06:00
Brian Paul
7f86da6c60 progs/demos: create a texture object in lodbias.c
Before, we were using the default texture object (name=0).  This caused
the intel_generate_mipmap() path to fail since passing texture=0 to
glFramebufferTexture2DEXT() causes us to _unbind_ the texture if present.
2009-09-15 18:17:42 -06:00
Zack Rusin
a016043386 st/xorg: fixing copies and composite shaders
copies were busted when src == dst. also the composite shaders
were incorrectly using the fragments instead of the texture coordinate.
2009-09-15 19:50:36 -04:00
Zack Rusin
8adcad0c70 st/xorg: lots of fixes
fixes blending binding and copy coordinates
2009-09-15 19:50:34 -04:00
Brian Paul
f9574e05c2 docs: GL_ARB_provoking_vertex 2009-09-15 16:01:51 -06:00
Brian Paul
2e7a1dd8ca mesa: added GL_ARB_provoking_vertex (same as EXT version) 2009-09-15 16:01:51 -06:00
Alex Deucher
87d40a95bf radeon: don't build non-r600 span code on r600 2009-09-15 17:13:08 -04:00
Alex Deucher
49fc41eeed r600: minor span cleanups 2009-09-15 17:13:08 -04:00
Ian Romanick
ac4e23d784 Merge branch 'mesa_7_6_branch' 2009-09-15 13:14:38 -07:00
Zack Rusin
f1ce6b09cd st/xorg: Brian suggested that those could be mad's
optimizes the common paths
2009-09-15 15:21:42 -04:00
Brian Paul
b0c52e491d mesa: remove incorrect texture state check
Fixes incorrectly textured bitmap text in engine demo.
It's incorrect to test the texture enable bits here since they may have
been changed by disabling the shader above.  Optimization is still possible
but will have to be reexamined.
2009-09-15 12:36:55 -06:00
Maarten Maathuis
26860a6e2f nv50: avoid excessive FIRE_RING
- And reduce RING_SPACE to 2, instead of 3.
2009-09-15 18:59:53 +02:00
Maarten Maathuis
db37279e0b nv50: use flush_notify to reduce number of relocs 2009-09-15 18:59:53 +02:00
Michel Dänzer
0469465c31 st/xorg: Only unreference texture on pixmap destruction, don't destroy it.
Fixes memory corruption if e.g. the driver still has references to the texture.
2009-09-15 18:31:07 +02:00
Michel Dänzer
45cf2696ca st/xorg: Explicitly check whether the driver supports the pixmap formats.
Rather than arbitrarily checking for pixmap depth < 15.
2009-09-15 18:30:58 +02:00
Michel Dänzer
be94a1d3bc st/xorg: Use A8 format for depth 8 pixmaps.
The inconsistent bpp caused issues with UploadTo/DownloadFromScreen.
2009-09-15 18:23:00 +02:00
Brian Paul
be0cdd77ea st/mesa: disable accidentally committed _mesa_print_program() call 2009-09-15 09:52:27 -06:00
Brian Paul
41bbc83951 Merge branch 'mesa_7_6_branch' 2009-09-15 09:47:35 -06:00
Brian Paul
c0cf9dc05e ARB prog parser: regenerated file 2009-09-15 09:40:26 -06:00
Brian Paul
2aad3a855b ARB prog parser: more detailed error message for out of bounds ADDR offsets 2009-09-15 09:40:25 -06:00
Andre Maasikas
5ef40337ab r600: support position_invariant programs 2009-09-15 11:27:51 -04:00
José Fonseca
a18301790c gallium: Use the enum for pipe_transfer::usage. 2009-09-15 16:02:55 +01:00
José Fonseca
cb5f1bce23 gallium: pipe_transfer_destroy helper inline. 2009-09-15 16:02:54 +01:00
Christoph Bumiller
d3a9cf54c0 nv50: fix stupid thinko in emit_set
When swapping sources 0 and 1, EQ of course does *not*
become NE, etc.

Introduced in 2b963f5c72.
2009-09-15 15:37:10 +02:00
Michal Krol
7aee53002c gallium: Fix pointer type casts. 2009-09-15 12:00:27 +01:00
Christoph Bumiller
750c6cae3d nv50: let programs use the whole param buffer
Allocation is unnecessary since all uniforms are
uploaded on every constant buffer change anyway.
2009-09-15 12:13:23 +02:00
Christoph Bumiller
01670ca807 nv50: add preliminary support for point sprites 2009-09-15 12:13:23 +02:00
Christoph Bumiller
06dac41cc5 nv50: add support for point size per vertex 2009-09-15 12:13:23 +02:00
Christoph Bumiller
4d7b4781c8 nv50: add support for light-twoside 2009-09-15 12:13:23 +02:00
Christoph Bumiller
6516594c8e nv50: proper linkage between VP and FP
This moves construction of the mapping between VP outputs
and FP inputs into validation.

The map also contains slots for special outputs like clip
distance and point size, so we need to at least merge the
VP related and FP related parts on validation if we want
to support those.

Now we match every single FP input component with results
from the VP and leave those not read out of the map, or
replace those not written by 0 (xyz) or 1 (w).
The bitmap indicating linear interpolants is also filled,
and flat FP inputs are mapped in only after non-flat ones,
as is required.

Furthermore, we can save some space by only fetching VP
attrs we actually use, and avoid wasting any output regs
because of TGSI using less than 4 components.
2009-09-15 12:13:23 +02:00
Christoph Bumiller
38849c529e nv50: move allocation of pc regs
Make use of tgsi_shader_info to determine how many nv50_regs we
need to allocate, whether program uses KIL, or writes DEPR.
2009-09-15 12:13:23 +02:00
Christoph Bumiller
e0951797cb nv50: nicer initialization of nv50_regs 2009-09-15 12:13:23 +02:00
Christoph Bumiller
849885c7a6 nv50: handle CEIL and TRUNC opcodes 2009-09-15 12:13:23 +02:00
Christoph Bumiller
2b963f5c72 nv50: handle SEQ, SGT, SLE, SNE opcodes 2009-09-15 12:13:23 +02:00
Christoph Bumiller
e774b3c0f2 nv50: SIN and COS use src0.w for dst.w 2009-09-15 12:13:22 +02:00
Christoph Bumiller
81de711fc8 nv50: use broadcast TEMP reg in tx_insn
Makes some opcode cases nicer and might reduce the total
nr of TEMPs required, or save some MOVs.
2009-09-15 12:13:22 +02:00
Christoph Bumiller
234d82ed63 nv50: add nv50_tgsi_insn to handle swizzles safely 2009-09-15 12:13:22 +02:00
Christoph Bumiller
2da8608ad7 nv50: add functions for swizzle resolution
We're going to try to reorder the scalar ops of a vector instr
to accomodate swizzles that would otherwise require us to emit
to an additional TEMP first (like MOV R0.xy, R0.zx).
2009-09-15 12:13:22 +02:00
Christoph Bumiller
5d141b3e3e nv50: extend insn src mask function
Extend its usage to avoiding e.g. emission of negation
instructions in tx_insn for sources we don't need.
2009-09-15 12:13:22 +02:00
Cooper Yuan
287f0072d2 st/g3dvl: pass color values to softpipe clear function 2009-09-15 15:25:47 +08:00
Cooper Yuan
2ef8c60e55 xvmc: Generate new resource ID in _XIDHandler, otherwise it's invalid. 2009-09-15 13:16:56 +08:00
Zack Rusin
ef77462171 st/xorg: add some debugging helpers 2009-09-14 19:03:28 -04:00
Alex Deucher
364ca57aff r600: add span support for 1D tiles
1D tile span support for depth/stencil/color/textures

Z and stencil buffers are always tiled, so this fixes
sw access to Z and stencil buffers.  color and textures
are currently linear, but this adds span support when we
implement 1D tiling.

This fixes the text in progs/demos/engine and progs/tests/z*
2009-09-14 18:10:24 -04:00
Alex Deucher
f662cedae4 r600: fix warning
Noticed by rnoland on IRC.
2009-09-14 18:10:24 -04:00
Brian Paul
909ab3377f st/mesa: minor whitespace, comment clean-ups 2009-09-14 16:01:27 -06:00
Brian Paul
5a87a25a65 st/xorg: fix ureg_DECL_constant() parameters
This fixes the compilation errors reported in bug 23945 but someone more
familiar with the code should review for correctness and close the bug
report.
2009-09-14 15:47:13 -06:00
José Fonseca
d3f5a2e5ab scons: Allow to use only the WINDDK headers. 2009-09-14 20:12:02 +01:00
José Fonseca
a4a4553a80 scons: Allow to use MS's DXSDK headers with MinGW. 2009-09-14 20:12:01 +01:00
José Fonseca
c51bd94a14 gallium: Add pipe_transfer_map/unmap inlines. 2009-09-14 20:12:01 +01:00
José Fonseca
88b88bba68 util: Add _BitScanForward intrinsic's declaration.
It is missing in some Microsoft DDKs.
2009-09-14 20:12:01 +01:00
Brian Paul
aa522e6cc4 intel: minor code clean-ups 2009-09-14 12:42:18 -06:00
Brian Paul
8ec456c68c intel: fix renderbuffer map/unmap regression
Commit 36dd53a3cd caused a few regressions
because the glReadBuffer() buffer wasn't getting mapped when GL_READ_BUFFER
!= GL_DRAW_BUFFER.
2009-09-14 12:42:18 -06:00
Brian Paul
3c31049439 intel: remove unneeded driver function assignments
These default swrast functions are already installed by
_mesa_init_driver_functions().
2009-09-14 12:42:18 -06:00
Brian Paul
284d3b2d9c progs/tests: exercise display lists and pixelstore 2009-09-14 12:42:17 -06:00
Keith Whitwell
d7512521fd mesa/st: remove dead comment 2009-09-14 17:11:09 +01:00
Keith Whitwell
4295b34d25 st/mesa: convert to new tgsi_ureg mechanism for shader emit
Should be easier to read and work with than the older ways of emitting
TGSI tokens.

Also, emit simpler TGSI than previously:
  - translate away source and dest extended modifiers
  - translate away the SWZ opcode
2009-09-14 17:09:15 +01:00
Marcin Kościelnicki
d8a191e314 nv50: Fix m2mf positions. 2009-09-14 12:12:03 +02:00
José Fonseca
b4835ea03d llvmpipe: Make lp_type a regular union.
Union not worth the hassle of violating C99 or adding a name to
the structure.
2009-09-14 11:05:38 +01:00
José Fonseca
fa150debf0 util: Fix a1r5g5b5's format description. 2009-09-14 11:05:38 +01:00
Cooper Yuan
aad0deee4b g3dvl: update tgsi_opcode in order to build g3dvl library 2009-09-14 16:23:03 +08:00
Keith Whitwell
66a7eedaa2 tgsi: handle some src/dst aliasing in tgsi_sse2.c
Src/Dst aliasing (aka SOA dependencies) requires some care to ensure
intermediate results do not overwrite yet-to-be read source registers.

This change ensures that MOV/SWZ handle this correctly, which is poor but
no worse than the current tgsi_exec.c path.  Remove the fallback as there
is nothing to be gained correctness-wise between the two implementations now.

Fixing this properly looks like a bit of work in this code, but might be
easily achieved by sending destination writes to temporary storage.
2009-09-13 11:59:24 -07:00
José Fonseca
86226d5ea1 llvmpipe: Compute derivatives. 2009-09-13 16:22:27 +01:00
José Fonseca
4b32dd3007 llvmpipe: Remove dead references to pipe_winsys. 2009-09-13 16:13:12 +01:00
José Fonseca
5e13e987da llvmpipe: Use const keyword for input array arguments. 2009-09-13 16:12:48 +01:00
José Fonseca
faec23387e llvmpipe: Delay storing into the dst register to prevent clobbering the src registers.
How I'm thankful for regular expressions -- just a couple of them were
all that was needed to do this otherwise tiresome and bug prone change.
2009-09-13 14:42:52 +01:00
José Fonseca
873773ee2b llvmpipe: Translate more TGSI opcodes.
Basically cover all low hanging fruit, and mark the still missing opcodes
as "fixme" or deprecated.
2009-09-13 13:55:08 +01:00
José Fonseca
00dd0156e0 llvmpipe: Add a few more common arithmetic functions.
We are relying on SSE4.1 for round/trunc/ceil/floor. We'll need to
eventually find alternatives for the rest of the world.
2009-09-13 13:50:19 +01:00
José Fonseca
d7aa114e16 llvmpipe: Rename function to free up lp_build_trunc to the usual arithmetic meaning. 2009-09-13 13:45:48 +01:00
Keith Whitwell
18e5f1cee4 tgsi: implement saturation
Fix recent performance regression.
2009-09-12 18:33:46 -07:00
Keith Whitwell
055fe5768c tgsi: add missing implementation of constant decl change 2009-09-12 16:27:25 -07:00
Cooper Yuan
bffa18624d r300g: delete unused flag due to commit: 09b566e161 2009-09-13 07:10:34 -04:00
Keith Whitwell
11f41f54cf ureg: add a mechanism to get the built tokens rather than a full shader
Previously ureg would always call the driver's create-shader function.  This
allows the caller the opportunity to hold onto the tokens if it needs to
reuse them, eg. to create an internal draw shader.
2009-09-12 14:18:50 -07:00
Keith Whitwell
c23894295b ureg: add generic emitters for tex and branch instructions
Couldn't previously emit these except by calling the opcode-specific helper.
2009-09-12 14:18:00 -07:00
Keith Whitwell
ae4704eabc tgsi/ureg: give ureg_DECL_constant an explicit index parameter
Avoid the need to emit all constant declarations in order.  Makes
referring to a specific constant in the constant buffer much easier.
2009-09-12 14:16:00 -07:00
Keith Whitwell
09b566e161 mesa: remove unused SATURATE_PLUS_MINUS_ONE flag
Never set in mesa.  Remove from tgsi translation as well.
2009-09-12 14:15:15 -07:00
Keith Whitwell
6d8dbd3d1e tgsi/ureg: VS inputs don't have any semantic tags, just an index
Fix ureg_DECL_vs_input to reflect this and fix up all callers.
2009-09-12 14:12:35 -07:00
Keith Whitwell
149945c432 tgsi: free tokens on error 2009-09-12 14:07:48 -07:00
Keith Whitwell
e90fb86ac3 tgsi: sanity check ureg programs 2009-09-12 14:05:37 -07:00
Keith Whitwell
983b261e6d tgsi: add const qualifier 2009-09-12 14:04:36 -07:00
Nicolai Hähnle
3cb30e55e4 r300g: There is no such thing as "texture stride"
Individual texture images have a stride, but textures as a whole do not.

There are still pieces of code which are confused about this, but the core of
the confusion is hopefully gone.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-12 16:55:25 +02:00
Eric Anholt
57d16c4cc3 i965: Move OPCODE_DDX/DDY to brw_wm_emit.c and make it actually work.
Previously, it was trying to mess around with the varying's
WM setup data to produce a result.  Along with not actually working when
passed a varying, this wouldn't work if you did dFd[xy]() on a temporary.
Instead, just calculate the derivative using the neighbors in the subspan.
2009-09-11 14:13:47 -07:00
Andre Maasikas
a79eecb913 r600: fix texcoords from constants
with some minor updates from Richard.
2009-09-11 15:59:55 -04:00
Alex Deucher
08b7d32140 Revert "r600: support tex coords from constants"
This reverts commit 4099bb7614.

Tex coord src has to be a GPR.
2009-09-11 12:11:04 -04:00
Cooper Yuan
622b31925b r300g: only allocate one BO for vertex buffers, default size is 64*1024
it can fix redbook/sceneflat, scene, scenebamb, surface, nurbs and so on
2009-09-11 23:21:28 +08:00
Alex Deucher
4099bb7614 r600: support tex coords from constants
Fixes neverball among other things.
2009-09-11 11:07:58 -04:00
Andre Maasikas
4108ed7e80 r600: enable caching of vertex programs 2009-09-11 10:59:53 -04:00
José Fonseca
672c5f52d1 llvmpipe: set dirty_render_cache in llvmpipe_clear()
Based on Brian's softpipe change on
commit 988db64119. We don't use the tile
cache for zsbuf though, only for color buffers.
2009-09-11 11:29:24 +01:00
José Fonseca
1fc4100225 llvmpipe: Update status in README and TODO/FIXME comments throughout the code. 2009-09-11 11:24:26 +01:00
Eric Anholt
7c0152fbae i965: Enable loops in the VS.
Passes piglit glsl-vs-loop testcase.

Bug #20171
2009-09-10 20:43:44 -07:00
Brian Paul
0ef5b62787 mesa: nicer vertex setup 2009-09-10 19:56:35 -06:00
Brian Paul
4781c1f459 st/mesa: use st_context() helper 2009-09-10 19:40:53 -06:00
Brian Paul
6bc36f29c7 softpipe: remove no-op softpipe_init_texture_funcs() function 2009-09-10 16:51:52 -06:00
Brian Paul
209031701a softpipe: remove unused #includes, move comment 2009-09-10 16:50:18 -06:00
Brian Paul
de059d35c3 util: remove unneeded #includes 2009-09-10 16:45:25 -06:00
Brian Paul
afcaa45a94 softpipe: reformatting, clean-ups, comments 2009-09-10 16:42:47 -06:00
Brian Paul
759696defb util: minor clean-ups, reformatting 2009-09-10 16:39:13 -06:00
Brian Paul
71b3ccc4b0 softpipe: remove unneeded #includes 2009-09-10 16:38:51 -06:00
Ian Romanick
b8e1e8d2d8 Merge branch 'master' into asm-shader-rework-2
Conflicts:
	src/mesa/shader/lex.yy.c
	src/mesa/shader/program_parse.tab.c
	src/mesa/shader/program_parse.tab.h
2009-09-10 15:33:45 -07:00
Ian Romanick
81722c5d7e NV fp parser: Add support for condition codes
Conditional write masks and the condition-code based KIL instruction
are all supported.  The specific behavior of KIL in the following
shader may or may not match the behavior of other implementations:

!!ARBfp1.0
	TEMP	GT;
	MOVC	GT, fragment.texcoord[0];
	KIL	GT.x;
	END

Should be it interpreted as 'KIL srcReg' or as 'KIL ccTest'?  The
current parser will interpret it as 'KIL srcReg'.
2009-09-10 15:04:24 -07:00
Ian Romanick
cdb7193994 ARB prog lexer: Add missing #include to silence compile warning 2009-09-10 14:55:36 -07:00
Brian Paul
d9dc4cb0e4 Merge branch 'mesa_7_6_branch' 2009-09-10 15:41:52 -06:00
Zack Rusin
8c37a4c8fd st/xorg: rename ctx to pipe to match every other gallium state tracker
plus it avoids the "ctx->ctx->" syntax
2009-09-10 17:43:25 -04:00
Ian Romanick
0e7953366f ARB prog parser: Differentiate between used and unused names in the lexer
The lexer will return IDENTIFIER only when the name does not have an
associated symbol.  Otherwise USED_IDENTIFIER is returned.
2009-09-10 14:35:33 -07:00
Zack Rusin
85a716bf62 st/xorg: temporarily disablie copies 2009-09-10 17:21:06 -04:00
Zack Rusin
feb74e7753 st/xorg: implement pipelines surface/texture copies 2009-09-10 17:21:06 -04:00
Zack Rusin
57d0934bc5 st/xorg: unite finalization and stub out pipelined copies 2009-09-10 17:21:06 -04:00
Zack Rusin
974dec2e7b st/xorg: abstract flushing and syncing for the exa code 2009-09-10 17:21:06 -04:00
Zack Rusin
16886c8be3 st/xorg: disable solid fills until copies are accelerated as well 2009-09-10 17:21:06 -04:00
Zack Rusin
6be1a98ab9 st/xorg: implement exasolids with full pipelining
plus fix some small issues with the shaders
2009-09-10 17:21:06 -04:00
Zack Rusin
3167c2e8a0 st/xorg: start adding support for surface fills 2009-09-10 17:21:06 -04:00
Marcin Kościelnicki
18882f4d30 nv50: Fix tiling mode for lower mipmap levels. 2009-09-10 21:06:48 +02:00
Eric Anholt
36dd53a3cd intel: Don't forget to map the depth read buffer in spans.
This broke BlitFramebufferEXT(GL_DEPTH_BUFFER_BIT).
2009-09-10 11:16:18 -07:00
Alex Deucher
e669dc2b0d r300: enable rb3d_discard_src_pixel_lte_threshold for more chips on dri2 2009-09-10 12:04:38 -04:00
Alex Deucher
7dfe54a60e r300: add full support for two sided stencil on r5xx for dri2 2009-09-10 12:01:19 -04:00
Mathias Frohlich
f89751e719 mesa: fix cut&paste typos 2009-09-10 08:50:16 -06:00
Vinson Lee
c7291f69a0 util: Add PIPE_OS_APPLE back to auxiliary/util/u_time.h.
Fixes typo from commit c6c44bf481.
2009-09-10 15:33:57 +01:00
José Fonseca
6a405b4a21 llvmpipe: Fix alpha test. 2009-09-10 13:35:39 +01:00
José Fonseca
4c3a48ad0c llvmpipe: Mask out color channels not present in the color buffer. 2009-09-10 12:37:44 +01:00
José Fonseca
48f19c0bcd llvmpipe: Fix sampling from depth textures. Respect texture compare func.
Fixes Mesa shadowtex sample.
2009-09-10 12:14:53 +01:00
José Fonseca
c3c80c5c22 llvmpipe: Skip blending when mask is zero.
This increases quake3 timedemo fps another 10%.
2009-09-10 12:01:42 +01:00
José Fonseca
8e6b925d2a llvmpipe: Proper control flow builders.
New control flow helper functions which keep track of all variables
and generate the correct Phi functions.

This re-enables skipping the fs execution of quads masked out by
the rasterizer, early z testing, and kill opcode.

This yields a performance improvement of around 20%.
2009-09-10 11:44:03 +01:00
José Fonseca
bd3b59da63 llvmpipe: Copy the texture target into the sampler static state.
Hunk forgotten in previous commit.
2009-09-10 09:19:51 +01:00
José Fonseca
4139bc8f43 llvmpipe: Quick hack for 1D textures. 2009-09-09 21:48:50 +01:00
José Fonseca
b0b131b023 scons: Pass -mstackrealign option to gcc.
It is impossible to have gcc generate SSE code without it, as thirdparty
applications often call us with an unaligned stack pointer.
2009-09-09 21:48:50 +01:00
José Fonseca
abc160b664 llvmpipe: Fix depth mask computation.
Fixes depth test for 24bit depth formats.
2009-09-09 21:48:50 +01:00
José Fonseca
cdbbcdf3bd llvmpipe: Include zsbuf's format in the fragment shader key. 2009-09-09 21:48:50 +01:00
José Fonseca
da912a7a16 util: Fix depth/stencil format description.
Inverse channel order.
2009-09-09 21:48:49 +01:00
José Fonseca
01c831576e llvmpipe: Debug function to check stack alignment.
Doing alignment check in locus is redundant, as gcc alignment assumptions
will optimize away the check.
2009-09-09 21:48:49 +01:00
Eric Anholt
5604b27b93 i965: Fix relocation delta for WM surfaces.
This was a regression in 0f328c90db.

Bug #23688
Bug #23254
2009-09-09 12:52:52 -07:00
Brian Paul
4d85a6b393 i965: fix an overlooked merge conflict 2009-09-09 09:24:38 -06:00
Alex Deucher
49c230709c r600: check if textures are actually enabled before submission
noticed by taiu on IRC.
2009-09-09 11:17:24 -04:00
Brian Paul
7bf6347362 Merge branch 'mesa_7_6_branch' 2009-09-09 09:00:58 -06:00
Brian Paul
94a8157ef6 mesa: regenerate get.c form get_gen.py 2009-09-09 08:55:32 -06:00
Brian Paul
3fed69eb16 mesa: move call to init_c_cliptest() from enable.c to tnl module.
Fixed gallium build breakage.
2009-09-09 08:54:38 -06:00
Alex Deucher
da9ed257a3 r600: fix ftp for dri1
We use t->bo for dri1 since r600 uses CS for dri1.
2009-09-09 01:43:17 -04:00
Zhenyu Wang
ca246dd186 intel: add B43 chipset support
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-09-09 13:28:59 +08:00
Dave Airlie
5aaa45de4c r600: don't setup hardware state if TFP
if we have a BO here it means TFP and we should have set it
up already.

tested by b0le on #radeon
2009-09-09 15:02:16 +10:00
Brian Paul
8947cf6728 progs/tests: added Z invert option 2009-09-08 16:47:30 -06:00
Brian Paul
f78eafcacb mesa: bump version to 7.7 2009-09-08 16:46:06 -06:00
Brian Paul
97cbaab541 gallium: added r8g8b8_get/put_tile_rgba() 2009-09-08 16:45:34 -06:00
Brian Paul
079ae4c38c progs/demos: added RGB invert option 2009-09-08 16:45:07 -06:00
Brian Paul
126696caf7 mesa: fix viewport_z_clip breakage 2009-09-08 16:44:49 -06:00
Jakob Bornecrantz
e589a37f7b i915g: Add buffer write callback 2009-09-09 00:43:36 +01:00
Jakob Bornecrantz
d112132840 i915g: Reorg vbuf code a bit 2009-09-09 00:43:36 +01:00
Jakob Bornecrantz
547b726484 i915g: pwrite batchbuffer instead of map 2009-09-09 00:43:36 +01:00
Jakob Bornecrantz
d585616f5b i915g: Keep vertex buffers in a fifo 2009-09-09 00:43:35 +01:00
Jakob Bornecrantz
6e61d06209 util: Add super simple fifo 2009-09-09 00:43:35 +01:00
Jakob Bornecrantz
3833587818 i915g: Map vertex buffers via gtt 2009-09-09 00:43:35 +01:00
Jakob Bornecrantz
530fbd314e i915g: Remove lib prefix from driver 2009-09-09 00:43:35 +01:00
Eric Anholt
9fff4b46d3 docs: Add basic 7.7 relnotes. 2009-09-08 15:12:22 -07:00
Eric Anholt
f959ccdfa6 intel: Add support for ARB_draw_elements_base_vertex.
On the 965, we just drop the value into the primitive packet.  On non-945,
we rely on the sw tnl code handling it.
2009-09-08 15:12:22 -07:00
Eric Anholt
92d7ed8a20 mesa: Add support for ARB_draw_elements_base_vertex. 2009-09-08 15:12:20 -07:00
Eric Anholt
ec9e729580 glapi: Add ARB_draw_elements_base_vertex 2009-09-08 14:48:47 -07:00
Eric Anholt
b11a8ea863 mesa: Expose NV_depth_clamp if ARB_depth_clamp is supported.
The wording of these two is exactly the same, except for the issue
"Can fragments with wc<=0 be generated when this extension is supported?",
which idr thinks is a non-issue for us.
2009-09-08 14:30:18 -07:00
Eric Anholt
0310aafd9e i965: Add support for ARB_depth_clamp. 2009-09-08 14:30:18 -07:00
Eric Anholt
0e5c2598ec Regenerate files for GL_ARB_depth_clamp. 2009-09-08 14:30:18 -07:00
Eric Anholt
b4922b5331 mesa: Add support for ARB_depth_clamp.
This currently doesn't include fixing up the cliptests in the assembly
paths to support ARB_depth_clamp, so enabling depth_clamp forces the C path.
2009-09-08 14:30:15 -07:00
Eric Anholt
3e4539a471 i965: Respect spec requirement for pixel shader computed depth with no zbuffer. 2009-09-08 14:28:23 -07:00
Eric Anholt
15c0cc5cf4 i965: Set NULL WM surfaces as tiled according to requirement by specs. 2009-09-08 14:28:23 -07:00
Eric Anholt
ea6dab2537 i965: Use the renderbuffer surface size instead of region size for WM surfaces.
For drawing to lower mipmap levels, the region size makes the renderbuffer
be the size of the lowest level, instead of the current level.  On DRI1,
Brian previously found that the RB size was incorrect, so leave this broken
there.
2009-09-08 14:28:23 -07:00
Eric Anholt
58a57e3fc4 Revert "intel: helper to debug bufmgr (disabled)"
This reverts commit e0ec405a9f.

This is already available in INTEL_DEBUG=bufmgr in the environment.
2009-09-08 14:28:23 -07:00
Brian Paul
b2de028523 i965: #include clean-ups 2009-09-08 14:33:47 -06:00
Brian Paul
e61215242b intel: #include clean-ups 2009-09-08 14:33:47 -06:00
Brian Paul
8e8d3470be i965: use _mesa_is_bufferobj()
Also, remove unneeded call to _mesa_validate_pbo_access().  It's done by
core Mesa as the comment suggested.
2009-09-08 14:33:47 -06:00
Brian Paul
ced699b37a i965: use _mesa_is_bufferobj() 2009-09-08 14:33:47 -06:00
Brian Paul
abdf2e14bc i965: use _mesa_is_bufferobj() 2009-09-08 14:33:47 -06:00
Brian Paul
00aac1d29a i965: use _mesa_is_bufferobj() 2009-09-08 14:33:47 -06:00
Alex Deucher
e6ad286a80 r600: fix dri2 clipping 2009-09-08 16:03:25 -04:00
Michel Dänzer
e34ea368d9 st/xorg: Add support for EXA_MIXED_PIXMAPS and EXA_SUPPORTS_PREPARE_AUX.
Also make sure not to leak malloced memory when switching pixmaps to texture
based.
2009-09-08 18:08:24 +02:00
Vinson Lee
2c307c7750 scons: Add Mac OS to target platform list. 2009-09-08 12:32:37 +01:00
Michal Krol
fcb94f6e3e gdi: Fix prototype of gdi_softpipe_surface_buffer_create(). 2009-09-08 10:22:07 +02:00
Vinson Lee
79f48c9f9e scons: Don't set LLVM_VERSION if one of the llvm-config calls fails.
Ubuntu 8.10 has llvm-config version 2.2, which doesn't have
nativecodegen. This triggers an exception.
2009-09-07 15:16:25 +01:00
José Fonseca
b481fb2c6d llvmpipe: Silent debug statement. 2009-09-07 15:02:08 +01:00
José Fonseca
1127201088 llvmpipe: Better abs for floating points. 2009-09-07 15:02:08 +01:00
José Fonseca
e4c76c02f7 llvmpipe: Code generate the texture sampling inside the shader.
Finally a substantial performance improvement: framerates of apps using
texturing tripled, and furthermore, enabling/disabling texturing only
affects around 15% of the framerate, which means the bottleneck is now
somewhere else.

Generated texture sampling code is not complete though -- we always
sample from the base level -- so final figures will be different.
2009-09-07 15:02:08 +01:00
José Fonseca
de8376e2f2 llvmpipe: Texture sampling code generation primitives.
Only supports single level 2d textures, with neareast and bilinear
filtering for now.
2009-09-07 15:02:07 +01:00
José Fonseca
0c2ea24338 llvmpipe: Convenience function to obtain the integer type with same bitdepth of an arbitrary type. 2009-09-07 15:02:07 +01:00
José Fonseca
fa0f4b35be llvmpipe: Utility functions for linear and bilinear interpolation. 2009-09-07 15:02:07 +01:00
José Fonseca
4da20234f3 llvmpipe: Correct implementation of floor. 2009-09-07 15:02:07 +01:00
José Fonseca
b1eff018c7 llvmpipe: Utility function to get the pointer to a structure member. 2009-09-07 15:02:07 +01:00
José Fonseca
866fbacf2b llvmpipe: SoA pixel unpacking specialization. 2009-09-07 15:02:06 +01:00
José Fonseca
6b129a8222 util: Utility function to check if a number is a power of two. 2009-09-07 15:02:06 +01:00
José Fonseca
8be72bb764 llvmpipe: Further abstract the texture sampling generation from TGSI translation. 2009-09-07 15:02:06 +01:00
Michal Krol
970823978c mesa: Include <unistd.h> only when one is available. 2009-09-07 09:31:17 +02:00
Michal Krol
826d441cdf mesa: Fix calling conventions of sync object api callbacks. 2009-09-07 09:16:35 +02:00
Michel Dänzer
617202b578 r300g: Fix some issues pointed out by compiler warnings. 2009-09-06 18:12:14 +02:00
Michel Dänzer
7b8ec0d8e7 r300g: Handle PIPE_BUFFER_USAGE_DONTBLOCK as intended.
Return NULL if the BO is busy, otherwise just map it.
2009-09-06 18:12:14 +02:00
Brian Paul
23663ae914 mesa: initial version of _mesa_meta_generate_mipmap()
Incomplete and totally untested.  Based on intel_generate_mipmap().
2009-09-06 09:39:50 -06:00
Brian Paul
4d63c626d0 xlib: test _mesa_meta_bitmap() 2009-09-06 09:37:30 -06:00
Brian Paul
886e7b318d mesa: use separate temp texture for bitmaps 2009-09-06 09:37:30 -06:00
Brian Paul
b2951ffe96 mesa: temp_texture changes 2009-09-06 09:37:30 -06:00
Brian Paul
f477fa7a85 mesa: free meta bitmap buffers 2009-09-06 09:37:29 -06:00
Brian Paul
0e5293a240 mesa: use _mesa_set_enable() 2009-09-06 09:37:29 -06:00
Brian Paul
bcb62ae78a mesa: _mesa_meta_bitmap() function 2009-09-06 09:37:29 -06:00
Brian Paul
4fdc96db1d xlib: move misplaced brace 2009-09-06 09:37:29 -06:00
Nicolai Hähnle
1ddb22675c r300g: Fix a number of warnings
Seriously guys....
2009-09-06 15:14:22 +02:00
Nicolai Hähnle
4b01e6f614 r300g: Debug flags infrastructure
So that debugging is no longer a full-spam-or-nothing approach, you are now
supposed to set the RADEON_DEBUG environment flag just like for classic Mesa.

The available debug flags are different, however. Just running an OpenGL
application with RADEON_DEBUG set to an arbitrary string will print out
helpful information.

Everything must be compiled with -DDEBUG for any of this to work
2009-09-06 15:03:52 +02:00
Nicolai Hähnle
f02f63997c Merge branch 'master' into r300-compiler
Conflicts:
	src/gallium/drivers/r300/r300_tgsi_to_rc.c
2009-09-06 13:15:04 +02:00
Nicolai Hähnle
e95e76e125 r300/compiler: New dataflow structures and passes
This replaces the old NQSSADCE code with the same functionality, but quite
different design. Instead of doing a single integerated pass, we now build
explicit data structures representing the dataflow.

This will enable analysis of flow control instruction, and could potentially
open an avenue for several dataflow based optimizations, such as peephole
optimization, fusing MUL+ADD to MAD, and so on.
2009-09-06 11:47:40 +02:00
Cooper Yuan
9778731732 r300g: update the value of register VAP_VF_MAX_VTX_INDX
according to actual vertex index count.
2009-09-05 20:58:32 +08:00
Cooper Yuan
80ea03bd17 r300g: update rs_block state after changing rasterizer 2009-09-05 14:26:39 +08:00
Cooper Yuan
8f990f928b r300g: need to validate scissor and viewport state if bind new rasterizer 2009-09-05 10:26:39 +08:00
Ian Romanick
d0adebb8d5 NV fp parser: Support instruction and TEMP / OUTPUT sizes
Adds support for declaring TEMP and OUTPUT variables as 'LONG' or
'SHORT' precision.  The precision specifiers are parsed, but they are
currently ignored.  Some support for this may be added in the future,
but neither Intel hardware nor, as far as I'm aware, Radeon hardware
support multiple precisions.

Also adds support for instruction precision ('X', 'H', and 'R')
suffixes and instruction condition code output ('C') suffix.  This
results in a fairly major change to the lexer.  Instructions are
matched with all the possible suffix strings.  The suffix string are
then carved off by a context (i.e., which program mode and options are
set) aware parser that converts the suffixes to bits in
prog_instruction.

This could have been handled in the same way _SAT was originally
handled in the lexer, but it would have resulted in a very large lexer
with lots of opportunity for cut-and-paste errors.
2009-09-04 17:31:05 -07:00
Ian Romanick
9ea4319744 ARB prog parser: Add new constructor for asm_instruction
The new constructor copies fields from the prog_instruction that the
parser expects the lexer to set.
2009-09-04 16:35:50 -07:00
Alex Deucher
9ab19a3900 r600: add support for EXT_texture_sRGB 2009-09-04 18:46:16 -04:00
Alex Deucher
60ca65c016 r300: Add support for GL_EXT_provoking_vertex 2009-09-04 18:46:15 -04:00
Alex Deucher
8fd7586bcc r600: Add support for GL_EXT_provoking_vertex 2009-09-04 18:46:15 -04:00
Eric Anholt
0612ad4f19 i965: Don't set the complete field when there is more VUE yet to come.
This should help with things like lightsmark, but I don't have a testcase
for this commit.
2009-09-04 14:20:09 -07:00
Eric Anholt
a47858e45e i965: Add support for 2 threads in the GS.
This brings noop vertex shader throughput from 6.8M verts/sec to 10.4M
verts/sec using GL_QUADs on my GM45.
2009-09-04 14:20:09 -07:00
Eric Anholt
8f7f22ca1d i965: Add support for KIL_NV in brw_wm_emit.c
I ran into this lack of support when writing a shader that always discarded
the fragments.
2009-09-04 14:20:08 -07:00
Ian Romanick
eeb1402c05 NV fp parser: Add support for absolute value operator on instruction operands 2009-09-03 14:32:48 -07:00
Ian Romanick
5db8ebb8f5 Enable GL_NV_fragment_program_option for software rendering
At this point the extension is not fully implemented.
2009-09-03 14:07:07 -07:00
Ian Romanick
b8e389bb03 NV fp parser: Support new scalar constant behavior
ARBfp requires scalar constants have a '.x' suffix, but NVfp_option
does not.  This shows up with instructions that require a scalar
parameter (e.g., COS).
2009-09-03 14:05:18 -07:00
Ian Romanick
8ca6fd8a83 NV fp parser: Parse TXD instruction 2009-09-01 14:16:03 -07:00
Ian Romanick
ede0cd4d8c NV fp lexer: Add new opcodes 2009-08-31 17:00:31 -07:00
Ian Romanick
dc8ec05ace NV fp: Parse 'OPTION NV_fragment_program' in ARB assembly shaders 2009-08-31 16:57:49 -07:00
Ian Romanick
efff7aa980 NV fp: Add tracking for NV_fragment_program_option 2009-08-31 16:43:39 -07:00
Nicolai Hähnle
d1b4351e60 r300: Remove all Mesa dependencies from the shader compiler
In particular, this removes the dependency on prog_instruction, which
unfortunately creates some code duplication, but also opens a path towards
adding some hardware-specific things in there.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-08-30 18:51:46 +02:00
Nicolai Hähnle
d6d71e5bf4 r300: Move Mesa -> RC program conversion to classic Mesa driver
This really doesn't belong into the compiler itself, since the compiler
should eventually be independent of Mesa's program representation.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-08-30 17:57:20 +02:00
Keith Whitwell
67d4a5b15c mesa/swrast: use one fewer divide in swrast's choose_cube_face also
Same change as for softpipe
2009-08-24 08:26:33 +01:00
Keith Whitwell
fd19e8adcd softpipe: use one fewer divide in sample_cube
GCC won't do this for us.  Makes a bigger difference to cubemap fps
than previous set of compilcated rearrangements.
2009-08-24 08:26:33 +01:00
Keith Whitwell
60adc15ba5 softpipe: separate out 2d and cube img filter functions 2009-08-24 08:26:32 +01:00
Keith Whitwell
81601d85ef softpipe: make the various get_texel routines more similar
Remove arguments, return const float * by default.  Add specialized 3d
versions and remove 3d texture support from the others.
2009-08-24 08:26:17 +01:00
Keith Whitwell
75312b6555 progs/demos: add fps output to cubemap 2009-08-23 23:53:41 +01:00
Keith Whitwell
153e474d22 softpipe: lift tex_address construction up to img_filter
For fastpaths at least, can avoid recalculating this sometimes.
2009-08-23 13:38:10 +01:00
Keith Whitwell
4fe0fc3eba softpipe: remove old prim_setup draw stage
Everything now goes through the draw_vbuf handler, the same as
regular drivers.
2009-08-23 11:22:41 +01:00
Keith Whitwell
47800c572f softpipe: add missing header 2009-08-23 11:13:20 +01:00
Keith Whitwell
7670102468 Merge branch 'tex-tilecache' into softpipe-opt
Conflicts:
	src/gallium/drivers/softpipe/sp_state_derived.c
	src/gallium/drivers/softpipe/sp_state_sampler.c
	src/gallium/drivers/softpipe/sp_tex_sample.c
	src/gallium/drivers/softpipe/sp_tex_sample.h
	src/gallium/drivers/softpipe/sp_tile_cache.c
2009-08-23 10:23:46 +01:00
Brian Paul
0f24886f92 softpipe: remove duplicate #include, move another 2009-08-21 14:07:37 -06:00
Brian Paul
d204659c8c softpipe: remove tex sample dependencies on softpipe
The texture sampling code doesn't really have any dependencies on the
rest of softpipe, just the tile cache.
2009-08-21 14:04:51 -06:00
Brian Paul
3adc8c3779 softpipe: minor code refactoring to remove softpipe/tile cache dependencies
The tile cache code now has no hard dependencies on softpipe.
2009-08-21 14:01:58 -06:00
Brian Paul
4256c5829f softpipe: remove unused #includes, white-space clean-up 2009-08-21 13:47:50 -06:00
Brian Paul
46fbc87288 softpipe: remove unneeded const qualifier 2009-08-21 13:45:16 -06:00
Brian Paul
a29447c33d softpipe: per-unit sampler varients
Can't share sampler varients across multiple tex units because the texture
pointer is in the sampler varient.  That prevents different textures per unit.

Fixes progs/demos/multiarb, progs/glsl/samplers, etc.
2009-08-21 12:44:04 -06:00
Brian Paul
87ec83afd5 softpipe: add missing PIPE_TEXTURE_CUBE case in get_lambda_func()
Fixes progs/demos/cubemap
2009-08-21 11:47:31 -06:00
Keith Whitwell
ecfa8be150 softpipe: add missing sp_sampler_varient_destroy 2009-08-21 18:44:56 +01:00
Brian Paul
cf102b031e softpipe: remove redundant comparison, make test easier to understand 2009-08-21 11:43:48 -06:00
Brian Paul
41483627f0 softpipe: fix min/mag filter typo 2009-08-21 11:41:29 -06:00
Brian Paul
4e5c385d21 softpipe: fix s/t/p typos 2009-08-21 11:40:33 -06:00
Keith Whitwell
4fc7d0345a softpipe: rework texture sampling code
Split into component pieces, stitch together at runtime using function
pointers.  Make it possible to utilize the existing fastpaths as image-level
filters for generic mip-filtering routines.

Remove special case for rectangle filtering, as it can now be handled by
the 2d path.

As most of the mesa demo texturing was already covered by fast paths, its
harder to find examples of speedups, but tunnel gets a boost as mip-nearest
filtering is now able to access the img_2d_linear_wrap_POT functions
for sampling within a mipmap level.
2009-08-21 18:14:19 +01:00
Keith Whitwell
b1cc196e6d util: add util_is_power_of_two function 2009-08-21 18:07:35 +01:00
Keith Whitwell
00c8359182 softpipe: allow the existing sampler routines to be hooked up directly
Let eg. sp_get_samples_rect be hooked directly in as the tgsi sampler
routine.

Add a field to determine whether this is a vertex or fragment sampling
call, and massage parameters to match the tgsi call.
2009-08-20 18:36:57 +01:00
Keith Whitwell
0d9979d9ec softpipe: fix xpot calculation typo in sp_get_samples_2d_nearest_clamp_POT 2009-08-20 18:13:25 +01:00
Keith Whitwell
1fd40e506c softpipe: slightly optimized tiling calculation 2009-08-20 18:12:44 +01:00
Keith Whitwell
79a7ddb57a softpipe: fix glitch in texel lookups on fastpaths
Fixes two issues - firstly for mipmap levels with one or more
dimensions smaller than tilesize, the code was sampling off the edge
of the texture (but still within the tile).

Secondly, in the linear_mipmap_linear case, both the default code and
new fastpath were incorrect.  This change fixes the fastpath and adds
a comment to the default path, which still needs to be fixed.
Basically the issue is that the coordinates in the smaller texture
level are/were being computed by just dividing thecoordinates from the
larger texture level by two, as in:

               x0[j] /= 2;
               y0[j] /= 2;
               x1[j] /= 2;
               y1[j] /= 2;

The issues with this are signficant.  Initially x1 is most often equal
to x0+1, but after this, it will likely be equal to x0, so we will not
actually be performing the linear blend within the smaller mipmap.

The fastpath code avoided this (recalculated x1), but was still using
the weighting factors from the larger mipmap level (xw, yw), which
were incorrect.

Change the fastpath code to do two full, independent linear samples of
the two mipmap levels before blending.  The default code needs to do
the same thing.
2009-08-20 17:59:39 +01:00
Keith Whitwell
4f409da345 softpipe: optimized path for simple mipmap sampling
linear-mip-linear-repeat-POT sampling faspath, provides a very nice
speedup to apps that do this common type of texturing.

Test case: demos/terrain, turn fog off, turn texturing on.
Without patch: 12 fps
With patch: 20 fps.
2009-08-20 11:25:20 +01:00
Keith Whitwell
c84abe36a9 softpipe: fix typo in clear_tile 2009-08-18 16:55:10 +01:00
Keith Whitwell
80c78472ad softpipe: split texture and surface tile caches
These do similar jobs but with largely disjoint code.  Will want
to evolve them separately going forward.
2009-08-18 16:55:10 +01:00
Keith Whitwell
d12bae9368 softpipe: move flatshade-first check out of loop 2009-08-18 16:21:12 +01:00
Keith Whitwell
99ec78d946 Revert "softpipe: rearrange blend fastpaths"
This reverts commit 1295cf423e.

The original formulation was easier to understand & work with.  Will
revisit this later.
2009-08-11 18:23:28 +01:00
Keith Whitwell
da319095f2 softpipe: reduce textual differences between exec and sse shader paths
Unshare one function (setup_pos_vector) as we want to push this code
into the generated shader in the SSE case.
2009-08-11 18:06:16 +01:00
Keith Whitwell
b5c389721a softpipe: remove gallivm fragment shaders
However we do llvm integration, it will be different & more comprehensive
than this.
2009-08-11 18:03:01 +01:00
Keith Whitwell
95f7ed4638 softpipe: setup quad outputs from with fs->run 2009-07-30 11:59:32 +01:00
Keith Whitwell
1295cf423e softpipe: rearrange blend fastpaths 2009-07-30 11:35:50 +01:00
Keith Whitwell
73a6178a73 softpipe: add depth-lequal z16 path 2009-07-30 11:35:08 +01:00
Keith Whitwell
572c2fb5bb softpipe: remove unused variable in shade_quad 2009-07-30 11:34:36 +01:00
Keith Whitwell
5fdac2dcea softpipe: fix off-by-one in nearest texcoord routines
Stray '- 0.5' copied from linear versions.
2009-07-27 15:51:15 +01:00
Keith Whitwell
6142de393f softpipe: example fast paths for simple samplers
All these fastpaths are examples of the types of things we'd code-generate
in a more sophisticated version of softpipe.
2009-07-27 12:44:58 +01:00
Keith Whitwell
c611458205 softpipe: fastpath for interpolated z16 less depthtesting
Because this is interpolated (ie. early) depth, we can build in an
assumption about the quads emitted by triangle setup, ie that they
are actually linear spans.  Interpolate z over those spans in z16
format to save on math & conversion.
2009-07-27 12:11:16 +01:00
Keith Whitwell
1078844d18 softpipe: cope with nr_cbufs == 0
Disable blend code when no color buffer
2009-07-27 11:23:51 +01:00
Keith Whitwell
bac8e34c9e softpipe: move all depth/stencil/alpha pixel processing into one stage 2009-07-27 08:17:45 +01:00
Keith Whitwell
85613cc4f1 softpipe: fix error in scissor state dependencies 2009-07-25 11:01:48 +01:00
Keith Whitwell
ade8984f50 softpipe: cleanup framebuffer state routine slightly 2009-07-25 10:01:06 +01:00
Keith Whitwell
a2f7ab1d15 softpipe: move all color-combine code into sp_quad_blend.c
Consolidate the read-modify-write color combining code from
the blend, colormask and output stages.
2009-07-24 20:19:18 +01:00
Keith Whitwell
42f1757189 softpipe: fix typo 2009-07-24 20:18:52 +01:00
Keith Whitwell
333ec94380 softpipe: example fastpaths in blending 2009-07-24 18:46:17 +01:00
Keith Whitwell
a1dbd7aa15 softpipe: actually pass >1 quad from triangle routine
First attempt
2009-07-24 18:17:05 +01:00
Keith Whitwell
ab9fb51670 softpipe: expand quad pipeline to process >1 quad at a time
This is part one -- we still only pass a single quad down, but
the code can now cope with more.  The quads must all be from the same
tile.
2009-07-24 16:49:35 +01:00
Keith Whitwell
6153a1c28f softpipe: rip out old mulithread support 2009-07-24 16:12:48 +01:00
Keith Whitwell
93a026d4ba softpipe: avoid flushing depth buffer cache on swapbuffers
There's no need to push out depth buffer contents on swapbuffers.

Note that this change doesn't throw away depth buffer changes, it simply
holds them in the cache over calls to swapbuffers.  The hope is
that swapbuffers will be followed by a clear() which means in that case
we won't have to write the changes out.
2009-07-23 11:14:39 +01:00
Keith Whitwell
19097907ef softpipe: also shortcircuit non-texture tile lookups 2009-07-23 09:35:33 +01:00
Keith Whitwell
f911c3b989 softpipe: shortcircuit repeated lookups of the same tile
The sp_tile_cache is often called repeatedly to look up the same
tile.  Add a cache (to the cache) of the single tile most recently
retreived and make a quick inline check to see if this matches the
subsequent request.

Add a tile_address bitfield struct to make this check easier.
2009-07-22 15:08:42 +01:00
Keith Whitwell
13e2d35764 softpipe: remove unused vars in sp_setup.c 2009-07-22 12:48:01 +01:00
Keith Whitwell
0ed99f4552 softpipe: use bitwise logic to setup quad masks in sp_setup 2009-07-22 12:48:00 +01:00
Keith Whitwell
73e7356385 softpipe: simplify flush_spans
No loss of performance, but simpler code.
2009-07-22 12:48:00 +01:00
Keith Whitwell
b5d583efef softpipe: make some small steps to flush texture cache less frequently
No performance gain yet, but the code is a bit cleaner.
2009-07-22 12:48:00 +01:00
Keith Whitwell
07bb026900 gallium/xlib: use XSHM for swapbuffers
Makes some difference, but suprisingly little.  Barely worth the effort.
2009-07-22 12:47:59 +01:00
Keith Whitwell
0ac879dca7 util: _debug_printf should print even when DEBUG is not defined
The leading underscore is meaningful...  This function is used by
_warning and _error functions as well as the more common
debug_printf().

debug_printf (without underscore) gets turned off when DEBUG is
disabled, but warning/error messages still use this function to get
their message out.
2009-07-22 12:47:59 +01:00
Keith Whitwell
aa5db68438 softpipe: remove backwards dependency from tilecache to softpipe
The tile cache is a utility, it shouldn't know anything about the
entity which is making use of it (ie softpipe).

Remove softpipe parameter to all the tilecache function calls, and
also remove the need to keep a softpipe pointer in the sampler structs.
2009-07-22 12:47:59 +01:00
Jakob Bornecrantz
5e6fff7ac4 svga: Do the gallium intel configure trick for svga as well
Since the drivers we produce on systems where we use
configure depend on none stable kernel API the driver
deliverables should not be built by default in the
mesa 7.7 release.

People wishing to shoot them self in the foot have to
pull the trigger themself, we just hand them the gun.
2009-07-19 09:29:14 +02:00
Ian Romanick
bf75ee9ccc mesa: set version string to 7.7-rc3 2009-12-16 09:15:09 -08:00
Ian Romanick
006a526edb Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	src/mesa/drivers/dri/unichrome/via_ioctl.c
	src/mesa/drivers/dri/unichrome/via_screen.c
	src/mesa/main/version.h
	src/mesa/state_tracker/st_atom.c
2009-12-16 09:09:51 -08:00
Ian Romanick
42d9409873 mesa: set version string to 7.6.1-rc4 2009-12-16 09:01:58 -08:00
Ian Romanick
11522b74b3 Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Conflicts:
	src/gallium/drivers/softpipe/sp_quad_blend.c
2009-12-15 12:38:01 -08:00
Ian Romanick
b90f7f3ad3 i965: Use current draw buffer instead of drawable visual to get alpha bits
Use the currently bound draw buffer instead of the visual from the
drawable used to create the context.  This cause problems generating
mipmaps for an RGBA texture in an RGB context.

This fixes the failure in piglit's glsl-lod-bias test reported in bug #25614.
2009-12-14 16:30:53 -08:00
Jakob Bornecrantz
f4de0b176d vmwgfx: Update vmwgfx_drm.h to the on upstream 2009-12-14 22:27:08 +01:00
Jakob Bornecrantz
fb06d8f097 vmware/xorg: Use new stream ioctl 2009-12-14 22:12:20 +01:00
Brian Paul
69346c56a1 mesa/meta: move BindTexture() call in _mesa_meta_GenerateMipmap()
This is a follow-up to commit e3fa700c17.

The call to _mesa_BindTexture() must be before we set any other texture
object state, namely the _mesa_TexParameteri() calls.

This fixes bug 25601 (piglit gen-nonzero-unit failure).
2009-12-14 13:39:21 -07:00
Jakob Bornecrantz
48888b918b vmware/xorg: Fix failure paths and add some debug printing 2009-12-12 20:02:34 +01:00
Jakob Bornecrantz
49e4b624e5 vmwgfx/core: Check for 3D via the get param ioctl 2009-12-12 18:37:16 +01:00
Maciej Cencora
8413a3aefa radeon: fix #25463
This is just a workaroung until we properly fix texture mapping in radeonSpanRenderStart
2009-12-12 02:02:53 +01:00
Maciej Cencora
f1900323ea r300: fix depth textures 2009-12-11 23:56:47 +01:00
1794 changed files with 889349 additions and 202411 deletions

16792
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -182,7 +182,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.6.1
VERSION=7.7.1-devel
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
@@ -415,6 +415,12 @@ DEMO_FILES = \
$(DIRECTORY)/progs/demos/README \
$(DIRECTORY)/progs/fbdev/Makefile \
$(DIRECTORY)/progs/fbdev/glfbdevtest.c \
$(DIRECTORY)/progs/objviewer/*.[ch] \
$(DIRECTORY)/progs/objviewer/*.obj \
$(DIRECTORY)/progs/objviewer/*.mtl \
$(DIRECTORY)/progs/objviewer/*.rgb \
$(DIRECTORY)/progs/objviewer/Makefile \
$(DIRECTORY)/progs/objviewer/README.txt \
$(DIRECTORY)/progs/osdemos/Makefile \
$(DIRECTORY)/progs/osdemos/*.c \
$(DIRECTORY)/progs/xdemos/Makefile* \
@@ -496,9 +502,11 @@ rm_depend:
touch $$dep ; \
done
lib_gz:
rm -f configs/current ; \
rm -f configs/autoconf ; \
rm_config:
rm -f configs/current
rm -f configs/autoconf
lib_gz: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
@@ -516,9 +524,7 @@ glut_gz:
gzip $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
lib_bz2:
rm -f configs/current ; \
rm -f configs/autoconf ; \
lib_bz2: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
bzip2 $(LIB_NAME).tar ; \
@@ -536,9 +542,7 @@ glut_bz2:
bzip2 $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
lib_zip:
rm -f configs/current ; \
rm -f configs/autoconf ; \
lib_zip: rm_config
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
@@ -567,5 +571,7 @@ md5:
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend lib_gz demo_gz glut_gz lib_bz2 demo_bz2 \
glut_bz2 lib_zip demo_zip glut_zip md5
.PHONY: tarballs rm_depend rm_config md5 \
lib_gz demo_gz glut_gz \
lib_bz2 demo_bz2 glut_bz2 \
lib_zip demo_zip glut_zip

View File

@@ -32,10 +32,10 @@ import common
default_statetrackers = 'mesa'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
default_drivers = 'softpipe,failover,i915simple,trace,identity,llvmpipe'
default_drivers = 'softpipe,failover,svga,i915,trace,identity,llvmpipe'
default_winsys = 'xlib'
elif common.default_platform in ('winddk',):
default_drivers = 'softpipe,i915simple,trace,identity'
default_drivers = 'softpipe,svga,i915,trace,identity'
default_winsys = 'all'
else:
default_drivers = 'all'
@@ -46,9 +46,9 @@ common.AddOptions(opts)
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python', 'xorg']))
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
['softpipe', 'failover', 'i915simple', 'i965simple', 'cell', 'trace', 'r300', 'identity', 'llvmpipe']))
['softpipe', 'failover', 'svga', 'i915', 'cell', 'trace', 'r300', 'identity', 'llvmpipe']))
opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
['xlib', 'intel', 'gdi', 'radeon']))
['xlib', 'vmware', 'intel', 'gdi', 'radeon']))
opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
@@ -110,6 +110,8 @@ if platform in ('posix', 'linux', 'freebsd', 'darwin'):
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if platform == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(CPPPATH = ['/usr/X11R6/include'])
env.Append(LIBPATH = ['/usr/X11R6/lib'])
env.Append(LIBS = [

View File

@@ -724,22 +724,10 @@ case $ARCH in
# examine first object to determine ABI
set ${OBJECTS}
ABI_PPC=`file $1 | grep ' ppc'`
ABI_I386=`file $1 | grep ' i386'`
ABI_PPC64=`file $1 | grep ' ppc64'`
ABI_X86_64=`file $1 | grep ' x86_64'`
if [ "${ABI_PPC}" ] ; then
OPTS="${OPTS} -arch ppc"
fi
if [ "${ABI_I386}" ] ; then
OPTS="${OPTS} -arch i386"
fi
if [ "${ABI_PPC64}" ] ; then
OPTS="${OPTS} -arch ppc64"
fi
if [ "${ABI_X86_64}" ] ; then
OPTS="${OPTS} -arch x86_64"
fi
ABIS=`lipo -info $1 | sed s/.*://`
for ABI in $ABIS; do
OPTS="${OPTS} -arch ${ABI}"
done
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}

View File

@@ -1,309 +0,0 @@
#!/usr/bin/env python
##########################################################################
#
# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sub license, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice (including the
# next paragraph) shall be included in all copies or substantial portions
# of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
##########################################################################
import sys
import optparse
import re
import struct
from gprof2dot import Call, Function, Profile
from gprof2dot import CALLS, SAMPLES, TIME, TIME_RATIO, TOTAL_TIME, TOTAL_TIME_RATIO
from gprof2dot import DotWriter, TEMPERATURE_COLORMAP
__version__ = '0.1'
class ParseError(Exception):
pass
class MsvcDemangler:
# http://www.kegel.com/mangle.html
def __init__(self, symbol):
self._symbol = symbol
self._pos = 0
def lookahead(self):
return self._symbol[self._pos]
def consume(self):
ret = self.lookahead()
self._pos += 1
return ret
def match(self, c):
if self.lookahead() != c:
raise ParseError
self.consume()
def parse(self):
self.match('?')
name = self.parse_name()
qualifications = self.parse_qualifications()
return '::'.join(qualifications + [name])
def parse_name(self):
if self.lookahead() == '?':
return self.consume() + self.consume()
else:
name = self.parse_id()
self.match('@')
return name
def parse_qualifications(self):
qualifications = []
while self.lookahead() != '@':
name = self.parse_id()
qualifications.append(name)
self.match('@')
return qualifications
def parse_id(self):
s = ''
while True:
c = self.lookahead()
if c.isalnum() or c in '_':
s += c
self.consume()
else:
break
return s
def demangle(name):
if name.startswith('_'):
name = name[1:]
idx = name.rfind('@')
if idx != -1 and name[idx+1:].isdigit():
name = name[:idx]
return name
if name.startswith('?'):
demangler = MsvcDemangler(name)
return demangler.parse()
return name
class Reader:
def __init__(self):
self.symbols = []
self.symbol_cache = {}
self.base_addr = None
def read_map(self, mapfile):
# See http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
last_addr = 0
last_name = 0
for line in file(mapfile, "rt"):
fields = line.split()
try:
section_offset, name, addr, type, lib_object = fields
except ValueError:
continue
if type != 'f':
continue
section, offset = section_offset.split(':')
addr = int(offset, 16)
self.symbols.append((addr, name))
last_addr = addr
last_name = name
# sort symbols
self.symbols.sort(key = lambda (addr, name): addr)
def lookup_addr(self, addr):
try:
return self.symbol_cache[addr]
except KeyError:
pass
tolerance = 4196
s, e = 0, len(self.symbols)
while s != e:
i = (s + e)//2
start_addr, name = self.symbols[i]
try:
end_addr, next_name = self.symbols[i + 1]
except IndexError:
end_addr = start_addr + tolerance
if addr < start_addr:
e = i
continue
if addr == end_addr:
return next_name, addr - start_addr
if addr > end_addr:
s = i
continue
return name, addr - start_addr
raise ValueError
def lookup_symbol(self, name):
for symbol_addr, symbol_name in self.symbols:
if name == symbol_name:
return symbol_addr
return 0
def read_data(self, data):
profile = Profile()
fp = file(data, "rb")
entry_format = "IIII"
entry_size = struct.calcsize(entry_format)
caller = None
caller_stack = []
while True:
entry = fp.read(entry_size)
if len(entry) < entry_size:
break
caller_addr, callee_addr, samples_lo, samples_hi = struct.unpack(entry_format, entry)
if caller_addr == 0 and callee_addr == 0:
continue
if self.base_addr is None:
ref_addr = self.lookup_symbol('___debug_profile_reference@0')
if ref_addr:
self.base_addr = (caller_addr - ref_addr) & ~(options.align - 1)
else:
self.base_addr = 0
sys.stderr.write('Base addr: %08x\n' % self.base_addr)
samples = (samples_hi << 32) | samples_lo
try:
caller_raddr = caller_addr - self.base_addr
caller_sym, caller_ofs = self.lookup_addr(caller_raddr)
try:
caller = profile.functions[caller_sym]
except KeyError:
caller_name = demangle(caller_sym)
caller = Function(caller_sym, caller_name)
profile.add_function(caller)
caller[CALLS] = 0
caller[SAMPLES] = 0
except ValueError:
caller = None
if not callee_addr:
if caller:
caller[SAMPLES] += samples
else:
callee_raddr = callee_addr - self.base_addr
callee_sym, callee_ofs = self.lookup_addr(callee_raddr)
try:
callee = profile.functions[callee_sym]
except KeyError:
callee_name = demangle(callee_sym)
callee = Function(callee_sym, callee_name)
profile.add_function(callee)
callee[CALLS] = samples
callee[SAMPLES] = 0
else:
callee[CALLS] += samples
if caller is not None:
try:
call = caller.calls[callee.id]
except KeyError:
call = Call(callee.id)
call[CALLS] = samples
caller.add_call(call)
else:
call[CALLS] += samples
if options.verbose:
if not callee_addr:
sys.stderr.write('%s+%u: %u\n' % (caller_sym, caller_ofs, samples))
else:
sys.stderr.write('%s+%u -> %s+%u: %u\n' % (caller_sym, caller_ofs, callee_sym, callee_ofs, samples))
# compute derived data
profile.validate()
profile.find_cycles()
profile.aggregate(SAMPLES)
profile.ratio(TIME_RATIO, SAMPLES)
profile.call_ratios(CALLS)
profile.integrate(TOTAL_TIME_RATIO, TIME_RATIO)
return profile
def main():
parser = optparse.OptionParser(
usage="\n\t%prog [options] [file] ...",
version="%%prog %s" % __version__)
parser.add_option(
'-a', '--align', metavar='NUMBER',
type="int", dest="align", default=16,
help="section alignment")
parser.add_option(
'-m', '--map', metavar='FILE',
type="string", dest="map",
help="map file")
parser.add_option(
'-b', '--base', metavar='FILE',
type="string", dest="base",
help="base addr")
parser.add_option(
'-n', '--node-thres', metavar='PERCENTAGE',
type="float", dest="node_thres", default=0.5,
help="eliminate nodes below this threshold [default: %default]")
parser.add_option(
'-e', '--edge-thres', metavar='PERCENTAGE',
type="float", dest="edge_thres", default=0.1,
help="eliminate edges below this threshold [default: %default]")
parser.add_option(
'-v', '--verbose',
action="count",
dest="verbose", default=0,
help="verbose output")
global options
(options, args) = parser.parse_args(sys.argv[1:])
reader = Reader()
if options.base is not None:
reader.base_addr = int(options.base, 16)
if options.map is not None:
reader.read_map(options.map)
for arg in args:
profile = reader.read_data(arg)
profile.prune(options.node_thres/100.0, options.edge_thres/100.0)
output = sys.stdout
dot = DotWriter(output)
colormap = TEMPERATURE_COLORMAP
dot.graph(profile, colormap)
if __name__ == '__main__':
main()

View File

@@ -12,10 +12,10 @@ X11_DIR = $(INSTALL_DIR)
CC = gcc
CXX = g++
PIC_FLAGS = -fPIC
DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
-D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS \
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
-DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
# -D_GNU_SOURCE - for src/mesa/main ...
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx/x11
# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile
# -DIN_DRI_DRIVER
@@ -49,7 +49,7 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glx/x11 mesa glu glut/glx glew
SRC_DIRS = glx/x11 mesa gallium glu glut/glx glew
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri

View File

@@ -9,7 +9,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=6
MESA_MINOR=7
MESA_TINY=1
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
@@ -87,16 +87,16 @@ SRC_DIRS = mesa gallium egl gallium/winsys glu glut/glx glew glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = demos redbook samples glsl xdemos
PROGRAM_DIRS = demos redbook samples glsl objviewer xdemos
# EGL directories
EGL_DRIVERS_DIRS = demo
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARY_DIRS = rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices
GALLIUM_AUXILIARY_DIRS = rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices vl
GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
GALLIUM_DRIVERS_DIRS = softpipe i915simple failover trace identity
GALLIUM_DRIVERS_DIRS = softpipe failover svga i915 trace identity
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = xlib egl_xlib
GALLIUM_WINSYS_DRM_DIRS =

View File

@@ -23,11 +23,11 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -Wdeclaration-after-statement \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
-Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(X11_INCLUDES)
CXXFLAGS = -Wall -Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing

View File

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

View File

@@ -60,8 +60,8 @@ EGL_DRIVERS_DIRS = demo glx
DRIVER_DIRS = dri
WINDOW_SYSTEM = dri
GALLIUM_WINSYS_DIRS = drm
GALLIUM_WINSYS_DRM_DIRS = intel
GALLIUM_WINSYS_DRM_DIRS = vmware intel
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb swrast
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome ffb swrast

View File

@@ -11,6 +11,6 @@ ARCH_FLAGS = -DDEBUG
#DRI_DIRS = i915tex i915
#DRI_DIRS = i965
#DRI_DIRS = radeon r200 r300
#DRI_DIRS = unichrome sis trident
#DRI_DIRS = unichrome sis
#DRI_DIRS = i810 mga r128 tdfx

View File

@@ -68,5 +68,5 @@ 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
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome ffb

View File

@@ -18,7 +18,8 @@ AC_CONFIG_AUX_DIR([bin])
AC_CANONICAL_HOST
dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.3
LIBDRM_REQUIRED=2.4.15
LIBDRM_RADEON_REQUIRED=2.4.17
DRI2PROTO_REQUIRED=1.99.3
dnl Check for progs
@@ -419,7 +420,7 @@ WINDOW_SYSTEM=""
GALLIUM_DIRS="auxiliary drivers state_trackers"
GALLIUM_WINSYS_DIRS=""
GALLIUM_WINSYS_DRM_DIRS=""
GALLIUM_AUXILIARY_DIRS="rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices"
GALLIUM_AUXILIARY_DIRS="rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices vl"
GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
GALLIUM_STATE_TRACKERS_DIRS=""
@@ -577,7 +578,7 @@ dri)
GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
PKG_CHECK_MODULES([LIBDRM_RADEON], [libdrm_radeon], HAVE_LIBDRM_RADEON=yes, HAVE_LIBDRM_RADEON=no)
PKG_CHECK_MODULES([LIBDRM_RADEON], [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED], HAVE_LIBDRM_RADEON=yes, HAVE_LIBDRM_RADEON=no)
if test "$HAVE_LIBDRM_RADEON" = yes; then
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
@@ -775,8 +776,8 @@ if test "$mesa_driver" = dri; then
# default drivers
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon s3v \
savage sis tdfx trident unichrome ffb swrast"
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
savage sis tdfx unichrome ffb swrast"
fi
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
@@ -1143,7 +1144,14 @@ yes)
GALLIUM_STATE_TRACKERS_DIRS=glx
;;
dri)
test "x$enable_egl" = xyes && GALLIUM_STATE_TRACKERS_DIRS=egl
GALLIUM_STATE_TRACKERS_DIRS="dri"
if test "x$enable_egl" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
fi
# Have only tested st/xorg on 1.6.0 servers
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0],
HAVE_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
HAVE_XORG="no")
;;
esac
;;
@@ -1189,17 +1197,34 @@ AC_ARG_WITH([max-height],
[AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
)
dnl
dnl Gallium SVGA configuration
dnl
AC_ARG_ENABLE([gallium-svga],
[AS_HELP_STRING([--enable-gallium-svga],
[build gallium SVGA @<:@default=disabled@:>@])],
[enable_gallium_svga="$enableval"],
[enable_gallium_svga=auto])
if test "x$enable_gallium_svga" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS vmware"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
elif test "x$enable_gallium_svga" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
fi
dnl
dnl Gallium Intel configuration
dnl
AC_ARG_ENABLE([gallium-intel],
[AS_HELP_STRING([--disable-gallium-intel],
[build gallium intel @<:@default=enabled@:>@])],
[AS_HELP_STRING([--enable-gallium-intel],
[build gallium intel @<:@default=disabled@:>@])],
[enable_gallium_intel="$enableval"],
[enable_gallium_intel=yes])
[enable_gallium_intel=auto])
if test "x$enable_gallium_intel" = xyes; then
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915simple"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
elif test "x$enable_gallium_intel" = xauto; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
fi
dnl

45
debian/changelog vendored
View File

@@ -1,3 +1,48 @@
mesa (7.7-2) experimental; urgency=low
[ Julien Cristau ]
* Rename the build directory to not include DEB_BUILD_GNU_TYPE for no
good reason. Thanks, Colin Watson!
* Remove myself from Uploaders
[ Brice Goglin ]
* Pull from upstream mesa_7_7_branch up to commit 2f28ca0a.
+ Fix funky colors on radeon/r200/r300.
-- Brice Goglin <bgoglin@debian.org> Wed, 27 Jan 2010 09:14:38 +0100
mesa (7.7-1) experimental; urgency=low
[ Brice Goglin ]
* Bump libdrm build dependency to 2.4.15, closes: #561058.
* New upstream release.
* Pull from upstream mesa_7_7_branch up to commit 6d6c9c66.
[ Julien Cristau ]
* Add freedesktop.org ftp to watch file since that's where newer upstream
tarballs are.
* Don't include GLUT sources since we don't use them.
-- Brice Goglin <bgoglin@debian.org> Mon, 11 Jan 2010 17:52:31 +0100
mesa (7.7~rc2-1) experimental; urgency=low
* New upstream release candidate.
+ s3v and trident DRI drivers removed since they never worked.
-- Brice Goglin <bgoglin@debian.org> Sat, 12 Dec 2009 13:02:55 +0100
mesa (7.6.1-1) unstable; urgency=low
* New upstream release
+ Pull upstream mesa_7_6_branch up to commit da876fa3
* Bump linux-libc-dev build-dep to 2.6.31 for the r600 dri driver (fixes
ftbfs on mips).
* Drop hunk from 05_hurd-ftbfs.diff that was applied upstream. Refresh
other patches.
-- Julien Cristau <jcristau@debian.org> Tue, 29 Dec 2009 10:42:24 +0000
mesa (7.6.1~rc3-1) unstable; urgency=low
* New upstream release candidate.

6
debian/control vendored
View File

@@ -2,14 +2,14 @@ Source: mesa
Section: graphics
Priority: optional
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Uploaders: Thierry Reding <thierry@gilfi.de>, Julien Cristau <jcristau@debian.org>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>
Uploaders: Thierry Reding <thierry@gilfi.de>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>
Standards-Version: 3.8.3
Build-Depends: debhelper (>= 6.0.7), quilt (>= 0.40), pkg-config,
libdrm-dev (>= 2.4.3) [!hurd-i386], libx11-dev, xutils-dev,
libdrm-dev (>= 2.4.15) [!hurd-i386], libx11-dev, xutils-dev,
x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev,
libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev,
libxdamage-dev, libxext-dev, autoconf, automake, x11proto-dri2-dev (>= 1.99.3),
linux-libc-dev (>= 2.6.29) [!hurd-i386 !kfreebsd-amd64 !kfreebsd-i386]
linux-libc-dev (>= 2.6.31) [!hurd-i386 !kfreebsd-amd64 !kfreebsd-i386]
Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/mesa
Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/mesa.git
Homepage: http://mesa3d.sourceforge.net/

View File

@@ -6,7 +6,7 @@ Index: mesa/src/mesa/main/compiler.h
===================================================================
--- mesa.orig/src/mesa/main/compiler.h
+++ mesa/src/mesa/main/compiler.h
@@ -347,8 +347,9 @@
@@ -351,8 +351,9 @@
* USE_IEEE: Determine if we're using IEEE floating point
*/
#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \

View File

@@ -52,4 +52,4 @@ Index: mesa/progs/Makefile
+ done
clean:
-@for dir in $(SUBDIRS) tests ; do \
@list='$(SUBDIRS)'; for dir in $$list tests ; do \

View File

@@ -6,28 +6,11 @@ Subject: Fix build on GNU/Hurd
src/glx/x11/dri2.c | 2 ++
2 files changed, 16 insertions(+), 11 deletions(-)
Index: mesa-7.6.1~rc2/src/glx/x11/dri2.c
Index: mesa/configure.ac
===================================================================
--- mesa-7.6.1~rc2.orig/src/glx/x11/dri2.c 2009-12-05 23:51:01.000000000 +0100
+++ mesa-7.6.1~rc2/src/glx/x11/dri2.c 2009-12-06 00:10:10.000000000 +0100
@@ -30,6 +30,7 @@
* Kristian Høgsberg (krh@redhat.com)
*/
+#ifdef GLX_DIRECT_RENDERING
#define NEED_REPLIES
#include <X11/Xlibint.h>
@@ -377,3 +378,4 @@
UnlockDisplay(dpy);
SyncHandle();
}
+#endif
Index: mesa-7.6.1~rc2/configure.ac
===================================================================
--- mesa-7.6.1~rc2.orig/configure.ac 2009-12-05 23:50:57.000000000 +0100
+++ mesa-7.6.1~rc2/configure.ac 2009-12-06 00:10:27.000000000 +0100
@@ -538,6 +538,13 @@
--- mesa.orig/configure.ac
+++ mesa/configure.ac
@@ -539,6 +539,13 @@
enable_xcb=no
fi
@@ -41,7 +24,7 @@ Index: mesa-7.6.1~rc2/configure.ac
dnl
dnl libGL configuration per driver
dnl
@@ -571,11 +578,13 @@
@@ -572,11 +579,13 @@
AC_MSG_ERROR([Can't use static libraries for DRI drivers])
fi
@@ -58,9 +41,9 @@ Index: mesa-7.6.1~rc2/configure.ac
+ DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
+ fi
PKG_CHECK_MODULES([LIBDRM_RADEON], [libdrm_radeon], HAVE_LIBDRM_RADEON=yes, HAVE_LIBDRM_RADEON=no)
PKG_CHECK_MODULES([LIBDRM_RADEON], [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED], HAVE_LIBDRM_RADEON=yes, HAVE_LIBDRM_RADEON=no)
@@ -656,12 +665,6 @@
@@ -657,12 +666,6 @@
[DRI_DRIVER_SEARCH_DIR="$withval"],
[DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
AC_SUBST([DRI_DRIVER_SEARCH_DIR])

View File

@@ -8,11 +8,11 @@ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524690
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: mesa-7.6.1~rc2/configure.ac
Index: mesa/configure.ac
===================================================================
--- mesa-7.6.1~rc2.orig/configure.ac 2009-12-06 00:10:10.000000000 +0100
+++ mesa-7.6.1~rc2/configure.ac 2009-12-06 00:10:10.000000000 +0100
@@ -745,7 +745,7 @@
--- mesa.orig/configure.ac
+++ mesa/configure.ac
@@ -746,7 +746,7 @@
;;
esac
;;

6
debian/rules vendored
View File

@@ -22,7 +22,7 @@ DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
DEB_BUILD_DIR ?= $(CURDIR)/build
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build=$(DEB_HOST_GNU_TYPE)
else
@@ -69,7 +69,7 @@ else
ifeq ($(DEB_HOST_ARCH), lpia)
DRI_DRIVERS += i915 i965
else ifneq ($(DEB_HOST_ARCH), s390)
DRI_DRIVERS += mach64 mga r128 r200 r300 r600 radeon s3v savage tdfx trident
DRI_DRIVERS += mach64 mga r128 r200 r300 r600 radeon savage tdfx
ifeq ($(DEB_HOST_GNU_CPU), i486)
DRI_DRIVERS += i810 i915 i965 sis unichrome
else ifeq ($(DEB_HOST_GNU_CPU), x86_64)
@@ -207,7 +207,7 @@ clean: unpatch
rm -f */config.cache */config.log */config.status
rm -f conftest* */conftest*
rm -rf autom4te.cache */autom4te.cache
rm -rf obj-*
rm -rf build
rm -rf configure config.guess config.sub config.h.in
rm -rf $$(find -name Makefile.in)
rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh

3
debian/watch vendored
View File

@@ -1,3 +1,6 @@
version=3
opts="uversionmangle=s/-rc/~rc/" \
http://sf.net/mesa3d/MesaLib-(.*)\.tar\.gz
opts="uversionmangle=s/-rc/~rc/" \
ftp://freedesktop.org/pub/mesa/([\d\.]*)/ MesaLib-(.*)\.tar\.gz

View File

@@ -28,6 +28,7 @@ Setting this variable automatically sets the MESA_TEX_PROG variable as well.
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
and disable the GL_EXT_bar extension.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language options</a>
</ul>
<p>
@@ -50,5 +51,24 @@ See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</ul>
<p>
These environment variables are for the Intel i945/i965 drivers:
</p>
<ul>
<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
OpenGL conformance. If set to 2, always use software rendering.
<li>INTEL_NO_BLIT - if set, disable hardware-accelerated glBitmap,
glCopyPixels, glDrawPixels.
</ul>
<p>
These environment variables are for the Radeon R300 driver:
</p>
<ul>
<li>R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
</ul>
</BODY>
</HTML>

View File

@@ -35,14 +35,14 @@
<h3>1.1 Prerequisites for DRI and hardware acceleration</h3>
<p>
The following are required for DRI-based hardware acceleration with Mesa 7.3:
The following are required for DRI-based hardware acceleration with Mesa:
</p>
<ul>
<li><a href="http://xorg.freedesktop.org/releases/individual/proto/">dri2proto</a> version 1.99.3 or later
<li>Linux 2.6.28
<li><a href="http://dri.freedesktop.org/libdrm/" target="_parent">libDRM</a>
version 2.4.3 or later
version 2.4.15 or later
<li>Xorg server version 1.5 or later
</ul>
</p>

197
docs/libGL.txt Normal file
View File

@@ -0,0 +1,197 @@
Introduction
------------
This document describes the implementation of the XFree86 4.0 libGL.so
library defined by the Linux/OpenGL Base specification found at
http://reality.sgi.com/opengl/linux/linuxbase.html.
The documentation is divided into two sections:
User's Guide
Driver Developer's Guide
Author: Brian Paul (brian@precisioninsight.com)
Date: February 2000
User's Guide
------------
Using libGL.so
The libGL.so library defines the gl- and glX-prefixed functions needed to
run OpenGL programs. OpenGL client applications should link with the
-lGL option to use it.
libGL.so serves two primary functions: GLX protocol generation for indirect
rendering and loading/management of hardware drivers for direct rendering.
When libGL.so initializes itself it uses the DRI to determine the
appropriate hardware driver for each screen on the local X display.
The hardware drivers are expected to be in the /usr/X11R6/lib/modules/dri/
directory. Drivers are named with the convention <name>_dri.so where
<name> is a driver such as "tdfx", "i810", "gamma", etc.
The LIBGL_DRIVERS_DIR environment variable may be used to specify a
different DRI modules directory, overriding /usr/X11R6/lib/modules/dri/.
This environment variable is ignored in setuid programs for security
reasons.
When libGL.so is unable to locate appropriate hardware drivers it will
fall back to using indirect GLX rendering.
To aid in solving problems, libGL.so will print diagnostic messages to
stderr if the LIBGL_DEBUG environment variable is defined.
libGL.so is thread safe. The overhead of thread safety for common,
single-thread clients is negligible. However, the overhead of thread
safety for multi-threaded clients is significant. Each GL API call
requires two calls to pthread_get_specific() which can noticably
impact performance. Warning: libGL.so is thread safe but individual
DRI drivers may not be. Please consult the documentation for a driver
to learn if it is thread safe.
Indirect Rendering
You can force indirect rendering mode by setting the LIBGL_ALWAYS_INDIRECT
environment variable. Hardware acceleration will not be used.
libGL.so Extensibility
libGL.so is designed to be extended without upgrading. That is,
drivers may install new OpenGL extension functions into libGL.so
without requiring libGL.so to be replaced. Clients of libGL.so should
use the glXGetProcAddressEXT() function to obtain the address of
functions by name. For more details of GLX_ARB_get_proc_address see
http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.spec
libGL.so is also designed with flexibility such that it may be used
with many generations of hardware drivers to come.
Driver Developer's Guide
------------------------
This section describes the requirements to make an XFree86 4.0
libGL.so-compatible hardware driver. It is not intended for end
users of libGL.so.
XFree86 source files
libGL.so is built inside XFree86 with sources found in xc/lib/GL/.
Specifically, libGL.so is built from:
xc/lib/GL/glx/*.c
xc/lib/dri/XF86dri.c
xc/lib/dri/dri_glx.c
xc/lib/GL/mesa/src/glapi.c
xc/lib/GL/mesa/src/glapitemp.h
xc/lib/GL/mesa/src/glapitable.h
xc/lib/GL/mesa/src/glapioffsets.h
xc/lib/GL/mesa/src/glapinoop.c
xc/lib/GL/mesa/src/glheader.h
xc/lib/GL/mesa/src/glthread.c
xc/lib/GL/mesa/src/glthread.h
xc/lib/GL/mesa/src/X86/glapi_x86.S
xc/lib/GL/mesa/src/X86/assyntax.h
Understand that the mesa/src/gl*.[ch] files are not tied to Mesa. They
have no dependencies on the rest of Mesa and are designed to be reusable
in a number of projects.
The glapi_x86.X and assyntax.h files implement x86-optimized dispatch
of GL functions. They are not required; C-based dispatch can be used
instead, with a slight performance penalty.
Driver loading and binding
When libGL.so initializes itself (via the __glXInitialize function) a
call is made to driCreateDisplay(). This function uses DRI facilities
to determine the driver file appropriate for each screen on the local
display. Each screen's driver is then opened with dlopen() and asked
for its __driCreateScreen() function. The pointers to the __driCreateScreen()
functions are kept in an array, indexed by screen number, in the
__DRIdisplayRec struct.
When a driver's __driCreateScreen() function is called, it must initialize
a __DRIscreenRec struct. This struct acts as the root of a tree of
function pointers which are called to create and destroy contexts and
drawables and perform all the operations needed by the GLX interface.
See the xc/lib/GL/glx/glxclient.h file for details.
Dynamic Extension Function Registration
In order to provide forward compatibility with future drivers, libGL.so
allows drivers to register new OpenGL extension functions which weren't
known when libGL.so was built.
The register_extensions() function in xc/lib/GL/dri/dri_glx.c is called
as soon as libGL.so is loaded. This is done with gcc's constructor
attribute. This mechanism will likely have to be changed for other compilers.
register_extensions() loops over all local displays and screens, determines
the DRI driver for each, and calls the driver's __driRegisterExtensions()
function, if present.
The __driRegisterExtensions() function can add new entrypoints to libGL
by calling:
GLboolean _glapi_add_entrypoint(const char *funcName, GLuint offset)
The parameters are the name of the function (such as "glFoobarEXT") and the
offset of the dispatch slot in the API dispatch table. The return value
indicates success (GL_TRUE) or failure (GL_FALSE).
_glapi_add_entrypoint() will synthesize entrypoint code in assembly
language. Assembly languages is required since parameter passing
can't be handled correctly using a C-based solution.
The address of the new entrypoint is obtained by calling the
glXGetProcAddressARB() function.
The dispatch offset number MUST be a number allocated by SGI in the same
manner in which new GL_* constants are allocated. Using an arbitrary
offset number will result in many problems.
Dispatch Management
When a GL context is made current, the driver must install its dispatch
table as the current dispatch table. This is done by calling
void _glapi_set_dispatch(struct _glapi_table *dispatch);
This will install the named dispatch table for the calling thread.
The current dispatch table for a thread can be obtained by calling
struct _glapi_table *_glapi_get_dispatch(void);
For higher performance in the common single-thread case, the global
variable _glapi_Dispatch will point to the current dispatch table.
This variable will be NULL when in multi-thread mode.
Context Management
libGL.so uses the XFree86 xthreads package to manage a thread-specific
current context pointer. See __glXGet/SetCurrentContext() in glext.c
Drivers may use the _glapi_set/get_context() functions to maintain
a private thread-specific context pointer.

View File

@@ -13,36 +13,41 @@
</p>
<ul>
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-announce"
target="_parent">mesa3d-announce</a> - announcements of new Mesa
versions are sent to this list.
</li>
<br>
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-users"
target="_parent">mesa3d-users</a> - intended for users of the Mesa and DRI.
Newbie questions are appropriate, but please try the general OpenGL
target="_parent">mesa3d-users</a> - intended for end-users of Mesa and DRI
drivers. Newbie questions are OK, but please try the general OpenGL
resources and Mesa/DRI documentation first.
</li>
<br>
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-dev"
target="_parent">mesa3d-dev</a> - for discussion of Mesa and Direct Rendering
Infrastructure development. Not for beginners.
target="_parent">mesa3d-dev</a> - for Mesa, Gallium and DRI development
discussion. Not for beginners.
</li>
<br>
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-commit"
target="_parent">mesa-commit</a> - relays git check-in messages
(for developers).
In general, people should not post to this list.
</li>
<br>
Note: the old mesa3d-cvs list is no longer in use.
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-announce"
target="_parent">mesa3d-announce</a> - announcements of new Mesa
versions are sent to this list. Very low traffic.
</li>
</ul>
<p>
Follow the links above for list archives.
</p>
<p>For mailing lists about Direct Rendering Modules (drm) in Linux/BSD
kernels, see <a href="http://dri.freedesktop.org/wiki/MailingLists">wiki</a>.
kernels, see the
<a href="http://dri.freedesktop.org/wiki/MailingLists" target="_parent">
DRI wiki</a>.
</p>
<p>
<b>Notice</b>: non-member posts to any of these lists will be automatically
rejected.
<b>Notice</b>: You must subscribe to these lists in order to post to them.
</p>

View File

@@ -10,11 +10,15 @@
<H1>News</H1>
<h2>November XX, 2009</h2>
<h2>December 21, 2009</h2>
<p>
<a href="relnotes-7.6.1.html">Mesa 7.6.1</a> is released. This is a bug-fix
release fixing issues found in the 7.6 release.
</p>
<p>
Also, <a href="relnotes-7.7.html">Mesa 7.7</a> is released. This is a new
development release.
</p>
<h2>September 28, 2009</h2>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.6.1 Release Notes, (date tbd)</H1>
<H1>Mesa 7.6.1 Release Notes, 21 December 2009</H1>
<p>
Mesa 7.6.1 is a bug-fix release fixing issues since version 7.6.
@@ -26,7 +26,15 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
tbd
e80fabad2e3eb7990adae773d6aeacba MesaLib-7.6.1.tar.gz
7db4617e9e10ad3aca1b64339fd71b7d MesaLib-7.6.1.tar.bz2
dd3275dbf9833480d2e92d0c69b22abd MesaLib-7.6.1.zip
f7fdcfe3c0f363e571c60f02f74368fb MesaDemos-7.6.1.tar.gz
a4226f06732a02556fcf6be290b86dff MesaDemos-7.6.1.tar.bz2
849425f356bd940726cebedfa79de176 MesaDemos-7.6.1.zip
d40cc7c5e337a85b674e27a8e494f52f MesaGLUT-7.6.1.tar.gz
ca9aecb91f05b1da9fd7d5eeb19d47d7 MesaGLUT-7.6.1.tar.bz2
23fad8398004c977a1d8953079b72ca6 MesaGLUT-7.6.1.zip
</pre>
@@ -59,6 +67,7 @@ tbd
<li>Point sprite fixes for i915/945 driver.
<li>Fixed assorted memory leaks (usually on error paths)
<li>Fixed some GLSL compiler bugs (ex: 25579)
<li>Assorted build fixes for BlueGene
</ul>
<h2>Changes</h2>

50
docs/relnotes-7.7.1.html Normal file
View File

@@ -0,0 +1,50 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.7.1 Release Notes / date tbd</H1>
<p>
Mesa 7.7.1 is a bug-fix release.
</p>
<p>
Mesa 7.7.1 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
tbd
</pre>
<h2>New features</h2>
<ul>
<li>tbd
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Assorted fixes to VMware SVGA gallium driver.
<li>Fixed broken blending to multiple color buffers in swrast driver.
<li>Allocate constants more tightly in GL_ARB_vertex/fragment parser.
<li>Fixed mipmap generation bug caused by invalid viewport state.
<li>Gallium SSE codegen for XPD didn't always work.
</ul>
</body>
</html>

70
docs/relnotes-7.7.html Normal file
View File

@@ -0,0 +1,70 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.7 Release Notes / 21 December 2009</H1>
<p>
Mesa 7.7 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 7.7.1.
</p>
<p>
Mesa 7.7 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
395c9516edf1ad54b0934d8db15557bf MesaLib-7.7.tar.gz
e3fa64a1508bc23dd9de9dd2cea7cfb1 MesaLib-7.7.tar.bz2
e54903eb5e49c3969821fa16b32da245 MesaLib-7.7.zip
53b5b6f78e55de170d43c98cb6aaab7e MesaDemos-7.7.tar.gz
6fd616b27b9826d0faa23e08e05d9435 MesaDemos-7.7.tar.bz2
240fe06159ad73d5e22c27033b66c80a MesaDemos-7.7.zip
9fe11a904b2a9d8cd06cc52bc330b716 MesaGLUT-7.7.tar.gz
e8dceed05a59a2d3c2619d7d734587e3 MesaGLUT-7.7.tar.bz2
96af041d435349ee23ead4667ec36363 MesaGLUT-7.7.zip
</pre>
<h2>New features</h2>
<ul>
<li>VMware "SVGA" Gallium driver. This is a Gallium3D driver which targets the
VMware virtual graphics device. It allows Linux OpenGL guest applications
to utilize the 3D graphics hardware of the host operating system.
<li>GL_ARB_draw_elements_base_vertex (supported in Intel i965 and software drivers)</li>
<li>GL_ARB_depth_clamp (supported in Intel i965 DRI and software drivers)</li>
<li>GL_NV_depth_clamp (supported in Intel i965 DRI and software drivers)</li>
<li>GL_ARB_provoking_vertex (same as GL_EXT_provoking_vertex)</li>
<li>Wavefront .obj file loader/viewer demo (progs/demos/objviewer)
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Many assorted i965 driver fixes.
<li>Many r300-gallium driver fixes; this driver is now considered unstable-quality instead of experimental-quality.
</ul>
<h2>Changes</h2>
<ul>
<li>New Mesa texture/surface format infrastructure
<li>Removed some unused Mesa device driver hooks
</ul>
</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-7.7.1.html">7.7.1 release notes</A>
<LI><A HREF="relnotes-7.7.html">7.7 release notes</A>
<LI><A HREF="relnotes-7.6.1.html">7.6.1 release notes</A>
<LI><A HREF="relnotes-7.6.html">7.6 release notes</A>
<LI><A HREF="relnotes-7.5.2.html">7.5.2 release notes</A>

View File

@@ -39,7 +39,8 @@ Contents
<p>
The <b>MESA_GLSL</b> environment variable can be set to a comma-separated
list of keywords to control some aspects of the GLSL compiler:
list of keywords to control some aspects of the GLSL compiler and shader
execution. These are generally used for debugging.
</p>
<ul>
<li>dump - print GLSL shader code to stdout at link time
@@ -49,6 +50,12 @@ list of keywords to control some aspects of the GLSL compiler:
<li>nopt - disable compiler optimizations
<li>opt - force compiler optimizations
<li>uniform - print message to stdout when glUniform is called
<li>nopvert - force vertex shaders to be a simple shader that just transforms
the vertex position with ftransform() and passes through the color and
texcoord[0] attributes.
<li>nopfrag - force fragment shader to be a simple shader that passes
through the color attribute.
<li>useprog - log glUseProgram calls to stderr
</ul>
<p>
Example: export MESA_GLSL=dump,nopt

View File

@@ -30,6 +30,7 @@
/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
#define glAccum MANGLE(Accum)
#define glActiveProgramEXT MANGLE(ActiveProgramEXT)
#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
#define glActiveTextureARB MANGLE(ActiveTextureARB)
#define glActiveTexture MANGLE(ActiveTexture)
@@ -60,6 +61,7 @@
#define glBeginTransformFeedback MANGLE(BeginTransformFeedback)
#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV)
#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
#define glBeginVideoCaptureNV MANGLE(BeginVideoCaptureNV)
#define glBindAttribLocationARB MANGLE(BindAttribLocationARB)
#define glBindAttribLocation MANGLE(BindAttribLocation)
#define glBindBufferARB MANGLE(BindBufferARB)
@@ -93,6 +95,8 @@
#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
#define glBindVertexArray MANGLE(BindVertexArray)
#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT)
#define glBindVideoCaptureStreamBufferNV MANGLE(BindVideoCaptureStreamBufferNV)
#define glBindVideoCaptureStreamTextureNV MANGLE(BindVideoCaptureStreamTextureNV)
#define glBinormal3bEXT MANGLE(Binormal3bEXT)
#define glBinormal3bvEXT MANGLE(Binormal3bvEXT)
#define glBinormal3dEXT MANGLE(Binormal3dEXT)
@@ -126,6 +130,7 @@
#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
#define glBlitFramebuffer MANGLE(BlitFramebuffer)
#define glBufferAddressRangeNV MANGLE(BufferAddressRangeNV)
#define glBufferDataARB MANGLE(BufferDataARB)
#define glBufferData MANGLE(BufferData)
#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE)
@@ -202,6 +207,7 @@
#define glColor4uiv MANGLE(Color4uiv)
#define glColor4us MANGLE(Color4us)
#define glColor4usv MANGLE(Color4usv)
#define glColorFormatNV MANGLE(ColorFormatNV)
#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI)
#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI)
#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI)
@@ -276,6 +282,7 @@
#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D)
#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT)
#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D)
#define glCopyImageSubDataNV MANGLE(CopyImageSubDataNV)
#define glCopyMultiTexImage1DEXT MANGLE(CopyMultiTexImage1DEXT)
#define glCopyMultiTexImage2DEXT MANGLE(CopyMultiTexImage2DEXT)
#define glCopyMultiTexSubImage1DEXT MANGLE(CopyMultiTexSubImage1DEXT)
@@ -302,6 +309,7 @@
#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB)
#define glCreateShader MANGLE(CreateShader)
#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
#define glCreateShaderProgramEXT MANGLE(CreateShaderProgramEXT)
#define glCullFace MANGLE(CullFace)
#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
@@ -379,6 +387,7 @@
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glDrawRangeElements MANGLE(DrawRangeElements)
#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
#define glEdgeFlagFormatNV MANGLE(EdgeFlagFormatNV)
#define glEdgeFlag MANGLE(EdgeFlag)
#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
@@ -408,6 +417,7 @@
#define glEndTransformFeedback MANGLE(EndTransformFeedback)
#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV)
#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
#define glEndVideoCaptureNV MANGLE(EndVideoCaptureNV)
#define glEvalCoord1d MANGLE(EvalCoord1d)
#define glEvalCoord1dv MANGLE(EvalCoord1dv)
#define glEvalCoord1f MANGLE(EvalCoord1f)
@@ -445,6 +455,7 @@
#define glFogCoorddv MANGLE(FogCoorddv)
#define glFogCoordfEXT MANGLE(FogCoordfEXT)
#define glFogCoordf MANGLE(FogCoordf)
#define glFogCoordFormatNV MANGLE(FogCoordFormatNV)
#define glFogCoordfvEXT MANGLE(FogCoordfvEXT)
#define glFogCoordfv MANGLE(FogCoordfv)
#define glFogCoordhNV MANGLE(FogCoordhNV)
@@ -544,6 +555,7 @@
#define glGetBufferParameteri64v MANGLE(GetBufferParameteri64v)
#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
#define glGetBufferParameterui64vNV MANGLE(GetBufferParameterui64vNV)
#define glGetBufferPointervARB MANGLE(GetBufferPointervARB)
#define glGetBufferPointerv MANGLE(GetBufferPointerv)
#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB)
@@ -609,6 +621,8 @@
#define glGetInteger64v MANGLE(GetInteger64v)
#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
#define glGetIntegeri_v MANGLE(GetIntegeri_v)
#define glGetIntegerui64i_vNV MANGLE(GetIntegerui64i_vNV)
#define glGetIntegerui64vNV MANGLE(GetIntegerui64vNV)
#define glGetIntegerv MANGLE(GetIntegerv)
#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT)
#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT)
@@ -651,6 +665,7 @@
#define glGetMultiTexParameterIuivEXT MANGLE(GetMultiTexParameterIuivEXT)
#define glGetMultiTexParameterivEXT MANGLE(GetMultiTexParameterivEXT)
#define glGetNamedBufferParameterivEXT MANGLE(GetNamedBufferParameterivEXT)
#define glGetNamedBufferParameterui64vNV MANGLE(GetNamedBufferParameterui64vNV)
#define glGetNamedBufferPointervEXT MANGLE(GetNamedBufferPointervEXT)
#define glGetNamedBufferSubDataEXT MANGLE(GetNamedBufferSubDataEXT)
#define glGetNamedFramebufferAttachmentParameterivEXT MANGLE(GetNamedFramebufferAttachmentParameterivEXT)
@@ -761,6 +776,7 @@
#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
#define glGetUniformLocation MANGLE(GetUniformLocation)
#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
#define glGetUniformui64vNV MANGLE(GetUniformui64vNV)
#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
#define glGetUniformuiv MANGLE(GetUniformuiv)
#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI)
@@ -788,6 +804,10 @@
#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
#define glGetVideoCaptureivNV MANGLE(GetVideoCaptureivNV)
#define glGetVideoCaptureStreamdvNV MANGLE(GetVideoCaptureStreamdvNV)
#define glGetVideoCaptureStreamfvNV MANGLE(GetVideoCaptureStreamfvNV)
#define glGetVideoCaptureStreamivNV MANGLE(GetVideoCaptureStreamivNV)
#define glGetVideoi64vNV MANGLE(GetVideoi64vNV)
#define glGetVideoivNV MANGLE(GetVideoivNV)
#define glGetVideoui64vNV MANGLE(GetVideoui64vNV)
@@ -812,6 +832,7 @@
#define glIndexd MANGLE(Indexd)
#define glIndexdv MANGLE(Indexdv)
#define glIndexf MANGLE(Indexf)
#define glIndexFormatNV MANGLE(IndexFormatNV)
#define glIndexFuncEXT MANGLE(IndexFuncEXT)
#define glIndexfv MANGLE(Indexfv)
#define glIndexi MANGLE(Indexi)
@@ -832,6 +853,7 @@
#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX)
#define glIsBufferARB MANGLE(IsBufferARB)
#define glIsBuffer MANGLE(IsBuffer)
#define glIsBufferResidentNV MANGLE(IsBufferResidentNV)
#define glIsEnabledi MANGLE(IsEnabledi)
#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT)
#define glIsEnabled MANGLE(IsEnabled)
@@ -840,6 +862,7 @@
#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
#define glIsFramebuffer MANGLE(IsFramebuffer)
#define glIsList MANGLE(IsList)
#define glIsNamedBufferResidentNV MANGLE(IsNamedBufferResidentNV)
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
#define glIsProgramARB MANGLE(IsProgramARB)
@@ -888,6 +911,8 @@
#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf)
#define glLockArraysEXT MANGLE(LockArraysEXT)
#define glLogicOp MANGLE(LogicOp)
#define glMakeBufferNonResidentNV MANGLE(MakeBufferNonResidentNV)
#define glMakeBufferResidentNV MANGLE(MakeBufferResidentNV)
#define glMap1d MANGLE(Map1d)
#define glMap1f MANGLE(Map1f)
#define glMap2d MANGLE(Map2d)
@@ -1060,6 +1085,8 @@
#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
#define glNamedMakeBufferNonResidentNV MANGLE(NamedMakeBufferNonResidentNV)
#define glNamedMakeBufferResidentNV MANGLE(NamedMakeBufferResidentNV)
#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
@@ -1091,6 +1118,7 @@
#define glNormal3iv MANGLE(Normal3iv)
#define glNormal3s MANGLE(Normal3s)
#define glNormal3sv MANGLE(Normal3sv)
#define glNormalFormatNV MANGLE(NormalFormatNV)
#define glNormalPointerEXT MANGLE(NormalPointerEXT)
#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
#define glNormalPointer MANGLE(NormalPointer)
@@ -1234,6 +1262,8 @@
#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT)
#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT)
#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
#define glProgramUniformui64NV MANGLE(ProgramUniformui64NV)
#define glProgramUniformui64vNV MANGLE(ProgramUniformui64vNV)
#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
#define glProvokingVertexEXT MANGLE(ProvokingVertexEXT)
#define glProvokingVertex MANGLE(ProvokingVertex)
@@ -1362,6 +1392,7 @@
#define glSecondaryColor3us MANGLE(SecondaryColor3us)
#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
#define glSecondaryColorFormatNV MANGLE(SecondaryColorFormatNV)
#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
@@ -1475,6 +1506,7 @@
#define glTexCoord4iv MANGLE(TexCoord4iv)
#define glTexCoord4s MANGLE(TexCoord4s)
#define glTexCoord4sv MANGLE(TexCoord4sv)
#define glTexCoordFormatNV MANGLE(TexCoordFormatNV)
#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
#define glTexCoordPointer MANGLE(TexCoordPointer)
@@ -1513,6 +1545,7 @@
#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT)
#define glTexSubImage3D MANGLE(TexSubImage3D)
#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS)
#define glTextureBarrierNV MANGLE(TextureBarrierNV)
#define glTextureBufferEXT MANGLE(TextureBufferEXT)
#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS)
#define glTextureImage1DEXT MANGLE(TextureImage1DEXT)
@@ -1601,6 +1634,8 @@
#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
#define glUniformui64NV MANGLE(Uniformui64NV)
#define glUniformui64vNV MANGLE(Uniformui64vNV)
#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
#define glUnmapBufferARB MANGLE(UnmapBufferARB)
#define glUnmapBuffer MANGLE(UnmapBuffer)
@@ -1609,6 +1644,7 @@
#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
#define glUseProgram MANGLE(UseProgram)
#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
#define glUseShaderProgramEXT MANGLE(UseShaderProgramEXT)
#define glValidateProgramARB MANGLE(ValidateProgramARB)
#define glValidateProgram MANGLE(ValidateProgram)
#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
@@ -1762,6 +1798,7 @@
#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
#define glVertexAttribDivisorARB MANGLE(VertexAttribDivisorARB)
#define glVertexAttribFormatNV MANGLE(VertexAttribFormatNV)
#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
#define glVertexAttribI1i MANGLE(VertexAttribI1i)
#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT)
@@ -1802,6 +1839,7 @@
#define glVertexAttribI4uiv MANGLE(VertexAttribI4uiv)
#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT)
#define glVertexAttribI4usv MANGLE(VertexAttribI4usv)
#define glVertexAttribIFormatNV MANGLE(VertexAttribIFormatNV)
#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
#define glVertexAttribIPointer MANGLE(VertexAttribIPointer)
#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
@@ -1827,6 +1865,7 @@
#define glVertexBlendARB MANGLE(VertexBlendARB)
#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
#define glVertexFormatNV MANGLE(VertexFormatNV)
#define glVertexPointerEXT MANGLE(VertexPointerEXT)
#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
#define glVertexPointer MANGLE(VertexPointer)
@@ -1868,6 +1907,10 @@
#define glVertexWeighthNV MANGLE(VertexWeighthNV)
#define glVertexWeighthvNV MANGLE(VertexWeighthvNV)
#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
#define glVideoCaptureNV MANGLE(VideoCaptureNV)
#define glVideoCaptureStreamParameterdvNV MANGLE(VideoCaptureStreamParameterdvNV)
#define glVideoCaptureStreamParameterfvNV MANGLE(VideoCaptureStreamParameterfvNV)
#define glVideoCaptureStreamParameterivNV MANGLE(VideoCaptureStreamParameterivNV)
#define glViewport MANGLE(Viewport)
#define glWaitSync MANGLE(WaitSync)
#define glWeightbvARB MANGLE(WeightbvARB)

View File

@@ -1,668 +0,0 @@
#ifndef __glut_h__
#define __glut_h__
/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
/* This program is freely distributable without licensing fees and is
provided without guarantee or warrantee expressed or implied. This
program is -not- in the public domain. */
#if defined(_WIN32)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# endif
# include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WIN32)
/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
in your compile preprocessor options. */
# if defined(_MSC_VER) && !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
# ifdef GLUT_USE_SGI_OPENGL
# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
# else
# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
# endif
# endif
/* To disable supression of annoying warnings about floats being promoted
to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
options. */
# if defined(_MSC_VER) && !defined(GLUT_NO_WARNING_DISABLE)
# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
# endif
/* Win32 has an annoying issue where there are multiple C run-time
libraries (CRTs). If the executable is linked with a different CRT
from the GLUT DLL, the GLUT DLL will not share the same CRT static
data seen by the executable. In particular, atexit callbacks registered
in the executable will not be called if GLUT calls its (different)
exit routine). GLUT is typically built with the
"/MD" option (the CRT with multithreading DLL support), but the Visual
C++ linker default is "/ML" (the single threaded CRT).
One workaround to this issue is requiring users to always link with
the same CRT as GLUT is compiled with. That requires users supply a
non-standard option. GLUT 3.7 has its own built-in workaround where
the executable's "exit" function pointer is covertly passed to GLUT.
GLUT then calls the executable's exit function pointer to ensure that
any "atexit" calls registered by the application are called if GLUT
needs to exit.
Note that the __glut*WithExit routines should NEVER be called directly.
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
/* XXX This is from Win32's <process.h> */
# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
/* Define __cdecl for non-Microsoft compilers. */
# define __cdecl
# define GLUT_DEFINED___CDECL
# endif
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
#include <stdlib.h>
#endif
/* GLUT callback calling convention for Win32. */
# define GLUTCALLBACK __cdecl
/* for callback/function pointer defs */
# define GLUTAPIENTRYV __cdecl
/* glut-win32 specific macros, defined to prevent collision with
and redifinition of Windows system defs, also removes requirement of
pretty much any standard windows header from this file */
#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
# define GLUTAPIENTRY __stdcall
#else
# define GLUTAPIENTRY
#endif
/* GLUT API entry point declarations for Win32. */
#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && !defined(GLUT_STATIC)
# define GLUTAPI __declspec(dllexport)
#elif !defined(GLUT_STATIC)
# define GLUTAPI __declspec(dllimport)
#else
# define GLUTAPI extern
#endif
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
# define GLUTAPIENTRY
# define GLUTAPIENTRYV
# define GLUTCALLBACK
# define GLUTAPI extern __attribute__((visibility("default")))
#else
/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing */
# define GLUTAPIENTRY
# define GLUTAPIENTRYV
# define GLUTCALLBACK
# define GLUTAPI extern
#endif
/**
GLUT API revision history:
GLUT_API_VERSION is updated to reflect incompatible GLUT
API changes (interface changes, semantic changes, deletions,
or additions).
GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
extension. Supports new input devices like tablet, dial and button
box, and Spaceball. Easy to query OpenGL extensions.
GLUT_API_VERSION=3 glutMenuStatus added.
GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP)
**/
#ifndef GLUT_API_VERSION /* allow this to be overriden */
#define GLUT_API_VERSION 5
#endif
/**
GLUT implementation revision history:
GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
API revisions and implementation revisions (ie, bug fixes).
GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
GLUT Xlib-based implementation. 11/29/94
GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
GLUT Xlib-based implementation providing GLUT version 2
interfaces.
GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
and video resize. 1/3/97
GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
**/
#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
#define GLUT_XLIB_IMPLEMENTATION 15
#endif
/* Display mode bit masks. */
#define GLUT_RGB 0
#define GLUT_RGBA GLUT_RGB
#define GLUT_INDEX 1
#define GLUT_SINGLE 0
#define GLUT_DOUBLE 2
#define GLUT_ACCUM 4
#define GLUT_ALPHA 8
#define GLUT_DEPTH 16
#define GLUT_STENCIL 32
#if (GLUT_API_VERSION >= 2)
#define GLUT_MULTISAMPLE 128
#define GLUT_STEREO 256
#endif
#if (GLUT_API_VERSION >= 3)
#define GLUT_LUMINANCE 512
#endif
/* Mouse buttons. */
#define GLUT_LEFT_BUTTON 0
#define GLUT_MIDDLE_BUTTON 1
#define GLUT_RIGHT_BUTTON 2
/* Mouse button state. */
#define GLUT_DOWN 0
#define GLUT_UP 1
#if (GLUT_API_VERSION >= 2)
/* function keys */
#define GLUT_KEY_F1 1
#define GLUT_KEY_F2 2
#define GLUT_KEY_F3 3
#define GLUT_KEY_F4 4
#define GLUT_KEY_F5 5
#define GLUT_KEY_F6 6
#define GLUT_KEY_F7 7
#define GLUT_KEY_F8 8
#define GLUT_KEY_F9 9
#define GLUT_KEY_F10 10
#define GLUT_KEY_F11 11
#define GLUT_KEY_F12 12
/* directional keys */
#define GLUT_KEY_LEFT 100
#define GLUT_KEY_UP 101
#define GLUT_KEY_RIGHT 102
#define GLUT_KEY_DOWN 103
#define GLUT_KEY_PAGE_UP 104
#define GLUT_KEY_PAGE_DOWN 105
#define GLUT_KEY_HOME 106
#define GLUT_KEY_END 107
#define GLUT_KEY_INSERT 108
#endif
/* Entry/exit state. */
#define GLUT_LEFT 0
#define GLUT_ENTERED 1
/* Menu usage state. */
#define GLUT_MENU_NOT_IN_USE 0
#define GLUT_MENU_IN_USE 1
/* Visibility state. */
#define GLUT_NOT_VISIBLE 0
#define GLUT_VISIBLE 1
/* Window status state. */
#define GLUT_HIDDEN 0
#define GLUT_FULLY_RETAINED 1
#define GLUT_PARTIALLY_RETAINED 2
#define GLUT_FULLY_COVERED 3
/* Color index component selection values. */
#define GLUT_RED 0
#define GLUT_GREEN 1
#define GLUT_BLUE 2
/* Layers for use. */
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN ((void*)0)
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15 ((void*)2)
#define GLUT_BITMAP_8_BY_13 ((void*)3)
#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
#if (GLUT_API_VERSION >= 3)
#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
#endif
#else
/* Stroke font opaque addresses (use constants instead in source code). */
GLUTAPI void *glutStrokeRoman;
GLUTAPI void *glutStrokeMonoRoman;
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
/* Bitmap font opaque addresses (use constants instead in source code). */
GLUTAPI void *glutBitmap9By15;
GLUTAPI void *glutBitmap8By13;
GLUTAPI void *glutBitmapTimesRoman10;
GLUTAPI void *glutBitmapTimesRoman24;
GLUTAPI void *glutBitmapHelvetica10;
GLUTAPI void *glutBitmapHelvetica12;
GLUTAPI void *glutBitmapHelvetica18;
/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
#if (GLUT_API_VERSION >= 3)
#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
#endif
#endif
/* glutGet parameters. */
#define GLUT_WINDOW_X 100
#define GLUT_WINDOW_Y 101
#define GLUT_WINDOW_WIDTH 102
#define GLUT_WINDOW_HEIGHT 103
#define GLUT_WINDOW_BUFFER_SIZE 104
#define GLUT_WINDOW_STENCIL_SIZE 105
#define GLUT_WINDOW_DEPTH_SIZE 106
#define GLUT_WINDOW_RED_SIZE 107
#define GLUT_WINDOW_GREEN_SIZE 108
#define GLUT_WINDOW_BLUE_SIZE 109
#define GLUT_WINDOW_ALPHA_SIZE 110
#define GLUT_WINDOW_ACCUM_RED_SIZE 111
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
#define GLUT_WINDOW_DOUBLEBUFFER 115
#define GLUT_WINDOW_RGBA 116
#define GLUT_WINDOW_PARENT 117
#define GLUT_WINDOW_NUM_CHILDREN 118
#define GLUT_WINDOW_COLORMAP_SIZE 119
#if (GLUT_API_VERSION >= 2)
#define GLUT_WINDOW_NUM_SAMPLES 120
#define GLUT_WINDOW_STEREO 121
#endif
#if (GLUT_API_VERSION >= 3)
#define GLUT_WINDOW_CURSOR 122
#endif
#define GLUT_SCREEN_WIDTH 200
#define GLUT_SCREEN_HEIGHT 201
#define GLUT_SCREEN_WIDTH_MM 202
#define GLUT_SCREEN_HEIGHT_MM 203
#define GLUT_MENU_NUM_ITEMS 300
#define GLUT_DISPLAY_MODE_POSSIBLE 400
#define GLUT_INIT_WINDOW_X 500
#define GLUT_INIT_WINDOW_Y 501
#define GLUT_INIT_WINDOW_WIDTH 502
#define GLUT_INIT_WINDOW_HEIGHT 503
#define GLUT_INIT_DISPLAY_MODE 504
#if (GLUT_API_VERSION >= 2)
#define GLUT_ELAPSED_TIME 700
#endif
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
#define GLUT_WINDOW_FORMAT_ID 123
#endif
#if (GLUT_API_VERSION >= 2)
/* glutDeviceGet parameters. */
#define GLUT_HAS_KEYBOARD 600
#define GLUT_HAS_MOUSE 601
#define GLUT_HAS_SPACEBALL 602
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
#define GLUT_HAS_TABLET 604
#define GLUT_NUM_MOUSE_BUTTONS 605
#define GLUT_NUM_SPACEBALL_BUTTONS 606
#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
#define GLUT_NUM_DIALS 608
#define GLUT_NUM_TABLET_BUTTONS 609
#endif
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
#define GLUT_DEVICE_KEY_REPEAT 611
#define GLUT_HAS_JOYSTICK 612
#define GLUT_OWNS_JOYSTICK 613
#define GLUT_JOYSTICK_BUTTONS 614
#define GLUT_JOYSTICK_AXES 615
#define GLUT_JOYSTICK_POLL_RATE 616
#endif
#if (GLUT_API_VERSION >= 3)
/* glutLayerGet parameters. */
#define GLUT_OVERLAY_POSSIBLE 800
#define GLUT_LAYER_IN_USE 801
#define GLUT_HAS_OVERLAY 802
#define GLUT_TRANSPARENT_INDEX 803
#define GLUT_NORMAL_DAMAGED 804
#define GLUT_OVERLAY_DAMAGED 805
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
/* glutVideoResizeGet parameters. */
#define GLUT_VIDEO_RESIZE_POSSIBLE 900
#define GLUT_VIDEO_RESIZE_IN_USE 901
#define GLUT_VIDEO_RESIZE_X_DELTA 902
#define GLUT_VIDEO_RESIZE_Y_DELTA 903
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
#define GLUT_VIDEO_RESIZE_X 906
#define GLUT_VIDEO_RESIZE_Y 907
#define GLUT_VIDEO_RESIZE_WIDTH 908
#define GLUT_VIDEO_RESIZE_HEIGHT 909
#endif
/* glutUseLayer parameters. */
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
/* glutGetModifiers return mask. */
#define GLUT_ACTIVE_SHIFT 1
#define GLUT_ACTIVE_CTRL 2
#define GLUT_ACTIVE_ALT 4
/* glutSetCursor parameters. */
/* Basic arrows. */
#define GLUT_CURSOR_RIGHT_ARROW 0
#define GLUT_CURSOR_LEFT_ARROW 1
/* Symbolic cursor shapes. */
#define GLUT_CURSOR_INFO 2
#define GLUT_CURSOR_DESTROY 3
#define GLUT_CURSOR_HELP 4
#define GLUT_CURSOR_CYCLE 5
#define GLUT_CURSOR_SPRAY 6
#define GLUT_CURSOR_WAIT 7
#define GLUT_CURSOR_TEXT 8
#define GLUT_CURSOR_CROSSHAIR 9
/* Directional cursors. */
#define GLUT_CURSOR_UP_DOWN 10
#define GLUT_CURSOR_LEFT_RIGHT 11
/* Sizing cursors. */
#define GLUT_CURSOR_TOP_SIDE 12
#define GLUT_CURSOR_BOTTOM_SIDE 13
#define GLUT_CURSOR_LEFT_SIDE 14
#define GLUT_CURSOR_RIGHT_SIDE 15
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
/* Inherit from parent window. */
#define GLUT_CURSOR_INHERIT 100
/* Blank cursor. */
#define GLUT_CURSOR_NONE 101
/* Fullscreen crosshair (if available). */
#define GLUT_CURSOR_FULL_CROSSHAIR 102
#endif
/* GLUT initialization sub-API. */
GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
#ifndef GLUT_BUILDING_LIB
static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
#define glutInit glutInit_ATEXIT_HACK
#endif
#endif
GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
#endif
GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
/* GLUT window sub-API. */
GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
#ifndef GLUT_BUILDING_LIB
static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
#endif
#endif
GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
#endif
GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
#if (GLUT_API_VERSION >= 3)
GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
#endif
/* GLUT overlay sub-API. */
GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
#endif
GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
#endif
/* GLUT menu sub-API. */
GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
#ifndef GLUT_BUILDING_LIB
static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
#endif
#endif
GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
/* GLUT window callback sub-API. */
GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
#if (GLUT_API_VERSION >= 2)
GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
#if (GLUT_API_VERSION >= 3)
GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
#endif
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
#endif
#endif
#endif
/* GLUT color index sub-API. */
GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue);
GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
/* GLUT state retrieval sub-API. */
GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
#if (GLUT_API_VERSION >= 2)
/* GLUT extension support sub-API */
GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
#endif
#if (GLUT_API_VERSION >= 3)
GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
#endif
#if (GLUT_API_VERSION >= 5)
typedef void (*GLUTproc)();
GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
#endif
/* GLUT font sub-API */
GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
#endif
/* GLUT pre-built models sub-API */
GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
/* GLUT video resize sub-API. */
GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
/* GLUT debugging sub-API. */
GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
#endif
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
/* GLUT device control sub-API. */
/* glutSetKeyRepeat modes. */
#define GLUT_KEY_REPEAT_OFF 0
#define GLUT_KEY_REPEAT_ON 1
#define GLUT_KEY_REPEAT_DEFAULT 2
/* Joystick button masks. */
#define GLUT_JOYSTICK_BUTTON_A 1
#define GLUT_JOYSTICK_BUTTON_B 2
#define GLUT_JOYSTICK_BUTTON_C 4
#define GLUT_JOYSTICK_BUTTON_D 8
GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
/* GLUT game mode sub-API. */
/* glutGameModeGet. */
#define GLUT_GAME_MODE_ACTIVE 0
#define GLUT_GAME_MODE_POSSIBLE 1
#define GLUT_GAME_MODE_WIDTH 2
#define GLUT_GAME_MODE_HEIGHT 3
#define GLUT_GAME_MODE_PIXEL_DEPTH 4
#define GLUT_GAME_MODE_REFRESH_RATE 5
#define GLUT_GAME_MODE_DISPLAY_CHANGED 6
GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __glut_h__ */

View File

@@ -1,340 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.1
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* This header file is based on the REAL glut.h by Mark J. Kilgard.
*
* The DJGPP/ALLEGRO (DJA) GLUT implementation was written by
* Bernhard Tschirren (bernie-t@geocities.com) for the sole purpose
* of compiling all the sample programs (which use GLUT). Therefore,
* is NOT AT ALL a complete version of GLUT!
*/
#ifndef __AGLUT_H__
#define __AGLUT_H__
#include <GL/gl.h>
#include <GL/glu.h>
#define GLUTCALLBACK
#define APIENTRY
#define GLUTAPI extern
#define GLUT_RGB 0
#define GLUT_RGBA GLUT_RGB
#define GLUT_INDEX 1
#define GLUT_SINGLE 0
#define GLUT_DOUBLE 2
#define GLUT_ACCUM 4
#define GLUT_ALPHA 8
#define GLUT_DEPTH 16
#define GLUT_STENCIL 32
/* Mouse buttons. */
#define GLUT_LEFT_BUTTON 0
#define GLUT_MIDDLE_BUTTON 1
#define GLUT_RIGHT_BUTTON 2
/* Mouse button state. */
#define GLUT_DOWN 0
#define GLUT_UP 1
/* function keys */
#define GLUT_KEY_F1 1
#define GLUT_KEY_F2 2
#define GLUT_KEY_F3 3
#define GLUT_KEY_F4 4
#define GLUT_KEY_F5 5
#define GLUT_KEY_F6 6
#define GLUT_KEY_F7 7
#define GLUT_KEY_F8 8
#define GLUT_KEY_F9 9
#define GLUT_KEY_F10 10
#define GLUT_KEY_F11 11
#define GLUT_KEY_F12 12
/* directional keys */
#define GLUT_KEY_LEFT 100
#define GLUT_KEY_UP 101
#define GLUT_KEY_RIGHT 102
#define GLUT_KEY_DOWN 103
#define GLUT_KEY_PAGE_UP 104
#define GLUT_KEY_PAGE_DOWN 105
#define GLUT_KEY_HOME 106
#define GLUT_KEY_END 107
#define GLUT_KEY_INSERT 108
/* Entry/exit state. */
#define GLUT_LEFT 0
#define GLUT_ENTERED 1
/* Visibility state. */
#define GLUT_NOT_VISIBLE 0
#define GLUT_VISIBLE 1
/* Color index component selection values. */
#define GLUT_RED 0
#define GLUT_GREEN 1
#define GLUT_BLUE 2
/* Layers for use. */
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN ((void*)0)
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15 ((void*)2)
#define GLUT_BITMAP_8_BY_13 ((void*)3)
#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
/* glutGet parameters. */
#define GLUT_WINDOW_X 100
#define GLUT_WINDOW_Y 101
#define GLUT_WINDOW_WIDTH 102
#define GLUT_WINDOW_HEIGHT 103
#define GLUT_WINDOW_BUFFER_SIZE 104
#define GLUT_WINDOW_STENCIL_SIZE 105
#define GLUT_WINDOW_DEPTH_SIZE 106
#define GLUT_WINDOW_RED_SIZE 107
#define GLUT_WINDOW_GREEN_SIZE 108
#define GLUT_WINDOW_BLUE_SIZE 109
#define GLUT_WINDOW_ALPHA_SIZE 110
#define GLUT_WINDOW_ACCUM_RED_SIZE 111
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
#define GLUT_WINDOW_DOUBLEBUFFER 115
#define GLUT_WINDOW_RGBA 116
#define GLUT_WINDOW_PARENT 117
#define GLUT_WINDOW_NUM_CHILDREN 118
#define GLUT_WINDOW_COLORMAP_SIZE 119
#define GLUT_WINDOW_NUM_SAMPLES 120
#define GLUT_WINDOW_STEREO 121
#define GLUT_WINDOW_CURSOR 122
#define GLUT_SCREEN_WIDTH 200
#define GLUT_SCREEN_HEIGHT 201
#define GLUT_SCREEN_WIDTH_MM 202
#define GLUT_SCREEN_HEIGHT_MM 203
#define GLUT_MENU_NUM_ITEMS 300
#define GLUT_DISPLAY_MODE_POSSIBLE 400
#define GLUT_INIT_WINDOW_X 500
#define GLUT_INIT_WINDOW_Y 501
#define GLUT_INIT_WINDOW_WIDTH 502
#define GLUT_INIT_WINDOW_HEIGHT 503
#define GLUT_INIT_DISPLAY_MODE 504
#define GLUT_ELAPSED_TIME 700
#define GLUT_WINDOW_FORMAT_ID 123
/* glutDeviceGet parameters. */
#define GLUT_HAS_KEYBOARD 600
#define GLUT_HAS_MOUSE 601
#define GLUT_HAS_SPACEBALL 602
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
#define GLUT_HAS_TABLET 604
#define GLUT_NUM_MOUSE_BUTTONS 605
#define GLUT_NUM_SPACEBALL_BUTTONS 606
#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
#define GLUT_NUM_DIALS 608
#define GLUT_NUM_TABLET_BUTTONS 609
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
#define GLUT_DEVICE_KEY_REPEAT 611
#define GLUT_HAS_JOYSTICK 612
#define GLUT_OWNS_JOYSTICK 613
#define GLUT_JOYSTICK_BUTTONS 614
#define GLUT_JOYSTICK_AXES 615
#define GLUT_JOYSTICK_POLL_RATE 616
/* glutLayerGet parameters. */
#define GLUT_OVERLAY_POSSIBLE 800
#define GLUT_LAYER_IN_USE 801
#define GLUT_HAS_OVERLAY 802
#define GLUT_TRANSPARENT_INDEX 803
#define GLUT_NORMAL_DAMAGED 804
#define GLUT_OVERLAY_DAMAGED 805
/* glutVideoResizeGet parameters. */
#define GLUT_VIDEO_RESIZE_POSSIBLE 900
#define GLUT_VIDEO_RESIZE_IN_USE 901
#define GLUT_VIDEO_RESIZE_X_DELTA 902
#define GLUT_VIDEO_RESIZE_Y_DELTA 903
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
#define GLUT_VIDEO_RESIZE_X 906
#define GLUT_VIDEO_RESIZE_Y 907
#define GLUT_VIDEO_RESIZE_WIDTH 908
#define GLUT_VIDEO_RESIZE_HEIGHT 909
/* glutUseLayer parameters. */
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
/* glutGetModifiers return mask. */
#define GLUT_ACTIVE_SHIFT 1
#define GLUT_ACTIVE_CTRL 2
#define GLUT_ACTIVE_ALT 4
/* glutSetCursor parameters. */
/* Basic arrows. */
#define GLUT_CURSOR_RIGHT_ARROW 0
#define GLUT_CURSOR_LEFT_ARROW 1
/* Symbolic cursor shapes. */
#define GLUT_CURSOR_INFO 2
#define GLUT_CURSOR_DESTROY 3
#define GLUT_CURSOR_HELP 4
#define GLUT_CURSOR_CYCLE 5
#define GLUT_CURSOR_SPRAY 6
#define GLUT_CURSOR_WAIT 7
#define GLUT_CURSOR_TEXT 8
#define GLUT_CURSOR_CROSSHAIR 9
/* Directional cursors. */
#define GLUT_CURSOR_UP_DOWN 10
#define GLUT_CURSOR_LEFT_RIGHT 11
/* Sizing cursors. */
#define GLUT_CURSOR_TOP_SIDE 12
#define GLUT_CURSOR_BOTTOM_SIDE 13
#define GLUT_CURSOR_LEFT_SIDE 14
#define GLUT_CURSOR_RIGHT_SIDE 15
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
/* Inherit from parent window. */
#define GLUT_CURSOR_INHERIT 100
/* Blank cursor. */
#define GLUT_CURSOR_NONE 101
/* Fullscreen crosshair (if available). */
#define GLUT_CURSOR_FULL_CROSSHAIR 102
/* GLUT initialization sub-API. */
GLUTAPI void APIENTRY glutInit(int *argcp, char **argv);
GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode);
GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y);
GLUTAPI void APIENTRY glutInitWindowSize(int width, int height);
GLUTAPI void APIENTRY glutMainLoop(void);
/* GLUT window sub-API. */
GLUTAPI int APIENTRY glutCreateWindow(const char *title);
GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
GLUTAPI void APIENTRY glutDestroyWindow(int win);
GLUTAPI void APIENTRY glutPostRedisplay(void);
GLUTAPI void APIENTRY glutSwapBuffers(void);
GLUTAPI int APIENTRY glutGetWindow(void);
GLUTAPI void APIENTRY glutSetWindow(int win);
GLUTAPI void APIENTRY glutSetWindowTitle(const char *title);
GLUTAPI void APIENTRY glutSetIconTitle(const char *title);
GLUTAPI void APIENTRY glutPositionWindow(int x, int y);
GLUTAPI void APIENTRY glutReshapeWindow(int width, int height);
GLUTAPI void APIENTRY glutPopWindow(void);
GLUTAPI void APIENTRY glutPushWindow(void);
GLUTAPI void APIENTRY glutIconifyWindow(void);
GLUTAPI void APIENTRY glutShowWindow(void);
GLUTAPI void APIENTRY glutHideWindow(void);
/* GLUT overlay sub-API. */
GLUTAPI void APIENTRY glutEstablishOverlay(void);
GLUTAPI void APIENTRY glutRemoveOverlay(void);
GLUTAPI void APIENTRY glutUseLayer(GLenum layer);
GLUTAPI void APIENTRY glutPostOverlayRedisplay(void);
GLUTAPI void APIENTRY glutShowOverlay(void);
GLUTAPI void APIENTRY glutHideOverlay(void);
/* GLUT menu sub-API. */
GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *)(int));
GLUTAPI void APIENTRY glutDestroyMenu(int menu);
GLUTAPI int APIENTRY glutGetMenu(void);
GLUTAPI void APIENTRY glutSetMenu(int menu);
GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value);
GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu);
GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
GLUTAPI void APIENTRY glutRemoveMenuItem(int item);
GLUTAPI void APIENTRY glutAttachMenu(int button);
GLUTAPI void APIENTRY glutDetachMenu(int button);
/* GLUT window callback sub-API. */
GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void));
GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height));
GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y));
GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y));
GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK * func)(int state));
GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK * func)(int state));
GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK * func)(void));
GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK * func)(int value), int value);
GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK * func)(int state));
GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK * func)(int key, int x, int y));
GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK * func)(int x, int y, int z));
GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK * func)(int x, int y, int z));
GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK * func)(int button, int state));
GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK * func)(int button, int state));
GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK * func)(int dial, int value));
GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y));
GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK * func)(int status, int x, int y));
GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK * func)(void));
GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK * func)(int state));
/* GLUT color index sub-API. */
GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component);
GLUTAPI void APIENTRY glutCopyColormap(int win);
/* GLUT state retrieval sub-API. */
GLUTAPI int APIENTRY glutGet(GLenum type);
GLUTAPI int APIENTRY glutDeviceGet(GLenum type);
/* GLUT font sub-API */
GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character);
GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character);
GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character);
GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character);
/* GLUT pre-built models sub-API */
GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUTAPI void APIENTRY glutWireCube(GLdouble size);
GLUTAPI void APIENTRY glutSolidCube(GLdouble size);
GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUTAPI void APIENTRY glutWireDodecahedron(void);
GLUTAPI void APIENTRY glutSolidDodecahedron(void);
GLUTAPI void APIENTRY glutWireTeapot(GLdouble size);
GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size);
GLUTAPI void APIENTRY glutWireOctahedron(void);
GLUTAPI void APIENTRY glutSolidOctahedron(void);
GLUTAPI void APIENTRY glutWireTetrahedron(void);
GLUTAPI void APIENTRY glutSolidTetrahedron(void);
GLUTAPI void APIENTRY glutWireIcosahedron(void);
GLUTAPI void APIENTRY glutSolidIcosahedron(void);
#endif /* __AGLUT_H__ */

View File

@@ -1,81 +0,0 @@
#ifndef __glutf90_h__
#define __glutf90_h__
/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
/* This header provides the binding interface for William Mitchell's
f90gl Fortran 90 GLUT binding. Other GLUT language bindings
can and should use this interace. */
/* I appreciate the guidance from William Mitchell
(mitchell@cam.nist.gov) in developing this friend interface
for use by the f90gl package. See ../../README.fortran */
#include <GL/glut.h>
/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */
/* NOTE These values are part of a binary interface for the f90gl Fortran
90 binding and so must NOT changes (additions are allowed). */
/* GLUTwindow callbacks. */
#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */
#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */
#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */
#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */
#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */
#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */
#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */
#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */
#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */
#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */
#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */
#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */
#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */
#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */
#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */
#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */
#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */
#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */
#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */
#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */
/* Non-GLUTwindow callbacks. */
#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */
#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */
#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */
/* GLUT Fortran callback function types. */
typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void);
typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *);
/* NOTE the pressed key is int, not unsigned char for Fortran! */
typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTentryFCB) (int *);
typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *);
typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *);
typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z);
typedef void (GLUTCALLBACK *GLUTselectFCB) (int *);
typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *);
typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */
typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTidleFCB) (void);
/* Functions that set and return Fortran callback functions. */
GLUTAPI GLUTproc APIENTRY __glutGetFCB(int which);
GLUTAPI void APIENTRY __glutSetFCB(int which, GLUTproc func);
#endif /* __glutf90_h__ */

View File

@@ -1,686 +0,0 @@
/* $Revision: 6822 $ on $Date:: 2008-10-30 05:14:19 -0400 #$ */
/*------------------------------------------------------------------------
*
* OpenVG 1.0.1 Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 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 MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief OpenVG 1.0.1 API.
*//*-------------------------------------------------------------------*/
#ifndef _OPENVG_H
#define _OPENVG_H
#include <VG/vgplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
#define OPENVG_VERSION_1_0 1
#define OPENVG_VERSION_1_0_1 1
#ifndef VG_MAXSHORT
#define VG_MAXSHORT 0x7FFF
#endif
#ifndef VG_MAXINT
#define VG_MAXINT 0x7FFFFFFF
#endif
#ifndef VG_MAX_ENUM
#define VG_MAX_ENUM 0x7FFFFFFF
#endif
typedef long VGHandle;
typedef VGHandle VGPath;
typedef VGHandle VGImage;
typedef VGHandle VGPaint;
#define VG_INVALID_HANDLE ((VGHandle)0)
typedef enum {
VG_FALSE = 0,
VG_TRUE = 1,
VG_BOOLEAN_FORCE_SIZE = VG_MAX_ENUM
} VGboolean;
typedef enum {
VG_NO_ERROR = 0,
VG_BAD_HANDLE_ERROR = 0x1000,
VG_ILLEGAL_ARGUMENT_ERROR = 0x1001,
VG_OUT_OF_MEMORY_ERROR = 0x1002,
VG_PATH_CAPABILITY_ERROR = 0x1003,
VG_UNSUPPORTED_IMAGE_FORMAT_ERROR = 0x1004,
VG_UNSUPPORTED_PATH_FORMAT_ERROR = 0x1005,
VG_IMAGE_IN_USE_ERROR = 0x1006,
VG_NO_CONTEXT_ERROR = 0x1007,
VG_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
} VGErrorCode;
typedef enum {
/* Mode settings */
VG_MATRIX_MODE = 0x1100,
VG_FILL_RULE = 0x1101,
VG_IMAGE_QUALITY = 0x1102,
VG_RENDERING_QUALITY = 0x1103,
VG_BLEND_MODE = 0x1104,
VG_IMAGE_MODE = 0x1105,
/* Scissoring rectangles */
VG_SCISSOR_RECTS = 0x1106,
/* Stroke parameters */
VG_STROKE_LINE_WIDTH = 0x1110,
VG_STROKE_CAP_STYLE = 0x1111,
VG_STROKE_JOIN_STYLE = 0x1112,
VG_STROKE_MITER_LIMIT = 0x1113,
VG_STROKE_DASH_PATTERN = 0x1114,
VG_STROKE_DASH_PHASE = 0x1115,
VG_STROKE_DASH_PHASE_RESET = 0x1116,
/* Edge fill color for VG_TILE_FILL tiling mode */
VG_TILE_FILL_COLOR = 0x1120,
/* Color for vgClear */
VG_CLEAR_COLOR = 0x1121,
/* Enable/disable alpha masking and scissoring */
VG_MASKING = 0x1130,
VG_SCISSORING = 0x1131,
/* Pixel layout information */
VG_PIXEL_LAYOUT = 0x1140,
VG_SCREEN_LAYOUT = 0x1141,
/* Source format selection for image filters */
VG_FILTER_FORMAT_LINEAR = 0x1150,
VG_FILTER_FORMAT_PREMULTIPLIED = 0x1151,
/* Destination write enable mask for image filters */
VG_FILTER_CHANNEL_MASK = 0x1152,
/* Implementation limits (read-only) */
VG_MAX_SCISSOR_RECTS = 0x1160,
VG_MAX_DASH_COUNT = 0x1161,
VG_MAX_KERNEL_SIZE = 0x1162,
VG_MAX_SEPARABLE_KERNEL_SIZE = 0x1163,
VG_MAX_COLOR_RAMP_STOPS = 0x1164,
VG_MAX_IMAGE_WIDTH = 0x1165,
VG_MAX_IMAGE_HEIGHT = 0x1166,
VG_MAX_IMAGE_PIXELS = 0x1167,
VG_MAX_IMAGE_BYTES = 0x1168,
VG_MAX_FLOAT = 0x1169,
VG_MAX_GAUSSIAN_STD_DEVIATION = 0x116A,
VG_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGParamType;
typedef enum {
VG_RENDERING_QUALITY_NONANTIALIASED = 0x1200,
VG_RENDERING_QUALITY_FASTER = 0x1201,
VG_RENDERING_QUALITY_BETTER = 0x1202, /* Default */
VG_RENDERING_QUALITY_FORCE_SIZE = VG_MAX_ENUM
} VGRenderingQuality;
typedef enum {
VG_PIXEL_LAYOUT_UNKNOWN = 0x1300,
VG_PIXEL_LAYOUT_RGB_VERTICAL = 0x1301,
VG_PIXEL_LAYOUT_BGR_VERTICAL = 0x1302,
VG_PIXEL_LAYOUT_RGB_HORIZONTAL = 0x1303,
VG_PIXEL_LAYOUT_BGR_HORIZONTAL = 0x1304,
VG_PIXEL_LAYOUT_FORCE_SIZE = VG_MAX_ENUM
} VGPixelLayout;
typedef enum {
VG_MATRIX_PATH_USER_TO_SURFACE = 0x1400,
VG_MATRIX_IMAGE_USER_TO_SURFACE = 0x1401,
VG_MATRIX_FILL_PAINT_TO_USER = 0x1402,
VG_MATRIX_STROKE_PAINT_TO_USER = 0x1403,
VG_MATRIX_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGMatrixMode;
typedef enum {
VG_CLEAR_MASK = 0x1500,
VG_FILL_MASK = 0x1501,
VG_SET_MASK = 0x1502,
VG_UNION_MASK = 0x1503,
VG_INTERSECT_MASK = 0x1504,
VG_SUBTRACT_MASK = 0x1505,
VG_MASK_OPERATION_FORCE_SIZE = VG_MAX_ENUM
} VGMaskOperation;
#define VG_PATH_FORMAT_STANDARD 0
typedef enum {
VG_PATH_DATATYPE_S_8 = 0,
VG_PATH_DATATYPE_S_16 = 1,
VG_PATH_DATATYPE_S_32 = 2,
VG_PATH_DATATYPE_F = 3,
VG_PATH_DATATYPE_FORCE_SIZE = VG_MAX_ENUM
} VGPathDatatype;
typedef enum {
VG_ABSOLUTE = 0,
VG_RELATIVE = 1,
VG_PATH_ABS_REL_FORCE_SIZE = VG_MAX_ENUM
} VGPathAbsRel;
typedef enum {
VG_CLOSE_PATH = ( 0 << 1),
VG_MOVE_TO = ( 1 << 1),
VG_LINE_TO = ( 2 << 1),
VG_HLINE_TO = ( 3 << 1),
VG_VLINE_TO = ( 4 << 1),
VG_QUAD_TO = ( 5 << 1),
VG_CUBIC_TO = ( 6 << 1),
VG_SQUAD_TO = ( 7 << 1),
VG_SCUBIC_TO = ( 8 << 1),
VG_SCCWARC_TO = ( 9 << 1),
VG_SCWARC_TO = (10 << 1),
VG_LCCWARC_TO = (11 << 1),
VG_LCWARC_TO = (12 << 1),
VG_PATH_SEGMENT_FORCE_SIZE = VG_MAX_ENUM
} VGPathSegment;
typedef enum {
VG_MOVE_TO_ABS = VG_MOVE_TO | VG_ABSOLUTE,
VG_MOVE_TO_REL = VG_MOVE_TO | VG_RELATIVE,
VG_LINE_TO_ABS = VG_LINE_TO | VG_ABSOLUTE,
VG_LINE_TO_REL = VG_LINE_TO | VG_RELATIVE,
VG_HLINE_TO_ABS = VG_HLINE_TO | VG_ABSOLUTE,
VG_HLINE_TO_REL = VG_HLINE_TO | VG_RELATIVE,
VG_VLINE_TO_ABS = VG_VLINE_TO | VG_ABSOLUTE,
VG_VLINE_TO_REL = VG_VLINE_TO | VG_RELATIVE,
VG_QUAD_TO_ABS = VG_QUAD_TO | VG_ABSOLUTE,
VG_QUAD_TO_REL = VG_QUAD_TO | VG_RELATIVE,
VG_CUBIC_TO_ABS = VG_CUBIC_TO | VG_ABSOLUTE,
VG_CUBIC_TO_REL = VG_CUBIC_TO | VG_RELATIVE,
VG_SQUAD_TO_ABS = VG_SQUAD_TO | VG_ABSOLUTE,
VG_SQUAD_TO_REL = VG_SQUAD_TO | VG_RELATIVE,
VG_SCUBIC_TO_ABS = VG_SCUBIC_TO | VG_ABSOLUTE,
VG_SCUBIC_TO_REL = VG_SCUBIC_TO | VG_RELATIVE,
VG_SCCWARC_TO_ABS = VG_SCCWARC_TO | VG_ABSOLUTE,
VG_SCCWARC_TO_REL = VG_SCCWARC_TO | VG_RELATIVE,
VG_SCWARC_TO_ABS = VG_SCWARC_TO | VG_ABSOLUTE,
VG_SCWARC_TO_REL = VG_SCWARC_TO | VG_RELATIVE,
VG_LCCWARC_TO_ABS = VG_LCCWARC_TO | VG_ABSOLUTE,
VG_LCCWARC_TO_REL = VG_LCCWARC_TO | VG_RELATIVE,
VG_LCWARC_TO_ABS = VG_LCWARC_TO | VG_ABSOLUTE,
VG_LCWARC_TO_REL = VG_LCWARC_TO | VG_RELATIVE,
VG_PATH_COMMAND_FORCE_SIZE = VG_MAX_ENUM
} VGPathCommand;
typedef enum {
VG_PATH_CAPABILITY_APPEND_FROM = (1 << 0),
VG_PATH_CAPABILITY_APPEND_TO = (1 << 1),
VG_PATH_CAPABILITY_MODIFY = (1 << 2),
VG_PATH_CAPABILITY_TRANSFORM_FROM = (1 << 3),
VG_PATH_CAPABILITY_TRANSFORM_TO = (1 << 4),
VG_PATH_CAPABILITY_INTERPOLATE_FROM = (1 << 5),
VG_PATH_CAPABILITY_INTERPOLATE_TO = (1 << 6),
VG_PATH_CAPABILITY_PATH_LENGTH = (1 << 7),
VG_PATH_CAPABILITY_POINT_ALONG_PATH = (1 << 8),
VG_PATH_CAPABILITY_TANGENT_ALONG_PATH = (1 << 9),
VG_PATH_CAPABILITY_PATH_BOUNDS = (1 << 10),
VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS = (1 << 11),
VG_PATH_CAPABILITY_ALL = (1 << 12) - 1,
VG_PATH_CAPABILITIES_FORCE_SIZE = VG_MAX_ENUM
} VGPathCapabilities;
typedef enum {
VG_PATH_FORMAT = 0x1600,
VG_PATH_DATATYPE = 0x1601,
VG_PATH_SCALE = 0x1602,
VG_PATH_BIAS = 0x1603,
VG_PATH_NUM_SEGMENTS = 0x1604,
VG_PATH_NUM_COORDS = 0x1605,
VG_PATH_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGPathParamType;
typedef enum {
VG_CAP_BUTT = 0x1700,
VG_CAP_ROUND = 0x1701,
VG_CAP_SQUARE = 0x1702,
VG_CAP_STYLE_FORCE_SIZE = VG_MAX_ENUM
} VGCapStyle;
typedef enum {
VG_JOIN_MITER = 0x1800,
VG_JOIN_ROUND = 0x1801,
VG_JOIN_BEVEL = 0x1802,
VG_JOIN_STYLE_FORCE_SIZE = VG_MAX_ENUM
} VGJoinStyle;
typedef enum {
VG_EVEN_ODD = 0x1900,
VG_NON_ZERO = 0x1901,
VG_FILL_RULE_FORCE_SIZE = VG_MAX_ENUM
} VGFillRule;
typedef enum {
VG_STROKE_PATH = (1 << 0),
VG_FILL_PATH = (1 << 1),
VG_PAINT_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGPaintMode;
typedef enum {
/* Color paint parameters */
VG_PAINT_TYPE = 0x1A00,
VG_PAINT_COLOR = 0x1A01,
VG_PAINT_COLOR_RAMP_SPREAD_MODE = 0x1A02,
VG_PAINT_COLOR_RAMP_PREMULTIPLIED = 0x1A07,
VG_PAINT_COLOR_RAMP_STOPS = 0x1A03,
/* Linear gradient paint parameters */
VG_PAINT_LINEAR_GRADIENT = 0x1A04,
/* Radial gradient paint parameters */
VG_PAINT_RADIAL_GRADIENT = 0x1A05,
/* Pattern paint parameters */
VG_PAINT_PATTERN_TILING_MODE = 0x1A06,
VG_PAINT_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGPaintParamType;
typedef enum {
VG_PAINT_TYPE_COLOR = 0x1B00,
VG_PAINT_TYPE_LINEAR_GRADIENT = 0x1B01,
VG_PAINT_TYPE_RADIAL_GRADIENT = 0x1B02,
VG_PAINT_TYPE_PATTERN = 0x1B03,
VG_PAINT_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGPaintType;
typedef enum {
VG_COLOR_RAMP_SPREAD_PAD = 0x1C00,
VG_COLOR_RAMP_SPREAD_REPEAT = 0x1C01,
VG_COLOR_RAMP_SPREAD_REFLECT = 0x1C02,
VG_COLOR_RAMP_SPREAD_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGColorRampSpreadMode;
typedef enum {
VG_TILE_FILL = 0x1D00,
VG_TILE_PAD = 0x1D01,
VG_TILE_REPEAT = 0x1D02,
VG_TILE_REFLECT = 0x1D03,
VG_TILING_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGTilingMode;
typedef enum {
/* RGB{A,X} channel ordering */
VG_sRGBX_8888 = 0,
VG_sRGBA_8888 = 1,
VG_sRGBA_8888_PRE = 2,
VG_sRGB_565 = 3,
VG_sRGBA_5551 = 4,
VG_sRGBA_4444 = 5,
VG_sL_8 = 6,
VG_lRGBX_8888 = 7,
VG_lRGBA_8888 = 8,
VG_lRGBA_8888_PRE = 9,
VG_lL_8 = 10,
VG_A_8 = 11,
VG_BW_1 = 12,
/* {A,X}RGB channel ordering */
VG_sXRGB_8888 = 0 | (1 << 6),
VG_sARGB_8888 = 1 | (1 << 6),
VG_sARGB_8888_PRE = 2 | (1 << 6),
VG_sARGB_1555 = 4 | (1 << 6),
VG_sARGB_4444 = 5 | (1 << 6),
VG_lXRGB_8888 = 7 | (1 << 6),
VG_lARGB_8888 = 8 | (1 << 6),
VG_lARGB_8888_PRE = 9 | (1 << 6),
/* BGR{A,X} channel ordering */
VG_sBGRX_8888 = 0 | (1 << 7),
VG_sBGRA_8888 = 1 | (1 << 7),
VG_sBGRA_8888_PRE = 2 | (1 << 7),
VG_sBGR_565 = 3 | (1 << 7),
VG_sBGRA_5551 = 4 | (1 << 7),
VG_sBGRA_4444 = 5 | (1 << 7),
VG_lBGRX_8888 = 7 | (1 << 7),
VG_lBGRA_8888 = 8 | (1 << 7),
VG_lBGRA_8888_PRE = 9 | (1 << 7),
/* {A,X}BGR channel ordering */
VG_sXBGR_8888 = 0 | (1 << 6) | (1 << 7),
VG_sABGR_8888 = 1 | (1 << 6) | (1 << 7),
VG_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7),
VG_sABGR_1555 = 4 | (1 << 6) | (1 << 7),
VG_sABGR_4444 = 5 | (1 << 6) | (1 << 7),
VG_lXBGR_8888 = 7 | (1 << 6) | (1 << 7),
VG_lABGR_8888 = 8 | (1 << 6) | (1 << 7),
VG_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7),
VG_IMAGE_FORMAT_FORCE_SIZE = VG_MAX_ENUM
} VGImageFormat;
typedef enum {
VG_IMAGE_QUALITY_NONANTIALIASED = (1 << 0),
VG_IMAGE_QUALITY_FASTER = (1 << 1),
VG_IMAGE_QUALITY_BETTER = (1 << 2),
VG_IMAGE_QUALITY_FORCE_SIZE = VG_MAX_ENUM
} VGImageQuality;
typedef enum {
VG_IMAGE_FORMAT = 0x1E00,
VG_IMAGE_WIDTH = 0x1E01,
VG_IMAGE_HEIGHT = 0x1E02,
VG_IMAGE_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGImageParamType;
typedef enum {
VG_DRAW_IMAGE_NORMAL = 0x1F00,
VG_DRAW_IMAGE_MULTIPLY = 0x1F01,
VG_DRAW_IMAGE_STENCIL = 0x1F02,
VG_IMAGE_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGImageMode;
typedef enum {
VG_RED = (1 << 3),
VG_GREEN = (1 << 2),
VG_BLUE = (1 << 1),
VG_ALPHA = (1 << 0),
VG_IMAGE_CHANNEL_FORCE_SIZE = VG_MAX_ENUM
} VGImageChannel;
typedef enum {
VG_BLEND_SRC = 0x2000,
VG_BLEND_SRC_OVER = 0x2001,
VG_BLEND_DST_OVER = 0x2002,
VG_BLEND_SRC_IN = 0x2003,
VG_BLEND_DST_IN = 0x2004,
VG_BLEND_MULTIPLY = 0x2005,
VG_BLEND_SCREEN = 0x2006,
VG_BLEND_DARKEN = 0x2007,
VG_BLEND_LIGHTEN = 0x2008,
VG_BLEND_ADDITIVE = 0x2009,
VG_BLEND_MODE_FORCE_SIZE = VG_MAX_ENUM
} VGBlendMode;
typedef enum {
VG_IMAGE_FORMAT_QUERY = 0x2100,
VG_PATH_DATATYPE_QUERY = 0x2101,
VG_HARDWARE_QUERY_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGHardwareQueryType;
typedef enum {
VG_HARDWARE_ACCELERATED = 0x2200,
VG_HARDWARE_UNACCELERATED = 0x2201,
VG_HARDWARE_QUERY_RESULT_FORCE_SIZE = VG_MAX_ENUM
} VGHardwareQueryResult;
typedef enum {
VG_VENDOR = 0x2300,
VG_RENDERER = 0x2301,
VG_VERSION = 0x2302,
VG_EXTENSIONS = 0x2303,
VG_STRING_ID_FORCE_SIZE = VG_MAX_ENUM
} VGStringID;
/* Function Prototypes */
#ifndef VG_API_CALL
# error VG_API_CALL must be defined
#endif
#ifndef VG_API_ENTRY
# error VG_API_ENTRY must be defined
#endif
#ifndef VG_API_EXIT
# error VG_API_EXIT must be defined
#endif
VG_API_CALL VGErrorCode VG_API_ENTRY vgGetError(void) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgFlush(void) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgFinish(void) VG_API_EXIT;
/* Getters and Setters */
VG_API_CALL void VG_API_ENTRY vgSetf (VGParamType type, VGfloat value) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSeti (VGParamType type, VGint value) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetfv(VGParamType type, VGint count,
const VGfloat * values) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetiv(VGParamType type, VGint count,
const VGint * values) VG_API_EXIT;
VG_API_CALL VGfloat VG_API_ENTRY vgGetf(VGParamType type) VG_API_EXIT;
VG_API_CALL VGint VG_API_ENTRY vgGeti(VGParamType type) VG_API_EXIT;
VG_API_CALL VGint VG_API_ENTRY vgGetVectorSize(VGParamType type) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgGetfv(VGParamType type, VGint count, VGfloat * values) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgGetiv(VGParamType type, VGint count, VGint * values) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetParameterf(VGHandle object,
VGint paramType,
VGfloat value) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetParameteri(VGHandle object,
VGint paramType,
VGint value) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetParameterfv(VGHandle object,
VGint paramType,
VGint count, const VGfloat * values) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetParameteriv(VGHandle object,
VGint paramType,
VGint count, const VGint * values) VG_API_EXIT;
VG_API_CALL VGfloat VG_API_ENTRY vgGetParameterf(VGHandle object,
VGint paramType) VG_API_EXIT;
VG_API_CALL VGint VG_API_ENTRY vgGetParameteri(VGHandle object,
VGint paramType);
VG_API_CALL VGint VG_API_ENTRY vgGetParameterVectorSize(VGHandle object,
VGint paramType) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgGetParameterfv(VGHandle object,
VGint paramType,
VGint count, VGfloat * values) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgGetParameteriv(VGHandle object,
VGint paramType,
VGint count, VGint * values) VG_API_EXIT;
/* Matrix Manipulation */
VG_API_CALL void VG_API_ENTRY vgLoadIdentity(void) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgLoadMatrix(const VGfloat * m) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgGetMatrix(VGfloat * m) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgMultMatrix(const VGfloat * m) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgTranslate(VGfloat tx, VGfloat ty) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgScale(VGfloat sx, VGfloat sy) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgShear(VGfloat shx, VGfloat shy) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgRotate(VGfloat angle) VG_API_EXIT;
/* Masking and Clearing */
VG_API_CALL void VG_API_ENTRY vgMask(VGImage mask, VGMaskOperation operation,
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgClear(VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
/* Paths */
VG_API_CALL VGPath VG_API_ENTRY vgCreatePath(VGint pathFormat,
VGPathDatatype datatype,
VGfloat scale, VGfloat bias,
VGint segmentCapacityHint,
VGint coordCapacityHint,
VGbitfield capabilities) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgClearPath(VGPath path, VGbitfield capabilities) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDestroyPath(VGPath path) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgRemovePathCapabilities(VGPath path,
VGbitfield capabilities) VG_API_EXIT;
VG_API_CALL VGbitfield VG_API_ENTRY vgGetPathCapabilities(VGPath path) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgAppendPath(VGPath dstPath, VGPath srcPath) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgAppendPathData(VGPath dstPath,
VGint numSegments,
const VGubyte * pathSegments,
const void * pathData) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgModifyPathCoords(VGPath dstPath, VGint startIndex,
VGint numSegments,
const void * pathData) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgTransformPath(VGPath dstPath, VGPath srcPath) VG_API_EXIT;
VG_API_CALL VGboolean VG_API_ENTRY vgInterpolatePath(VGPath dstPath,
VGPath startPath,
VGPath endPath,
VGfloat amount) VG_API_EXIT;
VG_API_CALL VGfloat VG_API_ENTRY vgPathLength(VGPath path,
VGint startSegment, VGint numSegments) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgPointAlongPath(VGPath path,
VGint startSegment, VGint numSegments,
VGfloat distance,
VGfloat * x, VGfloat * y,
VGfloat * tangentX, VGfloat * tangentY) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgPathBounds(VGPath path,
VGfloat * minX, VGfloat * minY,
VGfloat * width, VGfloat * height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgPathTransformedBounds(VGPath path,
VGfloat * minX, VGfloat * minY,
VGfloat * width, VGfloat * height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDrawPath(VGPath path, VGbitfield paintModes) VG_API_EXIT;
/* Paint */
VG_API_CALL VGPaint VG_API_ENTRY vgCreatePaint(void) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDestroyPaint(VGPaint paint) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetPaint(VGPaint paint, VGbitfield paintModes) VG_API_EXIT;
VG_API_CALL VGPaint VG_API_ENTRY vgGetPaint(VGPaintMode paintMode) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetColor(VGPaint paint, VGuint rgba) VG_API_EXIT;
VG_API_CALL VGuint VG_API_ENTRY vgGetColor(VGPaint paint) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgPaintPattern(VGPaint paint, VGImage pattern) VG_API_EXIT;
/* Images */
VG_API_CALL VGImage VG_API_ENTRY vgCreateImage(VGImageFormat format,
VGint width, VGint height,
VGbitfield allowedQuality) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDestroyImage(VGImage image) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgClearImage(VGImage image,
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgImageSubData(VGImage image,
const void * data, VGint dataStride,
VGImageFormat dataFormat,
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgGetImageSubData(VGImage image,
void * data, VGint dataStride,
VGImageFormat dataFormat,
VGint x, VGint y,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL VGImage VG_API_ENTRY vgChildImage(VGImage parent,
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
VG_API_CALL VGImage VG_API_ENTRY vgGetParent(VGImage image) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgCopyImage(VGImage dst, VGint dx, VGint dy,
VGImage src, VGint sx, VGint sy,
VGint width, VGint height,
VGboolean dither) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgDrawImage(VGImage image) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSetPixels(VGint dx, VGint dy,
VGImage src, VGint sx, VGint sy,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgWritePixels(const void * data, VGint dataStride,
VGImageFormat dataFormat,
VGint dx, VGint dy,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgGetPixels(VGImage dst, VGint dx, VGint dy,
VGint sx, VGint sy,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgReadPixels(void * data, VGint dataStride,
VGImageFormat dataFormat,
VGint sx, VGint sy,
VGint width, VGint height) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgCopyPixels(VGint dx, VGint dy,
VGint sx, VGint sy,
VGint width, VGint height) VG_API_EXIT;
/* Image Filters */
VG_API_CALL void VG_API_ENTRY vgColorMatrix(VGImage dst, VGImage src,
const VGfloat * matrix) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgConvolve(VGImage dst, VGImage src,
VGint kernelWidth, VGint kernelHeight,
VGint shiftX, VGint shiftY,
const VGshort * kernel,
VGfloat scale,
VGfloat bias,
VGTilingMode tilingMode) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgSeparableConvolve(VGImage dst, VGImage src,
VGint kernelWidth,
VGint kernelHeight,
VGint shiftX, VGint shiftY,
const VGshort * kernelX,
const VGshort * kernelY,
VGfloat scale,
VGfloat bias,
VGTilingMode tilingMode) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgGaussianBlur(VGImage dst, VGImage src,
VGfloat stdDeviationX,
VGfloat stdDeviationY,
VGTilingMode tilingMode) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgLookup(VGImage dst, VGImage src,
const VGubyte * redLUT,
const VGubyte * greenLUT,
const VGubyte * blueLUT,
const VGubyte * alphaLUT,
VGboolean outputLinear,
VGboolean outputPremultiplied) VG_API_EXIT;
VG_API_CALL void VG_API_ENTRY vgLookupSingle(VGImage dst, VGImage src,
const VGuint * lookupTable,
VGImageChannel sourceChannel,
VGboolean outputLinear,
VGboolean outputPremultiplied) VG_API_EXIT;
/* Hardware Queries */
VG_API_CALL VGHardwareQueryResult VG_API_ENTRY vgHardwareQuery(VGHardwareQueryType key,
VGint setting) VG_API_EXIT;
/* Renderer and Extension Information */
VG_API_CALL const VGubyte * VG_API_ENTRY vgGetString(VGStringID name) VG_API_EXIT;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _OPENVG_H */

View File

@@ -1,233 +0,0 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VG extensions Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 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 MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG extensions
*//*-------------------------------------------------------------------*/
#ifndef _VGEXT_H
#define _VGEXT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#include <VG/vgu.h>
#ifndef VG_API_ENTRYP
# define VG_API_ENTRYP VG_API_ENTRY*
#endif
#ifndef VGU_API_ENTRYP
# define VGU_API_ENTRYP VGU_API_ENTRY*
#endif
/*-------------------------------------------------------------------------------
* KHR extensions
*------------------------------------------------------------------------------*/
typedef enum {
#ifndef VG_KHR_iterative_average_blur
VG_MAX_AVERAGE_BLUR_DIMENSION_KHR = 0x116B,
VG_AVERAGE_BLUR_DIMENSION_RESOLUTION_KHR = 0x116C,
VG_MAX_AVERAGE_BLUR_ITERATIONS_KHR = 0x116D,
#endif
VG_PARAM_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeKHR;
#ifndef VG_KHR_EGL_image
#define VG_KHR_EGL_image 1
/* VGEGLImageKHR is an opaque handle to an EGLImage */
typedef void* VGeglImageKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL VGImage VG_API_ENTRY vgCreateEGLImageTargetKHR(VGeglImageKHR image);
#endif
typedef VGImage (VG_API_ENTRYP PFNVGCREATEEGLIMAGETARGETKHRPROC) (VGeglImageKHR image);
#endif
#ifndef VG_KHR_iterative_average_blur
#define VG_KHR_iterative_average_blur 1
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void vgIterativeAverageBlurKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
typedef void (VG_API_ENTRYP PFNVGITERATIVEAVERAGEBLURKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
#endif
#ifndef VG_KHR_advanced_blending
#define VG_KHR_advanced_blending 1
typedef enum {
VG_BLEND_OVERLAY_KHR = 0x2010,
VG_BLEND_HARDLIGHT_KHR = 0x2011,
VG_BLEND_SOFTLIGHT_SVG_KHR = 0x2012,
VG_BLEND_SOFTLIGHT_KHR = 0x2013,
VG_BLEND_COLORDODGE_KHR = 0x2014,
VG_BLEND_COLORBURN_KHR = 0x2015,
VG_BLEND_DIFFERENCE_KHR = 0x2016,
VG_BLEND_SUBTRACT_KHR = 0x2017,
VG_BLEND_INVERT_KHR = 0x2018,
VG_BLEND_EXCLUSION_KHR = 0x2019,
VG_BLEND_LINEARDODGE_KHR = 0x201a,
VG_BLEND_LINEARBURN_KHR = 0x201b,
VG_BLEND_VIVIDLIGHT_KHR = 0x201c,
VG_BLEND_LINEARLIGHT_KHR = 0x201d,
VG_BLEND_PINLIGHT_KHR = 0x201e,
VG_BLEND_HARDMIX_KHR = 0x201f,
VG_BLEND_CLEAR_KHR = 0x2020,
VG_BLEND_DST_KHR = 0x2021,
VG_BLEND_SRC_OUT_KHR = 0x2022,
VG_BLEND_DST_OUT_KHR = 0x2023,
VG_BLEND_SRC_ATOP_KHR = 0x2024,
VG_BLEND_DST_ATOP_KHR = 0x2025,
VG_BLEND_XOR_KHR = 0x2026,
VG_BLEND_MODE_KHR_FORCE_SIZE= VG_MAX_ENUM
} VGBlendModeKHR;
#endif
#ifndef VG_KHR_parametric_filter
#define VG_KHR_parametric_filter 1
typedef enum {
VG_PF_OBJECT_VISIBLE_FLAG_KHR = (1 << 0),
VG_PF_KNOCKOUT_FLAG_KHR = (1 << 1),
VG_PF_OUTER_FLAG_KHR = (1 << 2),
VG_PF_INNER_FLAG_KHR = (1 << 3),
VG_PF_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGPfTypeKHR;
typedef enum {
VGU_IMAGE_IN_USE_ERROR = 0xF010,
VGU_ERROR_CODE_KHR_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCodeKHR;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgParametricFilterKHR(VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguDropShadowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
typedef void (VG_API_ENTRYP PFNVGPARAMETRICFILTERKHRPROC) (VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUDROPSHADOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
#endif
/*-------------------------------------------------------------------------------
* NDS extensions
*------------------------------------------------------------------------------*/
#ifndef VG_NDS_paint_generation
#define VG_NDS_paint_generation 1
typedef enum {
VG_PAINT_COLOR_RAMP_LINEAR_NDS = 0x1A10,
VG_COLOR_MATRIX_NDS = 0x1A11,
VG_PAINT_COLOR_TRANSFORM_LINEAR_NDS = 0x1A12,
VG_PAINT_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPaintParamTypeNds;
typedef enum {
VG_DRAW_IMAGE_COLOR_MATRIX_NDS = 0x1F10,
VG_IMAGE_MODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGImageModeNds;
#endif
#ifndef VG_NDS_projective_geometry
#define VG_NDS_projective_geometry 1
typedef enum {
VG_CLIP_MODE_NDS = 0x1180,
VG_CLIP_LINES_NDS = 0x1181,
VG_MAX_CLIP_LINES_NDS = 0x1182,
VG_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGParamTypeNds;
typedef enum {
VG_CLIPMODE_NONE_NDS = 0x3000,
VG_CLIPMODE_CLIP_CLOSED_NDS = 0x3001,
VG_CLIPMODE_CLIP_OPEN_NDS = 0x3002,
VG_CLIPMODE_CULL_NDS = 0x3003,
VG_CLIPMODE_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGClipModeNds;
typedef enum {
VG_RQUAD_TO_NDS = ( 13 << 1 ),
VG_RCUBIC_TO_NDS = ( 14 << 1 ),
VG_PATH_SEGMENT_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathSegmentNds;
typedef enum {
VG_RQUAD_TO_ABS_NDS = (VG_RQUAD_TO_NDS | VG_ABSOLUTE),
VG_RQUAD_TO_REL_NDS = (VG_RQUAD_TO_NDS | VG_RELATIVE),
VG_RCUBIC_TO_ABS_NDS = (VG_RCUBIC_TO_NDS | VG_ABSOLUTE),
VG_RCUBIC_TO_REL_NDS = (VG_RCUBIC_TO_NDS | VG_RELATIVE),
VG_PATH_COMMAND_NDS_FORCE_SIZE = VG_MAX_ENUM
} VGPathCommandNds;
#ifdef VG_VGEXT_PROTOTYPES
VG_API_CALL void VG_API_ENTRY vgProjectiveMatrixNDS(VGboolean enable) ;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguTransformClipLineNDS(const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
typedef void (VG_API_ENTRYP PFNVGPROJECTIVEMATRIXNDSPROC) (VGboolean enable) ;
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUTRANSFORMCLIPLINENDSPROC) (const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGEXT_H */

View File

@@ -1,106 +0,0 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VG platform specific header Reference Implementation
* ----------------------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 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 MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VG platform specific header
*//*-------------------------------------------------------------------*/
#ifndef _VGPLATFORM_H
#define _VGPLATFORM_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef VG_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VG_API_CALL
#else
# if defined(_WIN32) || defined(__VC32__) /* Win32 */
# if defined (OPENVG_DLL_EXPORTS)
# define VG_API_CALL __declspec(dllexport)
# else
# define VG_API_CALL __declspec(dllimport)
# endif
# else
# define VG_API_CALL extern
# endif /* defined(_WIN32) ||... */
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VG_API_CALL */
#ifndef VGU_API_CALL
#if defined(OPENVG_STATIC_LIBRARY)
# define VGU_API_CALL
#else
# if defined(_WIN32) || defined(__VC32__) /* Win32 */
# if defined (OPENVG_DLL_EXPORTS)
# define VGU_API_CALL __declspec(dllexport)
# else
# define VGU_API_CALL __declspec(dllimport)
# endif
# else
# define VGU_API_CALL extern
# endif /* defined(_WIN32) ||... */
#endif /* defined OPENVG_STATIC_LIBRARY */
#endif /* ifndef VGU_API_CALL */
#ifndef VG_API_ENTRY
#define VG_API_ENTRY
#endif
#ifndef VG_API_EXIT
#define VG_API_EXIT
#endif
#ifndef VGU_API_ENTRY
#define VGU_API_ENTRY
#endif
#ifndef VGU_API_EXIT
#define VGU_API_EXIT
#endif
typedef float VGfloat;
typedef signed char VGbyte;
typedef unsigned char VGubyte;
typedef signed short VGshort;
typedef signed int VGint;
typedef unsigned int VGuint;
typedef unsigned int VGbitfield;
#ifndef VG_VGEXT_PROTOTYPES
#define VG_VGEXT_PROTOTYPES
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VGPLATFORM_H */

View File

@@ -1,130 +0,0 @@
/* $Revision: 6810 $ on $Date:: 2008-10-29 10:31:37 -0400 #$ */
/*------------------------------------------------------------------------
*
* VGU 1.0.1 Reference Implementation
* -------------------------------------
*
* Copyright (c) 2008 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and /or associated documentation files
* (the "Materials "), to deal in the Materials without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Materials,
* and to permit persons to whom the Materials are furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 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 MATERIALS OR
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*//**
* \file
* \brief VGU 1.0.1 API.
*//*-------------------------------------------------------------------*/
#ifndef _VGU_H
#define _VGU_H
#ifdef __cplusplus
extern "C" {
#endif
#include <VG/openvg.h>
#define VGU_VERSION_1_0 1
#ifndef VGU_API_CALL
# error VGU_API_CALL must be defined
#endif
#ifndef VGU_API_ENTRY
# error VGU_API_ENTRY must be defined
#endif
#ifndef VGU_API_EXIT
# error VGU_API_EXIT must be defined
#endif
typedef enum {
VGU_NO_ERROR = 0,
VGU_BAD_HANDLE_ERROR = 0xF000,
VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
VGU_OUT_OF_MEMORY_ERROR = 0xF002,
VGU_PATH_CAPABILITY_ERROR = 0xF003,
VGU_BAD_WARP_ERROR = 0xF004,
VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
} VGUErrorCode;
typedef enum {
VGU_ARC_OPEN = 0xF100,
VGU_ARC_CHORD = 0xF101,
VGU_ARC_PIE = 0xF102,
VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
} VGUArcType;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
VGfloat x0, VGfloat y0,
VGfloat x1, VGfloat y1) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
const VGfloat * points, VGint count,
VGboolean closed) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
VGfloat cx, VGfloat cy,
VGfloat width, VGfloat height) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
VGfloat x, VGfloat y,
VGfloat width, VGfloat height,
VGfloat startAngle, VGfloat angleExtent,
VGUArcType arcType) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat * matrix) VGU_API_EXIT;
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2,
VGfloat dx3, VGfloat dy3,
VGfloat sx0, VGfloat sy0,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
VGfloat sx3, VGfloat sy3,
VGfloat * matrix) VGU_API_EXIT;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* #ifndef _VGU_H */

View File

@@ -10,4 +10,5 @@ SConscript([
'vpglsl/SConscript',
'fp/SConscript',
'wgl/SConscript',
'perf/SConscript',
])

View File

@@ -124,13 +124,6 @@ reflect.o: reflect.c showbuffer.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
shadowtex: shadowtex.o showbuffer.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@
shadowtex.o: shadowtex.c showbuffer.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
gloss: gloss.o trackball.o readtex.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@

View File

@@ -26,6 +26,7 @@ static int Scissor = 0;
static float Xzoom, Yzoom;
static GLboolean DrawFront = GL_FALSE;
static GLboolean Dither = GL_TRUE;
static GLboolean Invert = GL_FALSE;
static void Reset( void )
@@ -59,6 +60,15 @@ static void Display( void )
if (Scissor)
glEnable(GL_SCISSOR_TEST);
if (Invert) {
glPixelTransferf(GL_RED_SCALE, -1.0);
glPixelTransferf(GL_GREEN_SCALE, -1.0);
glPixelTransferf(GL_BLUE_SCALE, -1.0);
glPixelTransferf(GL_RED_BIAS, 1.0);
glPixelTransferf(GL_GREEN_BIAS, 1.0);
glPixelTransferf(GL_BLUE_BIAS, 1.0);
}
/* draw copy */
glPixelZoom(Xzoom, Yzoom);
glWindowPos2iARB(Xpos, Ypos);
@@ -67,6 +77,15 @@ static void Display( void )
glDisable(GL_SCISSOR_TEST);
if (Invert) {
glPixelTransferf(GL_RED_SCALE, 1.0);
glPixelTransferf(GL_GREEN_SCALE, 1.0);
glPixelTransferf(GL_BLUE_SCALE, 1.0);
glPixelTransferf(GL_RED_BIAS, 0.0);
glPixelTransferf(GL_GREEN_BIAS, 0.0);
glPixelTransferf(GL_BLUE_BIAS, 0.0);
}
if (DrawFront)
glFinish();
else
@@ -105,6 +124,9 @@ static void Key( unsigned char key, int x, int y )
else
glDisable(GL_DITHER);
break;
case 'i':
Invert = !Invert;
break;
case 's':
Scissor = !Scissor;
break;

View File

@@ -58,6 +58,9 @@ static GLint ClampIndex = 0;
static GLboolean supportFBO = GL_FALSE;
static GLboolean supportSeamless = GL_FALSE;
static GLboolean seamless = GL_FALSE;
static GLuint TexObj = 0;
static GLint T0 = 0;
static GLint Frames = 0;
static struct {
@@ -282,6 +285,20 @@ static void draw( void )
glPopMatrix();
glutSwapBuffers();
Frames++;
{
GLint t = glutGet(GLUT_ELAPSED_TIME);
if (t - T0 >= 5000) {
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
fflush(stdout);
T0 = t;
Frames = 0;
}
}
}
@@ -543,6 +560,10 @@ static void init( GLboolean useImageFiles )
printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
glGenTextures(1, &TexObj);
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, TexObj);
if (useImageFiles) {
load_envmaps();
}

View File

@@ -120,7 +120,11 @@ static Engine Engines[NUM_ENGINES] =
0.3, /* CrankJournalRadius */
0.4, /* CrankJournalLength */
1.5, /* ConnectingRodLength */
0.1 /* ConnectingRodThickness */
0.1, /* ConnectingRodThickness */
0, /* CrankList */
0, /* ConnRodList */
0, /* PistonList */
0 /* BlockList */
},
{
"Inline-4",
@@ -136,7 +140,11 @@ static Engine Engines[NUM_ENGINES] =
0.3, /* CrankJournalRadius */
0.4, /* CrankJournalLength */
1.5, /* ConnectingRodLength */
0.1 /* ConnectingRodThickness */
0.1, /* ConnectingRodThickness */
0, /* CrankList */
0, /* ConnRodList */
0, /* PistonList */
0 /* BlockList */
},
{
"Boxer-6",
@@ -152,7 +160,11 @@ static Engine Engines[NUM_ENGINES] =
0.3, /* CrankJournalRadius */
0.4, /* CrankJournalLength */
1.5, /* ConnectingRodLength */
0.1 /* ConnectingRodThickness */
0.1, /* ConnectingRodThickness */
0, /* CrankList */
0, /* ConnRodList */
0, /* PistonList */
0 /* BlockList */
}
};

View File

@@ -938,7 +938,14 @@ reshape(int width, int height)
static void
init_fbotexture()
{
static const GLenum depthFormats[] = {
GL_DEPTH_COMPONENT,
GL_DEPTH_COMPONENT16,
GL_DEPTH_COMPONENT32
};
static int numDepthFormats = sizeof(depthFormats) / sizeof(depthFormats[0]);
GLint i;
GLenum stat;
/* gen framebuffer id, delete it, do some assertions, just for testing */
glGenFramebuffersEXT(1, &MyFB);
@@ -969,18 +976,31 @@ init_fbotexture()
/* make depth renderbuffer */
glGenRenderbuffersEXT(1, &DepthRB);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
TexWidth, TexHeight);
CheckError(__LINE__);
/* we may have to try several formats */
for (i = 0; i < numDepthFormats; i++) {
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, depthFormats[i],
TexWidth, TexHeight);
CheckError(__LINE__);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, DepthRB);
CheckError(__LINE__);
stat = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (stat == GL_FRAMEBUFFER_COMPLETE_EXT) {
break;
}
}
if (stat != GL_FRAMEBUFFER_COMPLETE_EXT) {
fprintf(stderr, "Error: unable to get usable FBO combination!\n");
exit(1);
}
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
CheckError(__LINE__);
printf("Depth renderbuffer size = %d bits\n", i);
/* attach DepthRB to MyFB */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, DepthRB);
CheckError(__LINE__);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
/*

View File

@@ -14,7 +14,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "extfuncs.h"
/* For debug */

View File

@@ -6,6 +6,7 @@
* Humanware s.r.l.
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@@ -725,8 +726,13 @@ main(int ac, char **av)
maxage = 1.0 / dt;
if (ac == 2)
if (ac == 2) {
np = atoi(av[1]);
if (np <= 0 || np > 1000000) {
fprintf(stderr, "Invalid input.\n");
exit(-1);
}
}
if (ac == 4) {
WIDTH = atoi(av[2]);
@@ -759,7 +765,9 @@ main(int ac, char **av)
glFogfv(GL_FOG_COLOR, fogcolor);
glFogf(GL_FOG_DENSITY, 0.1);
assert(np > 0);
p = (part *) malloc(sizeof(part) * np);
assert(p);
for (i = 0; i < np; i++)
setnewpart(&p[i]);

View File

@@ -25,6 +25,7 @@
*/
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <GL/glut.h>
@@ -129,8 +130,10 @@ Clear_Buffers ()
static void
LoadTriplet (TDA A)
{
int result;
Clear_Buffers ();
fscanf (mainfile, "%s %s %s %s", Buf1, Buf2, Buf3, Buf4);
result = fscanf (mainfile, "%s %s %s %s", Buf1, Buf2, Buf3, Buf4);
assert(result != EOF);
A[0] = atof (Buf2);
A[1] = atof (Buf3);
A[2] = atof (Buf4);
@@ -140,8 +143,10 @@ LoadTriplet (TDA A)
static void
LoadReal (float *a)
{
int result;
Clear_Buffers ();
fscanf (mainfile, "%s %s", Buf1, Buf2);
result = fscanf (mainfile, "%s %s", Buf1, Buf2);
assert(result != EOF);
*a = atof (Buf2);
}
@@ -149,8 +154,10 @@ LoadReal (float *a)
static void
LoadInteger (int *a)
{
int result;
Clear_Buffers ();
fscanf (mainfile, "%s %s", Buf1, Buf2);
result = fscanf (mainfile, "%s %s", Buf1, Buf2);
assert(result != EOF);
*a = atoi (Buf2);
}
@@ -158,8 +165,10 @@ LoadInteger (int *a)
static void
LoadText (char *a)
{
int result;
Clear_Buffers ();
fscanf (mainfile, "%s %s", Buf1, Buf2);
result = fscanf (mainfile, "%s %s", Buf1, Buf2);
assert(result != EOF);
strcpy (a, Buf2);
}
@@ -177,8 +186,10 @@ getdata (char filename[])
do
{
int result;
Clear_Buffers ();
fscanf (mainfile, "%s", Buf1);
result = fscanf (mainfile, "%s", Buf1);
(void) result;
if (ferror (mainfile))
{
printf ("\nError opening file !\n");

View File

@@ -27,7 +27,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#ifdef _WIN32
#include <windows.h>
@@ -132,9 +131,11 @@ static void read_surface( char *filename )
numverts = 0;
while (!feof(f) && numverts<maxverts) {
fscanf( f, "%f %f %f %f %f %f",
&data[numverts][0], &data[numverts][1], &data[numverts][2],
&data[numverts][3], &data[numverts][4], &data[numverts][5] );
int result;
result = fscanf( f, "%f %f %f %f %f %f",
&data[numverts][0], &data[numverts][1], &data[numverts][2],
&data[numverts][3], &data[numverts][4], &data[numverts][5] );
(void) result;
numverts++;
}
numverts--;

View File

@@ -43,6 +43,7 @@ static GLboolean Anim = GL_TRUE;
static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */
static GLint BiasMin = -400, BiasMax = 400;
static int win = 0;
static GLuint TexObj = 0;
static void
@@ -214,6 +215,9 @@ static void Init( void )
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &TexObj);
glBindTexture(GL_TEXTURE_2D, TexObj);
if (glutExtensionSupported("GL_SGIS_generate_mipmap")) {
/* test auto mipmap generation */
GLint width, height, i;

View File

@@ -137,7 +137,6 @@ So the angle is:
#endif
#include <GL/glut.h>
#include <math.h>
#include <string.h>
#define Scale 0.3
@@ -887,5 +886,6 @@ int main(int argc, char **argv)
glutIdleFunc( idle_ );
glutDisplayFunc( draw );
glutMainLoop();
return 0;
}

View File

@@ -27,6 +27,8 @@
#define ANIMATE 10
#define QUIT 100
static GLint T0 = 0;
static GLint Frames = 0;
static GLboolean Animate = GL_TRUE;
static GLint NumUnits = 1;
static GLboolean TexEnabled[8];
@@ -105,6 +107,20 @@ static void Display( void )
glPopMatrix();
glutSwapBuffers();
Frames++;
{
GLint t = glutGet(GLUT_ELAPSED_TIME);
if (t - T0 >= 5000) {
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
fflush(stdout);
T0 = t;
Frames = 0;
}
}
}

View File

@@ -219,7 +219,7 @@ Display( void )
GLint reads = 0;
GLint endTime;
GLint startTime = glutGet(GLUT_ELAPSED_TIME);
GLdouble seconds, pixelsPerSecond;
GLdouble seconds, mpixels, mpixelsPerSecond;
printf("Benchmarking...\n");
do {
glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
@@ -228,9 +228,10 @@ Display( void )
endTime = glutGet(GLUT_ELAPSED_TIME);
} while (endTime - startTime < 4000); /* 4 seconds */
seconds = (double) (endTime - startTime) / 1000.0;
pixelsPerSecond = reads * ImgWidth * ImgHeight / seconds;
printf("Result: %d reads in %f seconds = %f pixels/sec\n",
reads, seconds, pixelsPerSecond);
mpixels = reads * (ImgWidth * ImgHeight / (1000.0 * 1000.0));
mpixelsPerSecond = mpixels / seconds;
printf("Result: %d reads in %f seconds = %f Mpixels/sec\n",
reads, seconds, mpixelsPerSecond);
Benchmark = GL_FALSE;
}
else {

View File

@@ -38,7 +38,6 @@
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "showbuffer.h"
#define DEG_TO_RAD (3.14159 / 180.0)

View File

@@ -8,6 +8,7 @@
* based on a Mikael SkiZoWalker's (MoDEL) / France (Skizo@Hol.Fr) demo
*/
#include <assert.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
@@ -559,12 +560,14 @@ loadpic(void)
FILE *FilePic;
int i, tmp;
GLenum gluerr;
size_t result;
if ((FilePic = fopen("terrain.dat", "r")) == NULL) {
fprintf(stderr, "Error loading terrain.dat\n");
exit(-1);
}
fread(bufferter, 256 * 256, 1, FilePic);
result = fread(bufferter, 256 * 256, 1, FilePic);
assert(result == 1);
fclose(FilePic);
for (i = 0; i < (256 * 256); i++) {

View File

@@ -57,7 +57,7 @@ Idle(void)
{
Xrot = glutGet(GLUT_ELAPSED_TIME) * 0.02;
Yrot = glutGet(GLUT_ELAPSED_TIME) * 0.04;
//Zrot += 2.0;
/* Zrot += 2.0; */
glutPostRedisplay();
}

12
progs/egl/.gitignore vendored
View File

@@ -1,12 +0,0 @@
demo1
demo2
demo3
eglgears
eglinfo
eglscreen
egltri
peglgears
xeglbindtex
xeglgears
xeglthreads
xegl_tri

View File

@@ -1,119 +0,0 @@
/*
* Copyright (C) 1999-2001 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL 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.
*/
/*
* Stolen from eglgears
*
* Creates a surface and show that on the first screen
*/
#define EGL_EGLEXT_PROTOTYPES
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <GL/gl.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#define MAX_CONFIGS 10
#define MAX_MODES 100
int
main(int argc, char *argv[])
{
int maj, min;
EGLSurface screen_surf;
EGLConfig configs[MAX_CONFIGS];
EGLint numConfigs, i;
EGLBoolean b;
EGLDisplay d;
EGLint screenAttribs[10];
EGLModeMESA mode[MAX_MODES];
EGLScreenMESA screen;
EGLint count, chosenMode;
EGLint width = 0, height = 0;
d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
printf("eglscreen: eglInitialize failed\n");
exit(1);
}
printf("eglscreen: EGL version = %d.%d\n", maj, min);
printf("eglscreen: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
/* XXX use ChooseConfig */
eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
eglGetScreensMESA(d, &screen, 1, &count);
if (!eglGetModesMESA(d, screen, mode, MAX_MODES, &count) || count == 0) {
printf("eglscreen: eglGetModesMESA failed!\n");
return 0;
}
/* Print list of modes, and find the one to use */
printf("eglscreen: Found %d modes:\n", count);
for (i = 0; i < count; i++) {
EGLint w, h;
eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w);
eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h);
printf("%3d: %d x %d\n", i, w, h);
if (w > width && h > height) {
width = w;
height = h;
chosenMode = i;
}
}
printf("eglscreen: Using screen mode/size %d: %d x %d\n", chosenMode, width, height);
/* build up screenAttribs array */
i = 0;
screenAttribs[i++] = EGL_WIDTH;
screenAttribs[i++] = width;
screenAttribs[i++] = EGL_HEIGHT;
screenAttribs[i++] = height;
screenAttribs[i++] = EGL_NONE;
screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
if (screen_surf == EGL_NO_SURFACE) {
printf("eglscreen: Failed to create screen surface\n");
return 0;
}
b = eglShowScreenSurfaceMESA(d, screen, screen_surf, mode[chosenMode]);
if (!b) {
printf("eglscreen: Show surface failed\n");
return 0;
}
usleep(5000000);
eglDestroySurface(d, screen_surf);
eglTerminate(d);
return 0;
}

View File

@@ -1,264 +0,0 @@
/*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
* Copyright (C) 2008 Brian Paul All Rights Reserved.
* Copyright (C) 2008 Jakob Bornecrantz All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL 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.
*/
/*
* This program is based on eglgears and xegl_tri.
* Remixed by Jakob Bornecrantz
*
* No command line options.
* Program runs for 5 seconds then exits, outputing framerate to console
*/
#define EGL_EGLEXT_PROTOTYPES
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/gl.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#define MAX_CONFIGS 10
#define MAX_MODES 100
/* XXX this probably isn't very portable */
#include <sys/time.h>
#include <unistd.h>
/* return current time (in seconds) */
static double
current_time(void)
{
struct timeval tv;
#ifdef __VMS
(void) gettimeofday(&tv, NULL );
#else
struct timezone tz;
(void) gettimeofday(&tv, &tz);
#endif
return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
}
static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
static void draw()
{
static const GLfloat verts[3][2] = {
{ -1, -1 },
{ 1, -1 },
{ 0, 1 }
};
static const GLfloat colors[3][3] = {
{ 1, 0, 0 },
{ 0, 1, 0 },
{ 0, 0, 1 }
};
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(view_rotx, 1, 0, 0);
glRotatef(view_roty, 0, 1, 0);
glRotatef(view_rotz, 0, 0, 1);
{
glVertexPointer(2, GL_FLOAT, 0, verts);
glColorPointer(3, GL_FLOAT, 0, colors);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glDrawArrays(GL_TRIANGLES, 0, 3);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
}
glPopMatrix();
}
static void init()
{
glClearColor(0.4, 0.4, 0.4, 0.0);
}
/* new window size or exposure */
static void reshape(int width, int height)
{
GLfloat ar = (GLfloat) width / (GLfloat) height;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -10.0);
}
static void run(EGLDisplay dpy, EGLSurface surf, int ttr)
{
double st = current_time();
double ct = st;
int frames = 0;
while (ct - st < ttr)
{
double tt = current_time();
double dt = tt - ct;
ct = tt;
draw();
eglSwapBuffers(dpy, surf);
frames++;
}
GLfloat seconds = ct - st;
GLfloat fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
}
int main(int argc, char *argv[])
{
int maj, min;
EGLContext ctx;
EGLSurface screen_surf;
EGLConfig configs[MAX_CONFIGS];
EGLint numConfigs, i;
EGLBoolean b;
EGLDisplay d;
EGLint screenAttribs[10];
EGLModeMESA mode[MAX_MODES];
EGLScreenMESA screen;
EGLint count, chosenMode = 0;
GLboolean printInfo = GL_FALSE;
EGLint width = 0, height = 0;
/* parse cmd line args */
for (i = 1; i < argc; i++)
{
if (strcmp(argv[i], "-info") == 0)
{
printInfo = GL_TRUE;
}
else
printf("Warning: unknown parameter: %s\n", argv[i]);
}
/* DBR : Create EGL context/surface etc */
d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
printf("egltri: eglInitialize failed\n");
exit(1);
}
printf("egltri: EGL version = %d.%d\n", maj, min);
printf("egltri: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
/* XXX use ChooseConfig */
eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
eglGetScreensMESA(d, &screen, 1, &count);
if (!eglGetModesMESA(d, screen, mode, MAX_MODES, &count) || count == 0) {
printf("egltri: eglGetModesMESA failed!\n");
return 0;
}
/* Print list of modes, and find the one to use */
printf("egltri: Found %d modes:\n", count);
for (i = 0; i < count; i++) {
EGLint w, h;
eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w);
eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h);
printf("%3d: %d x %d\n", i, w, h);
if (w > width && h > height) {
width = w;
height = h;
chosenMode = i;
}
}
printf("egltri: Using screen mode/size %d: %d x %d\n", chosenMode, width, height);
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
if (ctx == EGL_NO_CONTEXT) {
printf("egltri: failed to create context\n");
return 0;
}
/* build up screenAttribs array */
i = 0;
screenAttribs[i++] = EGL_WIDTH;
screenAttribs[i++] = width;
screenAttribs[i++] = EGL_HEIGHT;
screenAttribs[i++] = height;
screenAttribs[i++] = EGL_NONE;
screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
if (screen_surf == EGL_NO_SURFACE) {
printf("egltri: failed to create screen surface\n");
return 0;
}
b = eglShowScreenSurfaceMESA(d, screen, screen_surf, mode[chosenMode]);
if (!b) {
printf("egltri: show surface failed\n");
return 0;
}
b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
if (!b) {
printf("egltri: make current failed\n");
return 0;
}
if (printInfo)
{
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
init();
reshape(width, height);
glDrawBuffer( GL_BACK );
run(d, screen_surf, 5.0);
eglDestroySurface(d, screen_surf);
eglDestroyContext(d, ctx);
eglTerminate(d);
return 0;
}

View File

@@ -1,449 +0,0 @@
/*
* Copyright (C) 1999-2001 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL 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.
*/
/*
* This is a port of the infamous "glxgears" demo to straight EGL
* Port by Dane Rushton 10 July 2005
*
* No command line options.
* Program runs for 5 seconds then exits, outputing framerate to console
*/
#define EGL_EGLEXT_PROTOTYPES
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/gl.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#define MAX_CONFIGS 10
#define MAX_MODES 100
#define BENCHMARK
#ifdef BENCHMARK
/* XXX this probably isn't very portable */
#include <sys/time.h>
#include <unistd.h>
/* return current time (in seconds) */
static double
current_time(void)
{
struct timeval tv;
#ifdef __VMS
(void) gettimeofday(&tv, NULL );
#else
struct timezone tz;
(void) gettimeofday(&tv, &tz);
#endif
return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
}
#else /*BENCHMARK*/
/* dummy */
static double
current_time(void)
{
/* update this function for other platforms! */
static double t = 0.0;
static int warn = 1;
if (warn) {
fprintf(stderr, "Warning: current_time() not implemented!!\n");
warn = 0;
}
return t += 1.0;
}
#endif /*BENCHMARK*/
#ifndef M_PI
#define M_PI 3.14159265
#endif
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
#if 0
static GLfloat eyesep = 5.0; /* Eye separation. */
static GLfloat fix_point = 40.0; /* Fixation point distance. */
static GLfloat left, right, asp; /* Stereo frustum params. */
#endif
/*
*
* Draw a gear wheel. You'll probably want to call this function when
* building a display list since we do a lot of trig here.
*
* Input: inner_radius - radius of hole at center
* outer_radius - radius at center of teeth
* width - width of gear
* teeth - number of teeth
* tooth_depth - depth of tooth
*/
static void
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
GLint teeth, GLfloat tooth_depth)
{
GLint i;
GLfloat r0, r1, r2;
GLfloat angle, da;
GLfloat u, v, len;
r0 = inner_radius;
r1 = outer_radius - tooth_depth / 2.0;
r2 = outer_radius + tooth_depth / 2.0;
da = 2.0 * M_PI / teeth / 4.0;
glShadeModel(GL_FLAT);
glNormal3f(0.0, 0.0, 1.0);
/* draw front face */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
if (i < teeth) {
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
}
}
glEnd();
/* draw front sides of teeth */
glBegin(GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
}
glEnd();
glNormal3f(0.0, 0.0, -1.0);
/* draw back face */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
if (i < teeth) {
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
}
}
glEnd();
/* draw back sides of teeth */
glBegin(GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
}
glEnd();
/* draw outward faces of teeth */
glBegin(GL_QUAD_STRIP);
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
u = r2 * cos(angle + da) - r1 * cos(angle);
v = r2 * sin(angle + da) - r1 * sin(angle);
len = sqrt(u * u + v * v);
u /= len;
v /= len;
glNormal3f(v, -u, 0.0);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
glNormal3f(cos(angle), sin(angle), 0.0);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-width * 0.5);
u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
glNormal3f(v, -u, 0.0);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glNormal3f(cos(angle), sin(angle), 0.0);
}
glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
glEnd();
glShadeModel(GL_SMOOTH);
/* draw inside radius cylinder */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glNormal3f(-cos(angle), -sin(angle), 0.0);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
}
glEnd();
}
static void
draw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(view_rotx, 1.0, 0.0, 0.0);
glRotatef(view_roty, 0.0, 1.0, 0.0);
glRotatef(view_rotz, 0.0, 0.0, 1.0);
glPushMatrix();
glTranslatef(-3.0, -2.0, 0.0);
glRotatef(angle, 0.0, 0.0, 1.0);
glCallList(gear1);
glPopMatrix();
glPushMatrix();
glTranslatef(3.1, -2.0, 0.0);
glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
glCallList(gear2);
glPopMatrix();
glPushMatrix();
glTranslatef(-3.1, 4.2, 0.0);
glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
glCallList(gear3);
glPopMatrix();
glPopMatrix();
}
/* new window size or exposure */
static void
reshape(int width, int height)
{
glViewport(0, 0, (GLint) width, (GLint) height);
GLfloat h = (GLfloat) height / (GLfloat) width;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -40.0);
}
static void
init(void)
{
static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, pos);
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
/* make the gears */
gear1 = glGenLists(1);
glNewList(gear1, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
gear(1.0, 4.0, 1.0, 20, 0.7);
glEndList();
gear2 = glGenLists(1);
glNewList(gear2, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
gear(0.5, 2.0, 2.0, 10, 0.7);
glEndList();
gear3 = glGenLists(1);
glNewList(gear3, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
gear(1.3, 2.0, 0.5, 10, 0.7);
glEndList();
glEnable(GL_NORMALIZE);
}
static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
{
double st = current_time();
double ct = st;
int frames = 0;
while (ct - st < ttr)
{
double tt = current_time();
double dt = tt - ct;
ct = tt;
/* advance rotation for next frame */
angle += 70.0 * dt; /* 70 degrees per second */
if (angle > 3600.0)
angle -= 3600.0;
draw();
eglSwapBuffers(dpy, surf);
frames++;
}
GLfloat seconds = ct - st;
GLfloat fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
}
int
main(int argc, char *argv[])
{
int major, minor;
EGLContext ctx;
EGLSurface surface;
EGLConfig configs[MAX_CONFIGS];
EGLint numConfigs, i;
EGLBoolean b;
EGLDisplay d;
EGLint screenAttribs[10];
GLboolean printInfo = GL_FALSE;
EGLint width = 300, height = 300;
/* parse cmd line args */
for (i = 1; i < argc; i++)
{
if (strcmp(argv[i], "-info") == 0)
{
printInfo = GL_TRUE;
}
else
printf("Warning: unknown parameter: %s\n", argv[i]);
}
/* DBR : Create EGL context/surface etc */
d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
assert(d);
if (!eglInitialize(d, &major, &minor)) {
printf("peglgears: eglInitialize failed\n");
return 0;
}
printf("peglgears: EGL version = %d.%d\n", major, minor);
printf("peglgears: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
eglBindAPI(EGL_OPENGL_API);
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
if (ctx == EGL_NO_CONTEXT) {
printf("peglgears: failed to create context\n");
return 0;
}
/* build up screenAttribs array */
i = 0;
screenAttribs[i++] = EGL_WIDTH;
screenAttribs[i++] = width;
screenAttribs[i++] = EGL_HEIGHT;
screenAttribs[i++] = height;
screenAttribs[i++] = EGL_NONE;
surface = eglCreatePbufferSurface(d, configs[0], screenAttribs);
if (surface == EGL_NO_SURFACE) {
printf("peglgears: failed to create pbuffer surface\n");
return 0;
}
b = eglMakeCurrent(d, surface, surface, ctx);
if (!b) {
printf("peglgears: make current failed\n");
return 0;
}
if (printInfo)
{
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
init();
reshape(width, height);
glDrawBuffer( GL_BACK );
run_gears(d, surface, 5.0);
eglDestroySurface(d, surface);
eglDestroyContext(d, ctx);
eglTerminate(d);
return 0;
}

View File

@@ -1,359 +0,0 @@
/*
* Copyright (C) 2008 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL 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.
*/
/*
* Draw a triangle with X/EGL.
* Brian Paul
* 3 June 2008
*/
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <GL/gl.h> /* using full OpenGL for now */
#include <GLES/egl.h>
static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
static void
draw(void)
{
static const GLfloat verts[3][2] = {
{ -1, -1 },
{ 1, -1 },
{ 0, 1 }
};
static const GLfloat colors[3][3] = {
{ 1, 0, 0 },
{ 0, 1, 0 },
{ 0, 0, 1 }
};
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(view_rotx, 1, 0, 0);
glRotatef(view_roty, 0, 1, 0);
glRotatef(view_rotz, 0, 0, 1);
{
glVertexPointer(2, GL_FLOAT, 0, verts);
glColorPointer(3, GL_FLOAT, 0, colors);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glDrawArrays(GL_TRIANGLES, 0, 3);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
}
glPopMatrix();
}
/* new window size or exposure */
static void
reshape(int width, int height)
{
GLfloat ar = (GLfloat) width / (GLfloat) height;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -10.0);
}
static void
init(void)
{
glClearColor(0.4, 0.4, 0.4, 0.0);
}
/*
* Create an RGB, double-buffered X window.
* Return the window and context handles.
*/
static void
make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
const char *name,
int x, int y, int width, int height,
Window *winRet,
EGLContext *ctxRet,
EGLSurface *surfRet)
{
static const EGLint attribs[] = {
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
EGL_DEPTH_SIZE, 1,
EGL_NONE
};
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
XVisualInfo *visInfo, visTemplate;
int num_visuals;
EGLContext ctx;
EGLConfig config;
EGLint num_configs;
EGLint vid;
scrnum = DefaultScreen( x_dpy );
root = RootWindow( x_dpy, scrnum );
if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
printf("Error: couldn't get an EGL visual config\n");
exit(1);
}
assert(config);
assert(num_configs > 0);
if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
printf("Error: eglGetConfigAttrib() failed\n");
exit(1);
}
/* The X window visual must match the EGL config */
visTemplate.visualid = vid;
visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
if (!visInfo) {
printf("Error: couldn't get X visual\n");
exit(1);
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( x_dpy, root, 0, 0, width, height,
0, visInfo->depth, InputOutput,
visInfo->visual, mask, &attr );
/* set hints and properties */
{
XSizeHints sizehints;
sizehints.x = x;
sizehints.y = y;
sizehints.width = width;
sizehints.height = height;
sizehints.flags = USSize | USPosition;
XSetNormalHints(x_dpy, win, &sizehints);
XSetStandardProperties(x_dpy, win, name, name,
None, (char **)NULL, 0, &sizehints);
}
eglBindAPI(EGL_OPENGL_API);
ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
if (!ctx) {
printf("Error: glXCreateContext failed\n");
exit(1);
}
*surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
if (!*surfRet) {
printf("Error: eglCreateWindowSurface failed\n");
exit(1);
}
XFree(visInfo);
*winRet = win;
*ctxRet = ctx;
}
static void
event_loop(Display *dpy, Window win,
EGLDisplay egl_dpy, EGLSurface egl_surf)
{
while (1) {
int redraw = 0;
XEvent event;
XNextEvent(dpy, &event);
switch (event.type) {
case Expose:
redraw = 1;
break;
case ConfigureNotify:
reshape(event.xconfigure.width, event.xconfigure.height);
break;
case KeyPress:
{
char buffer[10];
int r, code;
code = XLookupKeysym(&event.xkey, 0);
if (code == XK_Left) {
view_roty += 5.0;
}
else if (code == XK_Right) {
view_roty -= 5.0;
}
else if (code == XK_Up) {
view_rotx += 5.0;
}
else if (code == XK_Down) {
view_rotx -= 5.0;
}
else {
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return;
}
}
}
redraw = 1;
break;
default:
; /*no-op*/
}
if (redraw) {
draw();
eglSwapBuffers(egl_dpy, egl_surf);
}
}
}
static void
usage(void)
{
printf("Usage:\n");
printf(" -display <displayname> set the display to run on\n");
printf(" -info display OpenGL renderer info\n");
}
int
main(int argc, char *argv[])
{
const int winWidth = 300, winHeight = 300;
Display *x_dpy;
Window win;
EGLSurface egl_surf;
EGLContext egl_ctx;
EGLDisplay egl_dpy;
char *dpyName = NULL;
GLboolean printInfo = GL_FALSE;
EGLint egl_major, egl_minor;
int i;
const char *s;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-display") == 0) {
dpyName = argv[i+1];
i++;
}
else if (strcmp(argv[i], "-info") == 0) {
printInfo = GL_TRUE;
}
else {
usage();
return -1;
}
}
x_dpy = XOpenDisplay(dpyName);
if (!x_dpy) {
printf("Error: couldn't open display %s\n",
dpyName ? dpyName : getenv("DISPLAY"));
return -1;
}
egl_dpy = eglGetDisplay(x_dpy);
if (!egl_dpy) {
printf("Error: eglGetDisplay() failed\n");
return -1;
}
if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
printf("Error: eglInitialize() failed\n");
return -1;
}
s = eglQueryString(egl_dpy, EGL_VERSION);
printf("EGL_VERSION = %s\n", s);
make_x_window(x_dpy, egl_dpy,
"xegl_tri", 0, 0, winWidth, winHeight,
&win, &egl_ctx, &egl_surf);
XMapWindow(x_dpy, win);
if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
printf("Error: eglMakeCurrent() failed\n");
return -1;
}
if (printInfo) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
}
init();
/* Set initial projection/viewing transformation.
* We can't be sure we'll get a ConfigureNotify event when the window
* first appears.
*/
reshape(winWidth, winHeight);
event_loop(x_dpy, win, egl_dpy, egl_surf);
eglDestroyContext(egl_dpy, egl_ctx);
eglDestroySurface(egl_dpy, egl_surf);
eglTerminate(egl_dpy);
XDestroyWindow(x_dpy, win);
XCloseDisplay(x_dpy);
return 0;
}

View File

@@ -1,474 +0,0 @@
/*
* Simple demo for eglBindTexImage. Based on xegl_tri.c by
*
* Copyright (C) 2008 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL 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.
*/
/*
* The spec says that eglBindTexImage supports only OpenGL ES context, but this
* demo uses OpenGL context. Keep in mind that this is non-standard.
*/
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <GL/gl.h>
#include <EGL/egl.h>
static EGLDisplay dpy;
static EGLContext ctx_win, ctx_pbuf;
static EGLSurface surf_win, surf_pbuf;
static GLuint tex_pbuf;
static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
static GLboolean blend = GL_TRUE;
static GLuint color_flow;
static void
make_pbuffer(int width, int height)
{
static const EGLint config_attribs[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE,
EGL_NONE
};
EGLint pbuf_attribs[] = {
EGL_WIDTH, width,
EGL_HEIGHT, height,
EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB,
EGL_TEXTURE_TARGET, EGL_TEXTURE_2D,
EGL_NONE
};
EGLConfig config;
EGLint num_configs;
if (!eglChooseConfig(dpy, config_attribs, &config, 1, &num_configs)) {
printf("Error: couldn't get an EGL visual config for pbuffer\n");
exit(1);
}
eglBindAPI(EGL_OPENGL_API);
ctx_pbuf = eglCreateContext(dpy, config, EGL_NO_CONTEXT, NULL );
surf_pbuf = eglCreatePbufferSurface(dpy, config, pbuf_attribs);
if (surf_pbuf == EGL_NO_SURFACE) {
printf("failed to allocate pbuffer\n");
exit(1);
}
glGenTextures(1, &tex_pbuf);
}
static void
use_pbuffer(void)
{
static int initialized;
eglMakeCurrent(dpy, surf_pbuf, surf_pbuf, ctx_pbuf);
if (!initialized) {
EGLint width, height;
GLfloat ar;
initialized = 1;
eglQuerySurface(dpy, surf_pbuf, EGL_WIDTH, &width);
eglQuerySurface(dpy, surf_pbuf, EGL_WIDTH, &height);
ar = (GLfloat) width / (GLfloat) height;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1, 1, 1.0, 10.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
/* y-inverted */
glScalef(1.0, -1.0, 1.0);
glTranslatef(0.0, 0.0, -5.0);
glClearColor(0.2, 0.2, 0.2, 0.0);
}
}
static void
make_window(Display *x_dpy, const char *name,
int x, int y, int width, int height,
Window *winRet)
{
static const EGLint attribs[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_DEPTH_SIZE, 8,
EGL_NONE
};
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
XVisualInfo *visInfo, visTemplate;
int num_visuals;
EGLConfig config;
EGLint num_configs, vid;
scrnum = DefaultScreen( x_dpy );
root = RootWindow( x_dpy, scrnum );
if (!eglChooseConfig(dpy, attribs, &config, 1, &num_configs)) {
printf("Error: couldn't get an EGL visual config\n");
exit(1);
}
if (!eglGetConfigAttrib(dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
printf("Error: eglGetConfigAttrib() failed\n");
exit(1);
}
/* The X window visual must match the EGL config */
visTemplate.visualid = vid;
visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
if (!visInfo) {
printf("Error: couldn't get X visual\n");
exit(1);
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
attr.override_redirect = 0;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
win = XCreateWindow( x_dpy, root, 0, 0, width, height,
0, visInfo->depth, InputOutput,
visInfo->visual, mask, &attr );
/* set hints and properties */
{
XSizeHints sizehints;
sizehints.x = x;
sizehints.y = y;
sizehints.width = width;
sizehints.height = height;
sizehints.flags = USSize | USPosition;
XSetNormalHints(x_dpy, win, &sizehints);
XSetStandardProperties(x_dpy, win, name, name,
None, (char **)NULL, 0, &sizehints);
}
eglBindAPI(EGL_OPENGL_API);
ctx_win = eglCreateContext(dpy, config, EGL_NO_CONTEXT, NULL );
if (!ctx_win) {
printf("Error: glXCreateContext failed\n");
exit(1);
}
surf_win = eglCreateWindowSurface(dpy, config, win, NULL);
XFree(visInfo);
*winRet = win;
}
static void
use_window(void)
{
static int initialized;
eglMakeCurrent(dpy, surf_win, surf_win, ctx_win);
if (!initialized) {
initialized = 1;
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, tex_pbuf);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
}
static void
draw_triangle(void)
{
static const GLfloat verts[3][2] = {
{ -3, -3 },
{ 3, -3 },
{ 0, 3 }
};
GLfloat colors[3][3] = {
{ 1, 0, 0 },
{ 0, 1, 0 },
{ 0, 0, 1 }
};
GLint i;
/* flow the color */
for (i = 0; i < 3; i++) {
GLint first = (i + color_flow / 256) % 3;
GLint second = (first + 1) % 3;
GLint third = (second + 1) % 3;
GLfloat c = (color_flow % 256) / 256.0f;
c = c * c * c;
colors[i][first] = 1.0f - c;
colors[i][second] = c;
colors[i][third] = 0.0f;
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glVertexPointer(2, GL_FLOAT, 0, verts);
glColorPointer(3, GL_FLOAT, 0, colors);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glDrawArrays(GL_TRIANGLES, 0, 3);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
}
static void
draw_textured_cube(void)
{
static const GLfloat verts[][2] = {
{ -4, -4 },
{ 4, -4 },
{ 4, 4 },
{ -4, 4 }
};
static const GLfloat colors[][4] = {
{ 1, 1, 1, 0.5 },
{ 1, 1, 1, 0.5 },
{ 1, 1, 1, 0.5 },
{ 1, 1, 1, 0.5 }
};
static const GLfloat texs[][2] = {
{ 0, 0 },
{ 1, 0 },
{ 1, 1 },
{ 0, 1 }
};
static const GLfloat xforms[6][4] = {
{ 0, 0, 1, 0 },
{ 90, 0, 1, 0 },
{ 180, 0, 1, 0 },
{ 270, 0, 1, 0 },
{ 90, 1, 0, 0 },
{ -90, 1, 0, 0 }
};
GLint i;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (blend) {
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
} else {
glEnable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
}
glVertexPointer(2, GL_FLOAT, 0, verts);
glColorPointer(4, GL_FLOAT, 0, colors);
glTexCoordPointer(2, GL_FLOAT, 0, texs);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
for (i = 0; i < 6; i++) {
glPushMatrix();
glRotatef(xforms[i][0], xforms[i][1], xforms[i][2], xforms[i][3]);
glTranslatef(0, 0, 4.1);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glPopMatrix();
}
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
static void
draw(void)
{
use_pbuffer();
draw_triangle();
use_window();
eglBindTexImage(dpy, surf_pbuf, EGL_BACK_BUFFER);
glPushMatrix();
glRotatef(view_rotx, 1, 0, 0);
glRotatef(view_roty, 0, 1, 0);
glRotatef(view_rotz, 0, 0, 1);
draw_textured_cube();
glPopMatrix();
eglReleaseTexImage(dpy, surf_pbuf, EGL_BACK_BUFFER);
}
/* new window size or exposure */
static void
reshape(int width, int height)
{
GLfloat ar = (GLfloat) width / (GLfloat) height;
use_window();
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -40.0);
}
static void
event_loop(Display *x_dpy, Window win)
{
while (1) {
int redraw = 1;
if (XPending(x_dpy) > 0) {
XEvent event;
XNextEvent(x_dpy, &event);
switch (event.type) {
case Expose:
redraw = 1;
break;
case ConfigureNotify:
reshape(event.xconfigure.width, event.xconfigure.height);
break;
case KeyPress:
{
char buffer[10];
int r, code;
code = XLookupKeysym(&event.xkey, 0);
if (code == XK_Left) {
view_roty += 5.0;
}
else if (code == XK_Right) {
view_roty -= 5.0;
}
else if (code == XK_Up) {
view_rotx += 5.0;
}
else if (code == XK_Down) {
view_rotx -= 5.0;
}
else if (code == XK_b) {
blend = !blend;
}
else {
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return;
}
}
}
redraw = 1;
break;
default:
; /*no-op*/
}
}
if (redraw) {
view_rotx += 1.0;
view_roty += 2.0;
view_rotz += 1.5;
color_flow += 20;
draw();
eglSwapBuffers(dpy, surf_win);
}
}
}
int
main(int argc, char *argv[])
{
const int winWidth = 300, winHeight = 300;
Display *x_dpy;
Window win;
char *dpyName = NULL;
EGLint egl_major, egl_minor;
const char *s;
x_dpy = XOpenDisplay(dpyName);
if (!x_dpy) {
printf("Error: couldn't open display %s\n",
dpyName ? dpyName : getenv("DISPLAY"));
return -1;
}
dpy = eglGetDisplay(x_dpy);
if (!dpy) {
printf("Error: eglGetDisplay() failed\n");
return -1;
}
if (!eglInitialize(dpy, &egl_major, &egl_minor)) {
printf("Error: eglInitialize() failed\n");
return -1;
}
s = eglQueryString(dpy, EGL_VERSION);
printf("EGL_VERSION = %s\n", s);
make_window(x_dpy, "color flow", 0, 0, winWidth, winHeight, &win);
make_pbuffer(winWidth, winHeight);
XMapWindow(x_dpy, win);
reshape(winWidth, winHeight);
event_loop(x_dpy, win);
glDeleteTextures(1, &tex_pbuf);
eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglTerminate(dpy);
XDestroyWindow(x_dpy, win);
XCloseDisplay(x_dpy);
return 0;
}

View File

@@ -1,608 +0,0 @@
/*
* Copyright (C) 1999-2001 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL 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.
*/
/*
* Ported to X/EGL/GLES. XXX Actually, uses full OpenGL ATM.
* Brian Paul
* 30 May 2008
*/
/*
* Command line options:
* -info print GL implementation information
*
*/
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <GL/gl.h>
#include <EGL/egl.h>
#define BENCHMARK
#ifdef BENCHMARK
/* XXX this probably isn't very portable */
#include <sys/time.h>
#include <unistd.h>
/* return current time (in seconds) */
static double
current_time(void)
{
struct timeval tv;
#ifdef __VMS
(void) gettimeofday(&tv, NULL );
#else
struct timezone tz;
(void) gettimeofday(&tv, &tz);
#endif
return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
}
#else /*BENCHMARK*/
/* dummy */
static double
current_time(void)
{
/* update this function for other platforms! */
static double t = 0.0;
static int warn = 1;
if (warn) {
fprintf(stderr, "Warning: current_time() not implemented!!\n");
warn = 0;
}
return t += 1.0;
}
#endif /*BENCHMARK*/
#ifndef M_PI
#define M_PI 3.14159265
#endif
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
static GLboolean fullscreen = GL_FALSE; /* Create a single fullscreen window */
/*
*
* Draw a gear wheel. You'll probably want to call this function when
* building a display list since we do a lot of trig here.
*
* Input: inner_radius - radius of hole at center
* outer_radius - radius at center of teeth
* width - width of gear
* teeth - number of teeth
* tooth_depth - depth of tooth
*/
static void
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
GLint teeth, GLfloat tooth_depth)
{
GLint i;
GLfloat r0, r1, r2;
GLfloat angle, da;
GLfloat u, v, len;
r0 = inner_radius;
r1 = outer_radius - tooth_depth / 2.0;
r2 = outer_radius + tooth_depth / 2.0;
da = 2.0 * M_PI / teeth / 4.0;
glShadeModel(GL_FLAT);
glNormal3f(0.0, 0.0, 1.0);
/* draw front face */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
if (i < teeth) {
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
}
}
glEnd();
/* draw front sides of teeth */
glBegin(GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
}
glEnd();
glNormal3f(0.0, 0.0, -1.0);
/* draw back face */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
if (i < teeth) {
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
}
}
glEnd();
/* draw back sides of teeth */
glBegin(GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
}
glEnd();
/* draw outward faces of teeth */
glBegin(GL_QUAD_STRIP);
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
u = r2 * cos(angle + da) - r1 * cos(angle);
v = r2 * sin(angle + da) - r1 * sin(angle);
len = sqrt(u * u + v * v);
u /= len;
v /= len;
glNormal3f(v, -u, 0.0);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
glNormal3f(cos(angle), sin(angle), 0.0);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-width * 0.5);
u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
glNormal3f(v, -u, 0.0);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-width * 0.5);
glNormal3f(cos(angle), sin(angle), 0.0);
}
glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
glEnd();
glShadeModel(GL_SMOOTH);
/* draw inside radius cylinder */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glNormal3f(-cos(angle), -sin(angle), 0.0);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
}
glEnd();
}
static void
draw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(view_rotx, 1.0, 0.0, 0.0);
glRotatef(view_roty, 0.0, 1.0, 0.0);
glRotatef(view_rotz, 0.0, 0.0, 1.0);
glPushMatrix();
glTranslatef(-3.0, -2.0, 0.0);
glRotatef(angle, 0.0, 0.0, 1.0);
glCallList(gear1);
glPopMatrix();
glPushMatrix();
glTranslatef(3.1, -2.0, 0.0);
glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
glCallList(gear2);
glPopMatrix();
glPushMatrix();
glTranslatef(-3.1, 4.2, 0.0);
glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
glCallList(gear3);
glPopMatrix();
glPopMatrix();
}
/* new window size or exposure */
static void
reshape(int width, int height)
{
GLfloat ar = (GLfloat) width / (GLfloat) height;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -40.0);
}
static void
init(void)
{
static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, pos);
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
/* make the gears */
gear1 = glGenLists(1);
glNewList(gear1, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
gear(1.0, 4.0, 1.0, 20, 0.7);
glEndList();
gear2 = glGenLists(1);
glNewList(gear2, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
gear(0.5, 2.0, 2.0, 10, 0.7);
glEndList();
gear3 = glGenLists(1);
glNewList(gear3, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
gear(1.3, 2.0, 0.5, 10, 0.7);
glEndList();
glEnable(GL_NORMALIZE);
glClearColor(0.2, 0.2, 0.2, 0.0);
}
/*
* Create an RGB, double-buffered X window.
* Return the window and context handles.
*/
static void
make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
const char *name,
int x, int y, int width, int height,
Window *winRet,
EGLContext *ctxRet,
EGLSurface *surfRet)
{
static const EGLint attribs[] = {
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
/*EGL_DOUBLEBUFFER,*/
EGL_DEPTH_SIZE, 1,
EGL_NONE
};
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
XVisualInfo *visInfo, visTemplate;
int num_visuals;
EGLContext ctx;
EGLConfig config;
EGLint num_configs, vid;
scrnum = DefaultScreen( x_dpy );
root = RootWindow( x_dpy, scrnum );
if (fullscreen) {
x = 0; y = 0;
width = DisplayWidth( x_dpy, scrnum );
height = DisplayHeight( x_dpy, scrnum );
}
if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
printf("Error: couldn't get an EGL visual config\n");
exit(1);
}
if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
printf("Error: eglGetConfigAttrib() failed\n");
exit(1);
}
/* The X window visual must match the EGL config */
visTemplate.visualid = vid;
visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
if (!visInfo) {
printf("Error: couldn't get X visual\n");
exit(1);
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
attr.override_redirect = fullscreen;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
win = XCreateWindow( x_dpy, root, 0, 0, width, height,
0, visInfo->depth, InputOutput,
visInfo->visual, mask, &attr );
/* set hints and properties */
{
XSizeHints sizehints;
sizehints.x = x;
sizehints.y = y;
sizehints.width = width;
sizehints.height = height;
sizehints.flags = USSize | USPosition;
XSetNormalHints(x_dpy, win, &sizehints);
XSetStandardProperties(x_dpy, win, name, name,
None, (char **)NULL, 0, &sizehints);
}
eglBindAPI(EGL_OPENGL_API);
ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
if (!ctx) {
printf("Error: glXCreateContext failed\n");
exit(1);
}
*surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
XFree(visInfo);
*winRet = win;
*ctxRet = ctx;
}
static void
event_loop(Display *dpy, Window win,
EGLDisplay egl_dpy, EGLSurface egl_surf)
{
while (1) {
while (XPending(dpy) > 0) {
XEvent event;
XNextEvent(dpy, &event);
switch (event.type) {
case Expose:
/* we'll redraw below */
break;
case ConfigureNotify:
reshape(event.xconfigure.width, event.xconfigure.height);
break;
case KeyPress:
{
char buffer[10];
int r, code;
code = XLookupKeysym(&event.xkey, 0);
if (code == XK_Left) {
view_roty += 5.0;
}
else if (code == XK_Right) {
view_roty -= 5.0;
}
else if (code == XK_Up) {
view_rotx += 5.0;
}
else if (code == XK_Down) {
view_rotx -= 5.0;
}
else {
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return;
}
}
}
}
}
{
static int frames = 0;
static double tRot0 = -1.0, tRate0 = -1.0;
double dt, t = current_time();
if (tRot0 < 0.0)
tRot0 = t;
dt = t - tRot0;
tRot0 = t;
/* advance rotation for next frame */
angle += 70.0 * dt; /* 70 degrees per second */
if (angle > 3600.0)
angle -= 3600.0;
draw();
eglSwapBuffers(egl_dpy, egl_surf);
frames++;
if (tRate0 < 0.0)
tRate0 = t;
if (t - tRate0 >= 5.0) {
GLfloat seconds = t - tRate0;
GLfloat fps = frames / seconds;
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds,
fps);
tRate0 = t;
frames = 0;
}
}
}
}
static void
usage(void)
{
printf("Usage:\n");
printf(" -display <displayname> set the display to run on\n");
printf(" -fullscreen run in fullscreen mode\n");
printf(" -info display OpenGL renderer info\n");
}
int
main(int argc, char *argv[])
{
const int winWidth = 300, winHeight = 300;
Display *x_dpy;
Window win;
EGLSurface egl_surf;
EGLContext egl_ctx;
EGLDisplay egl_dpy;
char *dpyName = NULL;
GLboolean printInfo = GL_FALSE;
EGLint egl_major, egl_minor;
int i;
const char *s;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-display") == 0) {
dpyName = argv[i+1];
i++;
}
else if (strcmp(argv[i], "-info") == 0) {
printInfo = GL_TRUE;
}
else if (strcmp(argv[i], "-fullscreen") == 0) {
fullscreen = GL_TRUE;
}
else {
usage();
return -1;
}
}
x_dpy = XOpenDisplay(dpyName);
if (!x_dpy) {
printf("Error: couldn't open display %s\n",
dpyName ? dpyName : getenv("DISPLAY"));
return -1;
}
egl_dpy = eglGetDisplay(x_dpy);
if (!egl_dpy) {
printf("Error: eglGetDisplay() failed\n");
return -1;
}
if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
printf("Error: eglInitialize() failed\n");
return -1;
}
s = eglQueryString(egl_dpy, EGL_VERSION);
printf("EGL_VERSION = %s\n", s);
make_x_window(x_dpy, egl_dpy,
"glxgears", 0, 0, winWidth, winHeight,
&win, &egl_ctx, &egl_surf);
XMapWindow(x_dpy, win);
eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx);
if (printInfo) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
}
init();
/* Set initial projection/viewing transformation.
* We can't be sure we'll get a ConfigureNotify event when the window
* first appears.
*/
reshape(winWidth, winHeight);
event_loop(x_dpy, win, egl_dpy, egl_surf);
glDeleteLists(gear1, 1);
glDeleteLists(gear2, 1);
glDeleteLists(gear3, 1);
eglDestroyContext(egl_dpy, egl_ctx);
eglDestroySurface(egl_dpy, egl_surf);
eglTerminate(egl_dpy);
XDestroyWindow(x_dpy, win);
XCloseDisplay(x_dpy);
return 0;
}

View File

@@ -1,773 +0,0 @@
/*
* Copyright (C) 2000 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL 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.
*
* Ported to EGL by Chia-I Wu <olvaffe@gmail.com>
*/
/*
* This program tests EGL thread safety.
* Command line options:
* -p Open a display connection for each thread
* -l Enable application-side locking
* -n <num threads> Number of threads to create (default is 2)
* -display <display name> Specify X display (default is $DISPLAY)
* -t Use texture mapping
*
* Brian Paul 20 July 2000
*/
/*
* Notes:
* - Each thread gets its own EGL context.
*
* - The EGL contexts share texture objects.
*
* - When 't' is pressed to update the texture image, the window/thread which
* has input focus is signalled to change the texture. The other threads
* should see the updated texture the next time they call glBindTexture.
*/
#if defined(PTHREADS) /* defined by Mesa on Linux and other platforms */
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/gl.h>
#include <EGL/egl.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
/*
* Each window/thread/context:
*/
struct winthread {
Display *Dpy;
int Index;
pthread_t Thread;
Window Win;
EGLDisplay Display;
EGLContext Context;
EGLSurface Surface;
float Angle;
int WinWidth, WinHeight;
GLboolean NewSize;
GLboolean Initialized;
GLboolean MakeNewTexture;
};
#define MAX_WINTHREADS 100
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 GLboolean Texture = GL_FALSE;
static GLuint TexObj = 12;
static GLboolean Animate = GL_TRUE;
static pthread_mutex_t Mutex;
static pthread_cond_t CondVar;
static pthread_mutex_t CondMutex;
static void
Error(const char *msg)
{
fprintf(stderr, "Error: %s\n", msg);
exit(1);
}
static void
signal_redraw(void)
{
pthread_mutex_lock(&CondMutex);
pthread_cond_broadcast(&CondVar);
pthread_mutex_unlock(&CondMutex);
}
static void
MakeNewTexture(struct winthread *wt)
{
#define TEX_SIZE 128
static float step = 0.0;
GLfloat image[TEX_SIZE][TEX_SIZE][4];
GLint width;
int i, j;
for (j = 0; j < TEX_SIZE; j++) {
for (i = 0; i < TEX_SIZE; i++) {
float dt = 5.0 * (j - 0.5 * TEX_SIZE) / TEX_SIZE;
float ds = 5.0 * (i - 0.5 * TEX_SIZE) / TEX_SIZE;
float r = dt * dt + ds * ds + step;
image[j][i][0] =
image[j][i][1] =
image[j][i][2] = 0.75 + 0.25 * cos(r);
image[j][i][3] = 1.0;
}
}
step += 0.5;
glBindTexture(GL_TEXTURE_2D, TexObj);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
if (width) {
assert(width == TEX_SIZE);
/* sub-tex replace */
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TEX_SIZE, TEX_SIZE,
GL_RGBA, GL_FLOAT, image);
}
else {
/* create new */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEX_SIZE, TEX_SIZE, 0,
GL_RGBA, GL_FLOAT, image);
}
}
/* draw a colored cube */
static void
draw_object(void)
{
glPushMatrix();
glScalef(0.75, 0.75, 0.75);
glColor3f(1, 0, 0);
if (Texture) {
glBindTexture(GL_TEXTURE_2D, TexObj);
glEnable(GL_TEXTURE_2D);
}
else {
glDisable(GL_TEXTURE_2D);
}
glBegin(GL_QUADS);
/* -X */
glColor3f(0, 1, 1);
glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
glTexCoord2f(1, 0); glVertex3f(-1, 1, -1);
glTexCoord2f(1, 1); glVertex3f(-1, 1, 1);
glTexCoord2f(0, 1); glVertex3f(-1, -1, 1);
/* +X */
glColor3f(1, 0, 0);
glTexCoord2f(0, 0); glVertex3f(1, -1, -1);
glTexCoord2f(1, 0); glVertex3f(1, 1, -1);
glTexCoord2f(1, 1); glVertex3f(1, 1, 1);
glTexCoord2f(0, 1); glVertex3f(1, -1, 1);
/* -Y */
glColor3f(1, 0, 1);
glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
glTexCoord2f(1, 0); glVertex3f( 1, -1, -1);
glTexCoord2f(1, 1); glVertex3f( 1, -1, 1);
glTexCoord2f(0, 1); glVertex3f(-1, -1, 1);
/* +Y */
glColor3f(0, 1, 0);
glTexCoord2f(0, 0); glVertex3f(-1, 1, -1);
glTexCoord2f(1, 0); glVertex3f( 1, 1, -1);
glTexCoord2f(1, 1); glVertex3f( 1, 1, 1);
glTexCoord2f(0, 1); glVertex3f(-1, 1, 1);
/* -Z */
glColor3f(1, 1, 0);
glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
glTexCoord2f(1, 0); glVertex3f( 1, -1, -1);
glTexCoord2f(1, 1); glVertex3f( 1, 1, -1);
glTexCoord2f(0, 1); glVertex3f(-1, 1, -1);
/* +Y */
glColor3f(0, 0, 1);
glTexCoord2f(0, 0); glVertex3f(-1, -1, 1);
glTexCoord2f(1, 0); glVertex3f( 1, -1, 1);
glTexCoord2f(1, 1); glVertex3f( 1, 1, 1);
glTexCoord2f(0, 1); glVertex3f(-1, 1, 1);
glEnd();
glPopMatrix();
}
/* signal resize of given window */
static void
resize(struct winthread *wt, int w, int h)
{
wt->NewSize = GL_TRUE;
wt->WinWidth = w;
wt->WinHeight = h;
if (!Animate)
signal_redraw();
}
/*
* We have an instance of this for each thread.
*/
static void
draw_loop(struct winthread *wt)
{
while (!ExitFlag) {
if (Locking)
pthread_mutex_lock(&Mutex);
if (!wt->Initialized) {
eglMakeCurrent(wt->Display, wt->Surface, wt->Surface, wt->Context);
printf("xeglthreads: %d: GL_RENDERER = %s\n", wt->Index,
(char *) glGetString(GL_RENDERER));
if (Texture /*&& wt->Index == 0*/) {
MakeNewTexture(wt);
}
wt->Initialized = GL_TRUE;
}
if (Locking)
pthread_mutex_unlock(&Mutex);
eglBindAPI(EGL_OPENGL_API);
if (eglGetCurrentContext() != wt->Context) {
printf("xeglthreads: current context %p != %p\n",
eglGetCurrentContext(), wt->Context);
}
glEnable(GL_DEPTH_TEST);
if (wt->NewSize) {
GLfloat w = (float) wt->WinWidth / (float) wt->WinHeight;
glViewport(0, 0, wt->WinWidth, wt->WinHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-w, w, -1.0, 1.0, 1.5, 10);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0, 0, -2.5);
wt->NewSize = GL_FALSE;
}
if (wt->MakeNewTexture) {
MakeNewTexture(wt);
wt->MakeNewTexture = GL_FALSE;
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(wt->Angle, 0, 1, 0);
glRotatef(wt->Angle, 1, 0, 0);
glScalef(0.7, 0.7, 0.7);
draw_object();
glPopMatrix();
if (Locking)
pthread_mutex_lock(&Mutex);
eglSwapBuffers(wt->Display, wt->Surface);
if (Locking)
pthread_mutex_unlock(&Mutex);
if (Animate) {
usleep(5000);
}
else {
/* wait for signal to draw */
pthread_mutex_lock(&CondMutex);
pthread_cond_wait(&CondVar, &CondMutex);
pthread_mutex_unlock(&CondMutex);
}
wt->Angle += 1.0;
}
eglMakeCurrent(wt->Display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
}
static void
keypress(XEvent *event, struct winthread *wt)
{
char buf[100];
KeySym keySym;
XComposeStatus stat;
XLookupString(&event->xkey, buf, sizeof(buf), &keySym, &stat);
switch (keySym) {
case XK_Escape:
/* tell all threads to exit */
if (!Animate) {
signal_redraw();
}
ExitFlag = GL_TRUE;
/*printf("exit draw_loop %d\n", wt->Index);*/
return;
case XK_t:
case XK_T:
if (Texture) {
wt->MakeNewTexture = GL_TRUE;
if (!Animate)
signal_redraw();
}
break;
case XK_a:
case XK_A:
Animate = !Animate;
if (Animate) /* yes, prev Animate state! */
signal_redraw();
break;
case XK_s:
case XK_S:
if (!Animate)
signal_redraw();
break;
default:
; /* nop */
}
}
/*
* The main process thread runs this loop.
* Single display connection for all threads.
*/
static void
event_loop(Display *dpy)
{
XEvent event;
int i;
assert(!MultiDisplays);
while (!ExitFlag) {
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 */
for (i = 0; i < NumWinThreads; i++) {
struct winthread *wt = &WinThreads[i];
if (event.xconfigure.window == wt->Win) {
resize(wt, event.xconfigure.width,
event.xconfigure.height);
break;
}
}
break;
case KeyPress:
for (i = 0; i < NumWinThreads; i++) {
struct winthread *wt = &WinThreads[i];
if (event.xkey.window == wt->Win) {
keypress(&event, wt);
break;
}
}
break;
default:
/*no-op*/ ;
}
}
}
/*
* 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:
keypress(&event, wt);
break;
default:
; /* nop */
}
}
w = (w + 1) % NumWinThreads;
usleep(5000);
}
}
/*
* we'll call this once for each thread, before the threads are created.
*/
static void
create_window(struct winthread *wt, EGLContext shareCtx)
{
Window win;
EGLContext ctx;
EGLSurface surf;
EGLint attribs[] = { EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
EGL_DEPTH_SIZE, 1,
EGL_NONE };
EGLConfig config;
EGLint num_configs;
EGLint vid;
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
XVisualInfo *visinfo, visTemplate;
int num_visuals;
int width = 160, height = 160;
int xpos = (wt->Index % 8) * (width + 10);
int ypos = (wt->Index / 8) * (width + 20);
scrnum = DefaultScreen(wt->Dpy);
root = RootWindow(wt->Dpy, scrnum);
if (!eglChooseConfig(wt->Display, attribs, &config, 1, &num_configs)) {
Error("Unable to choose an EGL config");
}
assert(config);
assert(num_configs > 0);
if (!eglGetConfigAttrib(wt->Display, config, EGL_NATIVE_VISUAL_ID, &vid)) {
Error("Unable to get visual id of EGL config\n");
}
visTemplate.visualid = vid;
visinfo = XGetVisualInfo(wt->Dpy, VisualIDMask,
&visTemplate, &num_visuals);
if (!visinfo) {
Error("Unable to find RGB, Z, double-buffered visual");
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap(wt->Dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow(wt->Dpy, root, xpos, ypos, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr);
if (!win) {
Error("Couldn't create window");
}
XFree(visinfo);
{
XSizeHints sizehints;
sizehints.x = xpos;
sizehints.y = ypos;
sizehints.width = width;
sizehints.height = height;
sizehints.flags = USSize | USPosition;
XSetNormalHints(wt->Dpy, win, &sizehints);
XSetStandardProperties(wt->Dpy, win, "xeglthreads", "xeglthreads",
None, (char **)NULL, 0, &sizehints);
}
eglBindAPI(EGL_OPENGL_API);
ctx = eglCreateContext(wt->Display, config, shareCtx, NULL);
if (!ctx) {
Error("Couldn't create EGL context");
}
surf = eglCreateWindowSurface(wt->Display, config, win, NULL);
if (!surf) {
Error("Couldn't create EGL surface");
}
XMapWindow(wt->Dpy, win);
XSync(wt->Dpy, 0);
/* save the info for this window/context */
wt->Win = win;
wt->Context = ctx;
wt->Surface = surf;
wt->Angle = 0.0;
wt->WinWidth = width;
wt->WinHeight = height;
wt->NewSize = GL_TRUE;
}
/*
* Called by pthread_create()
*/
static void *
thread_function(void *p)
{
struct winthread *wt = (struct winthread *) p;
draw_loop(wt);
return NULL;
}
/*
* called before exit to wait for all threads to finish
*/
static void
clean_up(void)
{
int i;
/* wait for threads to finish */
for (i = 0; i < NumWinThreads; i++) {
pthread_join(WinThreads[i].Thread, NULL);
}
for (i = 0; i < NumWinThreads; i++) {
eglDestroyContext(WinThreads[i].Display, WinThreads[i].Context);
XDestroyWindow(WinThreads[i].Dpy, WinThreads[i].Win);
}
}
static void
usage(void)
{
printf("xeglthreads: test of EGL/GL thread safety (any key = exit)\n");
printf("Usage:\n");
printf(" xeglthreads [options]\n");
printf("Options:\n");
printf(" -display DISPLAYNAME Specify display string\n");
printf(" -n NUMTHREADS Number of threads to create\n");
printf(" -p Use a separate display connection for each thread\n");
printf(" -l Use application-side locking\n");
printf(" -t Enable texturing\n");
printf("Keyboard:\n");
printf(" Esc Exit\n");
printf(" t Change texture image (requires -t option)\n");
printf(" a Toggle animation\n");
printf(" s Step rotation (when not animating)\n");
}
int
main(int argc, char *argv[])
{
char *displayName = NULL;
int numThreads = 2;
Display *dpy = NULL;
EGLDisplay *egl_dpy = NULL;
int i;
Status threadStat;
if (argc == 1) {
usage();
}
else {
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-display") == 0 && i + 1 < argc) {
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], "-t") == 0) {
Texture = 1;
}
else if (strcmp(argv[i], "-n") == 0 && i + 1 < argc) {
numThreads = atoi(argv[i + 1]);
if (numThreads < 1)
numThreads = 1;
else if (numThreads > MAX_WINTHREADS)
numThreads = MAX_WINTHREADS;
i++;
}
else {
usage();
exit(1);
}
}
}
if (Locking)
printf("xeglthreads: Using explicit locks around Xlib calls.\n");
else
printf("xeglthreads: No explict locking.\n");
if (MultiDisplays)
printf("xeglthreads: Per-thread display connections.\n");
else
printf("xeglthreads: Single display connection.\n");
/*
* VERY IMPORTANT: call XInitThreads() before any other Xlib functions.
*/
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",
XDisplayName(displayName));
return -1;
}
egl_dpy = eglGetDisplay(dpy);
if (!egl_dpy) {
fprintf(stderr, "Unable to get EGL display\n");
XCloseDisplay(dpy);
return -1;
}
if (!eglInitialize(egl_dpy, NULL, NULL)) {
fprintf(stderr, "Unable to initialize EGL display\n");
return -1;
}
}
pthread_mutex_init(&Mutex, NULL);
pthread_mutex_init(&CondMutex, NULL);
pthread_cond_init(&CondVar, NULL);
printf("xeglthreads: creating windows\n");
NumWinThreads = numThreads;
/* Create the EGL windows and contexts */
for (i = 0; i < numThreads; i++) {
EGLContext share;
if (MultiDisplays) {
WinThreads[i].Dpy = XOpenDisplay(displayName);
assert(WinThreads[i].Dpy);
WinThreads[i].Display = eglGetDisplay(WinThreads[i].Dpy);
assert(eglInitialize(WinThreads[i].Display, NULL, NULL));
}
else {
WinThreads[i].Dpy = dpy;
WinThreads[i].Display = egl_dpy;
}
WinThreads[i].Index = i;
WinThreads[i].Initialized = GL_FALSE;
share = (Texture && i > 0) ? WinThreads[0].Context : 0;
create_window(&WinThreads[i], share);
}
printf("xeglthreads: creating threads\n");
/* Create the threads */
for (i = 0; i < numThreads; i++) {
pthread_create(&WinThreads[i].Thread, NULL, thread_function,
(void*) &WinThreads[i]);
printf("xeglthreads: Created thread %p\n",
(void *) WinThreads[i].Thread);
}
if (MultiDisplays)
event_loop_multi();
else
event_loop(dpy);
clean_up();
if (MultiDisplays) {
for (i = 0; i < numThreads; i++) {
eglTerminate(WinThreads[i].Display);
XCloseDisplay(WinThreads[i].Dpy);
}
}
else {
eglTerminate(egl_dpy);
XCloseDisplay(dpy);
}
return 0;
}
#else /* PTHREADS */
#include <stdio.h>
int
main(int argc, char *argv[])
{
printf("Sorry, this program wasn't compiled with PTHREADS defined.\n");
return 0;
}
#endif /* PTHREADS */

View File

@@ -182,7 +182,7 @@ static void fillConvolution(GLint *k,
static void setupConvolution()
{
GLint *kernel = (GLint*)malloc(sizeof(GLint) * 9);
GLfloat scale;
GLfloat scale = 0.0;
GLfloat *vecKer = (GLfloat*)malloc(sizeof(GLfloat) * 9 * 4);
GLuint loc;
GLuint i;

View File

@@ -369,12 +369,9 @@ InitPrograms(void)
static void
InitGL(void)
{
const char *version = (const char *) glGetString(GL_VERSION);
if (!ShadersSupported())
exit(1);
if (version[0] != '2' || version[1] != '.') {
printf("Warning: this program expects OpenGL 2.0\n");
/*exit(1);*/
}
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
printf("Usage:\n");
printf(" a - toggle arrays vs. immediate mode rendering\n");

View File

@@ -29,7 +29,6 @@
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -492,9 +491,8 @@ ReadConfigFile(const char *filename, struct config_file *conf)
conf->num_uniforms = 0;
/* ugly but functional parser */
while (!feof(f)) {
fgets(line, sizeof(line), f);
if (!feof(f) && line[0]) {
while (fgets(line, sizeof(line), f) != NULL) {
if (line[0]) {
if (strncmp(line, "vs ", 3) == 0) {
VertShaderFile = strdup(line + 3);
VertShaderFile[strlen(VertShaderFile) - 1] = 0;
@@ -550,6 +548,10 @@ ReadConfigFile(const char *filename, struct config_file *conf)
type = TypeFromName(typeName);
if (strlen(name) + 1 > sizeof(conf->uniforms[conf->num_uniforms].name)) {
fprintf(stderr, "string overflow\n");
exit(1);
}
strcpy(conf->uniforms[conf->num_uniforms].name, name);
conf->uniforms[conf->num_uniforms].value[0] = v1;
conf->uniforms[conf->num_uniforms].value[1] = v2;
@@ -627,7 +629,7 @@ Init(void)
NumAttribs = GetAttribs(Program, Attribs);
PrintAttribs(Attribs);
//assert(glGetError() == 0);
/* assert(glGetError() == 0); */
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);

View File

@@ -310,8 +310,8 @@ MakeMipmap(void)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
////glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5);
/* glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4); */
/* glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5); */
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
#undef SZ

View File

@@ -400,11 +400,8 @@ InitPrograms(void)
static void
Init(GLboolean useImageFiles)
{
const char *version = (const char *) glGetString(GL_VERSION);
if (version[0] != '2' || version[1] != '.') {
printf("Warning: this program expects OpenGL 2.0\n");
/*exit(1);*/
if (!ShadersSupported()) {
exit(1);
}
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));

View File

@@ -40,15 +40,6 @@ static GLboolean Anim = GL_TRUE;
static GLboolean WireFrame = GL_TRUE;
static GLfloat xRot = -70.0f, yRot = 0.0f, zRot = 0.0f;
/* value[0] = tex unit */
static struct uniform_info Uniforms[] = {
{ "tex1", 1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 },
END_OF_UNIFORMS
};
static void
Idle(void)
{

View File

@@ -0,0 +1,161 @@
# Exported from Wings 3D 0.99.03
# Top flaps
newmtl BottomWing
Ns 100.0
d 1.0
illum 2
Kd 1.0 0.0 0.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd TopBotMap.rgb
newmtl CompBall_auv
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd CompBall_auv.rgb
newmtl EngMat1
Ns 100.0
d 1.0
illum 2
Kd 0.334 0.334 0.334
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl EngMat2
Ns 100.0
d 1.0
illum 2
Kd 0.78688 0.78688 0.78688
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl Fuselage_auv
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 0.0 0.0 0.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd SidesMap.rgb
newmtl Glass
Ns 100.0
d 0.5
illum 2
#Kd 0.5533333333333333 1.0 1.0
Kd 1.0 1.0 1.0
#Ka 0.37333333333333335 0.68 1.0
Ka 0.0 0.0 0.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl Grip
Ns 100.0
d 1.0
illum 2
Kd 0.47386 0.47386 0.47386
Ka 0.6203799999999999 0.6203799999999999 0.6203799999999999
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl Interior
Ns 100.0
d 1.0
illum 2
Kd 0.70696 0.70696 0.70696
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl Prop
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 0.6266666666666667
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd PropMap.rgb
# Rudder
newmtl Sides
Ns 100.0
d 1.0
illum 2
Kd 1.0 0.0 0.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd SidesMap.rgb
newmtl TailHoriz
Ns 100.0
d 1.0
illum 2
Kd 1.0 0.0 0.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd TopBotMap.rgb
# Top wing, bot wing, fuselage
newmtl TopWing
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd TopBotMap.rgb
newmtl Wheels
Ns 100.0
d 1.0
illum 2
Kd 0.0 0.0 0.0
Ka 0.0 0.0 0.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd WheelsMap.rgb
newmtl cylinder58_auv
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd cylinder58_auv.rgb
newmtl default
Ns 100.0
d 1.0
illum 2
Kd 0.0 1.0 1.0
Ka 0.0 1.0 1.0
Ks 0.0 1.0 1.0
Ke 0.0 0.0 0.0
newmtl gage_auv
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd gage_auv.rgb

File diff suppressed because it is too large Load Diff

83
progs/objviewer/Makefile Normal file
View File

@@ -0,0 +1,83 @@
TOP = ../..
include $(TOP)/configs/current
INCDIR = $(TOP)/include
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) \
-l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
# using : to avoid APP_CC pointing to CC loop
CC := $(APP_CC)
CFLAGS := -I$(INCDIR) $(CFLAGS)
LDLIBS = $(LIBS)
SOURCES = \
glm.c \
glmdraw.c \
objview.c \
trackball.c \
skybox.c \
readtex.c \
shaderutil.c
HEADERS = \
extfuncs.h \
readtex.h \
shaderutil.h \
trackball.h
OBJS = $(SOURCES:.c=.o)
PROG = objview
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
default: $(PROG)
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
$(OBJS): $(HEADERS)
### Extra dependencies
extfuncs.h: $(TOP)/progs/util/extfuncs.h
cp $< .
readtex.c: $(TOP)/progs/util/readtex.c
cp $< .
readtex.h: $(TOP)/progs/util/readtex.h
cp $< .
shaderutil.c: $(TOP)/progs/util/shaderutil.c
cp $< .
shaderutil.h: $(TOP)/progs/util/shaderutil.h
cp $< .
trackball.c: $(TOP)/progs/util/trackball.c
cp $< .
trackball.h: $(TOP)/progs/util/trackball.h
cp $< .
clean:
-rm -f $(PROG) $(OBJS)
-rm -f *.o *~
-rm -f extfuncs.h
-rm -f shaderutil.*
-rm -f trackball.*
-rm -f readtex.*
depend: $(SOURCES)
@$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(SOURCES) \
> /dev/null 2>/dev/null
-include depend

View File

@@ -0,0 +1,23 @@
This .obj viewer is based on the "smooth" program by Nate Robins
found in the Kilgard GLUT package.
The alpine sky box textures come from http://www.hazelwhorley.com/skyboxtex3_bitmaps.html
The bunny.obj and buddha.obj models come from Stanford.
The GreatLakesBiplaneHP.obj model comes from http://www.sharecg.com/v/25978/3D-Model/Great-Lakes-Biplane-Model
The bobcat.obj model comes from http://www.sharecg.com/v/24771/3D-Model/Bobcat,3d-studio-and-wavefront-objects
The .obj file reader code in glm.c isn't perfect. Not all .obj files are
parsed correctly. There are often mistakes in material-to-triangle assignments.
Mouse:
Left = rotate
Middle = scale
Right = menu
Keyboard:
See pop-up menu for keyboard shortcuts, or press 'h'.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,72 @@
# Exported from Wings 3D 0.99.00b
newmtl black
Ns 48.6667
d 1.00000
illum 2
Kd 1.00000e-3 1.00000e-3 1.00000e-3
Ka 1.00000 1.00000 1.00000
Ks 1.00000 1.00000 1.00000
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl blanco
Ns 100.000
d 1.00000
illum 2
Kd 1.00000 1.00000 1.00000
Ka 0.620380 0.620380 0.620380
Ks 0.806860 0.806860 0.806860
Ke 1.00000e-3 1.00000e-3 1.00000e-3
newmtl blue
Ns 100.000
d 1.00000
illum 2
Kd 0.105111 0.125293 0.366667
Ka 1.00000 1.00000 1.00000
Ks 1.00000 1.00000 1.00000
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl default
Ns 100.000
d 1.00000
illum 2
Kd 1.00000 1.00000 1.00000
Ka 1.00000 1.00000 1.00000
Ks 1.00000 1.00000 1.00000
Ka 0.10000 0.10000 0.10000
Ks 0.50000 0.50000 0.500000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl gre
Ns 100.000
d 1.00000
illum 2
Kd 0.200800 0.200800 0.200800
Ka 1.00000 1.00000 1.00000
Ks 1.00000 1.00000 1.00000
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl red
Ns 100.000
d 1.00000
illum 2
Kd 0.460000 0.00000e+0 0.00000e+0
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 0.00000e+0 0.00000e+0 0.00000e+0
newmtl rojo
Ns 100.000
d 1.00000
illum 2
Kd 0.700000 0.00000e+0 0.00000e+0
Ka 0.00000 0.00000 0.00000
Ks 0.00000 0.00000 0.00000
Ke 1.00000e-3 1.00000e-3 1.00000e-3

9251
progs/objviewer/bobcat.obj Normal file

File diff suppressed because it is too large Load Diff

149990
progs/objviewer/buddha.obj Normal file

File diff suppressed because it is too large Load Diff

104501
progs/objviewer/bunny.obj Normal file

File diff suppressed because it is too large Load Diff

1917
progs/objviewer/glm.c Normal file

File diff suppressed because it is too large Load Diff

287
progs/objviewer/glm.h Normal file
View File

@@ -0,0 +1,287 @@
/*
* GLM library. Wavefront .obj file format reader/writer/manipulator.
*
* Written by Nate Robins, 1997.
* email: ndr@pobox.com
* www: http://www.pobox.com/~ndr
*/
#ifndef GLM_H
#define GLM_H
typedef unsigned int uint;
#ifndef M_PI
#define M_PI 3.14159265
#endif
/* defines */
#define GLM_NONE (0) /* render with only vertices */
#define GLM_FLAT (1 << 0) /* render with facet normals */
#define GLM_SMOOTH (1 << 1) /* render with vertex normals */
#define GLM_TEXTURE (1 << 2) /* render with texture coords */
#define GLM_COLOR (1 << 3) /* render with colors */
#define GLM_MATERIAL (1 << 4) /* render with materials */
/* structs */
/* GLMmaterial: Structure that defines a material in a model.
*/
typedef struct _GLMmaterial
{
char* name; /* name of material */
float diffuse[4]; /* diffuse component */
float ambient[4]; /* ambient component */
float specular[4]; /* specular component */
float emmissive[4]; /* emmissive component */
float shininess; /* specular exponent */
char *map_kd; /* diffuse texture map file */
uint texture_kd; /* diffuse texture map */
uint texture_ks; /* specular texture map */
int uDiffuse, uAmbient, uSpecular, uShininess, uDiffTex, uSpecTex;
uint prog;
} GLMmaterial;
/* GLMtriangle: Structure that defines a triangle in a model.
*/
typedef struct {
uint vindices[3]; /* array of triangle vertex indices */
uint nindices[3]; /* array of triangle normal indices */
uint tindices[3]; /* array of triangle texcoord indices*/
uint findex; /* index of triangle facet normal */
} GLMtriangle;
/* GLMgroup: Structure that defines a group in a model.
*/
typedef struct _GLMgroup {
char* name; /* name of this group */
uint numtriangles; /* number of triangles in this group */
uint* triangles; /* array of triangle indices */
uint material; /* index to material for group */
uint * triIndexes;
uint minIndex, maxIndex;
struct _GLMgroup* next; /* pointer to next group in model */
} GLMgroup;
/* GLMmodel: Structure that defines a model.
*/
typedef struct {
char* pathname; /* path to this model */
char* mtllibname; /* name of the material library */
uint numvertices; /* number of vertices in model */
float* vertices; /* array of vertices */
uint numnormals; /* number of normals in model */
float* normals; /* array of normals */
uint numtexcoords; /* number of texcoords in model */
float* texcoords; /* array of texture coordinates */
uint numfacetnorms; /* number of facetnorms in model */
float* facetnorms; /* array of facetnorms */
uint numtriangles; /* number of triangles in model */
GLMtriangle* triangles; /* array of triangles */
uint nummaterials; /* number of materials in model */
GLMmaterial* materials; /* array of materials */
uint numgroups; /* number of groups in model */
GLMgroup* groups; /* linked list of groups */
float position[3]; /* position of the model */
float scale;
uint vbo; /* OpenGL VBO for vertex data */
uint vertexSize; /* number of floats per vertex */
uint posOffset; /* offset of position within vertex, in bytes */
uint normOffset; /* offset of normal within vertex, in bytes */
uint texOffset; /* offset of texcoord within vertex, in bytes */
} GLMmodel;
/* public functions */
/* glmUnitize: "unitize" a model by translating it to the origin and
* scaling it to fit in a unit cube around the origin. Returns the
* scalefactor used.
*
* model - properly initialized GLMmodel structure
*/
float
glmUnitize(GLMmodel* model);
/* glmDimensions: Calculates the dimensions (width, height, depth) of
* a model.
*
* model - initialized GLMmodel structure
* dimensions - array of 3 floats (float dimensions[3])
*/
void
glmDimensions(GLMmodel* model, float* dimensions);
/* glmScale: Scales a model by a given amount.
*
* model - properly initialized GLMmodel structure
* scale - scalefactor (0.5 = half as large, 2.0 = twice as large)
*/
void
glmScale(GLMmodel* model, float scale);
/* glmReverseWinding: Reverse the polygon winding for all polygons in
* this model. Default winding is counter-clockwise. Also changes
* the direction of the normals.
*
* model - properly initialized GLMmodel structure
*/
void
glmReverseWinding(GLMmodel* model);
/* glmFacetNormals: Generates facet normals for a model (by taking the
* cross product of the two vectors derived from the sides of each
* triangle). Assumes a counter-clockwise winding.
*
* model - initialized GLMmodel structure
*/
void
glmFacetNormals(GLMmodel* model);
/* glmVertexNormals: Generates smooth vertex normals for a model.
* First builds a list of all the triangles each vertex is in. Then
* loops through each vertex in the the list averaging all the facet
* normals of the triangles each vertex is in. Finally, sets the
* normal index in the triangle for the vertex to the generated smooth
* normal. If the dot product of a facet normal and the facet normal
* associated with the first triangle in the list of triangles the
* current vertex is in is greater than the cosine of the angle
* parameter to the function, that facet normal is not added into the
* average normal calculation and the corresponding vertex is given
* the facet normal. This tends to preserve hard edges. The angle to
* use depends on the model, but 90 degrees is usually a good start.
*
* model - initialized GLMmodel structure
* angle - maximum angle (in degrees) to smooth across
*/
void
glmVertexNormals(GLMmodel* model, float angle);
/* glmLinearTexture: Generates texture coordinates according to a
* linear projection of the texture map. It generates these by
* linearly mapping the vertices onto a square.
*
* model - pointer to initialized GLMmodel structure
*/
void
glmLinearTexture(GLMmodel* model);
/* glmSpheremapTexture: Generates texture coordinates according to a
* spherical projection of the texture map. Sometimes referred to as
* spheremap, or reflection map texture coordinates. It generates
* these by using the normal to calculate where that vertex would map
* onto a sphere. Since it is impossible to map something flat
* perfectly onto something spherical, there is distortion at the
* poles. This particular implementation causes the poles along the X
* axis to be distorted.
*
* model - pointer to initialized GLMmodel structure
*/
void
glmSpheremapTexture(GLMmodel* model);
/* glmDelete: Deletes a GLMmodel structure.
*
* model - initialized GLMmodel structure
*/
void
glmDelete(GLMmodel* model);
/* glmReadOBJ: Reads a model description from a Wavefront .OBJ file.
* Returns a pointer to the created object which should be free'd with
* glmDelete().
*
* filename - name of the file containing the Wavefront .OBJ format data.
*/
GLMmodel*
glmReadOBJ(char* filename);
/* glmWriteOBJ: Writes a model description in Wavefront .OBJ format to
* a file.
*
* model - initialized GLMmodel structure
* filename - name of the file to write the Wavefront .OBJ format data to
* mode - a bitwise or of values describing what is written to the file
* GLM_NONE - write only vertices
* GLM_FLAT - write facet normals
* GLM_SMOOTH - write vertex normals
* GLM_TEXTURE - write texture coords
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
void
glmWriteOBJ(GLMmodel* model, char* filename, uint mode);
/* glmDraw: Renders the model to the current OpenGL context using the
* mode specified.
*
* model - initialized GLMmodel structure
* mode - a bitwise OR of values describing what is to be rendered.
* GLM_NONE - render with only vertices
* GLM_FLAT - render with facet normals
* GLM_SMOOTH - render with vertex normals
* GLM_TEXTURE - render with texture coords
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
void
glmDraw(GLMmodel* model, uint mode);
/* glmList: Generates and returns a display list for the model using
* the mode specified.
*
* model - initialized GLMmodel structure
* mode - a bitwise OR of values describing what is to be rendered.
* GLM_NONE - render with only vertices
* GLM_FLAT - render with facet normals
* GLM_SMOOTH - render with vertex normals
* GLM_TEXTURE - render with texture coords
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
uint
glmList(GLMmodel* model, uint mode);
/* glmWeld: eliminate (weld) vectors that are within an epsilon of
* each other.
*
* model - initialized GLMmodel structure
* epsilon - maximum difference between vertices
* ( 0.00001 is a good start for a unitized model)
*
*/
void
glmWeld(GLMmodel* model, float epsilon);
void
glmReIndex(GLMmodel *model);
void
glmMakeVBOs(GLMmodel *model);
void
glmDrawVBO(GLMmodel *model);
void
glmPrint(const GLMmodel *model);
void
glmShaderMaterial(GLMmaterial *mat);
void
glmLoadTextures(GLMmodel *model);
void
glmSpecularTexture(GLMmodel *model, uint cubeTex);
#endif /* GLM_H */

455
progs/objviewer/glmdraw.c Normal file
View File

@@ -0,0 +1,455 @@
/* */
#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "glm.h"
#include "readtex.h"
#include "shaderutil.h"
/* defines */
#define T(x) model->triangles[(x)]
/* glmDraw: Renders the model to the current OpenGL context using the
* mode specified.
*
* model - initialized GLMmodel structure
* mode - a bitwise OR of values describing what is to be rendered.
* GLM_NONE - render with only vertices
* GLM_FLAT - render with facet normals
* GLM_SMOOTH - render with vertex normals
* GLM_TEXTURE - render with texture coords
* GLM_COLOR - render with colors (color material)
* GLM_MATERIAL - render with materials
* GLM_COLOR and GLM_MATERIAL should not both be specified.
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
GLvoid
glmDraw(GLMmodel* model, GLuint mode)
{
GLuint i;
GLMgroup* group;
assert(model);
assert(model->vertices);
/* do a bit of warning */
if (mode & GLM_FLAT && !model->facetnorms) {
printf("glmDraw() warning: flat render mode requested "
"with no facet normals defined.\n");
mode &= ~GLM_FLAT;
}
if (mode & GLM_SMOOTH && !model->normals) {
printf("glmDraw() warning: smooth render mode requested "
"with no normals defined.\n");
mode &= ~GLM_SMOOTH;
}
if (mode & GLM_TEXTURE && !model->texcoords) {
printf("glmDraw() warning: texture render mode requested "
"with no texture coordinates defined.\n");
mode &= ~GLM_TEXTURE;
}
if (mode & GLM_FLAT && mode & GLM_SMOOTH) {
printf("glmDraw() warning: flat render mode requested "
"and smooth render mode requested (using smooth).\n");
mode &= ~GLM_FLAT;
}
if (mode & GLM_COLOR && !model->materials) {
printf("glmDraw() warning: color render mode requested "
"with no materials defined.\n");
mode &= ~GLM_COLOR;
}
if (mode & GLM_MATERIAL && !model->materials) {
printf("glmDraw() warning: material render mode requested "
"with no materials defined.\n");
mode &= ~GLM_MATERIAL;
}
if (mode & GLM_COLOR && mode & GLM_MATERIAL) {
printf("glmDraw() warning: color and material render mode requested "
"using only material mode\n");
mode &= ~GLM_COLOR;
}
if (mode & GLM_COLOR)
glEnable(GL_COLOR_MATERIAL);
if (mode & GLM_MATERIAL)
glDisable(GL_COLOR_MATERIAL);
glPushMatrix();
glTranslatef(model->position[0], model->position[1], model->position[2]);
glBegin(GL_TRIANGLES);
group = model->groups;
while (group) {
if (mode & GLM_MATERIAL) {
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,
model->materials[group->material].ambient);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,
model->materials[group->material].diffuse);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR,
model->materials[group->material].specular);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS,
model->materials[group->material].shininess);
}
if (mode & GLM_COLOR) {
glColor3fv(model->materials[group->material].diffuse);
}
for (i = 0; i < group->numtriangles; i++) {
if (mode & GLM_FLAT)
glNormal3fv(&model->facetnorms[3 * T(group->triangles[i]).findex]);
if (mode & GLM_SMOOTH)
glNormal3fv(&model->normals[3 * T(group->triangles[i]).nindices[0]]);
if (mode & GLM_TEXTURE)
glTexCoord2fv(&model->texcoords[2*T(group->triangles[i]).tindices[0]]);
glVertex3fv(&model->vertices[3 * T(group->triangles[i]).vindices[0]]);
#if 0
printf("%f %f %f\n",
model->vertices[3 * T(group->triangles[i]).vindices[0] + X],
model->vertices[3 * T(group->triangles[i]).vindices[0] + Y],
model->vertices[3 * T(group->triangles[i]).vindices[0] + Z]);
#endif
if (mode & GLM_SMOOTH)
glNormal3fv(&model->normals[3 * T(group->triangles[i]).nindices[1]]);
if (mode & GLM_TEXTURE)
glTexCoord2fv(&model->texcoords[2*T(group->triangles[i]).tindices[1]]);
glVertex3fv(&model->vertices[3 * T(group->triangles[i]).vindices[1]]);
#if 0
printf("%f %f %f\n",
model->vertices[3 * T(group->triangles[i]).vindices[1] + X],
model->vertices[3 * T(group->triangles[i]).vindices[1] + Y],
model->vertices[3 * T(group->triangles[i]).vindices[1] + Z]);
#endif
if (mode & GLM_SMOOTH)
glNormal3fv(&model->normals[3 * T(group->triangles[i]).nindices[2]]);
if (mode & GLM_TEXTURE)
glTexCoord2fv(&model->texcoords[2*T(group->triangles[i]).tindices[2]]);
glVertex3fv(&model->vertices[3 * T(group->triangles[i]).vindices[2]]);
#if 0
printf("%f %f %f\n",
model->vertices[3 * T(group->triangles[i]).vindices[2] + X],
model->vertices[3 * T(group->triangles[i]).vindices[2] + Y],
model->vertices[3 * T(group->triangles[i]).vindices[2] + Z]);
#endif
}
group = group->next;
}
glEnd();
glPopMatrix();
}
void
glmMakeVBOs(GLMmodel *model)
{
uint bytes, vertexFloats, i;
float *buffer;
vertexFloats = 3;
model->posOffset = 0;
if (model->numnormals > 0) {
assert(model->numnormals == model->numvertices);
model->normOffset = vertexFloats * sizeof(GLfloat);
vertexFloats += 3;
}
if (model->numtexcoords > 0) {
assert(model->numtexcoords == model->numvertices);
model->texOffset = vertexFloats * sizeof(GLfloat);
vertexFloats += 2;
}
model->vertexSize = vertexFloats;
bytes = (model->numvertices + 1) * vertexFloats * sizeof(float);
buffer = (float *) malloc(bytes);
for (i = 0; i < model->numvertices; i++) {
/* copy vertex pos */
uint j = 0;
buffer[i * vertexFloats + j++] = model->vertices[i * 3 + 0];
buffer[i * vertexFloats + j++] = model->vertices[i * 3 + 1];
buffer[i * vertexFloats + j++] = model->vertices[i * 3 + 2];
if (model->numnormals > 0) {
buffer[i * vertexFloats + j++] = model->normals[i * 3 + 0];
buffer[i * vertexFloats + j++] = model->normals[i * 3 + 1];
buffer[i * vertexFloats + j++] = model->normals[i * 3 + 2];
}
if (model->numtexcoords > 0) {
buffer[i * vertexFloats + j++] = model->texcoords[i * 2 + 0];
buffer[i * vertexFloats + j++] = model->texcoords[i * 2 + 1];
}
}
glGenBuffersARB(1, &model->vbo);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, model->vbo);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, bytes, buffer, GL_STATIC_DRAW_ARB);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
free(buffer);
}
static void
_glmLoadTexture(GLMmaterial *mat)
{
if (mat->map_kd) {
GLint imgWidth, imgHeight;
GLenum imgFormat;
GLubyte *image = NULL;
glGenTextures(1, &mat->texture_kd);
image = LoadRGBImage( mat->map_kd, &imgWidth, &imgHeight, &imgFormat );
if (!image) {
/*fprintf(stderr, "Couldn't open texture %s\n", mat->map_kd);*/
free(mat->map_kd);
mat->map_kd = NULL;
mat->texture_kd = 0;
return;
}
if (0)
printf("load texture %s %d x %d\n", mat->map_kd, imgWidth, imgHeight);
glBindTexture(GL_TEXTURE_2D, mat->texture_kd);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, imgWidth, imgHeight,
imgFormat, GL_UNSIGNED_BYTE, image);
free(image);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
}
}
void
glmLoadTextures(GLMmodel *model)
{
uint i;
for (i = 0; i < model->nummaterials; i++) {
GLMmaterial *mat = &model->materials[i];
_glmLoadTexture(mat);
}
}
void
glmDrawVBO(GLMmodel *model)
{
GLMgroup* group;
assert(model->vbo);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, model->vbo);
glVertexPointer(3, GL_FLOAT, model->vertexSize * sizeof(float),
(void *) model->posOffset);
glEnableClientState(GL_VERTEX_ARRAY);
if (model->numnormals > 0) {
glNormalPointer(GL_FLOAT, model->vertexSize * sizeof(float),
(void *) model->normOffset);
glEnableClientState(GL_NORMAL_ARRAY);
}
if (model->numtexcoords > 0) {
glTexCoordPointer(2, GL_FLOAT, model->vertexSize * sizeof(float),
(void *) model->texOffset);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
glPushMatrix();
glTranslatef(model->position[0], model->position[1], model->position[2]);
glScalef(model->scale, model->scale, model->scale);
for (group = model->groups; group; group = group->next) {
if (group->numtriangles > 0) {
glmShaderMaterial(&model->materials[group->material]);
glDrawRangeElements(GL_TRIANGLES,
group->minIndex, group->maxIndex,
3 * group->numtriangles,
GL_UNSIGNED_INT, group->triIndexes);
}
}
glPopMatrix();
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
/* glmList: Generates and returns a display list for the model using
* the mode specified.
*
* model - initialized GLMmodel structure
* mode - a bitwise OR of values describing what is to be rendered.
* GLM_NONE - render with only vertices
* GLM_FLAT - render with facet normals
* GLM_SMOOTH - render with vertex normals
* GLM_TEXTURE - render with texture coords
* GLM_COLOR - render with colors (color material)
* GLM_MATERIAL - render with materials
* GLM_COLOR and GLM_MATERIAL should not both be specified.
* GLM_FLAT and GLM_SMOOTH should not both be specified.
*/
GLuint
glmList(GLMmodel* model, GLuint mode)
{
GLuint list;
list = glGenLists(1);
glNewList(list, GL_COMPILE);
glmDraw(model, mode);
glEndList();
return list;
}
static const char *VertexShader =
"varying vec3 normal; \n"
"void main() { \n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; \n"
" normal = gl_NormalMatrix * gl_Normal; \n"
" gl_TexCoord[0] = gl_MultiTexCoord0; \n"
"} \n";
/**
* Two %s substitutions:
* diffuse texture? true/false
* specular texture? true/false
*/
static const char *TexFragmentShader =
"uniform vec4 ambient, diffuse, specular; \n"
"uniform vec4 ambientLight, diffuseLight, specularLight; \n"
"uniform float shininess; \n"
"uniform sampler2D diffTex; \n"
"uniform samplerCube specTex; \n"
"varying vec3 normal; \n"
"\n"
"void main() \n"
"{ \n"
" vec4 diffTerm, specTerm; \n"
" float dotProd = max(dot(gl_LightSource[0].position.xyz, \n"
" normalize(normal)), 0.0);\n"
" float dotProd2 = max(dot(-gl_LightSource[0].position.xyz, \n"
" normalize(normal)), 0.0);\n"
" dotProd += dotProd2; \n"
" \n"
" diffTerm = diffuse * diffuseLight * dotProd; \n"
" if (%s) \n"
" diffTerm *= texture2D(diffTex, gl_TexCoord[0].st); \n"
" \n"
" specTerm = specular * specularLight * pow(dotProd, shininess); \n"
" if (%s) \n"
" specTerm *= textureCube(specTex, normal); \n"
" \n"
" gl_FragColor = ambient * ambientLight + diffTerm + specTerm; \n"
"} \n";
void
glmShaderMaterial(GLMmaterial *mat)
{
static const float ambientLight[4] = { 0.1, 0.1, 0.1, 0.0 };
static const float diffuseLight[4] = { 0.75, 0.75, 0.75, 1.0 };
static const float specularLight[4] = { 1.0, 1.0, 1.0, 0.0 };
if (!mat->prog) {
/* make shader now */
char newShader[10000];
GLuint vs, fs;
const char *diffuseTex = mat->texture_kd ? "true" : "false";
const char *specularTex = mat->texture_ks ? "true" : "false";
GLint uAmbientLight, uDiffuseLight, uSpecularLight;
/* replace %d with 0 or 1 */
sprintf(newShader, TexFragmentShader, diffuseTex, specularTex);
if (0)
printf("===== new shader =====\n%s\n============\n", newShader);
vs = CompileShaderText(GL_VERTEX_SHADER, VertexShader);
fs = CompileShaderText(GL_FRAGMENT_SHADER, newShader);
mat->prog = LinkShaders(vs, fs);
assert(mat->prog);
glUseProgram(mat->prog);
mat->uAmbient = glGetUniformLocation(mat->prog, "ambient");
mat->uDiffuse = glGetUniformLocation(mat->prog, "diffuse");
mat->uSpecular = glGetUniformLocation(mat->prog, "specular");
mat->uShininess = glGetUniformLocation(mat->prog, "shininess");
mat->uDiffTex = glGetUniformLocation(mat->prog, "diffTex");
mat->uSpecTex = glGetUniformLocation(mat->prog, "specTex");
uAmbientLight = glGetUniformLocation(mat->prog, "ambientLight");
uDiffuseLight = glGetUniformLocation(mat->prog, "diffuseLight");
uSpecularLight = glGetUniformLocation(mat->prog, "specularLight");
glUniform4fv(mat->uAmbient, 1, mat->ambient);
glUniform4fv(mat->uDiffuse, 1, mat->diffuse);
glUniform4fv(mat->uSpecular, 1, mat->specular);
glUniform1f(mat->uShininess, mat->shininess);
glUniform1i(mat->uDiffTex, 0);
glUniform1i(mat->uSpecTex, 1);
glUniform4fv(uAmbientLight, 1, ambientLight);
glUniform4fv(uDiffuseLight, 1, diffuseLight);
glUniform4fv(uSpecularLight, 1, specularLight);
}
glActiveTexture(GL_TEXTURE1);
if (mat->texture_ks)
glBindTexture(GL_TEXTURE_CUBE_MAP, mat->texture_ks);
else
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
glActiveTexture(GL_TEXTURE0);
if (mat->texture_kd)
glBindTexture(GL_TEXTURE_2D, mat->texture_kd);
else
glBindTexture(GL_TEXTURE_2D, 0);
if (mat->diffuse[3] < 1.0) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
else {
glDisable(GL_BLEND);
}
glUseProgram(mat->prog);
}
void
glmSpecularTexture(GLMmodel *model, uint cubeTex)
{
uint i;
for (i = 0; i < model->nummaterials; i++) {
model->materials[i].texture_ks = cubeTex;
}
}

515
progs/objviewer/objview.c Normal file
View File

@@ -0,0 +1,515 @@
/*
* .obj file viewer based on "smooth" by Nate Robins, 1997
*
* Brian Paul
* 1 Oct 2009
*/
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <stdarg.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "glm.h"
#include "readtex.h"
#include "skybox.h"
#include "trackball.h"
static char *Model_file = NULL; /* name of the obect file */
static GLMmodel *Model;
static GLfloat Scale = 4.0; /* scaling factor */
static GLboolean Performance = GL_FALSE;
static GLboolean Stats = GL_FALSE;
static GLboolean Animate = GL_TRUE;
static GLuint SkyboxTex;
static GLboolean Skybox = GL_TRUE;
static GLboolean Cull = GL_TRUE;
static GLboolean WireFrame = GL_FALSE;
static GLenum FrontFace = GL_CCW;
static GLfloat Yrot = 0.0;
static GLint WinWidth = 1024, WinHeight = 768;
static GLuint NumInstances = 1;
typedef struct
{
float CurQuat[4];
float Distance;
/* When mouse is moving: */
GLboolean Rotating, Translating;
GLint StartX, StartY;
float StartDistance;
} ViewInfo;
static ViewInfo View;
static void
InitViewInfo(ViewInfo *view)
{
view->Rotating = GL_FALSE;
view->Translating = GL_FALSE;
view->StartX = view->StartY = 0;
view->Distance = 12.0;
view->StartDistance = 0.0;
view->CurQuat[0] = 0.0;
view->CurQuat[1] = 1.0;
view->CurQuat[2] = 0.0;
view->CurQuat[3] = 0.0;
}
/* text: general purpose text routine. draws a string according to
* format in a stroke font at x, y after scaling it by the scale
* specified (scale is in window-space (lower-left origin) pixels).
*
* x - position in x (in window-space)
* y - position in y (in window-space)
* scale - scale in pixels
* format - as in printf()
*/
static void
text(GLuint x, GLuint y, GLfloat scale, char* format, ...)
{
va_list args;
char buffer[255], *p;
GLfloat font_scale = 119.05 + 33.33;
va_start(args, format);
vsprintf(buffer, format, args);
va_end(args);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, glutGet(GLUT_WINDOW_WIDTH), 0, glutGet(GLUT_WINDOW_HEIGHT));
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glTranslatef(x, y, 0.0);
glScalef(scale/font_scale, scale/font_scale, scale/font_scale);
for(p = buffer; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
glPopAttrib();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
static float
ComputeFPS(void)
{
static double t0 = -1.0;
static int frames = 0;
double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
static float fps = 0;
frames++;
if (t0 < 0.0) {
t0 = t;
fps = 0.0;
}
else if (t - t0 >= 4.0) {
fps = (frames / (t - t0) + 0.5);
t0 = t;
frames = 0;
return fps;
}
return 0.0;
}
static void
init_model(void)
{
float objScale;
/* read in the model */
Model = glmReadOBJ(Model_file);
objScale = glmUnitize(Model);
glmFacetNormals(Model);
if (Model->numnormals == 0) {
GLfloat smoothing_angle = 90.0;
printf("Generating normals.\n");
glmVertexNormals(Model, smoothing_angle);
}
glmLoadTextures(Model);
glmReIndex(Model);
glmMakeVBOs(Model);
if (0)
glmPrint(Model);
}
static void
init_skybox(void)
{
SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb",
"alpine_west.rgb",
"alpine_up.rgb",
"alpine_down.rgb",
"alpine_south.rgb",
"alpine_north.rgb");
glmSpecularTexture(Model, SkyboxTex);
}
static void
init_gfx(void)
{
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glEnable(GL_NORMALIZE);
glClearColor(0.3, 0.3, 0.9, 0.0);
}
static void
reshape(int width, int height)
{
float ar = 0.5 * (float) width / (float) height;
WinWidth = width;
WinHeight = height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -0.5, 0.5, 1.0, 300.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -3.0);
}
static void
Idle(void)
{
float q[4];
trackball(q, 100, 0, 99.99, 0);
add_quats(q, View.CurQuat, View.CurQuat);
glutPostRedisplay();
}
static void
display(void)
{
GLfloat rot[4][4];
float fps;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(0.0, 0.0, -View.Distance);
glRotatef(Yrot, 0, 1, 0);
build_rotmatrix(rot, View.CurQuat);
glMultMatrixf(&rot[0][0]);
glScalef(Scale, Scale, Scale );
glUseProgram(0);
if (Skybox)
DrawSkyBoxCubeTexture(SkyboxTex);
if (WireFrame)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
if (Cull)
glEnable(GL_CULL_FACE);
else
glDisable(GL_CULL_FACE);
if (NumInstances == 1) {
glmDrawVBO(Model);
}
else {
/* draw > 1 instance */
float dr = 360.0 / NumInstances;
float r;
for (r = 0.0; r < 360.0; r += dr) {
glPushMatrix();
glRotatef(r, 0, 1, 0);
glTranslatef(1.4, 0.0, 0.0);
glmDrawVBO(Model);
glPopMatrix();
}
}
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDisable(GL_CULL_FACE);
glPopMatrix();
if (Stats) {
glColor3f(1.0, 1.0, 1.0);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*1), 20, "%s",
Model->pathname);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*2), 20, "%d vertices",
Model->numvertices);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*3), 20, "%d triangles",
Model->numtriangles);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*4), 20, "%d normals",
Model->numnormals);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*5), 20, "%d texcoords",
Model->numtexcoords);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*6), 20, "%d groups",
Model->numgroups);
text(5, glutGet(GLUT_WINDOW_HEIGHT) - (5+20*7), 20, "%d materials",
Model->nummaterials);
}
glutSwapBuffers();
fps = ComputeFPS();
if (fps)
printf("%f FPS\n", fps);
}
static void
keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 'h':
printf("help\n\n");
printf("a - Toggle animation\n");
printf("d/D - Decrease/Incrase number of models\n");
printf("w - Toggle wireframe/filled\n");
printf("c - Toggle culling\n");
printf("n - Toggle facet/smooth normal\n");
printf("r - Reverse polygon winding\n");
printf("p - Toggle performance indicator\n");
printf("s - Toggle skybox\n");
printf("z/Z - Scale model smaller/larger\n");
printf("i - Show model info/stats\n");
printf("q/escape - Quit\n\n");
break;
case 'a':
Animate = !Animate;
if (Animate)
glutIdleFunc(Idle);
else
glutIdleFunc(NULL);
break;
case 'd':
if (NumInstances > 1)
NumInstances--;
break;
case 'D':
NumInstances++;
break;
case 'i':
Stats = !Stats;
break;
case 'p':
Performance = !Performance;
break;
case 'w':
WireFrame = !WireFrame;
break;
case 'c':
Cull = !Cull;
printf("Polygon culling: %d\n", Cull);
break;
case 'r':
if (FrontFace == GL_CCW)
FrontFace = GL_CW;
else
FrontFace = GL_CCW;
glFrontFace(FrontFace);
printf("Front face:: %s\n", FrontFace == GL_CCW ? "CCW" : "CW");
break;
case 's':
Skybox = !Skybox;
if (Skybox)
glmSpecularTexture(Model, SkyboxTex);
else
glmSpecularTexture(Model, 0);
break;
case 'z':
Scale *= 0.9;
break;
case 'Z':
Scale *= 1.1;
break;
case 'q':
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void
menu(int item)
{
keyboard((unsigned char)item, 0, 0);
}
/**
* Handle mouse button.
*/
static void
Mouse(int button, int state, int x, int y)
{
if (button == GLUT_LEFT_BUTTON) {
if (state == GLUT_DOWN) {
View.StartX = x;
View.StartY = y;
View.Rotating = GL_TRUE;
}
else if (state == GLUT_UP) {
View.Rotating = GL_FALSE;
}
}
else if (button == GLUT_MIDDLE_BUTTON) {
if (state == GLUT_DOWN) {
View.StartX = x;
View.StartY = y;
View.StartDistance = View.Distance;
View.Translating = GL_TRUE;
}
else if (state == GLUT_UP) {
View.Translating = GL_FALSE;
}
}
}
/**
* Handle mouse motion
*/
static void
Motion(int x, int y)
{
int i;
if (View.Rotating) {
float x0 = (2.0 * View.StartX - WinWidth) / WinWidth;
float y0 = (WinHeight - 2.0 * View.StartY) / WinHeight;
float x1 = (2.0 * x - WinWidth) / WinWidth;
float y1 = (WinHeight - 2.0 * y) / WinHeight;
float q[4];
trackball(q, x0, y0, x1, y1);
View.StartX = x;
View.StartY = y;
for (i = 0; i < 1; i++)
add_quats(q, View.CurQuat, View.CurQuat);
glutPostRedisplay();
}
else if (View.Translating) {
float dz = 0.02 * (y - View.StartY);
View.Distance = View.StartDistance + dz;
glutPostRedisplay();
}
}
static void
DoFeatureChecks(void)
{
char *version = (char *) glGetString(GL_VERSION);
if (version[0] == '1') {
/* check for individual extensions */
if (!glutExtensionSupported("GL_ARB_texture_cube_map")) {
printf("Sorry, GL_ARB_texture_cube_map is required.\n");
exit(1);
}
if (!glutExtensionSupported("GL_ARB_vertex_shader")) {
printf("Sorry, GL_ARB_vertex_shader is required.\n");
exit(1);
}
if (!glutExtensionSupported("GL_ARB_fragment_shader")) {
printf("Sorry, GL_ARB_fragment_shader is required.\n");
exit(1);
}
if (!glutExtensionSupported("GL_ARB_vertex_buffer_object")) {
printf("Sorry, GL_ARB_vertex_buffer_object is required.\n");
exit(1);
}
}
}
int
main(int argc, char** argv)
{
glutInitWindowSize(WinWidth, WinHeight);
glutInit(&argc, argv);
if (argc > 1) {
Model_file = argv[1];
}
if (!Model_file) {
fprintf(stderr, "usage: objview file.obj\n");
fprintf(stderr, "(using default bunny.obj)\n");
Model_file = "bunny.obj";
}
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow("objview");
glewInit();
DoFeatureChecks();
glutReshapeFunc(reshape);
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutMouseFunc(Mouse);
glutMotionFunc(Motion);
if (Animate)
glutIdleFunc(Idle);
glutCreateMenu(menu);
glutAddMenuEntry("[a] Toggle animate", 'a');
glutAddMenuEntry("[d] Fewer models", 'd');
glutAddMenuEntry("[D] More models", 'D');
glutAddMenuEntry("[w] Toggle wireframe/filled", 'w');
glutAddMenuEntry("[c] Toggle culling on/off", 'c');
glutAddMenuEntry("[r] Reverse polygon winding", 'r');
glutAddMenuEntry("[z] Scale model smaller", 'z');
glutAddMenuEntry("[Z] Scale model larger", 'Z');
glutAddMenuEntry("[p] Toggle performance indicator", 'p');
glutAddMenuEntry("[i] Show model stats", 'i');
glutAddMenuEntry("", 0);
glutAddMenuEntry("[q] Quit", 27);
glutAttachMenu(GLUT_RIGHT_BUTTON);
InitViewInfo(&View);
init_model();
init_skybox();
init_gfx();
glutMainLoop();
return 0;
}

187
progs/objviewer/skybox.c Normal file
View File

@@ -0,0 +1,187 @@
#include <assert.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include <GL/glu.h>
#include "readtex.h"
#include "skybox.h"
static int
load(GLenum target, const char *filename,
GLboolean flipTB, GLboolean flipLR)
{
GLint w, h;
GLenum format;
GLubyte *img = LoadRGBImage( filename, &w, &h, &format );
if (!img) {
printf("Error: couldn't load texture image %s\n", filename);
return 0;
}
assert(format == GL_RGB);
printf("Load cube face 0x%x: %s %d x %d\n", target, filename, w, h);
/* <sigh> the way the texture cube mapping works, we have to flip
* images to make things look right.
*/
if (flipTB) {
const int stride = 3 * w;
GLubyte temp[3*1024];
int i;
for (i = 0; i < h / 2; i++) {
memcpy(temp, img + i * stride, stride);
memcpy(img + i * stride, img + (h - i - 1) * stride, stride);
memcpy(img + (h - i - 1) * stride, temp, stride);
}
}
if (flipLR) {
const int stride = 3 * w;
GLubyte temp[3];
GLubyte *row;
int i, j;
for (i = 0; i < h; i++) {
row = img + i * stride;
for (j = 0; j < w / 2; j++) {
int k = w - j - 1;
temp[0] = row[j*3+0];
temp[1] = row[j*3+1];
temp[2] = row[j*3+2];
row[j*3+0] = row[k*3+0];
row[j*3+1] = row[k*3+1];
row[j*3+2] = row[k*3+2];
row[k*3+0] = temp[0];
row[k*3+1] = temp[1];
row[k*3+2] = temp[2];
}
}
}
gluBuild2DMipmaps(target, GL_RGB, w, h, format, GL_UNSIGNED_BYTE, img);
free(img);
return 1;
}
GLuint
LoadSkyBoxCubeTexture(const char *filePosX,
const char *fileNegX,
const char *filePosY,
const char *fileNegY,
const char *filePosZ,
const char *fileNegZ)
{
GLuint tex;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_CUBE_MAP, tex);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST);
if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_X, filePosX, GL_TRUE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, fileNegX, GL_TRUE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, filePosY, 1+GL_FALSE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, fileNegY, 1+GL_FALSE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, filePosZ, GL_TRUE, GL_TRUE))
return 0;
if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, fileNegZ, GL_TRUE, GL_TRUE))
return 0;
return tex;
}
#define eps1 0.99
#define br 20.0 /* box radius */
void
DrawSkyBoxCubeTexture(GLuint tex)
{
struct vertex {
float x, y, z, s, t, r;
};
static const struct vertex verts[24] = {
/* +X side */
{ br, -br, -br, 1.0, -eps1, -eps1 },
{ br, -br, br, 1.0, -eps1, eps1 },
{ br, br, br, 1.0, eps1, eps1 },
{ br, br, -br, 1.0, eps1, -eps1 },
/* -X side */
{ -br, br, -br, -1.0, eps1, -eps1 },
{ -br, br, br, -1.0, eps1, eps1 },
{ -br, -br, br, -1.0, -eps1, eps1 },
{ -br, -br, -br, -1.0, -eps1, -eps1 },
/* +Y side */
{ br, br, -br, eps1, 1.0, -eps1 },
{ br, br, br, eps1, 1.0, eps1 },
{ -br, br, br, -eps1, 1.0, eps1 },
{ -br, br, -br, -eps1, 1.0, -eps1 },
/* -Y side */
{ -br, -br, -br, -eps1, -1.0, -eps1 },
{ -br, -br, br, -eps1, -1.0, eps1 },
{ br, -br, br, eps1, -1.0, eps1 },
{ br, -br, -br, eps1, -1.0, -eps1 },
/* +Z side */
{ br, -br, br, eps1, -eps1, 1.0 },
{ -br, -br, br, -eps1, -eps1, 1.0 },
{ -br, br, br, -eps1, eps1, 1.0 },
{ br, br, br, eps1, eps1, 1.0 },
/* -Z side */
{ br, br, -br, eps1, eps1, -1.0 },
{ -br, br, -br, -eps1, eps1, -1.0 },
{ -br, -br, -br, -eps1, -eps1, -1.0 },
{ br, -br, -br, eps1, -eps1, -1.0 },
};
static GLuint vbo = 0;
if (!vbo ) {
glGenBuffersARB(1, &vbo);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), verts,
GL_STATIC_DRAW_ARB);
}
else {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
}
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glVertexPointer(3, GL_FLOAT, sizeof(struct vertex),
(void *) offsetof(struct vertex, x));
glTexCoordPointer(3, GL_FLOAT, sizeof(struct vertex),
(void *) offsetof(struct vertex, s));
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glBindTexture(GL_TEXTURE_CUBE_MAP, tex);
glEnable(GL_TEXTURE_CUBE_MAP);
glDisable(GL_BLEND);
glDrawArrays(GL_QUADS, 0, 24);
glDisable(GL_TEXTURE_CUBE_MAP);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
}

18
progs/objviewer/skybox.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef SKYBOX_H
#define SKYBOX_H
extern GLuint
LoadSkyBoxCubeTexture(const char *filePosX,
const char *fileNegX,
const char *filePosY,
const char *fileNegY,
const char *filePosZ,
const char *fileNegZ);
extern void
DrawSkyBoxCubeTexture(GLuint tex);
#endif /* SKYBOX_H */

View File

@@ -1,39 +0,0 @@
# progs/vg/Makefile
TOP = ../../..
include $(TOP)/configs/current
VG_LIBS=-lm -pthread -lX11 -lEGL -lOpenVG
INCLUDE_DIRS = -I$(TOP)/include
PROGRAMS = \
lion \
sp
.c.o:
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
default: $(PROGRAMS)
lion: lion.o lion-render.o
$(CC) $(CFLAGS) lion.o lion-render.o -L$(TOP)/$(LIB_DIR) $(VG_LIBS) -o $@
lion.o: lion.c lion-render.h $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include lion.c
lion-render.o: lion-render.c lion-render.h $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include lion-render.c
sp: sp.c eglcommon.o
$(CC) $(INCLUDE_DIRS) $(CFLAGS) $^ -L$(TOP)/$(LIB_DIR) $(LIBS) $(VG_LIBS) $(APP_LIB_DEPS) -o $@
eglcommon.o: eglcommon.c $(HEADERS)
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) eglcommon.c
clean:
rm -f *.o *~
rm -f *.so
rm -f $(PROGRAMS)

View File

@@ -1,288 +0,0 @@
#include "eglcommon.h"
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <VG/openvg.h> /* using full OpenGL for now */
#include <GLES/egl.h>
static init_func init = 0;
static draw_func draw = 0;
static reshape_func reshape = 0;
static key_func keyPress = 0;
static VGint width = 300, height = 300;
void set_window_size(int w, int h)
{
width = w;
height = h;
}
/*
* Create an RGB, double-buffered X window.
* Return the window and context handles.
*/
static void
make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
const char *name,
int x, int y, int width, int height,
Window *winRet,
EGLContext *ctxRet,
EGLSurface *surfRet)
{
static const EGLint attribs[] = {
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
EGL_NONE
};
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
XVisualInfo *visInfo, visTemplate;
int num_visuals;
EGLContext ctx;
EGLConfig config;
EGLint num_configs;
EGLint vid;
scrnum = DefaultScreen( x_dpy );
root = RootWindow( x_dpy, scrnum );
if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
printf("Error: couldn't get an EGL visual config\n");
exit(1);
}
assert(config);
assert(num_configs > 0);
if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
printf("Error: eglGetConfigAttrib() failed\n");
exit(1);
}
/* The X window visual must match the EGL config */
visTemplate.visualid = vid;
visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
if (!visInfo) {
printf("Error: couldn't get X visual\n");
exit(1);
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( x_dpy, root, 0, 0, width, height,
0, visInfo->depth, InputOutput,
visInfo->visual, mask, &attr );
/* set hints and properties */
{
XSizeHints sizehints;
sizehints.x = x;
sizehints.y = y;
sizehints.width = width;
sizehints.height = height;
sizehints.flags = USSize | USPosition;
XSetNormalHints(x_dpy, win, &sizehints);
XSetStandardProperties(x_dpy, win, name, name,
None, (char **)NULL, 0, &sizehints);
}
eglBindAPI(EGL_OPENVG_API);
ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
if (!ctx) {
printf("Error: eglCreateContext failed\n");
exit(1);
}
*surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
if (!*surfRet) {
printf("Error: eglCreateWindowSurface failed\n");
exit(1);
}
XFree(visInfo);
*winRet = win;
*ctxRet = ctx;
}
static void
event_loop(Display *dpy, Window win,
EGLDisplay egl_dpy, EGLSurface egl_surf)
{
while (1) {
int redraw = 0;
XEvent event;
XNextEvent(dpy, &event);
switch (event.type) {
case Expose:
redraw = 1;
break;
case ConfigureNotify:
if (reshape) {
width = event.xconfigure.width;
height = event.xconfigure.height;
reshape(event.xconfigure.width, event.xconfigure.height);
}
break;
case KeyPress:
{
char buffer[10];
int r, code;
code = XLookupKeysym(&event.xkey, 0);
if (!keyPress || !keyPress(code)) {
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return;
}
}
}
redraw = 1;
break;
default:
; /*no-op*/
}
if (redraw) {
draw();
eglSwapBuffers(egl_dpy, egl_surf);
}
}
}
int window_width(void)
{
return width;
}
int window_height(void)
{
return height;
}
static void
usage(void)
{
printf("Usage:\n");
printf(" -display <displayname> set the display to run on\n");
printf(" -info display OpenGL renderer info\n");
}
int run(int argc, char **argv,
init_func init_f,
reshape_func resh_f,
draw_func draw_f,
key_func key_f)
{
const int winWidth = width, winHeight = height;
Display *x_dpy;
Window win;
EGLSurface egl_surf;
EGLContext egl_ctx;
EGLDisplay egl_dpy;
char *dpyName = NULL;
GLboolean printInfo = GL_FALSE;
EGLint egl_major, egl_minor;
int i;
const char *s;
init = init_f;
draw = draw_f;
reshape = resh_f;
keyPress = key_f;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-display") == 0) {
dpyName = argv[i+1];
i++;
}
else if (strcmp(argv[i], "-info") == 0) {
printInfo = GL_TRUE;
}
}
x_dpy = XOpenDisplay(dpyName);
if (!x_dpy) {
printf("Error: couldn't open display %s\n",
dpyName ? dpyName : getenv("DISPLAY"));
return -1;
}
egl_dpy = eglGetDisplay(x_dpy);
if (!egl_dpy) {
printf("Error: eglGetDisplay() failed\n");
return -1;
}
if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
printf("Error: eglInitialize() failed\n");
return -1;
}
s = eglQueryString(egl_dpy, EGL_VERSION);
printf("EGL_VERSION = %s\n", s);
make_x_window(x_dpy, egl_dpy,
"OpenVG Example", 0, 0, winWidth, winHeight,
&win, &egl_ctx, &egl_surf);
XMapWindow(x_dpy, win);
if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
printf("Error: eglMakeCurrent() failed\n");
return -1;
}
if (printInfo) {
printf("VG_RENDERER = %s\n", (char *) vgGetString(VG_RENDERER));
printf("VG_VERSION = %s\n", (char *) vgGetString(VG_VERSION));
printf("VG_VENDOR = %s\n", (char *) vgGetString(VG_VENDOR));
}
if (init)
init();
/* Set initial projection/viewing transformation.
* We can't be sure we'll get a ConfigureNotify event when the window
* first appears.
*/
if (reshape)
reshape(winWidth, winHeight);
event_loop(x_dpy, win, egl_dpy, egl_surf);
eglMakeCurrent(egl_dpy, 0, 0, 0);
eglDestroyContext(egl_dpy, egl_ctx);
eglDestroySurface(egl_dpy, egl_surf);
eglTerminate(egl_dpy);
XDestroyWindow(x_dpy, win);
XCloseDisplay(x_dpy);
return 0;
}

View File

@@ -1,20 +0,0 @@
#ifndef EGLCOMMON_H
#define EGLCOMMON_H
typedef void (*init_func)();
typedef void (*reshape_func)(int, int);
typedef void (*draw_func)();
typedef int (*key_func)(unsigned key);
void set_window_size(int width, int height);
int window_width(void);
int window_height(void);
int run(int argc, char **argv,
init_func init,
reshape_func resh,
draw_func draw,
key_func key);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
#ifndef LION_RENDER_H
#define LION_RENDER_H
#include <VG/openvg.h>
#define LION_SIZE 132
struct lion {
VGPath paths[LION_SIZE];
VGPaint fills[LION_SIZE];
};
struct lion *lion_create(void);
void lion_render(struct lion *l);
void lion_destroy(struct lion *l);
#endif

View File

@@ -1,288 +0,0 @@
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <VG/openvg.h>
#include <GLES/egl.h>
#include "lion-render.h"
static VGint width, height;
struct lion *lion = 0;
VGfloat angle = 0;
static void
draw(void)
{
vgClear(0, 0, width, height);
vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
vgLoadIdentity();
vgTranslate(width/2, height/2);
vgRotate(angle);
vgTranslate(-width/2, -height/2);
lion_render(lion);
++angle;
}
/* new window size or exposure */
static void
reshape(int w, int h)
{
width = w;
height = h;
}
static void
init(void)
{
float clear_color[4] = {1.0, 1.0, 1.0, 1.0};
vgSetfv(VG_CLEAR_COLOR, 4, clear_color);
lion = lion_create();
}
/*
* Create an RGB, double-buffered X window.
* Return the window and context handles.
*/
static void
make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
const char *name,
int x, int y, int width, int height,
Window *winRet,
EGLContext *ctxRet,
EGLSurface *surfRet)
{
static const EGLint attribs[] = {
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
EGL_NONE
};
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
XVisualInfo *visInfo, visTemplate;
int num_visuals;
EGLContext ctx;
EGLConfig config;
EGLint num_configs;
EGLint vid;
scrnum = DefaultScreen( x_dpy );
root = RootWindow( x_dpy, scrnum );
if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
printf("Error: couldn't get an EGL visual config\n");
exit(1);
}
assert(config);
assert(num_configs > 0);
if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
printf("Error: eglGetConfigAttrib() failed\n");
exit(1);
}
/* The X window visual must match the EGL config */
visTemplate.visualid = vid;
visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
if (!visInfo) {
printf("Error: couldn't get X visual\n");
exit(1);
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( x_dpy, root, 0, 0, width, height,
0, visInfo->depth, InputOutput,
visInfo->visual, mask, &attr );
/* set hints and properties */
{
XSizeHints sizehints;
sizehints.x = x;
sizehints.y = y;
sizehints.width = width;
sizehints.height = height;
sizehints.flags = USSize | USPosition;
XSetNormalHints(x_dpy, win, &sizehints);
XSetStandardProperties(x_dpy, win, name, name,
None, (char **)NULL, 0, &sizehints);
}
eglBindAPI(EGL_OPENVG_API);
ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
if (!ctx) {
printf("Error: eglCreateContext failed\n");
exit(1);
}
*surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
if (!*surfRet) {
printf("Error: eglCreateWindowSurface failed\n");
exit(1);
}
XFree(visInfo);
*winRet = win;
*ctxRet = ctx;
}
static void
event_loop(Display *dpy, Window win,
EGLDisplay egl_dpy, EGLSurface egl_surf)
{
while (1) {
XEvent event;
while (XPending(dpy) > 0) {
XNextEvent(dpy, &event);
switch (event.type) {
case Expose:
break;
case ConfigureNotify:
reshape(event.xconfigure.width, event.xconfigure.height);
break;
case KeyPress:
{
char buffer[10];
int r, code;
code = XLookupKeysym(&event.xkey, 0);
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return;
}
}
break;
default:
; /*no-op*/
}
}
draw();
eglSwapBuffers(egl_dpy, egl_surf);
}
}
static void
usage(void)
{
printf("Usage:\n");
printf(" -display <displayname> set the display to run on\n");
printf(" -info display OpenGL renderer info\n");
}
int
main(int argc, char *argv[])
{
const int winWidth = 350, winHeight = 450;
Display *x_dpy;
Window win;
EGLSurface egl_surf;
EGLContext egl_ctx;
EGLDisplay egl_dpy;
char *dpyName = NULL;
GLboolean printInfo = GL_FALSE;
EGLint egl_major, egl_minor;
int i;
const char *s;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-display") == 0) {
dpyName = argv[i+1];
i++;
}
else if (strcmp(argv[i], "-info") == 0) {
printInfo = GL_TRUE;
}
else {
usage();
return -1;
}
}
x_dpy = XOpenDisplay(dpyName);
if (!x_dpy) {
printf("Error: couldn't open display %s\n",
dpyName ? dpyName : getenv("DISPLAY"));
return -1;
}
egl_dpy = eglGetDisplay(x_dpy);
if (!egl_dpy) {
printf("Error: eglGetDisplay() failed\n");
return -1;
}
if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
printf("Error: eglInitialize() failed\n");
return -1;
}
s = eglQueryString(egl_dpy, EGL_VERSION);
printf("EGL_VERSION = %s\n", s);
make_x_window(x_dpy, egl_dpy,
"Lion Example", 0, 0, winWidth, winHeight,
&win, &egl_ctx, &egl_surf);
XMapWindow(x_dpy, win);
if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
printf("Error: eglMakeCurrent() failed\n");
return -1;
}
if (printInfo) {
printf("VG_RENDERER = %s\n", (char *) vgGetString(VG_RENDERER));
printf("VG_VERSION = %s\n", (char *) vgGetString(VG_VERSION));
printf("VG_VENDOR = %s\n", (char *) vgGetString(VG_VENDOR));
}
init();
/* Set initial projection/viewing transformation.
* We can't be sure we'll get a ConfigureNotify event when the window
* first appears.
*/
reshape(winWidth, winHeight);
event_loop(x_dpy, win, egl_dpy, egl_surf);
eglDestroyContext(egl_dpy, egl_ctx);
eglDestroySurface(egl_dpy, egl_surf);
eglTerminate(egl_dpy);
XDestroyWindow(x_dpy, win);
XCloseDisplay(x_dpy);
return 0;
}

View File

@@ -1,537 +0,0 @@
#include "eglcommon.h"
#include <VG/openvg.h>
#include <VG/vgu.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <X11/keysym.h>
#define ELEMENTS(x) (sizeof(x)/sizeof((x)[0]))
struct object {
VGPath path;
VGPaint fill;
VGPaint stroke;
VGint draw_mode;
VGfloat matrix[9];
VGfloat stroke_width;
};
struct character {
struct object objects[32];
VGint num_objects;
};
VGfloat identity_matrix[] = {1, 0, 0, 0, 1, 0, 0, 0, 1};
struct character cartman;
static void add_object_fill(const VGubyte *segments, VGint num_segments,
const VGfloat *coords,
VGuint color)
{
struct object object;
object.path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
1, 0, 0, 0, VG_PATH_CAPABILITY_ALL);
vgAppendPathData(object.path, num_segments, segments, coords);
object.fill = vgCreatePaint();
vgSetColor(object.fill, color);
memcpy(object.matrix, identity_matrix, 9 * sizeof(VGfloat));
object.draw_mode = VG_FILL_PATH;
cartman.objects[cartman.num_objects] = object;
++cartman.num_objects;
}
static void add_object_stroke(const VGubyte *segments, VGint num_segments,
const VGfloat *coords,
VGuint color, VGfloat width)
{
struct object object;
object.path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
1, 0, 0, 0, VG_PATH_CAPABILITY_ALL);
vgAppendPathData(object.path, num_segments, segments, coords);
object.stroke = vgCreatePaint();
vgSetColor(object.stroke, color);
memcpy(object.matrix, identity_matrix, 9 * sizeof(VGfloat));
object.draw_mode = VG_STROKE_PATH;
object.stroke_width = width;
cartman.objects[cartman.num_objects] = object;
++cartman.num_objects;
}
static void add_object_fillm(const VGubyte *segments, VGint num_segments,
const VGfloat *coords,
VGuint color,
VGfloat *matrix)
{
struct object object;
object.path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
1, 0, 0, 0, VG_PATH_CAPABILITY_ALL);
vgAppendPathData(object.path, num_segments, segments, coords);
object.fill = vgCreatePaint();
vgSetColor(object.fill, color);
memcpy(object.matrix, matrix, 9 * sizeof(VGfloat));
object.draw_mode = VG_FILL_PATH;
cartman.objects[cartman.num_objects] = object;
++cartman.num_objects;
}
static void add_object_m(const VGubyte *segments, VGint num_segments,
const VGfloat *coords,
VGuint fill_color,
VGuint stroke_color, VGfloat stroke_width,
VGfloat *matrix)
{
struct object object;
object.path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
1, 0, 0, 0, VG_PATH_CAPABILITY_ALL);
vgAppendPathData(object.path, num_segments, segments, coords);
memcpy(object.matrix, matrix, 9 * sizeof(VGfloat));
object.fill = vgCreatePaint();
vgSetColor(object.fill, fill_color);
object.draw_mode = VG_FILL_PATH | VG_STROKE_PATH;
object.stroke = vgCreatePaint();
vgSetColor(object.stroke, stroke_color);
object.stroke_width = stroke_width;
cartman.objects[cartman.num_objects] = object;
++cartman.num_objects;
}
static void init_character()
{
{
const VGubyte segments[] = {VG_MOVE_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CLOSE_PATH};
const VGfloat coords[] = {181.83267, 102.60408,
181.83267,102.60408, 185.53793,114.5749, 186.5355,115.00243,
187.53306,115.42996, 286.0073,115.00243, 286.0073,115.00243,
286.0073,115.00243, 292.70526,103.45914, 290.85263,101.03648,
289.00001,98.61381, 181.54765,102.31906, 181.83267,102.60408
};
VGuint color = 0x7c4e32ff;
add_object_fill(segments, ELEMENTS(segments),
coords, color);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_LINE_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CLOSE_PATH
};
const VGfloat coords[] = {188.62208,50.604156,
188.62208,50.604156, 176.73127,60.479579, 170.68509,69.548844,
164.63892,78.618109, 175.11895,79.827344, 175.11895,79.827344,
176.52973,98.368952,
176.52973,98.368952, 189.83131,110.05823, 208.97754,110.25976,
228.12377,110.46131, 244.24691,111.67054, 247.06846,110.25976,
249.89,108.849, 258.95927,106.8336, 260.16851,105.01975,
261.37774,103.2059, 296.84865,106.43053, 297.05019,91.919698,
297.25172,77.408874, 306.11945,64.308824, 282.13628,51.611853,
258.15311,38.914882, 189.2267,49.999539, 188.62208,50.604156
};
VGuint color = 0xe30000ff;
add_object_fill(segments, ELEMENTS(segments),
coords, color);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS,
VG_CLOSE_PATH
};
const VGfloat coords[] = {
68.25, 78.875,
68.25,93.296, 54.642,105, 37.875,105,
21.108,105, 7.5,93.296, 7.5,78.875,
7.5,64.454, 21.108,52.75, 37.875,52.75,
54.642,52.75, 68.25,64.454, 68.25,78.875
};
VGuint color = 0xffe1c4ff;
VGfloat matrix[] = {
1.6529, 0, 0,
0, 1.582037, 0,
172.9649,-90.0116, 1
};
add_object_fillm(segments, ELEMENTS(segments),
coords, color, matrix);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
170.14687,71.536958,
173.53626,68.814326, 176.70232,68.971782, 180.55009,71.679467,
184.39785,74.387153, 199.19294,80.036105, 191.52334,86.500482,
189.02942,88.6025, 183.97032,85.787933, 180.26507,86.928011,
178.8737,87.356121, 174.71827,89.783259, 171.8028,87.494856,
166.95426,83.689139, 163.51779,76.861986, 170.14687,71.536958
};
VGuint color = 0xfff200ff;
add_object_fill(segments, ELEMENTS(segments),
coords, color);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
299.83075,66.834136,
299.83075,66.834136, 287.85993,64.69649, 284.15467,72.962055,
280.44942,81.227621, 280.1644,78.234916, 280.1644,79.374994,
280.1644,80.515072, 278.16927,84.077816, 284.86722,83.792796,
291.56518,83.507777, 291.99271,86.785501, 294.84291,86.642991,
297.6931,86.500482, 303.536,85.645423, 303.67851,80.657582,
303.82102,75.66974, 302.68094,65.551548, 299.83075,66.834136
};
VGuint color = 0xfff200ff;
add_object_fill(segments, ELEMENTS(segments),
coords, color);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS
};
const VGfloat coords[] = {
240.83171,75.81225,
240.83171,75.81225, 241.54426,88.495618, 242.25681,91.488323,
242.96936,94.481028, 240.6892,108.01945, 240.83171,110.01459,
240.97422,112.00973, 240.97422,111.01216, 240.97422,111.01216
};
VGuint color = 0x000000ff;
VGfloat swidth = 1.14007807;
add_object_stroke(segments, ELEMENTS(segments), coords, color, swidth);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
83.375, 95.5,
83.375,96.121, 83.067,96.625, 82.6875,96.625,
82.308,96.625, 82,96.121, 82,95.5,
82,94.879, 82.308,94.375, 82.6875,94.375,
83.066677,94.375, 83.374492,94.878024, 83.374999,95.498494,
82.6875,95.5,
83.375,95.5
};
VGuint fill_color = 0x000000ff;
VGuint stroke_color = 0x000000ff;
VGfloat swidth = 0.60000002;
VGfloat matrix1[] = {
1.140078, 0, 0,
0, 1.140078, 0,
145.4927, -15.10897, 1
};
VGfloat matrix2[] = {
1.140078,0, 0,
0,1.140078, 0,
144.2814,-27.93485, 1
};
VGfloat matrix3[] = {
1.140078,0, 0,
0,1.140078, 0,
144.1388,-3.70819, 1
};
add_object_m(segments, ELEMENTS(segments), coords,
fill_color, stroke_color, swidth, matrix1);
add_object_m(segments, ELEMENTS(segments), coords,
fill_color, stroke_color, swidth, matrix2);
add_object_m(segments, ELEMENTS(segments), coords,
fill_color, stroke_color, swidth, matrix3);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS,
VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_LINE_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
179.41001,115.28745,
179.41001,115.28745, 207.48443,109.30204, 236.84144,115.14494,
236.84144,115.14494, 274.74903,109.87208, 291.8502,115.42996,
179.41001,115.28745
};
VGuint color = 0x000000ff;
add_object_fill(segments, ELEMENTS(segments),
coords, color);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
83.792156,68.157364,
83.792156,69.669865, 82.72301,70.897403, 81.40567,70.897403,
80.08833,70.897403, 79.019185,69.669865, 79.019185,68.157364,
79.019185,66.644862, 80.08833,65.417325, 81.40567,65.417325,
82.721887,65.417325, 83.790391,66.642485, 83.792153,68.153696,
81.40567,68.157364,
83.792156,68.157364
};
VGuint fill_color = 0x000000ff;
VGuint stroke_color = 0x000000ff;
VGfloat swidth = 0.52891117;
VGfloat matrix1[] = {
1.140078,0, 0,
0,1.140078, 0,
145.2489,-15.58714, 1
};
add_object_m(segments, ELEMENTS(segments), coords,
fill_color, stroke_color, swidth, matrix1);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS
};
const VGfloat coords[] = {
232.28113,66.976646,
232.28113,66.976646, 237.98152,70.539389, 245.39202,66.549116
};
VGuint color = 0x000000ff;
VGfloat swidth = 0.60299999;
add_object_stroke(segments, ELEMENTS(segments), coords, color, swidth);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
185.96908,30.061986,
185.96908,30.061986, 187.76995,14.508377, 203.23909,3.7427917,
209.95028,-0.92779696, 219.37764,-4.9841866, 232.1078,-6.00046,
246.13578,-7.1203411, 256.92106,-2.8560739, 264.81774,1.9451947,
280.60485,11.543934, 284.31582,25.937274, 284.08015,26.526452,
283.7266,27.410336, 240.83461,1.9346323, 185.96908,30.061986
};
VGuint color = 0x8ed8f8ff;
add_object_fill(segments, ELEMENTS(segments), coords, color);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_LINE_TO_ABS, VG_CUBIC_TO_ABS,
VG_LINE_TO_ABS, VG_CUBIC_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
185.39542,32.061757,
185.82295,29.211562,
185.82295,29.211562, 234.70379,2.277219, 284.01217,25.078779,
284.86722,27.643954,
284.86722,27.643954, 236.69893,4.5573746, 185.39542,32.061757
};
VGuint color = 0xfff200ff;
add_object_fill(segments, ELEMENTS(segments), coords, color);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
219.74027,-5.917093,
220.49206,-8.44929, 225.15564,-10.904934, 230.21473,-11.189954,
235.27383,-11.474973, 243.27521,-13.287236, 249.21385,-5.724198,
249.89961,-4.850868, 249.28247,-4.332166, 248.62298,-3.971398,
247.79117,-3.516361, 247.13703,-3.392737, 246.16222,-3.408047,
243.63973,-3.447664, 242.54183,-3.850701, 242.54183,-3.850701,
242.54183,-3.850701, 238.78367,-1.737343, 236.20014,-3.565682,
233.88436,-5.204544, 234.27626,-4.56325, 234.27626,-4.56325,
234.27626,-4.56325, 232.33303,-2.975658, 230.85603,-2.995643,
228.59433,-3.025282, 227.73672,-4.501857, 227.21966,-4.93027,
226.76318,-4.932008, 226.50948,-4.491995, 226.50948,-4.491995,
226.50948,-4.491995, 224.53199,-2.085883, 222.51431,-2.467064,
221.48814,-2.66093, 218.91968,-3.15318, 219.74027,-5.917093
};
VGuint color = 0xfff200ff;
add_object_fill(segments, ELEMENTS(segments), coords, color);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
178.97347,166.06432,
178.97347,181.2154, 168.0245,193.51193, 154.53381,193.51193,
141.04312,193.51193, 130.09416,181.2154, 130.09416,166.06432,
130.09416,150.91323, 141.04312,138.6167, 154.53381,138.6167,
168.0245,138.6167, 178.97347,150.91323, 178.97347,166.06432
};
VGuint color = 0xffffffff;
VGfloat matrix1[] = {
0.466614,-0.23492, 0,
0.108683,0.436638, 0,
134.5504,-0.901632, 1
};
VGfloat matrix2[] = {
-0.466614,-0.23492, 0,
-0.108683,0.436638, 0,
338.4496,-0.512182, 1
};
add_object_fillm(segments, ELEMENTS(segments), coords, color, matrix1);
add_object_fillm(segments, ELEMENTS(segments), coords, color, matrix2);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS,
VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS, VG_CLOSE_PATH
};
const VGfloat coords[] = {
123.82758,165.06168,
123.82758,166.79125, 122.59232,168.19497, 121.07029,168.19497,
119.54826,168.19497, 118.313,166.79125, 118.313,165.06168,
118.313,163.3321, 119.54826,161.92839, 121.07029,161.92839,
122.59232,161.92839, 123.82758,163.3321, 123.82758,165.06168
};
VGuint color = 0x000000ff;
VGfloat matrix1[] = {
0.525719,0, 0,
0,0.479931, 0,
178.9702,-43.3532, 1
};
VGfloat matrix2[] = {
0.525719,0, 0,
0,0.479931, 0,
165.258,-43.46162, 1
};
add_object_fillm(segments, ELEMENTS(segments), coords, color, matrix1);
add_object_fillm(segments, ELEMENTS(segments), coords, color, matrix2);
}
{
const VGubyte segments[] = {
VG_MOVE_TO_ABS, VG_CUBIC_TO_ABS, VG_CUBIC_TO_ABS
};
const VGfloat coords[] = {
197.25,54.5,
197.25,54.5, 211.75,71.5, 229.25,71.5,
246.75,71.5, 261.74147,71.132714, 277.75,50.75
};
VGuint color = 0x000000ff;
VGfloat swidth = 0.60299999;
add_object_stroke(segments, ELEMENTS(segments), coords, color, swidth);
}
}
static void
init(void)
{
float clear_color[4] = {1.0, 1.0, 1.0, 1.0};
vgSetfv(VG_CLEAR_COLOR, 4, clear_color);
init_character();
}
/* new window size or exposure */
static void
reshape(int w, int h)
{
}
static int
key_press(unsigned key)
{
switch(key) {
case XK_Right:
break;
case XK_Left:
break;
case XK_Up:
break;
case XK_Down:
break;
case 'a':
break;
case 's':
break;
default:
break;
}
return VG_FALSE;
}
static void
draw(void)
{
VGint i;
VGfloat save_matrix[9];
vgClear(0, 0, window_width(), window_height());
vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
vgLoadIdentity();
vgScale(2, 2);
vgTranslate(160, 60);
vgRotate(180);
vgTranslate(-160, -100);
vgGetMatrix(save_matrix);
for (i = 0; i < cartman.num_objects; ++i) {
struct object object = cartman.objects[i];
if ((object.draw_mode & VG_STROKE_PATH)) {
vgSetf(VG_STROKE_LINE_WIDTH, object.stroke_width);
vgSetPaint(object.stroke, VG_STROKE_PATH);
}
if ((object.draw_mode & VG_FILL_PATH))
vgSetPaint(object.fill, VG_FILL_PATH);
vgMultMatrix(object.matrix);
vgDrawPath(object.path, object.draw_mode);
vgLoadMatrix(save_matrix);
}
vgFlush();
}
int main(int argc, char **argv)
{
set_window_size(400, 400);
return run(argc, argv, init, reshape, draw, key_press);
}

View File

@@ -1,127 +0,0 @@
# These programs aren't intended to be included with the normal distro.
# They're not too interesting but they're good for testing.
TOP = ../../../
include $(TOP)/configs/current
INCLUDES = -I. -I$(TOP)/include
LIBS=-L$(TOP)/$(LIB_DIR) -lm -lX11 -lEGL -lOpenVG -lpthread
CFLAGS += $(INCLUDES)
HEADERS=eglcommon.h
PROGRAMS = \
arc \
cap \
clear \
coord \
dash \
ellipse \
filter \
gradorigin \
lineto \
lingrad \
lookup \
mask4 \
mask \
path3 \
radialgrad \
readpixels \
roundedrect \
star-nonzero \
star-oddeven \
stroke2 \
stroke \
vguarc
.c.o:
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
default: $(PROGRAMS)
arc: arc.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
cap: cap.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
clear: clear.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
coord: coord.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
dash: dash.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
ellipse: ellipse.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
filter: filter.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
gradorigin: gradorigin.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
image: image.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
lineto: lineto.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
lingrad: lingrad.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
lookup: lookup.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
mask: mask.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
mask4: mask4.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
path3: path3.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
pattern: pattern.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
radialgrad: radialgrad.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
readpixels: readpixels.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
roundedrect: roundedrect.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
star-nonzero: star-nonzero.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
star-oddeven: star-oddeven.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
stroke: stroke.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
stroke2: stroke2.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
vguarc: vguarc.c eglcommon.o
$(CC) $(CFLAGS) $^ $(LIBS) $(APP_LIB_DEPS) -o $@
eglcommon.o: eglcommon.c $(HEADERS)
$(CC) -c $(CFLAGS) eglcommon.c
clean:
rm -f *.o *~
rm -f *.so
rm -f $(PROGRAMS)

View File

@@ -1,139 +0,0 @@
#include "eglcommon.h"
#include <VG/openvg.h>
#include <math.h>
const VGfloat clear_color[4] = {1.0, 1.0, 1.0, 1.0};
const VGfloat color[4] = {1.0, 1.0, 1.0, 0.5};
VGPath vgPath;
static void ellipse(VGPath vgPath, VGfloat rx, VGfloat ry, VGfloat angle)
{
static const VGubyte cmd[] =
{ VG_MOVE_TO_ABS, VG_SCCWARC_TO_REL, VG_SCCWARC_TO_REL, VG_CLOSE_PATH };
VGfloat val[12];
VGfloat c = cos(angle) * rx;
VGfloat s = sin(angle) * rx;
val[0] = c;
val[1] = s;
val[2] = rx;
val[3] = ry;
val[4] = angle;
val[5] = -2.0f * c;
val[6] = -2.0f * s;
val[7] = rx;
val[8] = ry;
val[9] = angle;
val[10] = 2.0f * c;
val[11] = 2.0f * s;
vgClearPath(vgPath, VG_PATH_CAPABILITY_ALL);
vgAppendPathData(vgPath, sizeof(cmd), cmd, val);
vgDrawPath(vgPath, VG_FILL_PATH | VG_STROKE_PATH);
}
static void
init(void)
{
VGPaint vgPaint;
vgSetfv(VG_CLEAR_COLOR, 4, clear_color);
vgPath = vgCreatePath(VG_PATH_FORMAT_STANDARD,
VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0,
VG_PATH_CAPABILITY_ALL);
vgPaint = vgCreatePaint();
vgSetParameteri(vgPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
vgSetColor(vgPaint, 0x00ff00ff);
vgSetPaint(vgPaint, VG_FILL_PATH);
vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_NONANTIALIASED);
vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER);
vgSetf(VG_STROKE_LINE_WIDTH, 2.0f);
vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_SQUARE);
vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_MITER);
vgSetf(VG_STROKE_MITER_LIMIT, 4.0f);
vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
}
/* new window size or exposure */
static void
reshape(int w, int h)
{
}
static void
draw(void)
{
vgClear(0, 0, window_width(), window_height());
#if 0
vgLoadIdentity();
vgTranslate(40.0f, 24.0f);
vgScale(0.61804f, 0.61804f);
vgShear(-1.0f, 0.0f);
vgDrawPath(vgPath, VG_FILL_PATH | VG_STROKE_PATH);
#else
/* row 1, col 1: Identity transform. */
vgLoadIdentity();
vgTranslate(8.0f, 8.0f);
ellipse(vgPath, 4.0f, 4.0f, 0.0f);
/* row 1, col 2: 10^3 horizontal squeeze. */
vgLoadIdentity();
vgTranslate(24.0f, 8.0f);
vgScale(1.0e-3f, 1.0f);
ellipse(vgPath, 4.0e3f, 4.0f, 0.0f);
/* row 1, col 3: 10^6 horizontal squeeze. */
vgLoadIdentity();
vgTranslate(40.0f, 8.0f);
vgScale(1.0e-6f, 1.0f);
ellipse(vgPath, 4.0e6f, 4.0f, 0.0f);
/* row 1, col 4: 10^9 horizontal squeeze. */
vgLoadIdentity();
vgTranslate(56.0f, 8.0f);
vgScale(1.0e-9f, 1.0f);
ellipse(vgPath, 4.0e9f, 4.0f, 0.0f);
/* row 2, col 1: 10^3 vertical squeeze. */
vgLoadIdentity();
vgTranslate(8.0f, 24.0f);
vgScale(1.0f, 1.0e-3f);
ellipse(vgPath, 4.0f, 4.0e3f, 0.0f);
/* row 2, col 2: Shear 0. */
vgLoadIdentity();
vgTranslate(24.0f, 24.0f);
vgShear(0.0f, 0.0f);
ellipse(vgPath, 4.0f, 4.0f, 0.0f);
/* row 2, col 3: Horizontal shear -1. */
vgLoadIdentity();
vgTranslate(40.0f, 24.0f);
vgScale(0.61804f, 0.61804f);
vgShear(-1.0f, 0.0f);
ellipse(vgPath, 10.47213f, 4.0f, 31.717f);
#endif
vgFlush();
}
int main(int argc, char **argv)
{
set_window_size(64, 64);
return run(argc, argv, init, reshape,
draw, 0);
}

View File

@@ -1,75 +0,0 @@
#include "eglcommon.h"
#include <VG/openvg.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
static void
init(void)
{
}
/* new window size or exposure */
static void
reshape(int w, int h)
{
}
const int subtest = 0;
static void
draw(void)
{
VGPath line;
VGPaint fillPaint;
VGubyte lineCommands[3] = {VG_MOVE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS};
VGfloat lineCoords[] = {-2.0f,-1.0f, 0.0f,0.0f, -1.0f, -2.0f};
VGfloat clearColor[] = {0.0f, 0.0f, 0.0f, 1.0f};/* black color */
VGfloat fillColor[] = {1.0f, 1.0f, 1.0f, 1.0f};/* white color */
//VGfloat testRadius = 60.0f;
VGfloat testRadius = 10.0f;
int WINDSIZEX = window_width();
int WINDSIZEY = window_height();
line = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL);
fillPaint = vgCreatePaint();
vgSetf(VG_STROKE_LINE_WIDTH, 1.0f);
//vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_ROUND);
vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_BUTT);
vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_ROUND);
//vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_BEVEL);
vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_BETTER);
vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
vgLoadIdentity();
vgTranslate(60, 60);
vgScale(testRadius * 2, testRadius * 2);
vgAppendPathData(line, 3, lineCommands, lineCoords);
vgSetfv(VG_CLEAR_COLOR, 4, clearColor);
vgSetPaint(fillPaint, VG_STROKE_PATH);
vgSetParameterfv(fillPaint, VG_PAINT_COLOR, 4, fillColor);
vgSetParameteri( fillPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
vgClear(0, 0, WINDSIZEX, WINDSIZEY);
vgDrawPath(line, VG_STROKE_PATH);
vgDestroyPath(line);
vgDestroyPaint(fillPaint);
}
int main(int argc, char **argv)
{
set_window_size(100, 100);
return run(argc, argv, init, reshape,
draw, 0);
}

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