Compare commits

..

848 Commits

Author SHA1 Message Date
Brian Paul
9b3d748f02 mesa: omit files that were removed from git 2009-05-08 15:07:22 -06:00
Brian Paul
6fec2eb143 mesa: set version to 7.5-rc1 2009-05-08 15:04:12 -06:00
José Fonseca
b6e2261096 wgl: Grow the maximum number of pixel formats to cope with the new accum pixel formats.
Fix a segfault when using softpipe.
2009-05-08 14:57:30 +01:00
Keith Whitwell
e90beb93a8 mesa/st: keep surface_copy arguments positive
The src/dest x,y, and w,h arguments of the pipe->surface_copy
function are unsigned and the drivers aren't expecting negative
(or extremly-large unsigned) values as inputs.  Trim the requests
at the state-tracker level before passing down.
2009-05-08 14:57:30 +01:00
Keith Whitwell
507f4e7a74 mesa/st: remove redundant call to st_finish in CopyTexSubImage
Rendering should already have been flushed, any synchronization will
be done by the driver or memory manager.
2009-05-08 14:57:30 +01:00
José Fonseca
44a996b185 wgl: Export pixelformats with accumulation bits. 2009-05-08 14:57:30 +01:00
Keith Whitwell
33d2ca7624 mesa/st: cope with non-ibo index data in st_draw_feedback.c
Previously only non-indexed or indicies-in-a-vbo cases were handled in
this code.  This change adds the missing regular indices-in-memory
case.
2009-05-08 14:57:30 +01:00
Keith Whitwell
e6a3801f3d util/upload: catch failures to map_range and return error
Caller may be able to do something about this - eg flush and retry.
2009-05-08 14:57:30 +01:00
Keith Whitwell
222d7841e9 scons: mingw is broken with -O1 and higher 2009-05-08 14:57:30 +01:00
Keith Whitwell
ee79827186 stw: fix potential uninitialized use of curctx 2009-05-08 14:57:29 +01:00
José Fonseca
d5eac43a2e wgl: Enforce a minimum 1x1 framebuffer size. 2009-05-08 14:57:29 +01:00
José Fonseca
d78b5952c1 wgl: Add assertion for missing function. 2009-05-08 14:57:29 +01:00
José Fonseca
692263aad6 wgl: Remove unused variable. 2009-05-08 14:57:29 +01:00
José Fonseca
d88faf91e9 mesa: Make _mesa_share_state thread safe. 2009-05-08 14:57:29 +01:00
José Fonseca
4d28fcfeaa wgl: Implement ShareLists. 2009-05-08 14:57:28 +01:00
Keith Whitwell
d56b0e6847 progs/trivial: add test for vertex program invarient transform 2009-05-08 14:57:28 +01:00
Keith Whitwell
b6e8256899 mesa: more complete fix for transform_invarient glitches
Add a new flag mvp_with_dp4 in the context, and use that to switch
both ffvertex.c and programopt.c vertex transformation code to
either DP4 or MUL/MAD implementations.
2009-05-08 14:57:28 +01:00
Keith Whitwell
751f73e281 mesa/main: set PREFER_DP4 to match position_invarient code
This is a quick fix for z fighting in quake4 caused by the mismatch
between vertex transformation here and in the position_invarient code.
Full fix would be to make this driver-tunable and adjust both
position_invarient and ffvertex_prog.c code to respect driver
preferences.
2009-05-08 14:57:28 +01:00
José Fonseca
1ed90091be wgl: Implemente SwapLayerBuffers. 2009-05-08 14:57:28 +01:00
José Fonseca
0d0417cc75 scons: Don't use deprecated Options. 2009-05-08 14:57:27 +01:00
José Fonseca
be3f9dd26c util: Limit the stack walk to avoid referencing undefined memory. 2009-05-08 14:57:27 +01:00
Keith Whitwell
f628d7f5ee gallium/tgsi: hack around linker/archiver breakage
Add a dummy function which exists only so that tgsi_text_translate()
doesn't get magic-ed out of the libtgsi.a archive by the build system.
Don't remove unless you know this has been fixed - check on
mingw/scons builds as well.
2009-05-08 14:57:27 +01:00
Keith Whitwell
e99729d63d progs/trivial: add vbo-noninterleaved test 2009-05-08 14:57:27 +01:00
José Fonseca
d075cb4fc8 wgl: Include alpha bits in pixel format's cColorBits field. 2009-05-08 14:57:26 +01:00
Keith Whitwell
af09ba96e9 gallium/draw: cope with unused vertex_elements 2009-05-08 14:57:26 +01:00
Keith Whitwell
482be01db0 trivial: add line-flat.c 2009-05-08 14:57:26 +01:00
José Fonseca
bb9ea58f95 wgl: UINT_PTR null value is an integral type, so return 0 instead of NULL. 2009-05-08 14:57:26 +01:00
José Fonseca
1248ff7d45 pb: Save the stack backtrace when creating/mapping a debug buffer. 2009-05-08 14:57:26 +01:00
José Fonseca
606a547613 pb: Dump the fenced buffer sizes. 2009-05-08 14:57:26 +01:00
Brian Paul
6a3004b9ae swrast: fix span clipping bug
If a horizontal span of pixels was located at x < 0 we could sometimes
read/write outside of renderbuffer bounds.
2009-05-07 09:43:15 -06:00
Brian Paul
cc71704644 mesa: unmap buffer objects during context tear-down 2009-05-07 09:36:21 -06:00
Brian Paul
79ada8c633 gallium: fix texcoords for cubemap mipmap generation
We need to use (s,t,r) cubemap coords when sampling from the cubemap texture
so the rendered quad gets texture samples from the correct cube face.
2009-05-05 10:11:51 -06:00
Brian Paul
dd4c142e90 glx: replace Xmalloc() calls with Xcalloc()
Fixes a bug where psp->WaitX was uninitialized.  Reported by Chris Clayton.
2009-05-04 07:52:55 -06:00
Brian Paul
0a56a49687 st: create renderbuffer's pipe_surface in st_render_texture()
Previously we created the pipe_surface during framebuffer validation.
But if we did a glCopyTex[Sub]Image() before anything else we wouldn't yet
have the surface.  This fixes that.
2009-05-01 18:17:34 -06:00
Brian Paul
63f0130980 mesa: fix state validation bug for glCopyTex[Sub]Image()
We need to make sure the framebuffer state is up to date to make sure we
read pixels from the right buffer when doing a texture image copy.
2009-05-01 18:04:07 -06:00
Tom Fogal
36edcebb90 Fix symbol list for mangled Mesa on Darwin.
When building mangled Mesa on Darwin, the exported symbols are
named `_mgluWhatever' instead of simply `_gluWhatever'.  When
using a list of exported symbols via the system ld's
`-exported_symbols_list' command line option (as done by mklib),
this resulted in error messages about exporting symbols which do
not exist.

Fortunately the file format accepts simple wildcards.  This throws
a wildcard so that the symbol list will match both the mangled and
non-mangled names, preventing the warning and actually exporting
the correct symbols in one shot.
2009-05-01 11:55:50 -06:00
Brian Paul
8a488b1be7 mesa: remove -devel suffix from version 2009-05-01 09:19:59 -06:00
Brian Paul
3eafd25aa3 configs: bump MESA_MINOR to 5 2009-05-01 09:15:14 -06:00
Brian Paul
edd2bbe4a7 docs: fix typo 2009-05-01 09:08:39 -06:00
Corbin Simpson
2953b18004 radeon: Don't even bother with things too big to fit into our card. 2009-05-01 07:29:14 -07:00
Corbin Simpson
5b15cc312f r300-gallium, radeon-winsys: Hide radeon_cs from r300 pipe. 2009-05-01 06:01:52 -07:00
Corbin Simpson
c11ad489e7 r300-gallium, radeon-winsys: Space accounting.
It is no longer optional in current libdrm, so it was time to actually
start counting our BOs.
2009-05-01 05:54:53 -07:00
Corbin Simpson
d7f4ac9f34 r300-gallium, radeon-winsys: Reorganize r300_winsys header, break ABI.
Make things more consistent, prepare for more function hooks.
2009-05-01 05:03:56 -07:00
Corbin Simpson
a609f78cf6 r300-gallium: Don't bother with conditional double define.
We'll just forever leave it in r300_winsys.h since it's needed for
whichever winsys is hosting the pipe.
2009-05-01 04:47:50 -07:00
Corbin Simpson
1f43cc1d84 radeon: Fix cast and comment. 2009-05-01 04:39:04 -07:00
Brian Paul
e4e7ecc221 docs: asst. updates for 7.5 release 2009-04-30 17:17:31 -06:00
Brian Paul
a405cc7b72 docs: bring in 7.4 doc updates from mesa_7_4_branch 2009-04-30 17:13:22 -06:00
Brian Paul
675b1cacf7 docs: notes about new version number meaning in release notes 2009-04-30 17:11:20 -06:00
Brian Paul
aef475c889 mesa: update linux-static, linux-x86-static configs 2009-04-30 17:04:01 -06:00
Brian Paul
3dfe672c85 demos: silence warning 2009-04-30 17:03:54 -06:00
Tormod Volden
eef79d50bf mklib: replace if/expr with case
Saves forking an expr for every object.
2009-04-30 16:55:54 -06:00
Tormod Volden
9cb3cdec76 mesa: Prepend "-Wl," to linking options
Let mklib ignore -Wl options inside the object list when building
static libraries
2009-04-30 16:52:56 -06:00
Brian Paul
60927f97f7 i915simple: remove duplicated i915_context.c in C_SOURCES 2009-04-30 16:52:02 -06:00
Michel Dänzer
c28707b507 r300: Increase reference count of texture objects referenced by current state.
Fixes a use-after-free reported in
http://bugs.freedesktop.org/show_bug.cgi?id=20539, so this possibly fixes that
bug. It has been confirmed to fix
http://bugs.freedesktop.org/show_bug.cgi?id=17895 .
2009-04-30 13:21:08 +02:00
Michel Dänzer
ba27fe3710 gallium: Add SCons build support for the DRI state tracker. 2009-04-30 09:39:29 +02:00
Dan Nicholson
cc68cd20d9 egl: Don't install demodriver
I don't think anyone besides a developer would ever want to use the demo
egl driver. Furthermore, egl would only ever load demodriver if it was
set via EGL_DRIVER in the environment. In that case, I think you can
point it to your mesa source directory.
2009-04-29 20:46:37 -07:00
Jakob Bornecrantz
289dc69418 progs/tests: Update ignores 2009-04-29 20:44:03 +01:00
Jakob Bornecrantz
1793d5adac progs/tests: Add mipmap_comp for mipmap testing with compressed textures 2009-04-29 20:18:12 +01:00
Tom Fogal
a9c97c5f2a Use variable library name in pkg-config output.
Previously the pkg-config output files would contain e.g. `-lGL'
and `-lGLU', even if the user modified their configuration to
build libraries with different names.  This modifies the
pkg-config inputs, and corresponding makery, so that modifying the
output library name will cause the appropriate updated name to
appear in the pkg-config `-l' option.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-04-29 12:15:07 -07:00
Dan Nicholson
66f9786256 autoconf: Add switch for optional EGL
EGL doesn't build on all platforms, so allow people to opt out.
2009-04-29 12:15:07 -07:00
Dan Nicholson
356f311c4a autoconf: Clean up some m4 usage
m4_fatal is equivalent to m4_errprint + m4_exit.
2009-04-29 12:15:07 -07:00
Brian Paul
8fa6c1ac92 tgsi: added tgsi_check_soa_dependencies() and related debug code (disabled)
The TGSI interpeter operates in SOA style.  We need to check for data
dependencies in instructions which read from and write to the same register.
For now just adding some debug code to detect that condition.  Actual fixes
to follow.
2009-04-29 11:56:57 -06:00
Brian Paul
0e85dcb66b mesa: added _mesa_check_soa_dependencies() function
This function will check an instruction to see if there's data dependencies
between the dst and src registers if executed in an SOA manner.
2009-04-29 11:52:06 -06:00
Brian Paul
46ddcbc1a9 softpipe: return PIPE_UNREFERENCED in softpipe_is_buffer/texture_referenced()
This allows the engine demo to run again (avoid crash in VBO code).
This stuff still needs to be revisited someday though...
2009-04-28 14:29:27 -06:00
Keith Whitwell
801a33ae44 mesa/st: protect internal flushes with FLUSH_CURRENT
Already doing this for driver.flush()
2009-04-28 18:15:18 +01:00
Keith Whitwell
c0bff53334 mesa/main: protect driver.finish with FLUSH_CURRENT
Already doing this for driver.flush()
2009-04-28 18:15:18 +01:00
Keith Whitwell
106f2b031c mesa/st: remove duplicate offset calculation 2009-04-28 18:15:17 +01:00
Keith Whitwell
eb979cef85 gallium/draw: add ability to print out active pipeline stages 2009-04-28 18:15:17 +01:00
Keith Whitwell
afc0c59dbd mesa/st: translate VERT_ATTRIB_GENERIC8..15 in st_translate_vertex_program
It seems quake4 can hit these attributes sometimes.
2009-04-28 18:15:17 +01:00
Keith Whitwell
fd402791f9 progs: add fflushes for cygwin 2009-04-28 18:15:17 +01:00
Keith Whitwell
b91e5f8e19 util/indices: remove debug prints 2009-04-28 18:15:16 +01:00
Keith Whitwell
afd16512bc mesa/st: workaround for crashes in st_copy_texsubimage
Proper fix for this hasn't been identified, but avoid crashing.
2009-04-28 18:15:16 +01:00
José Fonseca
43e24a5928 wgl: Store current HDC/HGLRC in stw_context.
Less TLS lookups.
2009-04-28 18:15:16 +01:00
Alex Deucher
09c91a1565 R300: add quadpipe overrides
RV410 SE chips only have 1 quadpipe.
Also, handle other R300 chip with quadpipe override
2009-04-28 12:37:29 -04:00
Brian Paul
43d9020ff1 i965: avoid segfault in intel_update_renderbuffers() if using DRI1 2009-04-28 09:58:44 -06:00
Brian Paul
dcf571aff9 swrast: add missing break in clamp_rect_coord_linear()
See bug 21461.
2009-04-28 09:05:19 -06:00
Brian Paul
e0d5ff1a8a demos: asst. updates, clean-ups 2009-04-28 07:31:30 -06:00
Thomas Hellstrom
2c994ad3cb gallium dri st: Propagate the drawable info when we bind to new drawables.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-28 14:45:30 +02:00
Thomas Hellstrom
8cfa6546c9 gallium dri st: Use st_get_current() instead of GET_CURRENT_CONTEXT()
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-28 14:22:33 +02:00
Thomas Hellstrom
3d2bba0d10 st: Add an st_get_current() function.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-28 14:22:33 +02:00
Jakob Bornecrantz
aef3bccbda gallium-intel: Create a i965_dri.so symlink
This is only used for debuging the gem backend on i965
	chipset using the softpipe pipe driver.

	Usage: "export INTEL_SOFTPIPE=y" and point LIBGL_DRIVERS_PATH
	to "$MESA/lib/gallium" where $MESA is the mesa root.
2009-04-28 13:00:34 +01:00
Jakob Bornecrantz
c9b336bc93 gallium-intel: Fix build of dri driver 2009-04-28 01:17:44 +02:00
Thomas Hellstrom
171c7f91cd gallium dri st: Fix up some comments and minor bugs.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-28 13:05:54 +02:00
Corbin Simpson
81ded8092a radeon-r300: Fix a bit of breakage.
Not really sure why reordering the ioctls makes them work again.
2009-04-28 03:28:57 -07:00
Corbin Simpson
1ae877d95a radeon: Use PCI_MATCH_ANY for xorg driver.
Might as well.
2009-04-28 03:28:37 -07:00
Thomas Hellstrom
05af5a7f59 gallium: Rename the dri state tracker lib to libdridrm.a 2009-04-28 11:58:27 +02:00
Thomas Hellstrom
0929b2bf3c gallium: indent and cleanfile the dri state-tracker. 2009-04-28 11:54:25 +02:00
Thomas Hellstrom
ca1f5f7e6c gallium: Update the dri2 state tracker to support dri1.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-28 11:50:40 +02:00
Thomas Hellstrom
a70c4f352e gallium: Add a dri1 api
that a driver needs to implement on top of the drm api to support dri1.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-28 11:45:36 +02:00
Thomas Hellstrom
2e5acd24b0 gallium: Move the dri2 state tracker since we're about to extend it to dri1.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-28 11:35:29 +02:00
Thomas Hellstrom
638261b353 gallium: Update the drm_api.
Make it possible to pass state-tracker-specific data to the
init_screen function, and even open the door for device-specific
state-tracker screen initialization.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-28 11:25:56 +02:00
Robert Ellison
359a58230e Avoid a segfault in shader compilation
If a shader reaches an out-of-memory condition while adding
a new function (reallocating the function list), a segfault
will occur during cleanup (because the num_functions field
is non-zero, but the functions pointer is NULL).

This fixes that segfault by zeroing out the num_functions
field if reallocation fails.
2009-04-27 12:11:24 -06:00
José Fonseca
76b9da9e98 wgl: Cope with pre-existing threads.
DllMain is called with DLL_THREAD_ATTACH only by threads created after
the DLL is loaded by the process.
2009-04-27 18:48:11 +01:00
José Fonseca
c384ccb0c4 wgl: Implement WGL_EXT_extensions_string extension. 2009-04-27 17:30:05 +01:00
José Fonseca
3ebcf2dd74 util: Remove unix includes. 2009-04-27 17:13:40 +01:00
Brian Paul
dc9705d12d i965: only upload constant buffer data when we actually need the const buffer
Make the use_const_buffer field per-program and only call the code which
updates the constant buffer's data if the flag is set.

This should undo the perf regression from 20f3497e4b
2009-04-27 09:51:46 -06:00
Keith Whitwell
5250eec652 util/time: add util_time_sleep() for windows userspace
Somebody with a clue could probably do a better implemenation...
2009-04-27 14:43:57 +01:00
Keith Whitwell
5ed7764fd6 mesa/st: fix incorrect face, level in compress_with_blit
We were incorrectly applying the destination texture face and level
when requesting a transfer to the temporary texture, which has only
one face and level.  This would obviously cause problems uploading to
compressed cube and mipmap textures.
2009-04-27 14:43:57 +01:00
Shuang He
e326600609 demos: Clean up allocated Textures and Display Lists when demo quit 2009-04-27 07:13:33 -06:00
Micah Dowty
b618827fac util: Add debug_printf_once 2009-04-24 23:59:21 +02:00
José Fonseca
99b77d05d2 mesa: Call _mesa_snprintf instead of snprintf.
snprintf not directly available on Windows.
2009-04-27 13:09:58 +01:00
José Fonseca
b504721cc7 stw: Use a statically initiallized gl proc table.
It doesn't change anyway.
2009-04-27 12:53:54 +01:00
Maciej Cencora
4486e40143 r300: always emit output insts after all KIL insts 2009-04-27 19:02:39 +10:00
Corbin Simpson
904b563fd0 r300-gallium: Correctly flush Draw.
Should help with a few non-TCL bugs.
2009-04-26 10:06:02 -07:00
Mathias Gottschlag
86d2144412 r300-gallium: Add a draw_flush() to r300_flush().
This fixes some missing primitives which had been drawn right before the next glClear().
2009-04-26 10:01:17 -07:00
Corbin Simpson
233c6fb694 r300-gallium: Fix vertex shader OVM counting.
Attribs must be packed: position, point size, colors, texcoords.

Thanks to osiris for pointing it out.
2009-04-25 16:54:47 -07:00
Corbin Simpson
f45a7a1d1f r300-gallium: Clean up FB state emit. 2009-04-25 16:54:47 -07:00
Mathias Gottschlag
d9f2d0752b r300-gallium: Set framebuffer pitch on every framebuffer change.
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-04-25 16:54:47 -07:00
Jakob Bornecrantz
a098e60903 gallium-intel: Fix warning 2009-04-25 12:56:52 +01:00
Jakob Bornecrantz
5f701f22f0 gallium-intel: Cache software switch 2009-04-25 12:56:52 +01:00
Jakob Bornecrantz
f44f1155a9 gallium-intel: Link dri2 driver with softpipe 2009-04-25 12:56:52 +01:00
Samuel Thibault
d18dd6ad11 GNU/Hurd fixes
Here is a couple of fixes for GNU/Hurd:
- dri_interface.h: no libdrm support either.
- configure.ac:
 - GNU/Hurd is a GNU OS with _GNU_SOURCE and PTHREADS.
 - GNU needs a couple of flags like other OSes

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-04-24 19:10:01 -07:00
Ian Romanick
022319b92c intel: Fix more issues with the combined depth-stencil attachment 2009-04-24 16:39:00 -07:00
Ian Romanick
302ba83116 intel: Initialize region ptr to prevent assertion in intel_region_reference 2009-04-24 16:30:13 -07:00
Brian Paul
91eb8baaca tgis: SSE code generator doesn't yet support indirect addressing of temp regs
Fall back to interpreter in this case.
2009-04-24 17:18:02 -06:00
Ian Romanick
f2272b5b2f intel / DRI2: When available, use DRI2GetBuffersWithFormat
This interface gives the driver two important features.  First, it can
allocate the (fake) front-buffer only when needed.  Second, it can
tell the buffer allocator the format of buffers being allocated.  This
enables support for back-buffer and depth-buffer with different bits
per pixel.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-24 12:48:20 -07:00
Ian Romanick
dbf87f2312 DRI2: Implement interface for drivers to access DRI2GetBuffersWithFormat
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-24 12:48:20 -07:00
Ian Romanick
d8d7b2c395 DRI2: Implement protocol for DRI2GetBuffersWithFormat
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-24 12:48:20 -07:00
Brian Paul
1c9786894c mesa: fix up error/warning/debug output newlines
As of commit 23ad86cfb9 all messages go
through output_if_debug().

Add new parameter to output_if_debug() to indicate whether to emit a newline.

_mesa_warning() and _mesa_error() calls should not end their strings with \n.
_mesa_debug() calls should end their text with \n.
2009-04-24 10:50:40 -06:00
Brian Paul
3321b6984e i965: use drm_intel_gem_bo_map/unmap_gtt() when possible, otherwise dri_bo_subdata()
This wraps up the unfinished business from commit a9a363f829
2009-04-24 09:52:05 -06:00
Alan Hourihane
b2a69ae879 demos: ensure display lists are destroyed for next generation 2009-04-24 16:45:36 +01:00
Keith Whitwell
29d9abf72d pipebuffer: don't fail when validating mapped buffers
This can be almost impossible to avoid - hopefully we won't encounter
a situation where this is a true requirement.  Would probably require
drivers to flush between hardware and software vertex processing.
2009-04-24 12:43:04 +01:00
Keith Whitwell
a86ef37655 shadowtex: fflush stdout for cygwin 2009-04-24 12:16:39 +01:00
Jakob Bornecrantz
f4a286e5f5 util: Add more entry points for dumping to bmp 2009-04-24 13:02:26 +02:00
Keith Whitwell
eb5d96968f demos/readpix: add option to draw triangle instead of drawpix 2009-04-24 10:09:14 +01:00
Keith Whitwell
510a44eea7 tests/mipmap_view: add a bunch of keystrokes for testing render-to-texture
Move between mipmaps, render a triangle, reload textures with either
the original arch (and GenMipmaps) or via straightforward glTexImage.
2009-04-24 10:09:14 +01:00
Roland Scheidegger
ff71587b27 i965: fix point size issue
need to clamp point size to user set min/max values, even for constant
point size. Fixes glean pointAtten test.
2009-04-24 02:40:05 +02:00
Brian Paul
1d00399593 mesa: more informative error messages 2009-04-23 17:54:34 -06:00
Brian Paul
a9a363f829 i965: revert part of commit 4f4907d69f
The drm_intel_gem_bo_map_gtt() call that replaced dri_bo_map() is
producing errors like:

intel_bufmgr_gem.c:689: Error preparing buffer map 39 (vp_const_buffer): Invalid argument .

and returning NULL, causing a segfault in the memcpy().

Just reverting until we can get to the root issue...
2009-04-23 17:41:23 -06:00
Roland Scheidegger
ae69a04650 i915: fix fix for anisotropic filtering
forgot to commit the changes to actually support 4x aniso filtering...
2009-04-23 23:10:51 +02:00
Eric Anholt
8374379572 i965: Support drawing to FBO cube faces other than positive X.
Also fixes drawing to 3D texture depth levels.
2009-04-23 11:13:04 -07:00
Eric Anholt
4f4907d69f intel: Take advantage of GL_READ_ONLY_ARB to map to GEM bo_map write flag.
This is a CPU win in general, but in particular reduces the pain of
Mesa's calculation of min/max indices in DrawElements (wtf?).
2009-04-23 11:13:04 -07:00
Michel Dänzer
f3c7d6ff86 gallium: Handle non-NULL data pointer in EXA ModifyPixmapHeader hook.
Need to use the data pointed to for pixmap contents in that case.

Fixes RENDER based text rendering.
2009-04-23 14:47:31 +01:00
Michel Dänzer
e0da812c5b gallium: Make the intel xorg winsys start up with any Intel chipset.
For unsupported devices the screen/context creation should fail cleanly later
on.
2009-04-23 13:19:56 +01:00
Michel Dänzer
13cb8264d8 gallium/intel/gem: Use softpipe rather than i915simple if INTEL_SOFTPIPE is set. 2009-04-23 12:57:46 +01:00
Michel Dänzer
49ba80dff3 gallium: Always include xorg-server.h before other X server headers.
Various breakage otherwise, e.g. _XSERVER64 not being defined on 64 bit leading
to inconsistent definitions of X server internal structs.
2009-04-23 12:20:22 +01:00
Michel Dänzer
17ee25ba6f gallium: Fix up xorg state tracker build. 2009-04-23 12:17:28 +01:00
Brian Paul
6b0c9366a3 mesa: minor state-update changes in histogram code
Call FLUSH_VERTICES() in _mesa_Histogram().
No need to signal _NEW_PIXEL in ResetHistogram(), ResetMinmax().
2009-04-22 16:41:05 -06:00
Brian Paul
725d50601c mesa: fix comment typo 2009-04-22 16:38:04 -06:00
Brian Paul
c5a97eda32 gallium: license, copyright 2009-04-22 15:12:22 -06:00
Brian Paul
984f2bb629 st: comments, license, copyright 2009-04-22 15:10:36 -06:00
Brian Paul
8ee6ab6acb mesa: fix _mesa_dump_textures(), add null ptr check
Calling _mesa_dump_textures() deleted the textures... oops!!!
2009-04-22 15:03:05 -06:00
Brian Paul
fa92756400 mesa: Fix buffer overflow when parsing generic vertex attributes. 2009-04-22 18:18:29 +01:00
Roland Scheidegger
50853be894 intel: fix max anisotropy supported
i915 actually supports up to 4 (according to header file - not tested),
i965 up to 16 (code already handled this but slightly broken), so don't use 2
for all chips, even though angular dependency is very high.
2009-04-22 17:38:06 +02:00
Brian Paul
7843243dee st: also check _NEW_PROGRAM flag for vertex shader constant buffers
This is a follow-on to commit c1a3b85280.
Note that (at this time) wherever _NEW_PROGRAM_CONSTANTS is set we're still
setting _NEW_PROGRAM so this won't really make any difference (for now).
2009-04-22 07:58:25 -06:00
Thomas Hellstrom
f057f6543d gallium: Reinstate unconditional flushes.
Lost in commit e50dd26ca6.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-22 11:42:46 +02:00
Keith Whitwell
009749b4a8 mesa: protect driver.flush() with FLUSH_CURRENT
Need to do this to ensure vbo code unmaps its buffers before calling
the driver, which may be sitting on top of a memory manager which
objects to firing commands from a mapped buffer.
2009-04-22 09:03:17 +01:00
Brian Paul
c1a3b85280 st: play it safe for now and check _NEW_PROGRAM for shader const buffer atom
When a new program is bound but no constants are updated we still need
to update the Gallium const buffer.
2009-04-21 17:00:54 -06:00
Brian Paul
7872b8e37e swrast: simplify state update logic for fragment shader const buffers 2009-04-21 17:00:01 -06:00
Brian Paul
3eeefa47d0 st: use the static atoms[] array directly
We can simplify this now that we no longer have any dynamic atoms.
2009-04-21 16:50:34 -06:00
Brian Paul
f4f39902fd st: do away with dynamic state atom for const buffers
Just use the new _NEW_PROGRAM_CONSTANTS flag instead.
2009-04-21 16:47:30 -06:00
Brian Paul
64e331eb52 mesa: new _NEW_PROGRAM_CONSTANTS flag
This state flag will be used to indicate that vertex/fragment program
constants have changed.  _NEW_PROGRAM will be used to indicate changes
to the vertex/fragment shader itself, or misc related state.

_NEW_PROGRAM_CONSTANTS is also set whenever a program parameter that's
tracking GL state has changed.  For example, if the projection matrix is
in the parameter list, calling glFrustum() will cause _NEW_PROGRAM_CONSTANTS
to be set.  This will let to remove the need for dynamic state atoms in
some drivers.

For now, we still set _NEW_PROGRAM in all the places we used to.  We'll no
longer set _NEW_PROGRAM in glUniform() after drivers/etc have been updated.
2009-04-21 16:21:32 -06:00
Brian Paul
8a22e24fae mesa: print internal.current[i] attrib 2009-04-21 16:21:32 -06:00
Brian Paul
ac1fc3f465 mesa: print parameter list dirty state flag mask 2009-04-21 16:21:32 -06:00
Brian Paul
08e7f09f34 i965: const correctness 2009-04-21 16:21:32 -06:00
Michel Dänzer
6bd4bc785e Update GALLIUM_AUXILIARY_DIRS in configure.ac to match configs/default. 2009-04-21 18:32:42 +01:00
Maciej Cencora
584303ac8e r300: r300 hw doesn't support any input modifiers in tex insts 2009-04-21 12:14:35 -04:00
Mathias Gottschlag
b8fff1f9f1 r300-gallium: Fix CS size mismatch
This fixes some warnings which appear because the driver assumes a wrong
cs size (13 vs 16 register writes in some cases).
2009-04-21 09:52:30 -06:00
Brian Paul
dad1c1be18 demos: check that GL version is 2.0 or higher 2009-04-21 07:27:27 -06:00
Brian Paul
25e3a53403 st: report GL_OUT_OF_MEMORY instead of asserting 2009-04-21 07:27:26 -06:00
Keith Whitwell
e20f837f67 trivial/tri-viewport: add keys for frustrum/ortho and z coordinate 2009-04-21 11:40:59 +01:00
Keith Whitwell
6e05224bc4 trivial/tri-viewport: add more out-of-bounds background quads 2009-04-21 11:13:16 +01:00
Keith Whitwell
a38f7d9e68 trivial/tri_viewport: add space==reset key 2009-04-21 11:13:15 +01:00
Keith Whitwell
6bfcffa79e trivial/tri_viewport: add width/height keys 2009-04-21 11:13:15 +01:00
Brian Paul
d27d79db4a softpipe: fix softpipe_is_buffer/texture_referenced() regression
Return the conservative PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE
value for now.

This fixes a bunch of regressions seen in piglit and glean.
2009-04-20 14:57:00 -06:00
Brian Paul
5d5db81076 swrast: fix pointer arithmetic error in get_texel_array()
This came from commit 1b2ab02367
2009-04-20 14:15:04 -06:00
José Fonseca
29280ac69e gdi: Don't implement broken gl_dispatch_stub_xxx. 2009-04-20 16:44:37 +01:00
José Fonseca
be6037d459 wgl: Don't implement broken gl_dispatch_stub_xxx.
These don't respect the stdcall, so they crash upon return.
2009-04-20 16:44:37 +01:00
José Fonseca
708218119b mesa: Correct the gl_dispatch_stub_xxx prototypes. 2009-04-20 16:44:37 +01:00
José Fonseca
01397a66c7 mesa: Handle failure to create a transfer. 2009-04-20 16:44:36 +01:00
Keith Whitwell
d017749b3e mesa/progs: fix scons build after recent demo moves 2009-04-20 16:17:50 +01:00
Keith Whitwell
c691f96e98 trivial/tri-viewport.c - add guide lines, more triangles, make interactive
This is becoming more like a test than a trivial/ example.
2009-04-20 16:12:11 +01:00
Keith Whitwell
53c6467aea st: assert on pipe_buffer_create failure
This needs a proper fix to propogate the out-of-memory condition back
up to Mesa and the app as a GL error.  Until then, at least catch the
problem at its source.
2009-04-20 16:12:11 +01:00
Keith Whitwell
70588fc83c tests/mipmap_view: add linear/nearest key 2009-04-20 16:12:11 +01:00
Keith Whitwell
c7c76ba561 util: don't set unused blend state
Try to avoid creating multiple blend atoms.
2009-04-20 16:12:11 +01:00
Jakob Bornecrantz
8ae52413c7 trace: Add initializer for static variables 2009-04-20 16:07:44 +02:00
Maciej Cencora
6900046aad r300: fix register-negate branch merge regression 2009-04-20 07:31:44 -06:00
Michel Dänzer
c76a2444a3 gallium: Fix glDraw/CopyPixels fragment program leak. 2009-04-20 13:05:18 +02:00
Jakob Bornecrantz
f2d2b3d8e2 trace: Enable dumping to be turned on and off 2009-04-19 16:24:41 +01:00
Jakob Bornecrantz
439c42ae8b st: Wait to create bitmap transfer until needed 2009-04-19 16:24:41 +01:00
Jakob Bornecrantz
373e671683 autoconf: Build gallium softpipe when driver=xlib 2009-04-19 16:24:41 +01:00
Jakob Bornecrantz
90a23e340f progs/demos: Update ignore 2009-04-19 16:24:29 +01:00
Jakob Bornecrantz
59c8e738c4 progs/glsl: Update ignore 2009-04-19 16:23:49 +01:00
José Fonseca
dc1153ce83 softpipe: Simplify softpipe_create's prototype. 2009-04-18 23:15:26 +01:00
José Fonseca
876e95dcc8 softpipe: Fix softpipe_is_texture_referenced prototype. 2009-04-18 23:15:26 +01:00
José Fonseca
eb63e8cc75 softpipe: Remove softpipe_winsys.
Not used by softpipe anyway.
2009-04-18 23:15:26 +01:00
Brian Paul
c0565e86b4 demos: added glsl/texaaline.c program and overhaul the Makefile 2009-04-18 14:18:59 -06:00
Brian Paul
3595732f28 demos: updated .gitignore list 2009-04-18 13:18:44 -06:00
Brian Paul
c953f6620c docs: removed/added demo programs 2009-04-18 13:16:35 -06:00
Brian Paul
d61070b659 demos: move demos/texobj.c to tests/ 2009-04-18 13:12:50 -06:00
Brian Paul
30e80f6e55 demos: move demos/occlude.c (old HP extension) to tests 2009-04-18 13:10:51 -06:00
Brian Paul
22af013f85 demos: move tests/dinoshade.c to demos/ 2009-04-18 13:08:48 -06:00
Brian Paul
49c3e7172d demos: move tests/projtex.c to demos/
And fix compiler warnings.
2009-04-18 13:05:51 -06:00
Brian Paul
292e192093 demos: move tests/fbotexture.c to demos/ 2009-04-18 13:00:48 -06:00
Brian Paul
f47495ec42 demos: move texdown.c to tests/ 2009-04-18 12:58:00 -06:00
Brian Paul
dfd69a27f8 demos: move glutfx demo to tests/ 2009-04-18 12:57:13 -06:00
Brian Paul
6a495d26af demos: move streaming_rect.c demo to tests/ 2009-04-18 12:55:55 -06:00
Brian Paul
118856641f demos: move glslnoise.c demo to glsl/noise2.c 2009-04-18 12:54:27 -06:00
Brian Paul
927dc39de0 i965: use region width, height in brw_update_renderbuffer_surface()
Fixes a regression from commit 2c30fd84df
seen with DRI1.
2009-04-18 10:42:15 -06:00
Brian Paul
957a625b2d intel: #include polygon.h to silence warning 2009-04-18 10:40:21 -06:00
Brian Paul
3e750ce5c4 demos: fix incorrect assertion 2009-04-18 10:20:26 -06:00
Brian Paul
c5af2ed60f mesa: add switch case for GL_VERTEX_STATE_PROGRAM_NV in _mesa_new_program()
Fixes bug seen in progs/tests/vptest1.c
2009-04-18 10:08:54 -06:00
Brian Paul
2bf326af10 demos: fix usage text 2009-04-18 10:08:15 -06:00
Michel Dänzer
54fb6f0053 intel: Handle ARB_vertex_buffer_object state in intel_clear_tris().
Fixes gearsvbo app by Michael Clark.
2009-04-18 15:47:14 +02:00
Brian Paul
538a823882 demos: new glsl/array.c demo
Test variable indexing into a uniform array in a vertex shader.
2009-04-17 16:23:33 -06:00
Brian Paul
794d488e6d intel: make sure polygon mode is set properly in intel_clear_tris()
Fixes progs/glsl/skinning.c demo.
2009-04-17 16:11:05 -06:00
Brian Paul
36b0f26721 mesa: suppress extra newline 2009-04-17 16:10:26 -06:00
Brian Paul
0bc214a834 i915: fix broken indirect constant buffer reads
The READ message's msg_control value can be 0 or 1 to indicate that the
Oword should be read into the lower or upper half of the target register.
It seems that the other half of the register gets clobbered though.  So
we read into two dest registers then use a MOV to combine the upper/lower
halves.
2009-04-17 16:10:26 -06:00
Brian Paul
905130852a mesa: build a float[4] value in _mesa_add_sampler() to avoid random values 2009-04-17 16:10:26 -06:00
Brian Paul
4c13cb65a0 dri: build DRI swrast driver too 2009-04-17 16:10:26 -06:00
Brian Paul
e1a8852aa4 dri: __driUtilMessage(): not all messages are errors 2009-04-17 16:10:26 -06:00
Brian Paul
08ac96e55b mesa: minor tweak to error message 2009-04-17 16:10:26 -06:00
Brian Paul
f8f23e33c2 i965: updated CURBE allocation code
Now that we have real constant buffers, the demands on the CURBE are lessened.
When we use real VS/WM constant buffers we only use the CURBE for clip planes.
2009-04-17 16:10:26 -06:00
Jakob Bornecrantz
867afa4c09 xlib/trace: Fixup xlib trace 2009-04-17 21:33:12 +02:00
José Fonseca
86ed894e47 pipe: Get the p_atomic_dec_zero logic right this time. 2009-04-17 18:40:46 +01:00
Brian Paul
90c880f089 demos: move glewInit() call, fixes crash/bug 21247 2009-04-17 09:16:48 -06:00
Michel Dänzer
3b76072915 gallium: Fix PIPE_ATOMIC_GCC_INTRINSIC build. 2009-04-17 17:02:34 +02:00
Brian Paul
047efcd050 demos: move glewInit() after glutCreateWindow()
Fixes segfault.  See bug 21239.  However, the demo doesn't render
properly.  Probably a bug in the GL_ATI_fragment_shader code.
2009-04-17 08:11:00 -06:00
Jakob Bornecrantz
44d0e0caf4 trace: Keep screen objects on lists 2009-04-17 16:03:01 +02:00
Jakob Bornecrantz
1e42f68fd6 trace: Fix is_referenced functions 2009-04-17 16:03:01 +02:00
Jakob Bornecrantz
5800e0aad1 trace: Simplify trace_buffer function 2009-04-17 16:03:01 +02:00
José Fonseca
dbb90436f8 pipe: Fix InterlockedDecrement usage. 2009-04-17 15:01:38 +01:00
José Fonseca
995a168dea wgl: Put commas in the right places. 2009-04-17 14:55:49 +01:00
José Fonseca
5458f8eff6 wgl: Flip the pixel format order.
List 32bit pixel formats first, as nobody is interested in 16bit pixel
formats nowadays.
2009-04-17 14:53:29 +01:00
Thomas Hellstrom
e50dd26ca6 gallium: Create OGL state tracker wrappers for various CPU access operations.
There are two usage types of buffer CPU accesses:
One where we try to use the buffer contents for multiple draw commands in
a batch. (batch := sequence of commands that are flushed together),
like incrementally adding bitmaps to a bitmap texture that is reallocated
on flush.
And one where we assume we can safely overwrite the old buffer contexts, like
glTexSubImage. In this case we need to make sure all old drawing commands
referencing the buffer are flushed before we map the buffer.
This is easily forgotten.

Add wrappers for the most common of these operations. The first type is
prefixed with "st_no_flush" and the second type is prefixed with
"st_cond_flush", where "cond" indicates that we attmpt to only flush
if there is indeed unflushed draw commands referencing the buffer.

Prefixed functions are
screen::get_tex_transfer
pipe_buffer_write
pipe_buffer_read
pipe_buffer_map

Please use the wrappers whenever possible.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-17 13:18:05 +02:00
Zack Rusin
ee2a5f307a egl: don't crash with one more khronos api 2009-04-17 07:11:16 -04:00
Keith Whitwell
687f331a1f gallium: simplify further the logic for selecting mutex implementation
Cleaner than the previous cleanup...
2009-04-17 11:02:07 +01:00
Keith Whitwell
29a2f6fead util: flush stdout before emitting debug_printf on stderr
A lot of the mesa demos emit commentary on stdout, try to keep it in
sync with the corresponding output from debug_printf().
2009-04-17 11:02:07 +01:00
Keith Whitwell
db93dcecc8 gallium: add #warning to mutex-based atomic implementation
Some builds end up picking this up.
2009-04-17 11:02:07 +01:00
José Fonseca
3a618da6e1 python/retrace: Rename module as it conflicts with a builtin module.
And there is no way to override a builtin module... sigh
2009-04-17 10:07:53 +01:00
José Fonseca
56c2cd7ae2 scons: Cleanup. 2009-04-17 09:49:41 +01:00
Brian Paul
189db329ca demos: set init window size, not pos 2009-04-16 22:07:53 -06:00
Brian Paul
a902b6ba48 docs: separate compilation units in 7.5 2009-04-16 22:07:53 -06:00
Brian Paul
eb0d464903 Merge branch 'register-negate' 2009-04-16 22:02:54 -06:00
Alan Coopersmith
7571d5d3b0 egl/main/Makefile: Add dependency of install target on default build target
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-04-16 20:07:47 -07:00
Eric Anholt
f17ea143cb i915: Remove dead i830TexEnv and i915TexEnv.
These LOD bias updates are covered by the texture state uploads in
*_texstate.c now.
2009-04-16 12:04:34 -07:00
Eric Anholt
2c30fd84df intel: Add support for argb1555, argb4444 FBOs and fix rgb565 fbo readpixels.
Also enable them all regardless of screen bpp, as 32 bpp what I've been
testing against, and haven't been able to detect any screen bpp-specific
troubles with them.
2009-04-16 12:04:30 -07:00
Brian Paul
33b865f70d i965: disable using immediate values for MOV instructions
For some reason, MOV instructions using immediate src values don't seem
to work reliably on the GLSL path.  Disable them for now (falling back to
const buffer reads).  This fixes a bunch of glean glsl1 failures.
2009-04-16 11:08:23 -06:00
Brian Paul
a25632d890 i965: minor debug output changes 2009-04-16 11:08:23 -06:00
Brian Paul
fc76781456 i965: const buffer debug code (disabled) 2009-04-16 11:08:23 -06:00
Brian Paul
ee32e9b475 i965: implement relative addressing for VS constant buffer reads
A scatter-read should be possible, but we're just using two READs for
the time being.
2009-04-16 11:08:23 -06:00
Brian Paul
19ac3e2729 i965: handle address reg in get_dst() 2009-04-16 11:08:23 -06:00
Brian Paul
f2cfbfa2ba i965: fix const buffer temp register clobbering
Calls to release_tmps() were causing the temps holding constants to get
recycled.
2009-04-16 11:08:23 -06:00
Lars Henning Wendt
d82876e850 mesa: fix bad mask bit in clip plane restore code for glPopAttrib() 2009-04-16 10:15:10 -06:00
Roland Scheidegger
69cbf3c686 intel: fix small compressed texture upload
need to round up height for _mesa_copy_rect otherwise
textures with height smaller than 4 won't get copied to the miptree at all
Also fix up the confusing debug output (don't output unitialized values,
and output if data is present and the compressed flag)
2009-04-16 17:47:25 +02:00
Brian Paul
666702baec mesa: add distclean target to top-level Makefile 2009-04-16 09:31:45 -06:00
Brian Paul
0d0028e6df demos: use larger buffer for snprintf() call, see bug 21220 2009-04-16 09:25:52 -06:00
Keith Whitwell
8b2ebd1531 vbo: cache last dlist vertex in malloced memory
Avoids repeated mapping of the VBO buffer on display list replay.  We
need access to the final vertex in order to update the GL current attrib
values.
2009-04-16 12:19:19 +01:00
José Fonseca
e80d1e367a Merge branch 'gallium-s3tc' 2009-04-16 10:51:42 +01:00
Jakob Bornecrantz
82e92eeab0 progs/tests: Make texcompress2 get texture 2009-04-15 23:36:22 +02:00
Jakob Bornecrantz
5a118d4650 util: Fix surface usage 2009-04-15 23:33:07 +02:00
Brian Paul
255c33d733 st: remove XXX comment 2009-04-15 09:54:04 -06:00
Brian Paul
7b24e58a0c st: check for fast memcpy path in decompress_with_blit() 2009-04-15 09:52:04 -06:00
Brian Paul
66cdbf945a st: st_equal_formats() function to compare gallium/GL pixel formats 2009-04-15 09:51:38 -06:00
Brian Paul
51b339af2e st: decompress_with_blit() path for glGetTexImage().
Decompress a texture by rendering a textured quad.
2009-04-15 09:37:22 -06:00
Brian Paul
49b40f9bf4 gallium: new, simple RGBA surface create/destroy helpers
Use these for quickly creating an RGBA drawing surface.
2009-04-15 09:36:03 -06:00
Thomas Hellstrom
b83cf05d0d r300-gallium: Fixup for commit 9b75627fab.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-15 17:24:06 +02:00
Thomas Hellstrom
9b75627fab gallium: Make sure we flush before some texture / buffer operations.
Also implement context member functions to optimize away those
flushes whenever possible.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-15 17:16:58 +02:00
Brian Paul
f94053eb7d tests: another extended swizzle test 2009-04-15 19:55:28 -06:00
Corbin Simpson
1a84072db9 r300-gallium: Use viewport state. 2009-04-15 15:10:24 -07:00
Corbin Simpson
a4e0a46a8d r300-gallium: Don't use indexbufs for now.
They aren't working, so best to turn it off.
2009-04-15 15:10:24 -07:00
Corbin Simpson
a5f68b40cb r300-gallium: Point size is at OVM position 15, not 1.
Or so sayeth osiris, and he would know. :3
2009-04-15 15:10:23 -07:00
Corbin Simpson
ada7ced189 r300-gallium: vs: Dot products. 2009-04-15 15:10:23 -07:00
Eric Anholt
43257c1470 i965: Clean up output of WM SS state dump, and add format output. 2009-04-15 12:55:51 -07:00
Eric Anholt
bbae8791d1 i915: Use DEBUG_WM (like 965) for printing the fragment program out.
This is nice when paired with INTEL_DEBUG=batch for debugging what's going
out to the hardware.
2009-04-15 12:55:51 -07:00
Eric Anholt
0af7e9170f i915: Add decode of dest buffer variables (destination format) 2009-04-15 12:55:51 -07:00
Eric Anholt
c710430f3a mesa: Update texenv program when _NEW_ARRAYS is updated as well.
This fixes a regression in fbotest1 on 915, where a transition from
color+vertex array enabled to texcoord0+vertex array enabled wouldn't trigger
program update on the second _mesa_update_state of DrawArrays, and we'd sample
a constant texcoord of 0,0,0,1 instead of the array.

The double state update in DrawArrays from
1680ef8696 still needs fixing.
2009-04-15 12:55:50 -07:00
Eric Anholt
8bc3a6eb19 intel: Fix segfault when doing SW mipmap generation with a PBO texture upload.
Triggered in test-fbo from clutter since
37fb2d9b23.
2009-04-15 12:55:50 -07:00
José Fonseca
af9d202b26 mesa: TGSI translation of multiple render targets. 2009-04-15 20:08:33 +01:00
Brian Paul
05471828dc glx: added null pointer check in glXGetFBConfigs()
Fixes segfault seen with glxinfo with NVIDIA OpenGL.
2009-04-15 08:01:45 -06:00
Brian Paul
7db7ff878d mesa: merge the prog_src_register::NegateBase and NegateAbs fields
There's really no need for two negation fields.  This came from the
GL_NV_fragment_program extension.  The new, unified Negate bitfield applies
after the absolute value step.
2009-04-14 22:14:30 -06:00
Brian Paul
0115a4f8f1 mesa: remove unused matrixType param from ctx->Driver.UniformMatrix() functions 2009-04-14 20:00:28 -06:00
Brian Paul
62c45ec951 mesa: move #define for GL_PROGRAM_BINARY_LENGTH_OES 2009-04-14 19:56:59 -06:00
Brian Paul
fe278f1e60 mesa: remove NV vertex/fragment program print/debug code
The code in prog_print.c can be used instead.
2009-04-14 19:53:37 -06:00
Brian Paul
cdc7f681c8 mesa: use standard offsetof() macro 2009-04-14 19:44:16 -06:00
Brian Paul
92cc997003 i965: fix VS constant buffer reads
This mostly came down to finding the right MRF incantation in the
brw_dp_READ_4_vs() function.

Note: this feature is still disabled (but getting close to done).
2009-04-14 16:05:37 -06:00
Adam Jackson
a3c3c1f143 glx: Make glXGetScreenDriver() work for DRI2 2009-04-14 17:56:29 -04:00
José Fonseca
71793e0f79 scons: Support winddk 6001.18002. 2009-04-14 21:43:10 +01:00
José Fonseca
5ccbccb3c1 scons: Recent Windows DDK do not include LIB.EXE.
Have to use LINK /LIB instead. The biggest problem is when the command
line is very long and all the options are included in a argument file --
link doesn't like if /LIB is included in the argument file.
2009-04-14 21:43:10 +01:00
José Fonseca
1ea7f0fef0 mesa: Fix gcc assembly enable logic.
The i386 symbol is defined on WINDDK.
2009-04-14 21:43:10 +01:00
Ian Romanick
153012b29b DRI2: Don't fault on NULL DrawBuffer
It is possible for ctx->DrawBuffer to be NULL, so don't fault when
that happens.  This change is not being committed to master because it
doesn't appear to be necessary there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

Cherry picked from mesa_7_4_branch, commit 49e0c74ddd
2009-04-14 14:32:52 -06:00
Brian Paul
cafea75280 i965: checkpoint commit: VS constant buffers
Hook up a constant buffer, binding table, etc for the VS unit.
This will allow using large constant buffers with vertex shaders.
The new code is disabled at this time (use_const_buffer=FALSE).
2009-04-14 11:08:42 -06:00
Younes Manton
43c7ffaea6 dri glx: Swap before checking for cliprects.
We don't update drawables anymore unless they are completely
uninitialized, so we need to swap even if we don't have
cliprects yet, otherwise we never end up calling the driver's
SwapBuffers(). The driver should update the drawable in its
SwapBuffers() anyway.

See 8e753d0404,
"dri glx: Fix dri_util::driBindContext" for the change that
exposed it.
2009-04-13 21:34:53 -04:00
Ben Skeggs
352de305bd nv50: fix mrt clear 2009-04-13 14:41:06 +10:00
Corbin Simpson
9340c994b7 r300-gallium: Split up vertex format tallying for HW and SW TCL.
This makes things draw (again) with HW TCL. Yay?
2009-04-10 18:35:58 -07:00
Corbin Simpson
1b5b083d5c r300-gallium: Finish up cleanup of vertex format state.
This makes texcoords route properly, and also fixes a few asserts.
2009-04-10 18:35:57 -07:00
Corbin Simpson
e825609d81 r300-gallium: Clean up vertex format setup. 2009-04-10 18:35:57 -07:00
Brian Paul
4e96c81969 i965: remove unused var 2009-04-10 16:22:41 -06:00
Brian Paul
60ad4b0bf0 i965: clean-up in prepare_wm_surfaces() 2009-04-10 16:22:41 -06:00
Brian Paul
3444567050 mesa: reduce makefile output 2009-04-10 16:22:41 -06:00
José Fonseca
11084d5827 wgl: Protect the framebuffer with a lock.
Unfortunately this doesn't catch all the cases, as the mesa state tracker
can still use the framebuffer without giving the wgl state tracker
the chance to lock it.
2009-04-10 19:50:35 +01:00
José Fonseca
6fc244c68d wgl: Note down the gallium pixel formats, instead of re-guessing them. 2009-04-10 19:50:35 +01:00
José Fonseca
aa405a2a77 wgl: Query the screen for supported formats. 2009-04-10 19:50:35 +01:00
José Fonseca
0bca413ce9 wgl: Walk through the pixel formats combinations. 2009-04-10 19:50:35 +01:00
José Fonseca
e5d700721b wgl: Keep copies of the PIXELFORMATDESCRIPTOR structures. 2009-04-10 19:50:34 +01:00
Robert Noland
48f0543b39 Build dri drivers for powerpc and sparc on FreeBSD. 2009-04-10 12:55:50 -05:00
Brian Paul
d60b4f7885 mesa: asst. progs/test/Makefile files 2009-04-10 08:54:37 -06:00
Brian Paul
23a911b4a6 i965: added null const_buffer pointer check in update_constant_buffer() 2009-04-10 08:36:19 -06:00
Brian Paul
ded05d32d5 intel: added screen->dri2.loader null pointer check in intel_flush()
Fixes segfaults when rendering to front buffer.
2009-04-10 08:36:19 -06:00
Brian Paul
88999de8b7 gallium: remove pipe_texture::compressed field
The format field encodes compressed vs. uncompressed already.  We can easily
check if a texture is compressed with pf_is_compressed(texture->format).
2009-04-10 08:05:10 -06:00
José Fonseca
0a2269703c wgl: Slightly simplify pixelformat creation. 2009-04-10 13:26:36 +01:00
José Fonseca
f8f4b03442 progs: Port glxinfo to wgl. 2009-04-10 13:26:35 +01:00
José Fonseca
46857f3c66 mesa: Don't define WGL_ARB_extensions_string in mesa_wgl.h.
It breaks wglext.h as it doesn't define PFNWGLGETEXTENSIONSSTRINGARBPROC.
2009-04-10 13:26:35 +01:00
José Fonseca
87b04ce59b wgl: Move pixel format information into device structure. 2009-04-10 13:26:35 +01:00
José Fonseca
3f2420e2e0 wgl: Combine alpha pixelformat info in color. 2009-04-10 13:26:35 +01:00
José Fonseca
2921a49033 stw: Reorder the pixelformats, so that no alpha pixelformats get chosen before alpha.
Some applications might not handle a alpha visual when when they did not
request for one.
2009-04-10 13:26:35 +01:00
José Fonseca
0dd81ec97b stw: Don't make assumptions about integer size. 2009-04-10 13:26:34 +01:00
José Fonseca
f14497a9cd stw: Free the mesa framebuffer. 2009-04-10 13:26:34 +01:00
Michal Krol
5fae9514c2 tgsi/sse2: Cleanup NRM/NRM4 implementation.
Fix comments.
Make sure .w is set to 1.0 for NRM.
Optimise for non-.xyzw writemasks.
2009-04-10 11:58:49 +02:00
Michal Krol
05c70f8f5d rtasm: Silence `static function not used' warning. 2009-04-10 09:07:22 +02:00
Michal Krol
13be57df3a draw: Silence pointer-to-integer cast warning. 2009-04-10 09:07:19 +02:00
Michal Krol
f4cc0692e6 draw: Fix vertex_header initialisation. 2009-04-10 09:07:17 +02:00
Brian Paul
6c2d1e6839 swrast: remove some unneeded CHAN_TYPE!=GL_FLOAT code 2009-04-09 20:37:48 -06:00
Brian Paul
92d3b2a4da gallium: comments for surface_copy(), surface_fill() in p_context.h 2009-04-09 18:40:24 -06:00
Brian Paul
20f3497e4b i965: re-org of some of the new constant buffer code
Plus, begin the new code for vertex shader const buffers.
2009-04-09 18:37:03 -06:00
Brian Paul
08a1e1ebcb demos: fix aspect ratio in Reshape() 2009-04-09 17:04:58 -06:00
Brian Paul
2078e6cf55 i965: new SURF_INDEX_ macros
Used to map drawables, textures and constant buffers to surface binding
table indexes.
2009-04-09 17:04:09 -06:00
Brian Paul
7e0d4598fb gallium: change // comment to /* */ style 2009-04-09 16:10:43 -06:00
Brian Paul
985e71866a gallium: updated comments in p_screen.h 2009-04-09 16:03:50 -06:00
Brian Paul
a35e745826 i965simple: remove pipe_texture::compressed reference 2009-04-09 15:33:09 -06:00
Michal Krol
c27c670ad8 tgsi/sse2: Fix build. 2009-04-09 23:24:57 +02:00
Michal Krol
5f31890861 draw: Fix LIT instruction. 2009-04-09 23:19:22 +02:00
Ian Romanick
6a6e478e55 intel / DRI2: Accept fake front-buffer from loader
Handle the loader returning a fake front-buffer.  Since the driver
never specifically requests a fake front-buffer, the driver assumes
that it will never receive both a fake and a real front-buffer.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-09 14:18:14 -07:00
Ian Romanick
e6386e0d9a DRI2: Assume that there is always a front buffer
Assume that the front-buffer exists even if the server didn't tell the
client that it exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-09 14:18:14 -07:00
Ian Romanick
43cf0d1eeb intel / DRI2: Track and flush front-buffer rendering
Track two flags:  whether or not front-buffer rendering is currently
enabled and whether or not front-buffer rendering has been enabled
since the last glFlush.  If the second flag is set, the front-buffer
is flushed via a loader call back.  If the first flag is cleared, the
second flag is cleared at this time.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-09 14:18:14 -07:00
Ian Romanick
82634ee8df DRI2: Provide an interface for drivers to flush front-buffer rendering
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-09 14:18:14 -07:00
José Fonseca
c09ef3e747 python: Fix bad pointer. 2009-04-09 22:11:48 +01:00
Brian Paul
311f77198e st: remove another unneeded 'is compressed' comparison 2009-04-09 15:02:48 -06:00
Brian Paul
1f4a7f3a2e st: remove unneeded "is compressed" check
The format indicates compressed vs. uncompressed.
2009-04-09 15:02:48 -06:00
Brian Paul
e53d6ab39b st: rearrange some code to be a little more clear 2009-04-09 15:02:48 -06:00
Brian Paul
227aa0070d gallium: remove unneeded compressed=0 assignment 2009-04-09 15:02:48 -06:00
Brian Paul
f97df61d26 gallium: remove unneeded compressed=0 assignment 2009-04-09 15:02:47 -06:00
Brian Paul
f122015674 st: remove comp_byte parameter to st_texture_create()
We can determine if the texture is compressed by checking the format.
2009-04-09 15:02:47 -06:00
Brian Paul
1ad2484f03 st: consolidate format->usage computation 2009-04-09 15:02:47 -06:00
Brian Paul
eaca19edbb st: add const qualifiers, use GL types 2009-04-09 15:02:47 -06:00
Brian Paul
d11d903c1b st: make loops over 3D texture slices a litte more intuitive 2009-04-09 15:02:47 -06:00
Brian Paul
5facd7986a st: reformatting and clean-ups in texture code 2009-04-09 15:02:47 -06:00
Michal Krol
790a18f2c2 tgsi/sse2: Fix ARL instruction. 2009-04-09 22:51:15 +02:00
Michal Krol
c54b219975 tgsi/sse2: Fix LIT instruction. 2009-04-09 22:51:13 +02:00
José Fonseca
7cfd3b3bdf trace: Dump the fence, not its pointer. 2009-04-09 21:28:31 +01:00
José Fonseca
16c9bb81fd wgl: Remove unused member. 2009-04-09 21:27:43 +01:00
José Fonseca
0da3a13d6a trace: Use 'flags' name consistently. 2009-04-09 21:27:03 +01:00
José Fonseca
7ea265888f gallium: Use "flags" consistently. 2009-04-09 21:26:15 +01:00
José Fonseca
fa2b9e4306 gdi: Use stw_* names. 2009-04-09 20:45:44 +01:00
José Fonseca
81660a44dc wgl: Use more stw_* names. 2009-04-09 20:45:43 +01:00
José Fonseca
4bbb5eb96a wgl: Use hooks instead of subclassing the window.
Subclassing the window is invasive: we might call an old window proc even
after it was removed. Glut and another bug just in the wrong time was
provoking this. Hooks don't have this problem.
2009-04-09 20:45:43 +01:00
Brian Paul
deff099215 mesa: fix potential recursive locking deadlock in _mesa_HashWalk()
If the walk callback called _mesa_HashRemove() we'd deadlock.
2009-04-09 10:53:43 -06:00
Brian Paul
3163ea1453 i965: free shader's constant buffer in brwDeleteProgram()
Fixes mem leak observed with texcombine test.
2009-04-09 10:33:16 -06:00
José Fonseca
564ba25386 wgl: Catch the attempt of releasing a context which is not current. 2009-04-09 15:22:15 +01:00
José Fonseca
858d3da441 wgl: Move the framebuffer list to the device. Avoid recursive locking. 2009-04-09 15:22:15 +01:00
José Fonseca
8ef4129003 wgl: More symbol naming normalization. 2009-04-09 15:22:15 +01:00
José Fonseca
d8ffccc80b stw: Use wglext.h's defines and prototypes. 2009-04-09 15:22:15 +01:00
José Fonseca
19068d93c8 stw: Normalize symbols prefix. 2009-04-09 15:22:15 +01:00
José Fonseca
7e563200b8 wgl: Add const qualifier to global constant data. 2009-04-09 15:22:15 +01:00
Brian Paul
8131123eff i965: set BRW_MASK_DISABLE flag in "send" instruction in brw_dp_READ_4()
This fixes the random results that were seen when fetching a constant
inside an IF/ELSE clause.  Disabling the execution mask ensures that all
the components of the register are written.
2009-04-08 19:37:33 -06:00
Brian Paul
43fc20e4e1 i965: clean-ups, debug code in brw_wm_glsl.c 2009-04-08 19:37:33 -06:00
Brian Paul
42cd3014f8 i965: init current_const[i].index = -1 2009-04-08 19:37:33 -06:00
Brian Paul
ed9ba19bbb i965: move the fetch_constants() call before setting conditional mod state
Before, the instruction's CondUpdate field was mistakenly effecting the
constant-fetch operation.

Fixes progs/glsl/bump.c demo.  But there are some other issues related
to condition flags and IF/ELSE that need investigation...
2009-04-08 19:37:33 -06:00
Brian Paul
f4468384b6 mesa: minor datatype changes in optimization code 2009-04-08 19:37:33 -06:00
Ben Skeggs
0da2781f2f nv50: adapt for new clear interface
this is so much nicer :)
2009-04-09 11:36:28 +10:00
Corbin Simpson
8648c26858 r300-gallium: Properly emit indexbufs.
This fixes hardlocks with anything using elts.
2009-04-08 15:31:04 -07:00
Corbin Simpson
b3639d43f2 r300-gallium: Add vertex shader constant emit. 2009-04-08 15:31:04 -07:00
Jakob Bornecrantz
b3c1c5cf2c mesa: Report name for missing s3tc functions 2009-04-09 00:13:10 +02:00
Jakob Bornecrantz
55ed2a7365 st: If the hw supports it do hw conversion of texture uploads 2009-04-09 00:13:10 +02:00
José Fonseca
71504c7700 python/retrace: Try to cope with failures creating textures. 2009-04-08 21:41:04 +01:00
José Fonseca
c89eba0f31 python: Don't try to finish a null fence. 2009-04-08 21:41:04 +01:00
José Fonseca
4342d6a91f python/retrace: Use colors on windows console. 2009-04-08 21:41:03 +01:00
Robert Ellison
23ad86cfb9 Mesa: allow suppression of debug messages in a debug build
For testing, it's very useful to be able to test on a debug build,
while suppressing the debug messages (messages that are by default
suppressed in a release build), in order to see the same behavior
that users of release builds will see.

For example, the "piglit" test suite will flag an error on
programs that produce unexpected output, which means that a
debug build will always fail due to the extra debug messages.

This change introduces a new value to the MESA_DEBUG
environment variable.  In a debug build, explicitly setting MESA_DEBUG
to "0" will suppress all debug messages (both from _mesa_debug() and
from _mesa_warning()).  (The former behavior was that debug
messages were never suppressed in debug builds.)

Behavior of non-debug builds has not changed.  In such a build,
_mesa_debug() messages are always suppressed, and _mesa_warning()
messages will be suppressed unless MESA_DEBUG is set *to any value*.
2009-04-08 11:10:46 -06:00
Alan Hourihane
a97c846d61 gallium: when using gl_PointCoord ensure we use the correct attribute. 2009-04-08 16:39:17 +01:00
José Fonseca
84e784665a python/retrace: Allow to specify the range of calls of interest. 2009-04-08 16:26:06 +01:00
José Fonseca
e0e5d5014e trace: Make calls dumping threadsafe. 2009-04-08 16:26:05 +01:00
José Fonseca
d2cdf6253c trace: Make call no global. 2009-04-08 16:26:05 +01:00
José Fonseca
c14562d3b1 python/retrace: Handle recent traces.
Try to keep backwards compatability with old traces as much as possible.
2009-04-08 16:26:05 +01:00
José Fonseca
aaea658dbe python: Fix method renaming. 2009-04-08 16:26:05 +01:00
José Fonseca
724929db3c python: Cope with null surfaces. 2009-04-08 16:26:05 +01:00
José Fonseca
923b4413a6 wgl: Integrate the trace driver on debug builds. 2009-04-08 16:26:05 +01:00
José Fonseca
927eb8fe4c trace: Simplify cast wrappers. 2009-04-08 16:26:05 +01:00
José Fonseca
7000b9d74a trace: Match pipe_context::clear prototype. 2009-04-08 16:26:04 +01:00
Brian Paul
a3277c542b gallium: handle the case of util_pack_z_stencil(format=PIPE_FORMAT_S8_UNORM)
Fixes failed assertion in glean fbo test.
2009-04-08 08:23:45 -06:00
Brian Paul
9f784647ad docs: bump Gallium version number 2009-04-08 08:23:45 -06:00
Brian Paul
f6b71d02c7 docs: updated Cell driver info 2009-04-08 08:23:45 -06:00
Brian Paul
ce01de5075 docs: more info for 7.4 release notes 2009-04-08 08:23:45 -06:00
José Fonseca
629700ed7e mesa: Don't attempt to free the dummy program. 2009-04-08 11:32:43 +01:00
Brian Paul
105758105a st: implement glCopyTexImage() for GL_DEPTH24_STENCIL8 internal format 2009-04-07 17:56:40 -06:00
Brian Paul
b7615e5240 st: implement GL_DEPTH_STENCIL format for glReadPixels and DrawPixels() 2009-04-07 17:32:29 -06:00
Brian Paul
fbcd78b5d1 softpipe: minor debug-help changes in softpipe_transfer_map() 2009-04-07 17:31:49 -06:00
Brian Paul
ac1ff1b9fe mesa: add another special/optimized case in _mesa_unpack_depth_span() 2009-04-07 17:31:14 -06:00
Brian Paul
228f20e324 swrast: fix point rendering function selection
Need to clamp default point size to min/max range before checking if it's one.
Fixes glean pointAtten test.
2009-04-07 13:44:13 -06:00
Brian Paul
d03053688f mesa: fix incorrect component ordering for sRGB8 texture fetch/store
This format is layered on MESA_FORMAT_RGB888 so the component order is
actually BGR.
Fixes glean pixelFormat failures.
2009-04-07 13:17:42 -06:00
Brian Paul
0f0e24f6ef glsl: enable the new linear scan register allocator code
Seems to b working well enough to enable all the time.
Optimizations can be disabled with "export MESA_GLSL=nopt" if needed.
2009-04-07 11:10:27 -06:00
Brian Paul
439909a87d docs: document the MESA_GLSL env var, other misc GLSL updates 2009-04-07 11:09:53 -06:00
Brian Paul
4069447f73 glsl: don't optimize program if MESA_GLSL=nopt 2009-04-07 11:01:15 -06:00
Brian Paul
3e79d65083 swrast: restore !shader check around add_specular()
Fixes a regression from commit 76ac75af8e.
2009-04-07 07:04:14 -06:00
Corbin Simpson
799f43f2e0 r300-gallium: vs: Add MAD. 2009-04-06 23:36:34 -07:00
Corbin Simpson
00bb3deed2 r300-gallium: vs: Add MUL. 2009-04-06 23:26:38 -07:00
Corbin Simpson
6a1be41af9 r300-gallium: Fix surface_copy too. 2009-04-06 23:25:27 -07:00
Corbin Simpson
ffbf3f4952 r300-gallium: Properly setup HW/SW TCL controls.
This keeps non-TCL chipsets from locking up, and also fully unbreaks
RADEON_NO_TCL rendering.
2009-04-06 23:18:56 -07:00
Brian Paul
3630da9916 swrast: more texcombine clean-ups 2009-04-06 21:37:20 -06:00
Brian Paul
1b2ab02367 swrast: asst. clean-ups in texcombine code 2009-04-06 20:08:43 -06:00
Brian Paul
76ac75af8e swrast: fix secondary color add for glBitmap
Also, clean up the logic involved in choosing per-vertex vs. per-fragment
primary+secondary color addition.
2009-04-06 17:18:58 -06:00
José Fonseca
b4c0e1f9e1 stw: Choose a color buffer format that matches the visual.
The massive ifs are ugly, but it's not worth to automate this for just a
handful of formats.

Fixes conform bcolor.c.
2009-04-06 23:09:02 +01:00
Brian Paul
f4d744af24 softpipe: clean up the buffer clear and tile cache code a little 2009-04-06 15:31:58 -06:00
Brian Paul
87c356a222 swrast: fix incorrect arithmetic for GL_ADD_SIGNED/GL_COMBINE4_NV mode 2009-04-06 14:38:09 -06:00
Brian Paul
89276e2aaf st: as with swrast, interpret texture border color according to texture format
Depending on the hardware driver this might not be needed, but it will
cause no harm.
2009-04-06 14:06:08 -06:00
Brian Paul
a07e68df68 st: rename a helper function 2009-04-06 14:00:03 -06:00
Brian Paul
b48eb05f1f swrast: fix texture border color interpretation
The texture border color must be interpreted according to the texture's
base format.  For example, for a GL_ALPHA texture, sampling the border
color should return (0,0,0,borderAlpha).  This wasn't an issue here until
I removed the legacy texenv code (we always use the combiner path now).
2009-04-06 13:53:46 -06:00
José Fonseca
8332925c3c mesa: Fix orientation adjustment for reading stencil pixels.
Fixes conform spcorner.c & spclear.c failure.
2009-04-06 20:38:37 +01:00
Eric Anholt
6b187cc8a5 intel: Avoid dri2 GetBuffers round-trips for internal Viewport calls.
This gets us the savings for driver-internal viewport calls that
dd1c68f151 was attempting, without relying
on Xlib internals or clients handling X events.
2009-04-06 11:17:25 -07:00
Eric Anholt
e7aef006e5 i965: Use GTT maps when available to upload vertex arrays and system VBOs.
This speeds up OA on my GM45 by 21% (more than the original CPU cost of
the upload path).  We might still be able to squeeze a few more percent out
by avoiding repeatedly mapping/unmapping buffers as we upload elements into
them.
2009-04-06 10:58:52 -07:00
Eric Anholt
5cca1ceb81 intel: Clean up some a leftover from sedding of bufmgr context->screen move. 2009-04-06 10:31:13 -07:00
José Fonseca
2d56d0839e r300-gallium: Skeleton for integrating into the python statetracker. 2009-04-06 15:51:27 +01:00
Michel Dänzer
e798bf8053 radeon: Expose a 32 bit RGBA fbconfig even when the screen depth is 16.
Otherwise current xserver / libGL no longer expose a 32 bit RGBA GLX visual,
and compiz fails.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=20479 .
2009-04-06 08:59:57 +02:00
Corbin Simpson
36ae0766b9 r300-gallium: vp: Moar. 2009-04-05 02:05:08 -07:00
Corbin Simpson
84d76607ec r300-gallium: vs: Use a tab to properly set up OVM. 2009-04-05 01:32:55 -07:00
Corbin Simpson
50ee103cf0 r300-gallium: Re-translate shaders if constants change. 2009-04-05 01:32:28 -07:00
Corbin Simpson
ce7963f338 r300-gallium: Properly interface with Draw for vert shaders. 2009-04-05 01:00:25 -07:00
Corbin Simpson
484795ff14 r300-gallium: Update state handlers/setters for vertex shaders. 2009-04-05 00:15:19 -07:00
Corbin Simpson
316b244ff1 r300-gallium: vs: Moar vert shaders. 2009-04-04 23:44:37 -07:00
Corbin Simpson
7cd535b478 r300-gallium: vs: Expand instruction emission. 2009-04-04 22:57:45 -07:00
Corbin Simpson
a4a853e593 r300-gallium: Update clear() code.
We have a huge optimization opportunity, but for now we'll just use the util.
2009-04-04 22:30:14 -07:00
Brian Paul
7a164411ab cell: update clear() code to catch up to gallium changes 2009-04-04 13:45:54 -06:00
Michal Krol
1bf6af141f python/regress: Clean up driver clear() interface. 2009-04-04 21:16:37 +02:00
Michel Dänzer
eb168e26aa gallium: Clean up driver clear() interface.
Only allows clearing currently bound buffers, but colour and depth/stencil in
a single call.
2009-04-04 19:01:51 +02:00
Michel Dänzer
ba14b043bc gallium: Add utility helper for packing combined depth/stencil values. 2009-04-04 16:04:59 +02:00
Michal Krol
b0ce915186 python/regress: Remove trailing whitespace. 2009-04-04 13:42:31 +02:00
Michal Krol
4661817dac python/regress: Initial fragment shader test suite. 2009-04-04 13:35:53 +02:00
Michal Krol
2d8bf51ffc python/regress: Use X8R8G8B8 rendertarget in vertex shader test. 2009-04-04 13:35:51 +02:00
Corbin Simpson
024817649f radeon: A bit of indent and line break cleanup. 2009-04-04 02:43:09 -07:00
Corbin Simpson
48688e5e8f r300-gallium: Calculate vert shader inputs for HW TCL.
This is definitely not perfect.
2009-04-04 02:38:13 -07:00
Corbin Simpson
21f1cdbe07 radeon: If the CS emit fails, dump it to stderr. 2009-04-04 02:20:29 -07:00
Corbin Simpson
23639ddbae r300-gallium: Fix bad register write. 2009-04-04 02:19:48 -07:00
Corbin Simpson
5c50218d00 r300-gallium: Move swtcl_emit to render to reflect its true purpose. 2009-04-04 02:12:30 -07:00
Corbin Simpson
b7ffe1e876 Add scons build support for radeon/r300. 2009-04-04 00:36:05 -07:00
Corbin Simpson
d6fd672bf9 radeon: Fix compile warnings, compile errors. 2009-04-04 00:36:05 -07:00
Corbin Simpson
be1dbba0a4 r300-gallium: Clean up compile warnings and strict compile errors. 2009-04-04 00:36:04 -07:00
Corbin Simpson
a7dc04fa73 r300-gallium: r500 surface_copy fragment shader. 2009-04-04 00:36:04 -07:00
Brian Paul
4d363cc16d intel: #include texgetimage.h 2009-04-03 17:43:03 -06:00
Brian Paul
a4bec69e72 mesa: move glGetTexImage(), glGetCompresssedTexImage() code into new file 2009-04-03 17:42:22 -06:00
Brian Paul
c7eb423c49 mesa: remove the noClamp parameter to _mesa_pack_rgba_span_float()
It was only set to GL_TRUE in one place where it isn't really needed
(glGetTexImage(sRGB format)).
2009-04-03 17:28:35 -06:00
Brian Paul
35d88e1ac2 mesa: clamp colors to [0,1] for glGetTexImage() when format is GL_LUMINANCE
For luminance, we add R+G+B and it seems we should always clamp in case.
2009-04-03 17:10:31 -06:00
Brian Paul
b7cb6650c1 mesa: whitespace and comment clean-up 2009-04-03 16:51:04 -06:00
Brian Paul
a5ce781282 mesa: remove extra semicolons 2009-04-03 16:37:36 -06:00
Brian Paul
5d3b1494b6 softpipe: add additional surface formats in tile cache code 2009-04-03 15:43:13 -06:00
Brian Paul
80197a0c1b mesa: in mesa_add_named_constant(), avoid adding duplicate constants 2009-04-03 15:42:14 -06:00
Brian Paul
866bdd0509 mesa: fix parameter counting in ARB vertex/fragment program parsing
Duplicated unnamed constants were getting counted more than once.
2009-04-03 15:41:10 -06:00
Brian Paul
a4173956eb mesa: replace >= with > when testing if we've exceeded max local params
Now a program that uses 256 locals works as it should.
2009-04-03 13:48:43 -06:00
Brian Paul
ce461ffc5a mesa: only clear matrix MAT_DIRTY_INVERSE flag when we actually compute the inverse
If _math_matrix_analyse() got called before we allocated the inverse
matrix array we could lose the flag indicating that we needed to compute
the inverse.  This could happen with certain vertex shader cases.
2009-04-03 12:49:03 -06:00
Brian Paul
b8a200ac9d mesa: for OPCODE_LIT, use _mesa_pow() instead of exp() and log()
Also, s/pow/_mesa_pow/
2009-04-03 11:06:27 -06:00
Michal Krol
a7b6a28b0c python/regress: Use A8R8G8B8 rendertarget format. 2009-04-03 18:55:28 +02:00
Brian Paul
7391ba1e9d mesa: rename some gl_light fields to be clearer
EyeDirection -> SpotDirection
_NormDirection -> _NormSpotDirection
2009-04-03 10:09:28 -06:00
Brian Paul
650d147289 mesa: don't normalize spot light direction until validation time
In glLight() we're only supposed to transform the direction by the modelview
matrix, not normalized it too.
2009-04-03 10:09:27 -06:00
Michal Krol
be4c2d9a33 python/regress: vertex shader srcmod swz test does not use TEMP[0]. 2009-04-03 17:55:21 +02:00
Michal Krol
e3d5e0aead tgsi/exec: Actually enable switch-case for FLR. 2009-04-03 17:26:01 +02:00
Brian Paul
cbd305394a i965: remove unused var 2009-04-03 09:08:00 -06:00
Brian Paul
29ae40f5dc glx: remove unused local var in determineTextureFormat() 2009-04-03 09:07:04 -06:00
Brian Paul
5c5d78e191 mesa: replace assertion with conditional in _mesa_opcode_string() 2009-04-03 09:07:04 -06:00
Brian Paul
0139637975 i965: more const buffer debug code 2009-04-03 09:07:04 -06:00
Brian Paul
21982a2cd5 i965: added brw_same_reg() 2009-04-03 09:07:04 -06:00
Brian Paul
a330a6fcd0 i965: s/GL_FALSE/BRW_COMPRESSION_NONE/ 2009-04-03 09:07:04 -06:00
Brian Paul
1e299ff828 i965: another checkpoint commit of new constant buffer support
Everything is in place now for using a true constant buffer for GLSL fragment
shaders.  Still some bugs to find though.
2009-04-03 09:07:04 -06:00
Brian Paul
30adf05181 i965: fix response length param in brw_dp_READ_4()
We were accidentally clobbering the next register.
2009-04-03 09:07:04 -06:00
Brian Paul
3423986243 i965: change args to get_src_reg() to prep for new constant buffer support 2009-04-03 09:07:04 -06:00
Brian Paul
597cd5b94e i965: check-point commit of new constant buffer support
Currently, shader constants are stored in the GRF (loaded from the CURBE
prior to shader execution).  This severly limits the number of constants
and temps that we can support.

This new code will support (practically) unlimited size constant buffers
and free up registers in the GRF.  We allocate a new buffer object for the
constants and read them with "Read" messages/instructions.  When only a
small number of constants are used, we can still use the old method.

The code works for fragment shaders only (and is actually disabled) for now.
Need to do the same thing for vertex shaders and need to add the necessary
code-gen to fetch the constants which are referenced by the shader
instructions.
2009-04-03 09:07:04 -06:00
Brian Paul
ba8b25a46c i965: remove unused code for sampling a constant buffer 2009-04-03 09:07:04 -06:00
Brian Paul
8c093a1fb0 i965: code to setup a constant buffer sampler
This code won't actually be used and will be removed in a subsequent commit.
Just committing for posterity.
2009-04-03 09:07:04 -06:00
Brian Paul
a9c62a2340 i965: do negation and Abs in get_src_reg_imm()
Fixes regression seen with progs/glsl/bump.c
2009-04-03 09:07:04 -06:00
Brian Paul
5f1ce6b87e i965: comments 2009-04-03 09:07:03 -06:00
Brian Paul
ed8f54aa65 i965: code to debug/dump instruction immediates 2009-04-03 09:07:03 -06:00
Brian Paul
1ee0e22646 i965: minor code movement, new comment 2009-04-03 09:07:03 -06:00
Brian Paul
8127e49b93 i965: added new brw_dp_READ_4() function
Used to read float[4] vectors from the constant buffer/surface.
2009-04-03 09:07:03 -06:00
Brian Paul
6b18a8d3e7 i965: new and updated comments 2009-04-03 09:07:03 -06:00
Brian Paul
264058f38a mesa: more error message info 2009-04-03 09:07:03 -06:00
Brian Paul
f5a4d20e4a mesa: clean up formatting and use 'return' instead of 'break' consistantly 2009-04-03 09:07:03 -06:00
Brian Paul
1146d40b9c i965: comments for brw_SAMPLE() 2009-04-03 09:07:03 -06:00
Brian Paul
e1a1a5a638 i965: comments for sampling code 2009-04-03 09:07:03 -06:00
Brian Paul
154cd7a723 i965: add support for float literal instruction operands
Call the get_src_reg_imm() function when it's permissible to generate a
literal value src register.
2009-04-03 09:07:03 -06:00
Brian Paul
966cd4f1af i965: remove 'nr' param from get_src/dst_reg() functions
The value was always 1.
2009-04-03 09:07:03 -06:00
Brian Paul
f1b9a5cff1 i965: fix comment typo 2009-04-03 09:07:03 -06:00
Brian Paul
d5346a925c i965: comments, clean-up in prepare_wm_surfaces() 2009-04-03 09:07:03 -06:00
Brian Paul
5d7f3ae15c i965: remove unneeded #includes 2009-04-03 09:07:03 -06:00
Brian Paul
7709b26e6b i965: formatting clean-ups 2009-04-03 09:07:03 -06:00
Brian Paul
4999721022 i965: comments, whitespace changes 2009-04-03 09:07:03 -06:00
Brian Paul
c82851598f i965: rename scratch_buffer -> scratch_bo to be consistant with other buffers 2009-04-03 09:07:03 -06:00
Brian Paul
bf28b576cb i965: fix indentation 2009-04-03 09:07:03 -06:00
Brian Paul
9f146943ec i965: whitespace changes, comments 2009-04-03 09:07:03 -06:00
Michal Krol
dfab375c07 tgsi/text: Allow optional component selection for indirect registers. 2009-04-03 17:06:36 +02:00
Michal Krol
3b7c9a9a16 python/regress: vertex shader FRC test does not use IN[1]. 2009-04-03 16:37:34 +02:00
Michal Krol
37661516ea python/regress: Add relative addressing tests. 2009-04-03 16:37:13 +02:00
Michal Krol
d2ed91201e util/debug: Initialise local variables. 2009-04-03 14:59:25 +02:00
Michal Krol
cc770e0a0c tgsi/text: Allow -|src| variant of -(|src|). 2009-04-03 14:59:22 +02:00
Alan Hourihane
f7039fde4f mesa: ensure pbo stencil buffers are mapped before use 2009-04-03 12:49:53 +01:00
Michal Krol
016052c18f python/regress: Add vertex shader source modifier tests. 2009-04-03 08:27:50 +02:00
Christoph Bumiller
030533dd10 nv50: fix viewport state update 2009-04-03 08:33:19 +10:00
Roland Scheidegger
ebc1478e50 mesa: fix TexParameter functions
premature return in TexParameterf caused mesa to never call Driver.TexParameter
breaking drivers relying on this (fix bug #20966).
While here, also fix using ctx->ErrorValue when deciding to call
Driver.TexParameter. Errors are sticky and uncleared errors thus would cause
this to no longer get called. Since we thus need return value of
set_tex_parameter[if] can also optimize this to only call when value changed.
2009-04-02 23:38:34 +02:00
Brian Paul
7b9bf39543 mesa: don't call ctx->Driver.ReadPixels() if width or height is zero 2009-04-02 13:05:55 -06:00
Brian Paul
f6a3f1f52a mesa: don't call ctx->Driver.Draw/CopyPixels() if width or height is zero 2009-04-02 13:05:22 -06:00
Brian Paul
46d09cb53d glsl: fix segfault in linker when vertex or fragment shader was missing 2009-04-02 11:15:53 -06:00
Jakob Bornecrantz
29a1ed599b progs: Ignores 2009-04-02 17:00:25 +02:00
Michal Krol
39c2fae657 python/regress: Do not generate HTML summary for vertex shader test. 2009-04-02 12:21:50 +02:00
Thomas Hellstrom
96fd3df59a glx: MakeCurrent fixes.
1) If MakeContextCurrent is called with (NULL, None, None), Don't
   send the request to the X server if the current context is direct.
2) Return BadMatch in some error cases according to the glx spec.
3) If MakeContextCurrent is called for a context which is current in
   another thread, return BadAccess according to the glx spec.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-02 11:33:20 +02:00
Thomas Hellstrom
8e753d0404 dri glx: Fix dri_util::driBindContext
1) Don't error-check here. It's done in glx makeCurrent.
2) Allow ctx and the dri drawables to be NULL for future use. This is
   currently blocked in glx makeCurrent.
3) Avoid updating dri drawables unless they are completely uninitialized.
   Since the updating was done outside of the lock, the driver need to
   verify and redo it anyway.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-02 11:33:19 +02:00
Thomas Hellstrom
c952b3e907 dri glx: Propagate driver MakeCurrent errors.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-02 11:33:19 +02:00
Michal Krol
fbabeb9b56 python/regress: Do not create zbuf for vertex shader test. 2009-04-02 10:00:11 +02:00
Michal Krol
336a4f84e8 python/regress: Add more vertex shader test cases. 2009-04-02 10:00:09 +02:00
Brian Paul
bd32640f77 swrast: remove unused integer lerp functions 2009-04-01 20:24:23 -06:00
Brian Paul
7fbae9f41d mesa: get rid of gl_texture_object::_BorderChan 2009-04-01 20:24:23 -06:00
Brian Paul
79c55e55f8 dri: use BorderColor instead of _BorderChan 2009-04-01 20:24:23 -06:00
Brian Paul
7aed2b0c30 swrast: remove old texture_apply() code; always use texture combine code 2009-04-01 20:24:22 -06:00
Brian Paul
84b24efe8d swrast: fix bad optimization check 2009-04-01 20:24:22 -06:00
Brian Paul
0d8d904823 swrast: remove unused parameter 2009-04-01 20:24:22 -06:00
Brian Paul
aef2e1c1dc swrast: minor improvements, clean-ups in texcombine code 2009-04-01 20:24:22 -06:00
Brian Paul
efe3d10aea mesa: simplify ycbcr->rgb conversion code 2009-04-01 20:24:22 -06:00
Brian Paul
611128365d mesa: convert more texture fetch functions to return GLfloat 2009-04-01 20:24:22 -06:00
Brian Paul
cb5bd7d4d4 mesa: switch texel fetch functions from GLchan to GLfloat 2009-04-01 20:24:22 -06:00
Brian Paul
0695413d2b swrast: use float4_array typedef to simplify the code a bit 2009-04-01 20:24:22 -06:00
Brian Paul
bd9b2be828 mesa: texture combine clean-ups
Use MAX_COMBINER_TERMS instead of 4.
Rename some vars.
Update comments.
2009-04-01 20:20:03 -06:00
Brian Paul
a35ad020f9 swrast: refactor depth/shadow sampling code 2009-04-01 20:17:19 -06:00
Brian Paul
933f3b13c3 swrast: general clean-up of texture combine code 2009-04-01 20:17:19 -06:00
Brian Paul
de2afd8688 swrast: do texture sampling/combining in floating point
The code's cleaner and a step toward supporting float-valued texture sampling.
Some optimizations for common cases can be added and re-enabled...
2009-04-01 20:17:19 -06:00
Brian Paul
f8304bf1ed demos: added progs/glsl/linktest.c to test linking of separate compilation units 2009-04-01 19:54:35 -06:00
Brian Paul
49fb750a68 glsl: implement compiling/linking of separate compilation units
A shader program may consist of multiple shaders (source code units).
If we find there are unresolved functions after compiling the unit that
defines main(), we'll concatenate all the respective vertex or fragment
shaders then recompile.

This isn't foolproof but should work in most cases.
2009-04-01 19:54:35 -06:00
Brian Paul
1ab225017e mesa: use correct tex unit lod bias for TXB instruction 2009-04-01 18:50:07 -06:00
Brian Paul
9cc79fc2dc swrast: fix glDrawBuffer(GL_FRONT_AND_BACK)
We weren't putting the right colors into the back buffer in this mode.
2009-04-01 18:44:15 -06:00
Brian Paul
e4b27b4a69 mesa: fix a recursive display list problem
This fixes an issue when compiling glCallList() into another display list
when the mode is GL_COMPILE_AND_EXECUTE.

Before, the call to glCallList() called _mesa_save_CallList() which called
neutral_CallList() which then called _mesa_save_CallList() again.  In the
end, the parent display list contained two calls to the child display list
instead of one.

Let's be on the lookout for regressions caused by this change for a while
before we cherry-pick this elsewhere.
2009-04-01 17:39:26 -06:00
Corbin Simpson
935e6b1924 r300-gallium: Translate vertex shader magic numbers. 2009-04-01 15:52:32 -07:00
Corbin Simpson
28fa809c9e r300-gallium: Fix compiler warnings.
"const" is the right keyword, but I can't do that without adding a bunch
of really annoying and ugly const casts everywhere, and frankly,
that's really stupid, so instead, just don't make them const.
2009-04-01 15:24:28 -07:00
Corbin Simpson
c4fb791909 r300-gallium: Add vertex shader for surface_copy. 2009-04-01 15:14:19 -07:00
José Fonseca
8d72caea3f util: Fix x86_64 build. 2009-04-01 22:05:07 +01:00
José Fonseca
346e127732 util: Lookup symbol names from addresses.
Nice for stack backtraces.

Windows-only for now.
2009-04-01 21:29:58 +01:00
Michal Krol
d11a476ead tgsi: Fix structure members initialisation. 2009-04-01 22:06:53 +02:00
Michal Krol
4900545bba python/regress: Add vertex shader LRP test. 2009-04-01 16:06:22 +02:00
Michal Krol
16c281dfb5 python/regress: Add vertex shader FRC test. 2009-04-01 16:06:20 +02:00
Brian Paul
f8dd6594bf glsl: fix texgen state variable tokens in emit_statevars()
This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays.
See bug 20986.
2009-04-01 07:37:08 -06:00
Brian Paul
2555bed7fc mesa: minor tweaks in append_token() for printing state var strings 2009-04-01 07:37:08 -06:00
Michal Krol
daec1035a2 tgsi: Lookup alternate instruction mnemonics when parsing tgsi text. 2009-04-01 11:49:55 +02:00
Michal Krol
1aa4b79dc7 tgsi: Provide alternate instruction mnemonics in tgsi info. 2009-04-01 11:45:25 +02:00
Michal Krol
9d77663abb tgsi/doc: Fix typo. 2009-04-01 11:25:58 +02:00
Michal Krol
998234ced2 python/regress: Add vertex shader EX2 test. 2009-04-01 11:25:02 +02:00
Michal Krol
449bab61b3 python/regress: Add vertex shader DST test. 2009-04-01 11:09:37 +02:00
Michal Krol
65cbe7e69c python/regress: Fix vertex shader XPD test. 2009-04-01 11:08:41 +02:00
Michal Krol
dd6f1771c9 python/regress: Indent. 2009-04-01 10:58:46 +02:00
Michal Krol
5d8677469b python/regress: Add vertex shader test for XPD. 2009-04-01 10:56:53 +02:00
Michal Krol
541d74423a python/regress: Rename test files from *.txt to *.sh -- won't be .gitignored. 2009-04-01 10:34:08 +02:00
Michal Krol
e8b5d170ab python/regress: Add more vertex shader tests. 2009-04-01 10:34:05 +02:00
Corbin Simpson
27d886ae33 r300-gallium: Backwards test.
Wow, how long's that been there? Embarrassing.
2009-03-31 20:24:50 -07:00
Corbin Simpson
7540c847f1 r300-gallium: Moar vert shader emit. 2009-03-31 20:23:55 -07:00
Corbin Simpson
ddd0c94f04 r300-gallium: Add vertex shader emit. 2009-03-31 18:58:03 -07:00
Corbin Simpson
63529c731a r300-gallium: Stubs for vertex shaders. 2009-03-31 18:32:10 -07:00
Brian Paul
a44f54912e tgsi: added some helpful debug functions in the tgsi interpreter
Check for NaN/Inf, print exec vectors, print temp registers.
2009-03-31 16:21:51 -06:00
Brian Paul
919f57078b mesa: fix bug in GPU codegen for fixed-function two-sided lighting
The 'dots' register wasn't getting properly un-negated and un-swizzled
after emitting the code for back-face lighting.  So, if more than one
light source was enabled, the specular exponent for the next light source
was wrong.

During execution we were evaluating pow(x, y) where y was negative instead
of positive.  This led to the outcome being zero or NaN.

This fixes the occasional black triangles seen in isosurf when hacked to
enable two-sided lighting.
2009-03-31 16:21:51 -06:00
Brian Paul
ef6f1027ff draw: added Nan/Inf assertion in debug code 2009-03-31 16:21:51 -06:00
Brian Paul
d0f28b6dd9 softpipe: use util_is_inf_or_nan()
And print/warn NaN/Inf in print_vertex().
2009-03-31 16:21:51 -06:00
Brian Paul
3705d03b0f gallium: added util_is_inf_or_nan() function to u_math.h 2009-03-31 16:21:51 -06:00
Brian Paul
53d507562b mesa: minor reformatting, whitespace changes 2009-03-31 16:21:51 -06:00
Michal Krol
3f3db46911 python/regress: Initial commit for vertex shader regression tests. 2009-04-01 00:20:56 +02:00
Jeremy Huddleston
093ad509fc Updated CPU_TO_LE32 to work on darwin 2009-03-31 15:08:49 -07:00
Jeremy Huddleston
f25c6b164f Fix compiling indirect.c when GLX_DIRECT_RENDERING is not defined
(cherry picked from commit b65bc1b6cb)
2009-03-31 15:01:45 -07:00
José Fonseca
10b987ae7f python/test: New test for surface copies. 2009-03-31 19:16:17 +01:00
José Fonseca
89ecefb887 python/test: Ignore test output files. 2009-03-31 18:39:18 +01:00
José Fonseca
e2cdc99788 python/test: Cleanup. 2009-03-31 18:39:06 +01:00
José Fonseca
f784906eb9 python/test: Dump classification tree to text file too. 2009-03-31 18:38:48 +01:00
José Fonseca
fee78c0c1f python/test: Set executable permission bit. 2009-03-31 18:02:27 +01:00
José Fonseca
4d9dd3ecef python/test: New test for rendering into textures. 2009-03-31 18:01:32 +01:00
José Fonseca
fcc2598fff util: Enable assembly breakpointt on x86_64.
A breakpoint is much nicer than abort when gdb is attached.
2009-03-31 18:00:46 +01:00
José Fonseca
71384f29f1 python/test: Limit tree depth. 2009-03-31 17:23:48 +01:00
José Fonseca
65554af5c3 python/test: Infer type (continuous/discrete) from object type. 2009-03-31 17:21:52 +01:00
José Fonseca
bdfc411b44 python/test: Flush stdout to keep in sync with debug info on stderr. 2009-03-31 16:39:11 +01:00
José Fonseca
10b808156b python/test: Dump a classification tree of the results when finished testing. 2009-03-31 16:38:03 +01:00
José Fonseca
6dd0a5f3d6 python/test: New test for texture transfers. 2009-03-31 12:29:13 +01:00
José Fonseca
7d5d5a6cb7 python/test: More descriptive test name. 2009-03-31 12:29:13 +01:00
José Fonseca
b4b4986f1f python: Make get/put_tile_raw more user friendlier. 2009-03-31 12:29:13 +01:00
José Fonseca
e848a86dba python: Add nblocksx/y members to surfaces. 2009-03-31 12:29:13 +01:00
José Fonseca
382306c573 gallium: Move pf_is_depth_stencil to p_format.h. 2009-03-31 12:29:13 +01:00
Roland Scheidegger
4d89eff0b6 fix ugly copy/paste error in mipmap generation code 2009-03-31 03:19:29 +02:00
Corbin Simpson
3eeeaf04e3 r300-gallium: RGBA, not ARGB, after all.
Clearly, something else is wrong.
2009-03-30 17:31:58 -07:00
Corbin Simpson
aafbbf7744 r300-gallium: r500-fs: If recompiling a shader, overwrite old insts. 2009-03-30 17:20:12 -07:00
Corbin Simpson
70de577b14 r300-gallium: Properly redo shaders when constant buffer changes size. 2009-03-30 16:58:20 -07:00
Corbin Simpson
70d39c7053 r300-gallium: Allow surface_fill to clear depth/stencil buffers too. 2009-03-30 16:51:01 -07:00
Corbin Simpson
4bfe784dca r300-gallium: Emit the "right" sequence of colors.
ARGB, not RGBA.
2009-03-30 16:15:04 -07:00
Corbin Simpson
a56020fe17 r300-gallium: Fix hardlock when no colors or textures are present. 2009-03-30 15:50:09 -07:00
Corbin Simpson
7620b3943b r300-gallium: Fix strange build error.
Why didn't this come up before?
2009-03-30 15:47:00 -07:00
Corbin Simpson
458bfe7e8d r300-gallium: Handful of small leftovers. 2009-03-30 13:55:46 -07:00
Adam Jackson
37fb2d9b23 intel: Avoid mapping the texture image for CopyTex{,Sub}Image
We don't upload the pixels with the CPU in that case, so the map will
only serve as a way of triggering cache flushes over a bunch of data we
don't touch.
2009-03-30 16:32:11 -04:00
José Fonseca
f24ce49969 python: Use depth buffer in the triangle example. 2009-03-30 19:49:11 +01:00
José Fonseca
b4de7c4c5f python: Read rgba8 with a single transfer. 2009-03-30 19:48:30 +01:00
José Fonseca
ffaff2736f python: Cleanup. 2009-03-30 18:29:35 +01:00
José Fonseca
76d43ed4c9 python: Don't use deprecated clear_value field. 2009-03-30 18:26:40 +01:00
José Fonseca
5e815cf26f python/test: Move the test description logic to the base class. 2009-03-30 18:18:15 +01:00
José Fonseca
a8251d041a python/test: Move the image comparison logic to the base test class. 2009-03-30 17:51:55 +01:00
José Fonseca
af25470a54 python: Force unsigned comparison. 2009-03-30 17:19:11 +01:00
José Fonseca
844868048f python: Set correct transfer mode. 2009-03-30 17:19:10 +01:00
José Fonseca
28de69d681 python: Set the surface GPU access flags.
Make python surface just a dumb (texture, face, level, zslice) tuple.
2009-03-30 17:19:10 +01:00
José Fonseca
68342f9036 python: Hide away the surface usage flags.
Surfaces are now by definition GPU views. So CPU access flags don't make
any sense when creating a surface.

For now we are forcing surfaces to be GPU read/write, but that will go away
soon.
2009-03-30 17:19:10 +01:00
Michal Krol
e08a0f4790 tgsi: Condition codes are implied in KILP. 2009-03-30 17:13:52 +02:00
Michal Krol
bd4c1c133b tgsi: Explain symbols used in instruction set documentation. 2009-03-30 17:12:58 +02:00
Michal Krol
25e491e68c tgsi: Document BRA opcode. 2009-03-30 15:39:29 +02:00
José Fonseca
1c989c24ae python: Dont touch old pipe_winsys. 2009-03-30 14:24:20 +01:00
José Fonseca
29933fc6fe python: Update instructions for windows. 2009-03-30 14:11:03 +01:00
José Fonseca
a20bae3d17 scons: Get python extensions building correctly on windows. 2009-03-30 14:11:03 +01:00
Roland Scheidegger
a693a2998c i965: srgb texture fixes
i965 can either do SRGBA8_REV format or SARGB8 format, but not SRGBA8.
Could add SRGBA8_REV support to mesa, but simply use SARGB8 for now.
While here, also add true srgb luminance / luminance_alpha support -
unfortunately the published docs fail to mention which asics support
this, tested on g43 so assume this works on any g4x.
2009-03-28 02:06:49 +01:00
Roland Scheidegger
02a579f2e7 mesa: fix a glGetTexImage issue with base-converted texture formats
need to respect the user-supplied base format, not the one derived from
the texture format actually used.
2009-03-28 02:06:40 +01:00
Roland Scheidegger
79e2df63af i965: add support for signed rgba texture format 2009-03-28 02:06:18 +01:00
Roland Scheidegger
bb386a1eca mesa: add _rev signed rgba texture format 2009-03-28 02:03:45 +01:00
Roland Scheidegger
7d00ba195c glapi regenerate 2009-03-28 02:03:35 +01:00
Roland Scheidegger
05330b9cf3 glapi: remove a couple accidental GL_ prefixes 2009-03-28 02:02:49 +01:00
Roland Scheidegger
c6a6cc1918 mesa: add new signed rgba texture format
This is a (partial) backport of the signed texture format support in OGL 3.1.
Since it wasn't promoted from an existing extension roll our own.
2009-03-28 02:02:42 +01:00
Roland Scheidegger
a9bf5b5cca gl: add new OGL 3.1 enums to glext.h
This is just temporary until the upstream source is updated.
2009-03-28 02:02:35 +01:00
Roland Scheidegger
0d9a715cea gl: update glext.h to version 48 2009-03-28 02:02:28 +01:00
Roland Scheidegger
fd83289dbf fix various small intel blitter issues
use color format constants instead of magic numbers
remove handling of cpp 0 or 3 (neither is possible) in various places
don't misconfigure 8 bit surface blits as rgb565
2009-03-28 01:53:59 +01:00
José Fonseca
aa011836c2 wgl: Don't flush surface if it is NULL.
Just a quick fix to prevent segfaults with glean.
2009-03-27 21:43:24 +00:00
José Fonseca
c03000b73e wgl: Remove unused cruft. 2009-03-27 21:38:54 +00:00
José Fonseca
a790074810 util: Support Z24S8/Z24X8. 2009-03-27 20:23:16 +00:00
José Fonseca
e0a55dc9da mesa: Support Z24S8 wherever S8Z24 is supported. 2009-03-27 19:51:33 +00:00
Corbin Simpson
2431a027c1 r300-gallium: Add some surface_copy. 2009-03-27 12:41:51 -07:00
Corbin Simpson
aa91f05f9d r300-gallium: Use CMP for MOV on r300.
Doesn't quite fix problems, though. :c
2009-03-27 12:41:50 -07:00
José Fonseca
ec30d1b2e5 mesa: Use the python executable from sys.executable.
From Ramesh Dharan <rrdharan@vmware.com>
2009-03-27 19:13:21 +00:00
Carl-Johan Kjellander
c97e5e1fc1 egl: Fix newline typo in Makefiles 2009-03-26 19:20:11 +00:00
Brian Paul
2002e03a52 st: init the default texture to (0,0,0,1)
The default texture is used when a sampler uses an incomplete texture.
This change fixes the piglit fp-incomplete test.
2009-03-26 08:52:56 -06:00
Brian Paul
3673189326 tgsi: pass zero vector to texture sampler for 1D case instead of NULL
Fixes segfault when sampling 1D textures.
2009-03-26 08:40:07 -06:00
José Fonseca
a2f52f500c python: Don't bypass vs/clip/viewport by default. 2009-03-26 12:11:27 +00:00
José Fonseca
7138cd7009 python: Fix the texture test. 2009-03-26 12:04:15 +00:00
José Fonseca
bb84ce7159 python: Make swig bindings python independent. 2009-03-26 11:29:59 +00:00
José Fonseca
d18c2ee3d5 python: Drop st_buffer.
It adds nothing, now that pipe_buffer has a pointer to the screen.
2009-03-26 11:19:15 +00:00
José Fonseca
ca9d2044a2 python: Use pipe_buffer_read/write. 2009-03-26 11:16:56 +00:00
José Fonseca
f4520277e1 python: Transfer only the requested tile. 2009-03-26 11:16:56 +00:00
Michal Krol
6af3be4309 python: Fix tri sample. 2009-03-26 12:07:06 +01:00
Michel Dänzer
d332f8b4ef gallium: Remove some little-used fields from struct pipe_surface. 2009-03-26 10:53:47 +01:00
José Fonseca
6ce06f3fbc python: Pass transfers to the tile functions. 2009-03-25 21:47:17 +00:00
José Fonseca
8866ff4cac python: Catchup buffer_destroy interface change. 2009-03-25 21:47:17 +00:00
José Fonseca
57ea34214c trace: Defer the cast to after the check for enabled trace.
Prevents segfault when trace is disabled.
2009-03-25 21:47:17 +00:00
José Fonseca
e866cd7401 softpipe: Include declarations. 2009-03-25 21:47:17 +00:00
José Fonseca
573346da2a translate: Avoid unused variable warning. 2009-03-25 21:47:17 +00:00
Jakob Bornecrantz
e21d31e8ab st/egl: Set dpms to on when showing screens
There is a wonderful bug in 2.6.29 that causes a hard lock on my
	computer when this code is active for lvds that are turned off.
2009-03-25 21:06:40 +00:00
Jakob Bornecrantz
78abcb88fe st/egl: Fix warning 2009-03-25 21:06:40 +00:00
José Fonseca
de89c022d5 python: Show call no in image window. 2009-03-25 21:04:17 +00:00
José Fonseca
c847b45153 trace: Update readme.
Actually, the trace driver with the xlib statetracker is
still causing assertion failures here..
2009-03-25 21:04:12 +00:00
José Fonseca
58351b5023 trace: Number calls. 2009-03-25 21:04:05 +00:00
José Fonseca
710bcc8050 python/retrace: Use the call no when dumping images.
To make it easy associate images with the calls.
2009-03-25 21:03:44 +00:00
José Fonseca
ecfa99ece1 python: Use a sequential number to identify each call.
TODO: Modify the trace driver to generate these on the XML file itself.
2009-03-25 21:03:40 +00:00
José Fonseca
9d97c3d0be python/trace: Control the interpreter from command line options. 2009-03-25 21:03:38 +00:00
José Fonseca
5743483778 python: Use Ansi escape codes regardless of output is a tty or not. 2009-03-25 21:03:36 +00:00
José Fonseca
b52b78a226 python: List packages needed on debian systems. 2009-03-25 21:03:25 +00:00
José Fonseca
a6ad0c86ca python: Allow to dump all images to disk. 2009-03-25 21:03:22 +00:00
José Fonseca
8ca95d8121 python: Tweak instructions. 2009-03-25 21:03:20 +00:00
José Fonseca
ad5f9752ce python: s/pitch/stride/ 2009-03-25 21:03:15 +00:00
José Fonseca
5381331f97 python: s/num_cbufs/nr_cbufs/ 2009-03-25 21:03:10 +00:00
José Fonseca
ce518f4b0f wgl: Use right integer type. 2009-03-25 21:01:49 +00:00
José Fonseca
601a6a5839 wgl: Use SetWindowLongPtr. 2009-03-25 21:01:49 +00:00
José Fonseca
9fb46fb4c3 util: Use size_t (for x86_64). 2009-03-25 21:01:49 +00:00
José Fonseca
8c4bd92b68 util: Don't use x86 asm on x86_64. 2009-03-25 21:01:49 +00:00
José Fonseca
079be0fd3f draw: Use size_t (for x86_64). 2009-03-25 21:01:49 +00:00
José Fonseca
b3e03ede3e scons: Move MSVC specific away from Mingw builds. 2009-03-25 21:01:49 +00:00
Maciej Cencora
7860b0886c r300: cleanup swtcl a little
- remove disabled code
- silence compiler warnings (uinitialized values)
- remove unneeded code
2009-03-25 12:41:28 -07:00
José Fonseca
26e27ba308 scons: Support building with the Windows SDK.
x86_64 is also supported.
2009-03-25 19:24:49 +00:00
Brian Paul
33fa6a2755 egl: include stdint.h to get the c99 integer typedefs
Fixes breakage from commit 6dd9c22101
2009-03-25 13:02:44 -06:00
Alan Coopersmith
2e2f3b4086 Add Solaris to OS'es using X in eglplatform.h
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-25 11:10:03 -07:00
Alan Coopersmith
707c017af6 define __builtin_expect for non-gcc compilers in two more glx files
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-25 11:07:31 -07:00
Alan Coopersmith
ad11107206 Add #ifdefs needed to compile Gallium on Solaris with gcc or Sun cc
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-25 11:07:31 -07:00
Alan Coopersmith
6dd9c22101 Convert u_int*_t to C99 standard uint*_t
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-25 11:07:31 -07:00
Alan Coopersmith
3cf6e62ae3 mklib improvements for Solaris
Move flags for linking standard C/C++ libraries from configure.ac to mklib
Use -norunpath flag when linking with Sun C++ compiler
Convert mklib -exports list into a linker mapfile
Set FINAL_LIBS correctly when -noprefix is used

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-25 11:07:30 -07:00
Brian Paul
c10df26a31 glew: fix GLEW_LIB_NAME
This fixes rebuilding of the library every time we run make.
2009-03-25 09:01:01 -06:00
Michel Dänzer
11da7e02aa Revert "dri2: Avoid round-tripping on DRI2GetBuffers for the same set of buffers."
This scheme breaks when the display connection doesn't receive ConfigureNotify
events. This caused reporoducible problems (cropped / misplaced output) when
starting a 3D application in a guest operating system in VMware Workstation.

This reverts commit dd1c68f151.

Conflicts:

	src/glx/x11/dri2_glx.c
2009-03-25 15:53:28 +01:00
Brian Paul
4934ddf5d7 gl: update include/GL/glext.h to version 48 2009-03-25 08:33:10 -06:00
Brian Paul
66b0b200ee egl: don't use __FUNCTION__ in error messages 2009-03-25 08:18:28 -06:00
Alan Hourihane
7c8639e007 slang: ensure structure elements have their array length set 2009-03-25 14:17:33 +00:00
Corbin Simpson
def5660c9e r300-gallium: r300-fs: Moar. 2009-03-25 07:15:49 -07:00
Corbin Simpson
1db736f74a r300-gallium: Unify shader interfaces, enable r300 shader, start unbreaking.
progs/trivial/clear no longer is horrifically wrong, just kind of wrong.
2009-03-25 07:15:49 -07:00
Corbin Simpson
e36f01a7a1 r300-gallium: r500-fs: Remove unused variable. 2009-03-25 07:15:49 -07:00
Alan Coopersmith
ff421b6e0b r300_cmdbuf.c: convert cast to a form supported by Sun cc
Fixes Sun cc error:
"r300_cmdbuf.c", line 142: invalid cast expression

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-25 08:08:49 -06:00
Michel Dänzer
e101959b6a r300: Texture size limit cleanups.
Since core Mesa MAX_TEXTURE_LEVELS was bumped, we were incorrectly advertising
a maximum texture size of 4096 on older chips, causing corrupted menu text in
Extreme Tux Racer or Armagetron.

Also make sure our texture image array can actually hold all the mipmap levels
we support...
2009-03-25 11:19:05 +01:00
Keith Whitwell
e919bfa1f1 progs/vp: more psiz tests 2009-03-25 10:07:28 +00:00
Ben Skeggs
c306bf94d6 nv50: fix typo in nv50_query.c 2009-03-25 12:16:36 +10:00
Ben Skeggs
88b19bbe65 nouveau: fix some pipe_buffer reference counting issues 2009-03-25 12:09:58 +10:00
Alan Hourihane
0be8af8a39 mesa: bump MAX_PROGRAM_TEMPS to 256 (there's some big shaders out there) 2009-03-24 23:00:26 +00:00
Younes Manton
578af51610 nouveau: Frontbuffer needs to be marked as linear. 2009-03-24 18:57:06 -04:00
Brian Paul
c4c4358e08 demos: add LDFLAGS for corender target, bug 20844 2009-03-24 16:06:50 -06:00
Keith Whitwell
993b7e1d5c progs/vp: add pointsize + clamp test 2009-03-24 17:50:36 +00:00
Keith Whitwell
a4a0ba1adb mesa/st: bump gallium version to 0.3
To distinguish from the -0.2 version still being maintained on the
gallium-mesa-7.4 branch.  There are already greater interface changes
between these two branches than there were between -0.2 and -0.1.

Also stop injecting Tungsten into the vendor string - the Gallium in
the renderer string should be sufficient.
2009-03-24 16:38:27 +00:00
Keith Whitwell
eb9801ccfb progs/trivial: add fflushes for cygwin 2009-03-24 16:35:29 +00:00
Robert Ellison
cc8afbd386 i965: fix point rasterization when rendering to FBO
The FBO pixel coordinate system, with (0,0) as the
upper-left pixel, is inverted in Y compared to the
normal OpenGL pixel coordinate system, which has
(0,0) as its lower-left pixel.

Viewport and polygon stipple are sensitive to this
inversion; so is point rasterization.  The basic
fix is simple: when rendering to an FBO, instead
of the normal RASTRULE_UPPER_RIGHT that's
appropriate for OpenGL windows, use the Y inversion
RASTRULE_LOWER_RIGHT.

Unfortunately, current Intel documentation has this
value listed as "Reserved, but not seen as useful".
It does work on at least some i965-class devices,
though; and the worst that could happen if an
older device didn't support it would be incorrect
point rasterization to FBOs, which is what happens
already, so this fix is at least no worse than what
happens presently, and is better for some (and possibly
all) i965-class devices.
2009-03-24 10:01:23 -06:00
Keith Whitwell
2312f697a2 progs/trivial: draw non-interleaved arrays out of one vbo 2009-03-24 15:30:53 +00:00
Jakob Bornecrantz
39320c1bee progs/tests: Build texcompress2 with scons 2009-03-24 13:26:39 +01:00
Eric Anholt
699db6d842 i965: Fix glFrontFacing in twoside GLSL demo.
This also cuts instructions by just using the existing bit in the payload
rather than computing it from the determinant in the SF unit and passing it
as a varying down to the WM.  Something still goes wrong with getting the
backface color right, but a simpler shader appears to get the right result.
2009-03-23 22:52:51 -07:00
Eric Anholt
411d913cce i965: Fix fog coordinate g,b,a values when glFrontFacing isn't used.
Previously, we would sample (f,glFrontFacing,undef,undef) instead of the
(f,0,0,1) that fragment.fogcoord is supposed to return.  Due to
glFrontFacing's presence in FOGC.y, we'll still give bad results there when
glFrontFacing is used.

Bug #19122, piglit testcase fp-fog.
2009-03-23 22:52:17 -07:00
Eric Anholt
b013f945d8 i965: Clean up a bit of mess with unneeded variables in emit_interp. 2009-03-23 22:52:16 -07:00
Eric Anholt
bae07564c4 i965: Fix trailing "d" in debug output for 3DSTATE_VERTEX_ELEMENTS. 2009-03-23 22:28:00 -07:00
Eric Anholt
c0d6e07909 i965: Fix occlusion query when no other WM state updates occur.
Turns out that XXX comment was important.  We weren't flagging the WM to
re-update with the statistics enable, so we got zeroes out of our query.

Bug #20740, fixes piglit occlusion_query test.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-03-23 12:37:00 -07:00
Keith Whitwell
1a28750b43 vpglsl: add missing SConscript 2009-03-23 19:01:40 +00:00
Keith Whitwell
d0d5e6a22c draw: update aa points shader comment 2009-03-23 18:40:11 +00:00
Keith Whitwell
103a4bd711 progs/fp: pass texcoord to triangle, add a test shader 2009-03-23 18:39:36 +00:00
Michel Dänzer
e9d156e9e4 gallium: Remove remnants of reference counting internals outside of p_refcnt.h. 2009-03-23 18:03:13 +01:00
Jakob Bornecrantz
da96767c89 debug: Add function for writing transfers to files 2009-03-22 04:59:09 +01:00
Jakob Bornecrantz
1196885293 trace: Fix args to buffer write 2009-03-22 04:33:36 +01:00
José Fonseca
3708aaeaff util: Add a new macro for testing empty lists. 2009-03-23 12:05:07 +00:00
Brian Paul
bab6d6bfe9 softpipe: reformatting, comments, minor clean-ups 2009-03-22 18:11:12 -06:00
Brian Paul
0f82aa5f15 tgsi: minor comments 2009-03-22 18:10:10 -06:00
Michal Krol
699897e81c tgsi: Document KIL, KILP instructions. 2009-03-21 12:26:15 +01:00
Keith Whitwell
1bb60d25e0 gallium: remove remaining references to origin_lower_left 2009-03-21 10:55:45 +00:00
Michal Krol
d7b7b63bd7 st: Silence compiler warnings. 2009-03-21 11:46:54 +01:00
Brian Paul
401cbd0d23 gallium: remove use of origin_lower_left
This was used to indicate OpenGL's lower-left origin for fragment window
coordinates for polygon stipple and gl_FragCoord.

Now:
  - fragment coordinate origin is always upper-left corner
  - GL polygon stipple is inverted and shifted before given to gallium
  - GL fragment programs that use INPUT[WPOS] are modified to use an
    inverted window coord which is placed in a temp register.

Note: the origin_lower_left field still exists in pipe_rasterizer_state.
Remove it when all the drivers, etc. no longer reference it.
2009-03-20 20:29:07 -06:00
Brian Paul
1f45ae0813 mesa: add new internal state var for window size
Actually, window width - 1, height - 1
2009-03-20 20:29:06 -06:00
Brian Paul
12256fc2b2 mesa: linear scan register allocation for shader programs
This is a check-point commit; not turned on yet.

Use the linear scan register allocation algorithm to re-allocate temporary
registers.  This is done by computing the live intervals for registers and
reallocating temps with that information.

For some shaders this dramatically reduces the number of temp registers
needed.

For the time being we give up on a few cases such as relative-indexed temps
and subroutine calls (but we inline most GLSL functions anyway).
2009-03-20 17:15:21 -06:00
Brian Paul
c9caecaffa docs: updated Mesa extension enum info 2009-03-20 17:15:21 -06:00
Corbin Simpson
f411a66c06 r300-gallium: Misspelled macro name.
*pulls paper bag down over head*
2009-03-20 14:53:21 -07:00
Corbin Simpson
edfaa68609 r300-gallium: Put r300_cs_inlines to bed.
Guess it was a mistake in the first place. Oops.
2009-03-20 14:53:21 -07:00
Corbin Simpson
8066edb2a2 r300-gallium: Simplify/neaten up packet3.
Deck chairs on the Hindenburg. :3
2009-03-20 14:53:21 -07:00
Corbin Simpson
f142958084 r300-gallium: Clean up surface_fill, prep for surface_copy code. 2009-03-20 14:53:21 -07:00
Corbin Simpson
04fe31cd5e r300-gallium: Properly offset scissors.
As per r300_reg, classic Mesa, and xf86-video-ati.
2009-03-20 14:53:20 -07:00
Corbin Simpson
adb40a94b0 r300-gallium: Clean up r300_swtcl_emit.
Some compile warnings, some statements without effect.
2009-03-20 14:53:20 -07:00
Corbin Simpson
f3f5e04103 r300-gallium: Clean up some emit, and some state handlers. 2009-03-20 14:53:20 -07:00
Corbin Simpson
8852ac2b35 r300-gallium: A bit more invariant state. 2009-03-20 14:53:20 -07:00
José Fonseca
48f6e75489 gallium: Explain what happens if buffer_flush_mapped_range isn't called. 2009-03-20 18:34:24 +00:00
Keith Whitwell
210b468722 gallium/util: add upload manager helper module
Add a module that will manage uploading and coalescing multiple
user-buffers, malloc-buffers and other random data that doesn't
happen to be in a GPU buffer already.  The module stuffs multiple
little uploads into larger GPU buffers to reduce create/destroy
overheads, etc.
2009-03-20 18:07:11 +00:00
Eric Anholt
66175aac76 Fix DRI2 accelerated EXT_texture_from_pixmap with GL_RGB format.
This requires upgrading the interface so that the argument to
glXBindTexImageEXT isn't just dropped on the floor.  Note that this only
fixes the accelerated path on Intel, as Mesa's texture format support is
missing x8r8g8b8 support (right now, GL_RGB textures get uploaded as a8r8gb8,
but in this case we're not doing the upload so we can't really work around it
that way).

Fixes bugs with compositors trying to use shaders that use alpha channels, on
windows without a valid alpha channel.  Bug #19910 and likely others as well.

Reviewed-by:	Ian Romanick <ian.d.romanick@intel.com>
2009-03-20 10:41:28 -07:00
Michal Krol
cf0122e892 progs/wgl: Send a resize message after context have been created. 2009-03-20 16:48:54 +01:00
Michal Krol
d6e877d0d7 stw: Do not err on nil context handle in MakeCurrent(). 2009-03-20 16:36:23 +01:00
Michal Krol
9bbffcced4 progs/wgl: Create GL context in a thread that actually uses it. 2009-03-20 16:16:49 +01:00
Michal Krol
e8aa5a1018 progs/wgl: Make context current to get GL_RENDERER string. 2009-03-20 16:13:39 +01:00
Michal Krol
5465f3adf9 stw: Use u_handle_table to maintain context list. 2009-03-20 15:45:00 +01:00
Michal Krol
36e985e96e winsys/gdi: Init state tracker's per-thread data. 2009-03-20 13:06:28 +01:00
Michal Krol
4489f9efee stw: Keep per-thread storage for current context and pixel format. 2009-03-20 13:05:51 +01:00
Michal Krol
3d4246e22e slang: Use _mesa_snprintf() wrapper. 2009-03-20 12:19:40 +01:00
Alan Hourihane
114bb54324 slang: initialize the context 2009-03-19 22:38:01 +00:00
Alan Hourihane
e3aedec868 slang: support uniform arrays 2009-03-19 22:06:53 +00:00
Jakob Bornecrantz
c9a318a7c6 trace: Formalize on a standard for data size pair 2009-03-19 19:18:38 +01:00
Brian Paul
bbd208b60c glslcompiler: added new options to override debug/optimization pragmas 2009-03-19 10:29:13 -06:00
Brian Paul
65fc2ca82a glsl: change GLSL #pragma initialization
Initialize the shader's pragma settings before calling the compiler.
Added pragma "Ignore" fields to allow overriding the #pragma directives found
in shader source code.
2009-03-19 10:29:13 -06:00
Alan Hourihane
a57d7edf06 egl: fix comment 2009-03-19 15:39:01 +00:00
Alan Hourihane
9ed03af8c0 egl: try harder for eglGetProcAddress() 2009-03-19 15:37:25 +00:00
Brian Paul
214132adfe glsl: when debug pragma is on, emit comments about function calls/inlines
BTW, the debug pragma syntax is "#pragma debug(on)"
2009-03-19 09:26:20 -06:00
Alan Hourihane
264c3d218a mesa: check renderbuffer is defined before use. 2009-03-19 13:59:09 +00:00
Jakob Bornecrantz
9e84e7def1 st/gl: Only transfer needed parts in st_TexSubimage 2009-03-19 02:23:06 +01:00
Alan Hourihane
989856bde4 slang: if/else/break & if/else/continue work for unrolled loops 2009-03-19 10:17:30 +00:00
Michal Krol
1342664434 wgl: Add an `-s' option to wglthreads to force single-threaded operation. 2009-03-19 11:16:01 +01:00
Michal Krol
355e9bb45c swrast: Silence compiler warnings, give better structure to the code as a result. 2009-03-19 10:39:57 +01:00
Michal Krol
4b55a4f74d tgsi: Document vs_2_0 instruction set operations. 2009-03-19 09:53:34 +01:00
Michal Krol
7c50917b42 tgsi: Document vs_1_1 instruction set operations. 2009-03-19 09:53:31 +01:00
Michal Krol
a1f4b5d8b8 tgsi: Begin documenting ps_2_x instruction set operations. 2009-03-19 09:53:29 +01:00
Corbin Simpson
db83ee1647 r300-gallium: Emit viewport state.
Note that this will break you, hard, if you're not using RADEON_NO_TCL.
I really need to start vertex shaders soon.
2009-03-18 15:44:04 -07:00
Corbin Simpson
3a648d0cf2 r300-gallium: Viewport state storage. 2009-03-18 15:44:04 -07:00
Corbin Simpson
5b97ba4eb0 r300-gallium: Fixup registers for viewport state. 2009-03-18 15:44:04 -07:00
Brian Paul
a577471c54 mesa: use the IROUND() macro in pixel packing code
It turns out some tests are sensitive to rounding vs. truncating when
converting float color values to integers in glReadPixels().  In particular,
this matters when the destination format is 5/6/5 or 4/4/4/4, etc.
2009-03-18 15:45:38 -06:00
Alan Hourihane
cac1ce09ac slang: redo the last commit for if/break & if/continue tests as it
wasn't good enough for deeply nested if's.
2009-03-18 21:42:14 +00:00
Alan Hourihane
192b7bc706 Revert "slang: if we detect an if/break or if/continue within a loop and we're"
This reverts commit 752296b8f3.
2009-03-18 21:40:03 +00:00
Alan Hourihane
752296b8f3 slang: if we detect an if/break or if/continue within a loop and we're
trying to unroll, bail, and fallback to doing the real loop.
2009-03-18 21:17:35 +00:00
Keith Whitwell
08d44512e9 st: call _glapi_check_multithread from st_make_current
This function is called from many OS-dependent versions of MakeCurrent.

Move the check for multithreading to this central location to avoid
having to make this check from all the callers.
2009-03-18 19:14:45 +00:00
Thomas Hellstrom
caf99be999 stw: Fix makeCurrent.
Flush if we change current context.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-03-18 18:02:58 +00:00
José Fonseca
1f118c2557 progs: Build the wgl examples with scons. 2009-03-18 16:40:57 +00:00
Jakob Bornecrantz
3f17030d9c progs/trivial: Make quad-tex-sub repeat patterns 2009-03-18 17:27:34 +01:00
Brian Paul
4c460cfd2b tests: remove/update old comments 2009-03-18 10:24:19 -06:00
Brian Paul
0b0e2159f2 st: need to free/realloc pipe texture when we're handed image level > last_level
Fixes progs/tests/tri-fbo-tex-mip.c
2009-03-18 10:24:19 -06:00
Brian Paul
a0509f7d28 st: clean up some if-statment code 2009-03-18 10:24:19 -06:00
Brian Paul
9808ae688a softpipe: more texture transfer fixes.
Need to null-out pointers after freeing transfer objects.
Fix mix-ups between tc->transfer and tc->tex_trans fields.
2009-03-18 10:24:19 -06:00
Brian Paul
71e3aa14fb softpipe: need to set tc->transfer=NULL after destroying the transfer object
This fixes a number of crashes/regressions in programs such as lodbias.c,
mipmap_limits.c, etc.
2009-03-18 10:24:19 -06:00
Brian Paul
3151f5d75a st: update texture comments 2009-03-18 10:24:19 -06:00
Jakob Bornecrantz
87bcb328c1 progs/trivial: Add quad-tex-sub
Tests glTexSubImage
2009-03-18 17:17:45 +01:00
Dan Nicholson
13345a9540 Use the specified X11 headers for xlib mesa
The xlib build was using the system's Xlib headers or bombing if they
weren't available.
2009-03-18 07:37:08 -07:00
Keith Whitwell
f02aaa83c1 tests: add simplest mipgen test 2009-03-18 14:13:59 +00:00
Keith Whitwell
33c1bec73b pipe/atomic: dont use ms interlock calls from gcc 2009-03-18 13:27:53 +00:00
Keith Whitwell
0c550b0425 util: avoid clashprone UINT, UBYTE enum values 2009-03-18 13:04:43 +00:00
Keith Whitwell
5488fe84f9 draw: use AOS_ERROR rather than clash-prone ERROR() macro 2009-03-18 13:04:43 +00:00
Keith Whitwell
eddfad3955 pipe/atomic: clean up #ifdef maze 2009-03-18 13:04:43 +00:00
Jakob Bornecrantz
a528eb51eb progs/tests: Update mipmap_limits to show image and colors 2009-03-18 13:30:34 +01:00
Thomas Hellstrom
d405ba3151 xlib st: Fix makeCurrent.
Flush if we change context.
Also reinstate the old optimization of doing nothing if
nothing changes.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-03-18 11:58:40 +01:00
Jakob Bornecrantz
ae36fadb7f progs/trivial: Add tri-fbo-tex-mip
Tests rendering to mip levels other then first
2009-03-18 11:30:34 +01:00
Ben Skeggs
e00ae524e2 nouveau: rewrite winsys in terms of drm_api, support dri2 state tracker
drm_api is a set of hooks used by the dri2 state tracker, this wraps our
dri1 code around the same set of hooks.

Currently the dri2 build will produce nouveau_dri2.so which you'll need
to install as nouveau_dri.so if you wish to try it.  The dri2 state
tracker doesn't make it easy for a driver to support both paths in the
same binary.
2009-03-18 09:44:40 +10:00
Ben Skeggs
b46fcf25be st/dri2: use pipe_screen.is_format_supported to choose depth/stencil format 2009-03-18 09:44:40 +10:00
Corbin Simpson
5deefb7ea5 r300-gallium: Move all unsorted state into invariant state.
Gotta just slowly whittle this down.
2009-03-17 13:14:03 -07:00
Corbin Simpson
f822ac0fff r300-gallium: Emit invariant state, no matter what.
It's called "invariant" for a reason. :3
2009-03-17 13:14:03 -07:00
Corbin Simpson
9d5e6f66f0 r300-gallium: Quick little cleanup of surface_fill state. 2009-03-17 13:14:02 -07:00
José Fonseca
05318c5afa tgsi: Restore statement ordering. 2009-03-17 19:50:42 +00:00
Corbin Simpson
e87f26a9b6 r300-gallium: Debugging for the more sensitive card registers.
These are nearly always the cause of hardlocks, so let's dump them.
2009-03-17 11:51:15 -07:00
Corbin Simpson
0f0d0b62ff r300-gallium: r500-fs: Fixup immediate->constant counting a bit. 2009-03-17 11:51:14 -07:00
Corbin Simpson
fbd758c55e r300-gallium: More query stuff.
Should work, but doesn't. At least it doesn't hardlock.
2009-03-17 11:51:14 -07:00
Brian Paul
c334ce273e swrast: use better _swrast_compute_lambda() function
The MAX-based function can produce values that are non-monotonic for a span
which causes glitches in texture filtering.  The sqrt-based one avoids that.

This is perhaps slightly slower than before, but the difference
probably isn't noticable given we're doing software mipmap filtering.

Issue reported by Nir Radian <nirr@horizonsemi.com>
2009-03-17 10:28:32 -06:00
Vinson Lee
1eee1bac1f mesa: update/fix doxygen comments 2009-03-17 09:34:30 -06:00
José Fonseca
c1f8de9954 util: Realloc takes bytes. 2009-03-17 14:38:55 +00:00
Michal Krol
f20a0155f3 wgl: Port sharedtex_mt to WGL. 2009-03-17 14:27:47 +01:00
Michal Krol
ed3781fdc5 tgsi: Document ps_2_0 instruction set operations. 2009-03-17 12:42:45 +01:00
Michal Krol
223bf49b20 tgsi: Document ps_1_4 instruction set operations. 2009-03-17 12:42:43 +01:00
Michal Krol
95ef9803da tgsi: Document ps_1_1 instruction set operations. 2009-03-17 12:42:41 +01:00
Michal Krol
f07400592f tgsi: Begin documenting GLSL instruction set operations. 2009-03-17 12:42:38 +01:00
Michal Krol
0ff360c829 tgsi: Begin documenting NV_geometry_program4 instruction set operations. 2009-03-17 12:42:36 +01:00
Thomas Hellstrom
1d2b14cf56 xdemos: Fix sharedtex_mt.
1) Don't allow multiple threads sharing current context,
   even if they are mutex protected.
2) Remove all XLockDisplay(), XUnLockDisplay() calls, as they were
   only workarounds for xcb.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-03-17 11:38:00 +01:00
Michal Krol
7f1062584e python: Return on unknown pixel format. 2009-03-17 11:34:42 +01:00
Michal Krol
c337bafeb9 gallium: Use _new' name, new' is a reserved keyword in C++. 2009-03-17 10:56:00 +01:00
Michal Krol
1e23dac869 gallium: Provide unprotected atomic implementation for display and miniport interfaces. 2009-03-17 10:54:08 +01:00
Michal Krol
709b3128f3 python: Fix build after refcount rework. 2009-03-17 10:43:04 +01:00
Michal Krol
7b0c459bb4 python: Include `p_winsys_screen.h'. 2009-03-17 10:33:25 +01:00
Michal Krol
4e1c925ef5 python: Do not pass screen object to pipe_buffer_reference. 2009-03-17 10:26:38 +01:00
Michal Krol
627c2d2f0a tgsi: Silence const pointer cast warnings. 2009-03-17 10:18:24 +01:00
Corbin Simpson
175f58baa9 r300-gallium: r500-fs: Properly set up TEX/OUT. 2009-03-17 02:13:03 -07:00
Corbin Simpson
307e68f739 r300-gallium: r500-fs: Texture insts, ABS, moar comments. 2009-03-17 02:13:03 -07:00
Corbin Simpson
93ef9ec5eb r300-gallium: Clean up some code, un-special-case scalar ops. 2009-03-17 02:13:03 -07:00
Corbin Simpson
f1d93f6082 r300-gallium: r500-fs: CMP/MOV/SWZ, negation, ADD/MAD/MUL/SUB.
Also a fair amount of cleanup.
2009-03-17 02:13:02 -07:00
Corbin Simpson
add896aec8 r300-gallium: Fix relocation for textures.
This keeps texture emit from invalidating CS.
2009-03-17 02:13:02 -07:00
Jakob Bornecrantz
b95789ddb9 trace: Fix memory leak 2009-03-16 21:34:03 +01:00
José Fonseca
cddf629282 util: bitmask data type. 2009-03-16 19:37:08 +00:00
Jakob Bornecrantz
068fd6d50b trace: Re-init refcounters just incase 2009-03-16 20:33:30 +01:00
Jakob Bornecrantz
f73066fbd5 trace: Dump buffer data via buffer writes 2009-03-16 20:15:25 +01:00
Jakob Bornecrantz
2f52c7f901 progs/trivial: Ignores 2009-03-16 20:15:25 +01:00
Jakob Bornecrantz
2004b99b83 progs/tests: Ignores 2009-03-16 20:15:18 +01:00
Michal Krol
d8445e8fe1 python: Use transfer object to read from a surface. 2009-03-16 16:48:18 +01:00
Michal Krol
fcf93aa06d python: pipe_vertex_buffer's pitch member has been renamed to stride. 2009-03-16 16:12:04 +01:00
Michal Krol
56282d79f6 python: size is not a member of pipe_constant_buffer any more. 2009-03-16 16:12:02 +01:00
Corbin Simpson
5ad1721540 r300-gallium: r500-fs: Add ABS. 2009-03-16 06:49:22 -07:00
Corbin Simpson
567aead92a r300-gallium: r500-fs: Clamp only when saturation flags are set. 2009-03-16 06:49:22 -07:00
Corbin Simpson
3cce08e313 r300-gallium: r500-fs: Working ADD and MUL, add more sop stuff. 2009-03-16 06:49:22 -07:00
Corbin Simpson
b9ecd7273b r300-gallium: Cleanup a few things. 2009-03-16 06:49:22 -07:00
Corbin Simpson
d16533cc87 r300-gallium: r500-fs: MUL. 2009-03-16 06:49:22 -07:00
Corbin Simpson
fe1c94d8d3 r300-gallium: r500-fs: Stub out the simple scalar ops.
COS, SIN, and CSC are not simple.
2009-03-16 06:49:21 -07:00
Corbin Simpson
a22e40c29c r300-gallium: r500-fs: Add DPH. 2009-03-16 06:49:21 -07:00
Corbin Simpson
65ec17f320 r300-gallium: r500-fs: Add dot products.
We're cookin' now.
2009-03-16 06:49:21 -07:00
Michal Krol
c97b671d64 gallium: Implement atomic for MSVC on x86. 2009-03-16 13:42:22 +01:00
Michal Krol
a7d42e11b4 gallium: Implement atomic interface for windows user mode subsystem. 2009-03-16 13:15:50 +01:00
José Fonseca
102cb5c9cd scons: Promote declaration-after-statement to error. Detect more warnings. 2009-03-16 12:01:44 +00:00
José Fonseca
e5a3aa5672 progs: Try to read the texture from the current dir, if full path fails. 2009-03-16 12:01:44 +00:00
Michal Krol
ed7bb2c196 gallium: Use macro parameter names consistently. 2009-03-16 12:39:07 +01:00
Michal Krol
bf6ed0b962 gallium: pipe_mutex_init() is of type void.
Both the windows and fallback versions are void already.
2009-03-16 12:36:22 +01:00
Michal Krol
13dad5294b gallium: Include p_compiler.h for integer types. 2009-03-16 12:27:47 +01:00
Michal Krol
47c18b35b0 softpipe: Use p_atomic_read, not atomic_read. 2009-03-16 12:22:50 +01:00
Thomas Hellstrom
cf25ef9072 gallium: Use struct pipe_atomic for pipe refcounts.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-03-16 11:40:47 +01:00
Thomas Hellstrom
fc1ef97c33 gallium: Add simple atomic class api.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-03-16 11:40:18 +01:00
Michal Krol
1f3fe40554 tgsi: Begin documenting NV_gpu_program4 instruction set operations. 2009-03-16 10:24:16 +01:00
Michal Krol
bf3759e0d4 tgsi: Document NV_vertex_program3 instruction set operations.` 2009-03-16 10:04:51 +01:00
Michal Krol
ad908465f1 wgl: Port glthreads to WGL. 2009-03-16 09:45:23 +01:00
Michal Krol
9ba52e1268 mesa: Silence compiler warnings. 2009-03-16 09:13:29 +01:00
Corbin Simpson
877aaad06d r300-gallium: r500-fs: Actually handle consts and imms correctly.
This makes mad.txt draw correctly. Yay!
2009-03-16 00:31:54 -07:00
Corbin Simpson
5bc4562849 r300-gallium: Emit constants as floats, not uints. 2009-03-16 00:31:54 -07:00
michal
97e4caa33a python: Include missing `p_compiler.h' header. 2009-03-16 08:18:10 +01:00
michal
5494251890 python: Do not pass shader_state to util shader functions. 2009-03-16 08:18:06 +01:00
michal
38b074495a python: Use transfer objects to initialise texture data. 2009-03-16 08:18:03 +01:00
michal
f6c3edb308 python: Use new bypass_vs_clip_and_viewport rasteriser flag. 2009-03-16 08:17:59 +01:00
Corbin Simpson
f197a8b916 r300-gallium: Fix vertex memory offsets.
Wow, I must have been asleep when I made that mistake.
2009-03-15 23:42:42 -07:00
Corbin Simpson
4f5678c1eb radeon-gallium: Add my R580 to the xorg PCI ID list.
At some point, going to have to grab the big list from xf86-video-ati.
2009-03-15 23:07:31 -07:00
Corbin Simpson
44adea1a09 r300-gallium: r500-fs: Setup immediates.
Textures still not working. RS block shenanigans expected.
2009-03-15 23:07:31 -07:00
Corbin Simpson
1e56bb890b dri2-gallium: Add occlusion query support at the state tracker level. 2009-03-15 23:07:31 -07:00
Corbin Simpson
7c204c9753 r300-gallium: Actually set stride when creating textures.
Duh.
2009-03-15 23:07:31 -07:00
Corbin Simpson
61c65a6c7e r300-gallium: r500-fs: Add writemasks and some flexibility for MOV/SWZ. 2009-03-15 23:07:30 -07:00
Corbin Simpson
c5742cab19 r300-gallium: Always rasterize at least one color. 2009-03-15 23:07:30 -07:00
Corbin Simpson
954a9fadad r300-gallium: Fix spacing.
It was driving me crazy.
2009-03-15 23:07:30 -07:00
Michal Krol
8ae04f3c46 vbo: Silence integer-to-pointer warnings. 2009-03-15 10:23:15 +01:00
Younes Manton
474399ddd6 mesa: .gitignore 2009-03-14 20:20:56 -04:00
Younes Manton
8b45de9aa1 nouveau: bypass_vs_clip_and_viewport 2009-03-14 20:19:47 -04:00
Keith Whitwell
683e7091a9 gallium: consolidate bypass_vs and bypass_clipping flags
The draw module provides a similar interface to the driver which
is retained as various bits of hardware may be able to take on
incremental parts of the vertex pipeline.  However, there's no
need to advertise all this complexity to the state tracker.

There are basically two modes now - normal and passthrough/screen-coords.
2009-03-13 16:42:57 +00:00
Keith Whitwell
fa0f48504a gallium: no need to keep a copy of shader tokens in state tracker
Any driver who needs a copy of the shader tokens must organize to
do so itself.  This has been the case for a long time, but there
was still defensive code in the state tracker, which is now removed.

Any bugs resulting from this need to be fixed in the offending driver...
2009-03-13 16:24:22 +00:00
Keith Whitwell
b3be1651f4 mesa/st: add check for null front renderbuffer
Not sure if this indicates a problem elsewhere, but without this check
trivial/tri-fbo.c segfaults on resize.  With the patch, it renders
correctly.
2009-03-13 15:53:48 +00:00
Keith Whitwell
af34fa316d mesa/st: don't call finish in st_glFlush()
It is not the state tracker's responsibilty to inject sleeps and
pessimize performance in the hope of avoiding buffer synchronization
issues in buggy drivers.

Calling finish() here will just hide problems that need to be fixed
elsewhere.
2009-03-13 15:53:48 +00:00
848 changed files with 33117 additions and 14739 deletions

View File

@@ -37,6 +37,9 @@ realclean: clean
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
distclean: realclean
install:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
@@ -45,7 +48,7 @@ install:
done
.PHONY: default doxygen clean realclean install linux-directfb-install
.PHONY: default doxygen clean realclean distclean install linux-directfb-install
# If there's no current configuration file
$(TOP)/configs/current:
@@ -178,7 +181,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.5-devel
VERSION=7.5-rc1
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
@@ -399,7 +402,6 @@ DEMO_FILES = \
$(DIRECTORY)/progs/osdemos/Makefile \
$(DIRECTORY)/progs/osdemos/*.c \
$(DIRECTORY)/progs/xdemos/Makefile* \
$(DIRECTORY)/progs/xdemos/descrip.mms \
$(DIRECTORY)/progs/xdemos/*.[chf] \
$(DIRECTORY)/progs/redbook/Makefile* \
$(DIRECTORY)/progs/redbook/README \
@@ -415,9 +417,6 @@ DEMO_FILES = \
$(DIRECTORY)/progs/windml/*.c \
$(DIRECTORY)/progs/windml/*.bmp \
$(DIRECTORY)/progs/ggi/*.c \
$(DIRECTORY)/windows/VC6/progs/demos/*.dsp \
$(DIRECTORY)/windows/VC6/progs/progs.dsw \
$(DIRECTORY)/windows/VC7/progs/demos/*.vcproj \
$(DIRECTORY)/windows/VC7/progs/progs.sln
GLUT_FILES = \
@@ -427,14 +426,11 @@ GLUT_FILES = \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/descrip.mms \
$(DIRECTORY)/src/glut/glx/mms_depend \
$(DIRECTORY)/src/glut/glx/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile \
$(DIRECTORY)/src/glut/dos/*.[ch] \
$(DIRECTORY)/src/glut/dos/Makefile.DJ \
$(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \
$(DIRECTORY)/src/glut/ggi/*.[ch] \
$(DIRECTORY)/src/glut/ggi/Makefile \

View File

@@ -41,16 +41,16 @@ else:
default_drivers = 'all'
default_winsys = 'all'
opts = Options('config.py')
opts = Variables('config.py')
common.AddOptions(opts)
opts.Add(ListOption('statetrackers', 'state trackers to build', default_statetrackers,
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python']))
opts.Add(ListOption('drivers', 'pipe drivers to build', default_drivers,
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
['softpipe', 'failover', 'i915simple', 'i965simple', 'cell', 'trace', 'r300']))
opts.Add(ListOption('winsys', 'winsys drivers to build', default_winsys,
['xlib', 'intel', 'gdi', 'amd']))
opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
['xlib', 'intel', 'gdi', 'radeon']))
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
env = Environment(
options = opts,

View File

@@ -176,6 +176,23 @@ if [ ${ARCH} = "auto" ] ; then
fi
if [ $STATIC = 1 ]; then
# filter out linker options inside object list
NEWOBJECTS=""
for OBJ in $OBJECTS ; do
case $OBJ in
-Wl,*)
echo "mklib: warning: ignoring $OBJ for static library"
;;
*)
NEWOBJECTS="$NEWOBJECTS $OBJ"
;;
esac
done
OBJECTS=$NEWOBJECTS
fi
#
# Error checking
#
@@ -264,18 +281,21 @@ case $ARCH in
# expand any .a objects into constituent .o files.
NEWOBJECTS=""
DELETIA=""
for OBJ in ${OBJECTS} ; do
if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then
# extract the .o files from this .a archive
FILES=`ar t $OBJ`
ar x $OBJ
NEWOBJECTS="$NEWOBJECTS $FILES"
# keep track of temporary .o files and delete them below
DELETIA="$DELETIA $FILES"
else
# ordinary .o file
NEWOBJECTS="$NEWOBJECTS $OBJ"
fi
for OBJ in $OBJECTS ; do
case $OBJ in
*.a)
# extract the .o files from this .a archive
FILES=`ar t $OBJ`
ar x $OBJ
NEWOBJECTS="$NEWOBJECTS $FILES"
# keep track of temporary .o files and delete them below
DELETIA="$DELETIA $FILES"
;;
*)
# ordinary .o file
NEWOBJECTS="$NEWOBJECTS $OBJ"
;;
esac
done
# make lib
@@ -394,6 +414,30 @@ case $ARCH in
fi
fi
# If using Sun C++ compiler, need to tell it not to add runpaths
# that are specific to the build machine
if [ ${LINK} = "CC" ] ; then
OPTS="${OPTS} -norunpath"
fi
# Solaris linker requires explicitly listing the Standard C & C++
# libraries in the link path when building shared objects
if [ ${LINK} = "CC" ] ; then
DEPS="${DEPS} -lCrun"
fi
DEPS="${DEPS} -lc"
if [ $EXPORTS ] ; then
# Make the 'mapfile.scope' linker mapfile
echo "{" > mapfile.scope
echo "global:" >> mapfile.scope
sed 's/$/;/' ${EXPORTS} >> mapfile.scope
echo "local:" >> mapfile.scope
echo " *;" >> mapfile.scope
echo "};" >> mapfile.scope
OPTS="${OPTS} -Wl,-Mmapfile.scope"
fi
# Check if objects are SPARC v9
# file says: ELF 64-bit MSB relocatable SPARCV9 Version 1
set ${OBJECTS}
@@ -406,17 +450,19 @@ case $ARCH in
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
# for debug:
#echo "mklib: linker is" ${LINK} ${OPTS}
if [ $NOPREFIX = 1 ] ; then
rm -f ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
FINAL_LIBS="${LIBNAME}"
else
rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} -h ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
fi
FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
fi
;;

View File

@@ -46,13 +46,13 @@ else:
def AddOptions(opts):
try:
from SCons.Options.BoolOption import BoolOption
except ImportError:
from SCons.Variables.BoolVariable import BoolVariable as BoolOption
try:
from SCons.Options.EnumOption import EnumOption
except ImportError:
from SCons.Options.BoolOption import BoolOption
try:
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
except ImportError:
from SCons.Options.EnumOption import EnumOption
opts.Add(BoolOption('debug', 'debug build', 'no'))
opts.Add(BoolOption('profile', 'profile build', 'no'))
#opts.Add(BoolOption('quiet', 'quiet command lines', 'no'))
@@ -61,7 +61,7 @@ def AddOptions(opts):
opts.Add(EnumOption('platform', 'target platform', default_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince')))
opts.Add(EnumOption('toolchain', 'compiler toolchain', 'default',
allowed_values=('default', 'crossmingw', 'winddk')))
allowed_values=('default', 'crossmingw', 'winsdk', 'winddk')))
opts.Add(BoolOption('llvm', 'use LLVM', 'no'))
opts.Add(BoolOption('dri', 'build DRI drivers', default_dri))

View File

@@ -9,7 +9,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=3
MESA_MINOR=5
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)

View File

@@ -64,4 +64,4 @@ GALLIUM_WINSYS_DRM_DIRS = intel
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb
savage sis tdfx trident unichrome ffb swrast

View File

@@ -22,7 +22,5 @@ GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \
-l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group -lm \
-L/usr/X11R6/lib/ -lX11 -lXext -lXmu -lXi -lpthread
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) \
-l$(GL_LIB) -lm -L/usr/X11R6/lib/ -lX11 -lXext -lXmu -lXi -lpthread

View File

@@ -22,6 +22,5 @@ GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \
-l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group \
$(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread -lstdc++ -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) \
-l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread -lstdc++ -lm

View File

@@ -5,12 +5,8 @@ AC_PREREQ([2.59])
dnl Versioning - scrape the version from configs/default
m4_define([mesa_version],
[m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])])
m4_ifval(mesa_version,[],[
m4_errprint([Error: Failed to get the Mesa version from the output of
running `make -f bin/version.mk version'
])
m4_exit([1])
])
m4_ifval(mesa_version,,
[m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
dnl Tell the user about autoconf.html in the --help output
m4_divert_once([HELP_END], [
@@ -58,15 +54,11 @@ fi
AC_SUBST([MKDEP_OPTIONS])
dnl Make sure the pkg-config macros are defined
m4_ifdef([PKG_PROG_PKG_CONFIG],[],[
m4_errprint([Error: Could not locate the pkg-config autoconf macros.
These are usually located in /usr/share/aclocal/pkg.m4. If your
macros are in a different location, try setting the environment
variable ACLOCAL="aclocal -I/other/macro/dir" before running
autoreconf.
])
m4_exit([1])
])
m4_ifndef([PKG_PROG_PKG_CONFIG],
[m4_fatal([Could not locate the pkg-config autoconf macros.
These are usually located in /usr/share/aclocal/pkg.m4. If your macros
are in a different location, try setting the environment variable
ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
PKG_PROG_PKG_CONFIG()
dnl LIB_DIR - library basename
@@ -87,7 +79,7 @@ dnl Compiler macros
DEFINES=""
AC_SUBST([DEFINES])
case "$host_os" in
linux*|*-gnu*)
linux*|*-gnu*|gnu*)
DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
;;
solaris*)
@@ -375,17 +367,6 @@ if test "x$enable_selinux" = "xyes"; then
DEFINES="$DEFINES -DMESA_SELINUX"
fi
dnl OS-specific libraries
OS_LIBS=""
case "$host_os" in
solaris*)
OS_LIBS="-lc"
if test "x$GXX" != xyes; then
OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS"
fi
;;
esac
dnl
dnl Driver configuration. Options are xlib, dri and osmesa right now.
dnl More later: directfb, fbdev, ...
@@ -400,7 +381,7 @@ linux*)
;;
*freebsd* | dragonfly*)
case "$host_cpu" in
i*86|x86_64) default_driver="dri";;
i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
esac
;;
esac
@@ -422,25 +403,26 @@ esac
dnl
dnl Driver specific build directories
dnl
SRC_DIRS="mesa egl glew"
SRC_DIRS="mesa glew"
GLU_DIRS="sgi"
WINDOW_SYSTEM=""
GALLIUM_DIRS="auxiliary drivers state_trackers"
GALLIUM_WINSYS_DIRS=""
GALLIUM_WINSYS_DRM_DIRS=""
GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util"
GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util indices"
GALLIUM_DRIVERS_DIRS="softpipe failover trace"
GALLIUM_STATE_TRACKERS_DIRS=""
case "$mesa_driver" in
xlib)
DRIVER_DIRS="x11"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib"
;;
dri)
SRC_DIRS="glx/x11 $SRC_DIRS"
DRIVER_DIRS="dri"
WINDOW_SYSTEM="dri"
GALLIUM_WINSYS_DIRS="drm $GALLIUM_WINSYS_DIRS"
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm"
;;
osmesa)
DRIVER_DIRS="osmesa"
@@ -561,8 +543,8 @@ xlib)
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $OS_LIBS"
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
# if static, move the external libraries to the programs
# and empty the libraries for libGL
@@ -612,12 +594,12 @@ dri)
fi
# need DRM libs, -lpthread, etc.
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS"
GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS $OS_LIBS"
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
;;
osmesa)
# No libGL for osmesa
GL_LIB_DEPS="$OS_LIBS"
GL_LIB_DEPS=""
;;
esac
AC_SUBST([GL_LIB_DEPS])
@@ -752,6 +734,10 @@ if test "$mesa_driver" = dri; then
unichrome savage sis swrast"
fi
;;
gnu*)
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
;;
solaris*)
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
@@ -860,9 +846,9 @@ osmesa)
;;
esac
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS"
OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS"
fi
OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV $OS_LIBS"
OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
AC_SUBST([OSMESA_LIB_DEPS])
AC_SUBST([OSMESA_MESA_DEPS])
AC_SUBST([OSMESA_PC_REQ])
@@ -871,14 +857,23 @@ AC_SUBST([OSMESA_PC_LIB_PRIV])
dnl
dnl EGL configuration
dnl
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([EGL],[x11])
EGL_LIB_DEPS="$EGL_LIBS"
else
# should check these...
EGL_LIB_DEPS="$X_LIBS -lX11"
AC_ARG_ENABLE([egl],
[AS_HELP_STRING([--disable-egl],
[disable EGL library @<:@default=enabled@:>@])],
[enable_egl="$enableval"],
[enable_egl=yes])
if test "x$enable_egl" = xyes; then
SRC_DIRS="$SRC_DIRS egl"
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([EGL], [x11])
EGL_LIB_DEPS="$EGL_LIBS"
else
# should check these...
EGL_LIB_DEPS="$X_LIBS -lX11"
fi
EGL_LIB_DEPS="$EGL_LIB_DEPS $DLOPEN_LIBS"
fi
EGL_LIB_DEPS="$EGL_LIB_DEPS $DLOPEN_LIBS $OS_LIBS"
AC_SUBST([EGL_LIB_DEPS])
dnl
@@ -988,10 +983,10 @@ if test "x$enable_glw" = xyes; then
fi
# If static, empty GLW_LIB_DEPS and add libs for programs to link
GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV $OS_LIBS"
GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV"
if test "$enable_static" = no; then
GLW_MESA_DEPS='-l$(GL_LIB)'
GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS"
GLW_LIB_DEPS="$GLW_LIB_DEPS"
else
APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
GLW_LIB_DEPS=""
@@ -1047,8 +1042,8 @@ if test "x$enable_glut" = xyes; then
GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
GLUT_PC_CFLAGS="$X11_INCLUDES"
fi
GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS"
GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm $OS_LIBS"
GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
# If glut is available, we can build most programs
if test "$with_demos" = yes; then
@@ -1118,8 +1113,11 @@ no)
yes)
# look at what else is built
case "$mesa_driver" in
xlib)
GALLIUM_STATE_TRACKERS_DIRS=glx
;;
dri)
GALLIUM_STATE_TRACKERS_DIRS=egl
test "x$enable_egl" = xyes && GALLIUM_STATE_TRACKERS_DIRS=egl
;;
esac
;;
@@ -1129,6 +1127,10 @@ yes)
for tracker in $state_trackers; do
test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
if test "$tracker" = egl && test "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
;;
@@ -1244,6 +1246,7 @@ dnl Libraries
echo ""
echo " Shared libs: $enable_shared"
echo " Static libs: $enable_static"
echo " EGL: $enable_egl"
echo " GLU: $enable_glu"
echo " GLw: $enable_glw (Motif: $enable_motif)"
echo " glut: $enable_glut"

View File

@@ -0,0 +1,214 @@
Name
MESA_texture_signed_rgba
Name Strings
GL_MESA_texture_signed_rgba
Contact
Notice
IP Status
No known IP issues
Status
Version
0.3, 2009-03-24
Number
Not assigned ?
Dependencies
Written based on the wording of the OpenGL 2.0 specification.
This extension trivially interacts with ARB_texture_float.
This extension shares some language with ARB_texture_compression_rgtc
but does not depend on it.
Overview
OpenGL prior to 3.1 does not support any signed texture formats.
ARB_texture_compression_rgtc introduces some compressed red and
red_green signed formats but no uncompressed ones, which might
still be useful. NV_texture_shader adds signed texture formats,
but also a lot of functionality which has been superceded by fragment
shaders.
It is usually possible to get the same functionality
using a unsigned format by doing scale and bias in a shader, but this
is undesirable since modern hardware has direct support for this.
This extension adds a signed 4-channel texture format by backporting
the relevant features from OpenGL 3.1, as a means to support this in
OpenGL implementations only supporting older versions.
Issues
1) What should this extension be called?
RESOLVED: MESA_texture_signed_rgba seems reasonable.
The rgba part is there because only 4 channel format is supported.
2) Should the full set of signed formats (alpha, luminance, rgb, etc.)
be supported?
RESOLVED: NO. To keep this extension simple, only add the most
universal format, rgba. alpha/luminance can't be trivially supported
since OpenGL 3.1 does not support them any longer, and there is some
implied dependency on ARB_texture_rg for red/red_green formats so
avoid all this. Likewise, only 8 bits per channel is supported.
3) Should this extension use new enums for the texture formats?
RESOLVED: NO. Same enums as those used in OpenGL 3.1.
4) How are signed integer values mapped to floating-point values?
RESOLVED: Same as described in issue 5) of
ARB_texture_compression_rgtc (quote):
A signed 8-bit two's complement value X is computed to
a floating-point value Xf with the formula:
{ X / 127.0, X > -128
Xf = {
{ -1.0, X == -128
This conversion means -1, 0, and +1 are all exactly representable,
however -128 and -127 both map to -1.0. Mapping -128 to -1.0
avoids the numerical awkwardness of have a representable value
slightly more negative than -1.0.
This conversion is intentionally NOT the "byte" conversion listed
in Table 2.9 for component conversions. That conversion says:
Xf = (2*X + 1) / 255.0
The Table 2.9 conversion is incapable of exactly representing
zero.
(Difference to ARB_texture_compression_rgtc):
This is the same mapping as OpenGL 3.1 uses.
This is also different to what NV_texture_shader used.
The above mapping should be considered the reference, but there
is some leeway so other mappings are allowed for implementations which
cannot do this. Particulary the mapping given in NV_texture_shader or
the standard OpenGL byte/float mapping is considered acceptable too, as
might be a mapping which represents -1.0 by -128, 0.0 by 0 and 1.0 by
127 (that is, uses different scale factors for negative and positive
numbers).
Also, it is ok to store incoming GL_BYTE user data as-is, without
converting to GL_FLOAT (using the standard OpenGL float/byte mapping)
and converting back (using the mapping described here).
Other than those subtle issues there are no other non-standard
conversions used, so when using for instance CopyTexImage2D with
a framebuffer clamped to [0,1] all converted numbers will be in the range
[0, 127] (and not scaled and biased).
5) How will signed components resulting from RGBA8_SNORM texture
fetches interact with fragment coloring?
RESOLVED: Same as described in issue 6) of
ARB_texture_compression_rgtc (quote):
The specification language for this extension is silent
about clamping behavior leaving this to the core specification
and other extensions. The clamping or lack of clamping is left
to the core specification and other extensions.
For assembly program extensions supporting texture fetches
(ARB_fragment_program, NV_fragment_program, NV_vertex_program3,
etc.) or the OpenGL Shading Language, these signed formats will
appear as expected with unclamped signed components as a result
of a texture fetch instruction.
If ARB_color_buffer_float is supported, its clamping controls
will apply.
NV_texture_shader extension, if supported, adds support for
fixed-point textures with signed components and relaxed the
fixed-function texture environment clamping appropriately. If the
NV_texture_shader extension is supported, its specified behavior
for the texture environment applies where intermediate values
are clamped to [-1,1] unless stated otherwise as in the case
of explicitly clamped to [0,1] for GL_COMBINE. or clamping the
linear interpolation weight to [0,1] for GL_DECAL and GL_BLEND.
Otherwise, the conventional core texture environment clamps
incoming, intermediate, and output color components to [0,1].
This implies that the conventional texture environment
functionality of unextended OpenGL 1.5 or OpenGL 2.0 without
using GLSL (and with none of the extensions referred to above)
is unable to make proper use of the signed texture formats added
by this extension because the conventional texture environment
requires texture source colors to be clamped to [0,1]. Texture
filtering of these signed formats would be still signed, but
negative values generated post-filtering would be clamped to
zero by the core texture environment functionality. The
expectation is clearly that this extension would be co-implemented
with one of the previously referred to extensions or used with
GLSL for the new signed formats to be useful.
6) Should the RGBA_SNORM tokens also be accepted by CopyTexImage
functions?
RESOLVED: YES.
7) What to do with GetTexParameter if ARB_texture_float is supported,
in particular what datatype should this return for TEXTURE_RED_TYPE_ARB,
TEXTURE_GREEN_TYPE_ARB, TEXTURE_BLUE_TYPE_ARB, TEXTURE_ALPHA_TYPE_ARB?
RESOLVED: ARB_texture_float states type is either NONE,
UNSIGNED_NORMALIZED_ARB, or FLOAT. This extension adds a new enum,
SIGNED_NORMALIZED, which will be returned accordingly. This is the
same behaviour as in OpenGL 3.1.
New Tokens
Accepted by the <internalformat> parameter of
TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D:
RGBA_SNORM 0x8F93
RGBA8_SNORM 0x8F97
Returned by the <params> parameter of GetTexLevelParameter:
SIGNED_NORMALIZED 0x8F9C
Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization):
-- Section 3.8.1, Texture Image Specification
Add to Table 3.16 (page 154): Sized internal formats
Sized Base R G B A L I D
Internal Format Internal Format bits bits bits bits bits bits bits
--------------- --------------- ---- ---- ---- ---- ---- ---- ----
RGBA8_SNORM RGBA 8 8 8 8 0 0 0
Dependencies on ARB_texture_float extension:
If ARB_texture_float is supported, GetTexParameter queries with <value>
of TEXTURE_RED_TYPE_ARB, TEXTURE_GREEN_TYPE_ARB, TEXTURE_BLUE_TYPE_ARB or
TEXTURE_ALPHA_TYPE_ARB return SIGNED_NORMALIZED if
the base internal format is RGBA_SNORM.

View File

@@ -14,16 +14,7 @@ The Mesa
driver is part of the
<a href="http://www.tungstengraphics.com/wiki/index.php/Gallium3D" target="_parent">Gallium3D</a>
architecture.
</p>
<p>
<a href="http://www.tungstengraphics.com/" target="_parent">Tungsten Graphics</a>
is leading the project.
Two phases are planned.
First, to implement the framework for parallel rasterization using the Cell
SPEs, including texture mapping.
Second, to implement a full-featured OpenGL driver with support for GLSL, etc.
The second phase is now underway.
Tungsten Graphics did the original implementation of the Cell driver.
</p>
@@ -60,7 +51,7 @@ Mesa tree, then set <code>LD_LIBRARY_PATH</code> like this:
Verify that the Cell driver is being used by running
<code>progs/xdemos/glxinfo</code> and looking for:
<pre>
OpenGL renderer string: Gallium 0.2, Cell on Xlib
OpenGL renderer string: Gallium 0.3, Cell on Xlib
</pre>

View File

@@ -8,12 +8,6 @@
<H1>Downloading</H1>
<p>
Current development release: <b>7.3</b>
<br>
Last stable release: <b>7.2</b>
</p>
<p>
Primary download site:
<a href="http://sourceforge.net/project/showfiles.php?group_id=3"

View File

@@ -1,4 +1,6 @@
See the OpenGL ARB enum registry at http://www.opengl.org/registry/api/enum.spec
Blocks allocated to Mesa:
0x8750-0x875F
0x8BB0-0x8BBF
@@ -30,12 +32,12 @@ MESA_ycbcr_texture.spec:
GL_MESA_pack_invert.spec
GL_PACK_INVERT_MESA 0x8758
GL_MESA_shader_debug.spec:
GL_MESA_shader_debug.spec: (obsolete)
GL_DEBUG_OBJECT_MESA 0x8759
GL_DEBUG_PRINT_MESA 0x875A
GL_DEBUG_ASSERT_MESA 0x875B
GL_MESA_program_debug.spec:
GL_MESA_program_debug.spec: (obsolete)
GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x????
GL_VERTEX_PROGRAM_CALLBACK_MESA 0x????
GL_FRAGMENT_PROGRAM_POSITION_MESA 0x????
@@ -45,3 +47,11 @@ GL_MESA_program_debug.spec:
GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x????
GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x????
GL_MESAX_texture_stack:
GL_TEXTURE_1D_STACK_MESAX 0x8759
GL_TEXTURE_2D_STACK_MESAX 0x875A
GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E

View File

@@ -24,6 +24,7 @@ The specifications follow.
<LI><A HREF="MESA_resize_buffers.spec">MESA_resize_buffers.spec</A>
<LI><A HREF="MESA_set_3dfx_mode.spec">MESA_set_3dfx_mode.spec</A>
<LI><A HREF="MESA_sprite_point.spec">MESA_sprite_point.spec</A> (obsolete)
<LI><A HREF="MESA_texture_signed_rgba.spec">MESA_texture_signed_rgba.spec</A>
<LI><A HREF="MESA_trace.spec">MESA_trace.spec</A> (obsolete)
<LI><A HREF="MESA_window_pos.spec">MESA_window_pos.spec</A>
<LI><A HREF="MESA_ycbcr_texture.spec">MESA_ycbcr_texture.spec</A>

View File

@@ -11,6 +11,26 @@
<H1>News</H1>
<h2>May tbd, 2009</h2>
<p>
<a href="relnotes-7.5.html">Mesa 7.5</a> is released.
</p>
<h2>April 18, 2009</h2>
<p>
<a href="relnotes-7.4.1.html">Mesa 7.4.1</a> is released.
This is a stable release fixing bugs since the 7.4 release.
</p>
<h2>March 27, 2009</h2>
<p>
<a href="relnotes-7.4.html">Mesa 7.4</a> is released.
This is a stable release fixing bugs since the 7.3 release.
</p>
<h2>January 22, 2009</h2>
<p>
<a href="relnotes-7.3.html">Mesa 7.3</a> is released.

79
docs/relnotes-7.4.1.html Normal file
View File

@@ -0,0 +1,79 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.4.1 Release Notes / 18 April 2009</H1>
<p>
Mesa 7.4.1 is a stable development release fixing bugs since the 7.4 release.
</p>
<p>
Mesa 7.4.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>
0c3a72f3295a53a134c04bd7d209ea62 MesaLib-7.4.1.tar.gz
423260578b653818ba66c2fcbde6d7ad MesaLib-7.4.1.tar.bz2
84f78b154d4bd5c3ecc42eeff2e56676 MesaLib-7.4.1.zip
aa0ad323e59d6d10ff33ac0dde462a60 MesaDemos-7.4.1.tar.gz
1e169fb6abc2b45613f1c98a82dfe690 MesaDemos-7.4.1.tar.bz2
294e42be2d74176596c994ec23322fcf MesaDemos-7.4.1.zip
92373bfa48e7b68dddf356e86b0e5699 MesaGLUT-7.4.1.tar.gz
336f3824b578b072211e0beecf4f04f4 MesaGLUT-7.4.1.tar.bz2
20751388d8ef16b42d25d9e3d705d101 MesaGLUT-7.4.1.zip
</pre>
<h2>Bug fixes</h2>
<ul>
<li>Fixed a two-sided lighting bug in fixed-function-to-GPU code generation
<li>Fixed some Darwin issues (Jeremy Huddleston)
<li>Indexing the GLSL gl_EyePlane[] or gl_ObjectPlane[] arrays with a variable
was broken, bug 20986
<li>Fixed incorrect texture unit bias in TXB instruction
<li>glTexParameter settings weren't always propogated to drivers
<li>Assorted vertex/fragment program bug fixes
<li>Fixed point rendering in software rasterizer
<li>Fixed potential deadlock in object hash functions
<li>Fix a couple bugs surrounding front-buffer rendering with DRI2, but this
is not quite complete.
<li>Fixed glPopAttrib() bug when restoring user clip planes
</ul>
<h2>Driver Status</h2>
<pre>
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa/GLX (on Xlib) implements OpenGL 2.1
OSMesa (off-screen) implements OpenGL 2.1
Windows/Win32 implements OpenGL 2.1
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA unsupported
Wind River UGL unsupported
DJGPP unsupported
GGI unsupported
BeOS unsupported
Allegro unsupported
D3D unsupported
</pre>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.4 Release Notes / date TBD</H1>
<H1>Mesa 7.4 Release Notes / 27 March 2009</H1>
<p>
Mesa 7.4 is a stable development release fixing bugs since the 7.3 release.
@@ -20,28 +20,48 @@ 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 ardware acceleration.
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
tbd
ed6bd7437177307e51e16d0c7c381dfa MesaLib-7.4.tar.gz
7ecddb341a2691e0dfdb02f697109834 MesaLib-7.4.tar.bz2
433e823f8245f9fd5f397e7b719a8e47 MesaLib-7.4.zip
656eee6128016fb237e01aa8dabbc703 MesaDemos-7.4.tar.gz
02816f10f30b1dc5e069e0f68c177c98 MesaDemos-7.4.tar.bz2
44a70d6db4aa4c64ecc47871b6aceee8 MesaDemos-7.4.zip
25f80db4f8645cd3e58e2c9af53ec341 MesaGLUT-7.4.tar.gz
04ec01caebde44f5b0d619f00716b368 MesaGLUT-7.4.tar.bz2
019dc213baecaa3cb1278847d41b8591 MesaGLUT-7.4.zip
</pre>
<h2>New features</h2>
<ul>
<li>Added MESA_GLX_FORCE_DIRECT env var for Xlib/software driver
<li>GLSL version 1.20 is returnd by the GL_SHADING_LANGUAGE_VERSION query
</ul>
<h2>Bug fixes</h2>
<ul>
<li>glGetActiveUniform() returned wrong size for some array types
<li>Fixed some error checking in glUniform()
<li>Fixed a potential glTexImage('proxy target') segfault
<li>Fixed bad reference counting for 1D/2D texture arrays
<li>Fixed VBO + glPush/PopClientAttrib() bug #19835
<li>Assorted i965 driver bug fixes
<li>Fixed a Windows compilation failure in s_triangle.c
<li>Fixed a GLSL array indexing bug
<li>Fixes for building on Haiku
</ul>
<h2>Changes</h2>
<ul>
<li>Updated GL/glxext.h to version 48
<li>Assorted updates for building on Solaris
</ul>

View File

@@ -12,6 +12,13 @@
<p>
Mesa 7.5 is a new development release.
People who are concerned with stability and reliability should stick
with the 7.4.x branch or wait for Mesa 7.5.1.
</p>
<p>
The main new feature of Mesa 7.5 is the
<a href="http://www.tungstengraphics.com/wiki/index.php/Gallium3D"
target="_parent">Gallium3D</a> infrastructure.
</p>
<p>
Mesa 7.5 implements the OpenGL 2.1 API, but the version reported by
@@ -20,7 +27,14 @@ 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 ardware acceleration.
for DRI hardware acceleration.
</p>
<p>
Note that the Mesa project is no longer using odd/even version numbers
to indicate development/stable releases.
The so-called development releases have been fairly stable.
If you're especially concerned with stability you should probably look for
"point" releases such as 7.5.1 which will be a bug-fix release.
</p>
@@ -32,6 +46,17 @@ tbd
<h2>New features</h2>
<ul>
<li>Gallium - this is the new architecture for OS-independent and
API-independent 3D drivers.
Gallium3D is intended for GPUs that fully support vertex/fragment shaders.
The Gallium3D drivers currently included are:
<ul>
<li>softpipe - a software/reference driver
<li>i915 - Intel 915/945 driver
<li><a href="cell.html">Cell</a> - IBM/Sony/Toshiba Cell processor driver
<li>nouveau - preliminary driver for NVIDIA GPUs (still under development)
<li>r300 - preliminary driver for R300 (still under development)
</ul>
<li>GL_ARB_framebuffer_object extension (software drivers, i965 driver)
<li>Reworked two-sided stencil support.
This allows a driver to support all three variations of two-sided stencil
@@ -40,17 +65,21 @@ including GL_ATI_separate_stencil, GL_EXT_stencil_two_side and OpenGL 2.0
<li>GL_NV_texture_env_combine4 extension (software drivers, i965/i915 drivers)
<li>GL_EXT_texture_swizzle extension (software drivers, i965 driver)
<li>Updated SPARC assembly optimizations (David S. Miller)
<li>Initial support for separate compilation units in GLSL compiler.
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Lots of i965 driver bug fixes
</ul>
<h2>Changes</h2>
<ul>
<li>Remove support for GL_SGIX_shadow, GL_SGIX_shadow_ambient and
GL_SGIX_depth_texture extensions. Superseded by the ARB versions.
<li>Omitted some old Mesa demos from the release tarballs, added some others.
</ul>
</body>

View File

@@ -21,6 +21,7 @@ The release notes summarize what's new or changed in each Mesa release.
<UL>
<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
<LI><A HREF="relnotes-7.4.1.html">7.4.1 release notes</A>
<LI><A HREF="relnotes-7.4.html">7.4 release notes</A>
<LI><A HREF="relnotes-7.3.html">7.3 release notes</A>
<LI><A HREF="relnotes-7.2.html">7.2 release notes</A>

View File

@@ -22,6 +22,7 @@ Last updated on 15 December 2008.
Contents
</p>
<ul>
<li><a href="#envvars">Environment variables</a>
<li><a href="#120">GLSL 1.20 support</a>
<li><a href="#unsup">Unsupported Features</a>
<li><a href="#notes">Implementation Notes</a>
@@ -33,11 +34,32 @@ Contents
<a name="envvars">
<h2>Environment Variables</h2>
<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:
</p>
<ul>
<li>dump - print GLSL shader code to stdout at link time
<li>log - log all GLSL shaders to files.
The filenames will be "shader_X.vert" or "shader_X.frag" where X
the shader ID.
<li>nopt - disable compiler optimizations
<li>opt - force compiler optimizations
<li>uniform - print message to stdout when glUniform is called
</ul>
<p>
Example: export MESA_GLSL=dump,nopt
</p>
<a name="120">
<h2>GLSL 1.20 support</h2>
<p>
GLSL version 1.20 is supported in Mesa 7.3.
GLSL version 1.20 is supported in Mesa 7.3 and later.
Among the features/differences of GLSL 1.20 are:
<ul>
<li><code>mat2x3, mat2x4</code>, etc. types and functions
@@ -59,12 +81,14 @@ Among the features/differences of GLSL 1.20 are:
<h2>Unsupported Features</h2>
<p>
The following features of the shading language are not yet supported
The following features of the shading language are not yet fully supported
in Mesa:
</p>
<ul>
<li>Linking of multiple shaders is not supported
<li>Linking of multiple shaders does not always work. Currently, linking
is implemented through shader concatenation and re-compiling. This
doesn't always work because of some #pragma and preprocessor issues.
<li>gl_ClipVertex
<li>The gl_Color and gl_SecondaryColor varying vars are interpolated
without perspective correction
@@ -177,6 +201,8 @@ This tool is useful for:
After building Mesa, the glslcompiler can be built by manually running:
</p>
<pre>
make realclean
make linux
cd src/mesa/drivers/glslcompiler
make
</pre>

View File

@@ -136,8 +136,8 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL
#define EGL_INTERLACED_MESA 0x4008
#define EGL_SCREEN_BIT_MESA 0x08
typedef u_int32_t EGLScreenMESA;
typedef u_int32_t EGLModeMESA;
typedef uint32_t EGLScreenMESA;
typedef uint32_t EGLModeMESA;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);

View File

@@ -15,6 +15,7 @@
#if !defined(_WIN32_WCE)
#include <sys/types.h>
#include <stdint.h>
#endif
/* Macros used in EGL function prototype declarations.
@@ -57,7 +58,7 @@
#endif
typedef long int32_t;
typedef unsigned long u_int32_t;
typedef unsigned long uint32_t;
typedef unsigned char uint8_t;
#define snprintf _snprintf
#define strcasecmp _stricmp
@@ -68,7 +69,7 @@ typedef HWND NativeWindowType;
typedef HBITMAP NativePixmapType;
/** END Added for Windows **/
#elif defined(__gnu_linux__) || defined(__FreeBSD__)
#elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun)
/** BEGIN Added for X (Mesa) **/
#ifndef EGLAPI

View File

@@ -46,9 +46,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated 2009/03/04 */
/* glext.h last updated 2009/03/19 */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 46
#define GL_GLEXT_VERSION 48
#ifndef GL_VERSION_1_2
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
@@ -716,6 +716,24 @@ extern "C" {
/* reuse GL_VERTEX_ARRAY_BINDING */
#endif
#ifndef GL_VERSION_3_1
#define GL_RED_SNORM 0x8F90
#define GL_RG_SNORM 0x8F91
#define GL_RGB_SNORM 0x8F92
#define GL_RGBA_SNORM 0x8F93
#define GL_R8_SNORM 0x8F94
#define GL_RG8_SNORM 0x8F95
#define GL_RGB8_SNORM 0x8F96
#define GL_RGBA8_SNORM 0x8F97
#define GL_R16_SNORM 0x8F98
#define GL_RG16_SNORM 0x8F99
#define GL_RGB16_SNORM 0x8F9A
#define GL_RGBA16_SNORM 0x8F9B
#define GL_SIGNED_NORMALIZED 0x8F9C
#define GL_PRIMITIVE_RESTART 0x8F9D
#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
#endif
#ifndef GL_ARB_multitexture
#define GL_TEXTURE0_ARB 0x84C0
#define GL_TEXTURE1_ARB 0x84C1
@@ -1327,6 +1345,7 @@ extern "C" {
#endif
#ifndef GL_ARB_instanced_arrays
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
#endif
#ifndef GL_ARB_map_buffer_range
@@ -1382,6 +1401,51 @@ extern "C" {
#define GL_VERTEX_ARRAY_BINDING 0x85B5
#endif
#ifndef GL_ARB_uniform_buffer_object
#define GL_UNIFORM_BUFFER 0x8A11
#define GL_UNIFORM_BUFFER_BINDING 0x8A28
#define GL_UNIFORM_BUFFER_START 0x8A29
#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
#define GL_UNIFORM_TYPE 0x8A37
#define GL_UNIFORM_SIZE 0x8A38
#define GL_UNIFORM_NAME_LENGTH 0x8A39
#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
#define GL_UNIFORM_OFFSET 0x8A3B
#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
#define GL_INVALID_INDEX_ARB 0xFFFFFFFFu
#endif
#ifndef GL_ARB_compatibility
/* ARB_compatibility just defines tokens from core 3.0 */
#endif
#ifndef GL_ARB_copy_buffer
#define GL_COPY_READ_BUFFER 0x8F36
#define GL_COPY_WRITE_BUFFER 0x8F37
#endif
#ifndef GL_EXT_abgr
#define GL_ABGR_EXT 0x8000
#endif
@@ -3878,6 +3942,26 @@ extern "C" {
#define GL_PERFMON_RESULT_AMD 0x8BC6
#endif
#ifndef GL_AMD_texture_texture4
#endif
#ifndef GL_AMD_vertex_shader_tesselator
#define GL_SAMPLER_BUFFER_AMD 0x9001
#define GL_INT_SAMPLER_BUFFER_AMD 0x9002
#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
#define GL_TESSELLATION_MODE_AMD 0x9004
#define GL_TESSELLATION_FACTOR_AMD 0x9005
#define GL_DISCRETE_AMD 0x9006
#define GL_CONTINUOUS_AMD 0x9007
#endif
#ifndef GL_EXT_provoking_vertex
#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C
#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
#define GL_PROVOKING_VERTEX_EXT 0x8E4F
#endif
/*************************************************************/
@@ -4503,8 +4587,8 @@ GLAPI void APIENTRY glBeginTransformFeedback (GLenum);
GLAPI void APIENTRY glEndTransformFeedback (void);
GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint);
GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLint *, GLenum);
GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLint *);
GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar* *, GLenum);
GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
GLAPI void APIENTRY glClampColor (GLenum, GLenum);
GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum);
GLAPI void APIENTRY glEndConditionalRender (void);
@@ -4562,8 +4646,8 @@ typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLint *location);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
@@ -5321,6 +5405,38 @@ typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
#endif
#ifndef GL_ARB_uniform_buffer_object
#define GL_ARB_uniform_buffer_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetUniformIndices (GLuint, GLsizei, const GLchar* *, GLuint *);
GLAPI void APIENTRY glGetActiveUniformsiv (GLuint, GLsizei, const GLuint *, GLenum, GLint *);
GLAPI void APIENTRY glGetActiveUniformName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *);
GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint, const GLchar *);
GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint, GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *);
GLAPI void APIENTRY glUniformBlockBinding (GLuint, GLuint, GLuint);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
#endif
#ifndef GL_ARB_compatibility
#define GL_ARB_compatibility 1
#endif
#ifndef GL_ARB_copy_buffer
#define GL_ARB_copy_buffer 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCopyBufferSubData (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
#endif
#ifndef GL_EXT_abgr
#define GL_EXT_abgr 1
#endif
@@ -8053,16 +8169,16 @@ GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr);
GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint);
GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLint *, GLenum);
GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLint *);
GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLchar* *, GLenum);
GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLint *location);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
#endif
#ifndef GL_EXT_direct_state_access
@@ -8515,6 +8631,28 @@ typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
#endif
#ifndef GL_AMD_texture_texture4
#define GL_AMD_texture_texture4 1
#endif
#ifndef GL_AMD_vertex_shader_tesselator
#define GL_AMD_vertex_shader_tesselator 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTessellationFactorAMD (GLfloat);
GLAPI void APIENTRY glTessellationModeAMD (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
#endif
#ifndef GL_EXT_provoking_vertex
#define GL_EXT_provoking_vertex 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glProvokingVertexEXT (GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
#endif
#ifdef __cplusplus
}

View File

@@ -41,7 +41,7 @@
#define DRI_INTERFACE_H
/* For archs with no drm.h */
#if !defined(__APPLE__) && !defined(__CYGWIN__)
#if !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__GNU__)
#include <drm.h>
#else
typedef unsigned int drm_context_t;
@@ -231,7 +231,7 @@ struct __DRItexOffsetExtensionRec {
#define __DRI_TEX_BUFFER "DRI_TexBuffer"
#define __DRI_TEX_BUFFER_VERSION 1
#define __DRI_TEX_BUFFER_VERSION 2
struct __DRItexBufferExtensionRec {
__DRIextension base;
@@ -239,11 +239,23 @@ struct __DRItexBufferExtensionRec {
* Method to override base texture image with the contents of a
* __DRIdrawable.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
* For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
* setTexBuffer2 in version 2 of this interface
*/
void (*setTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
__DRIdrawable *pDraw);
/**
* Method to override base texture image with the contents of a
* __DRIdrawable, including the required texture format attribute.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*setTexBuffer2)(__DRIcontext *pDRICtx,
GLint target,
GLint format,
__DRIdrawable *pDraw);
};
/**
@@ -637,6 +649,7 @@ struct __DRIswrastExtensionRec {
#define __DRI_BUFFER_ACCUM 6
#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
struct __DRIbufferRec {
unsigned int attachment;
@@ -647,7 +660,7 @@ struct __DRIbufferRec {
};
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
#define __DRI_DRI2_LOADER_VERSION 1
#define __DRI_DRI2_LOADER_VERSION 3
struct __DRIdri2LoaderExtensionRec {
__DRIextension base;
@@ -655,6 +668,44 @@ struct __DRIdri2LoaderExtensionRec {
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate);
/**
* Flush pending front-buffer rendering
*
* Any rendering that has been performed to the
* \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
* \c __DRI_BUFFER_FRONT_LEFT.
*
* \param driDrawable Drawable whose front-buffer is to be flushed
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable
*/
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
/**
* Get list of buffers from the server
*
* Gets a list of buffer for the specified set of attachments. Unlike
* \c ::getBuffers, this function takes a list of attachments paired with
* opaque \c unsigned \c int value describing the format of the buffer.
* It is the responsibility of the caller to know what the service that
* allocates the buffers will expect to receive for the format.
*
* \param driDrawable Drawable whose buffers are being queried.
* \param width Output where the width of the buffers is stored.
* \param height Output where the height of the buffers is stored.
* \param attachments List of pairs of attachment ID and opaque format
* requested for the drawable.
* \param count Number of attachment / format pairs stored in
* \c attachments.
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable.
*/
__DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate);
};
/**

View File

@@ -178,4 +178,8 @@ typedef struct __GLcontextModesRec {
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
#endif /* __gl_core_h_ */

View File

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

View File

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

View File

@@ -5,10 +5,12 @@ bounce
clearspd
copypix
cubemap
dinoshade
drawpix
engine
extfuncs.h
fbo_firecube
fbotexture
fire
fogcoord
fplight
@@ -27,11 +29,9 @@ isosurf
lodbias
morph3d
multiarb
occlude
osdemo
paltex
pixeltex
pointblast
projtex
rain
ray
readpix
@@ -61,4 +61,5 @@ trispd
tunnel
tunnel2
vao_demo
Windows
winpos

View File

@@ -19,9 +19,11 @@ PROGS = \
clearspd \
copypix \
cubemap \
dinoshade \
drawpix \
engine \
fbo_firecube \
fbotexture \
fire \
fogcoord \
fplight \
@@ -32,9 +34,7 @@ PROGS = \
geartrain \
glinfo \
gloss \
glslnoise \
gltestperf \
glutfx \
isosurf \
ipers \
lodbias \
@@ -42,6 +42,7 @@ PROGS = \
multiarb \
paltex \
pointblast \
projtex \
rain \
ray \
readpix \
@@ -49,7 +50,6 @@ PROGS = \
renormal \
shadowtex \
singlebuffer \
streaming_rect \
spectex \
spriteblast \
stex3d \
@@ -57,9 +57,7 @@ PROGS = \
terrain \
tessdemo \
texcyl \
texdown \
texenv \
texobj \
textures \
trispd \
tunnel \

View File

@@ -39,11 +39,9 @@ progs = [
'geartrain',
'glinfo',
'gloss',
'glslnoise',
'gltestperf',
'glutfx',
'isosurf',
'ipers',
'isosurf',
'lodbias',
'morph3d',
'multiarb',
@@ -55,7 +53,6 @@ progs = [
'renormal',
'shadowtex',
'singlebuffer',
'streaming_rect',
'spectex',
'spriteblast',
'stex3d',
@@ -63,15 +60,16 @@ progs = [
'terrain',
'tessdemo',
'texcyl',
'texdown',
'texenv',
'texobj',
'textures',
'trispd',
'tunnel',
'tunnel2',
'vao_demo',
'winpos',
'dinoshade',
'fbotexture',
'projtex',
]
for prog in progs:

View File

@@ -165,7 +165,7 @@ enum {
};
/* Create a matrix that will project the desired shadow. */
void
static void
shadowMatrix(GLfloat shadowMat[4][4],
GLfloat groundplane[4],
GLfloat lightpos[4])
@@ -201,7 +201,7 @@ shadowMatrix(GLfloat shadowMat[4][4],
}
/* Find the plane equation given 3 points. */
void
static void
findPlane(GLfloat plane[4],
GLfloat v0[3], GLfloat v1[3], GLfloat v2[3])
{
@@ -224,7 +224,7 @@ findPlane(GLfloat plane[4],
plane[D] = -(plane[A] * v0[X] + plane[B] * v0[Y] + plane[C] * v0[Z]);
}
void
static void
extrudeSolidFromPolygon(GLfloat data[][2], unsigned int dataSize,
GLdouble thickness, GLuint side, GLuint edge, GLuint whole)
{
@@ -382,7 +382,7 @@ static GLfloat floorShadow[4][4];
static void
redraw(void)
{
int start, end;
int start = 0, end = 0;
if (reportSpeed) {
start = glutGet(GLUT_ELAPSED_TIME);
@@ -624,6 +624,7 @@ redraw(void)
glFinish();
end = glutGet(GLUT_ELAPSED_TIME);
printf("Speed %.3g frames/sec (%d ms)\n", 1000.0/(end-start), end-start);
fflush(stdout);
}
glutSwapBuffers();
@@ -878,6 +879,7 @@ main(int argc, char **argv)
polygonOffsetVersion = MISSING;
printf("\ndinoshine: Missing polygon offset.\n");
printf(" Expect shadow depth aliasing artifacts.\n\n");
fflush(stdout);
}
}

View File

@@ -236,11 +236,28 @@ special(int k, int x, int y)
}
}
static void
cleanup(void)
{
int i;
glDeleteTextures(1, &t1id);
glDeleteTextures(1, &t2id);
glDeleteLists(skydlist, 1);
for (i = 0; i < MAX_LOD; i++) {
glDeleteLists(LODdlist[i], 1);
glDeleteLists(LODnumpoly[i], 1);
}
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27:
cleanup();
exit(0);
break;
@@ -707,6 +724,7 @@ main(int ac, char **av)
glutIdleFunc(draw);
glutMainLoop();
cleanup();
return 0;
}

View File

@@ -20,11 +20,7 @@
#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
#if 0
#include "texture.h"
#else
#include "../util/readtex.c"
#endif
#include "readtex.h"
/* Some <math.h> files do not define M_PI... */
@@ -67,14 +63,15 @@ GLfloat zoomFactor = 1.0;
/*****************************************************************/
void ActiveTexture(int i)
static void
ActiveTexture(int i)
{
glActiveTextureARB(i);
}
/* matrix = identity */
void
static void
matrixIdentity(GLfloat matrix[16])
{
matrix[0] = 1.0;
@@ -96,7 +93,7 @@ matrixIdentity(GLfloat matrix[16])
}
/* matrix2 = transpose(matrix1) */
void
static void
matrixTranspose(GLfloat matrix2[16], GLfloat matrix1[16])
{
matrix2[0] = matrix1[0];
@@ -167,7 +164,7 @@ imgLoad(char *filenameIn, int borderIn, GLfloat borderColorIn[4],
/*****************************************************************/
/* Load the image file specified on the command line as the current texture */
void
static void
loadImageTextures(void)
{
GLfloat borderColor[4] =
@@ -252,7 +249,7 @@ loadImageTextures(void)
}
/* Create a simple spotlight pattern and make it the current texture */
void
static void
loadSpotlightTexture(void)
{
static int texWidth = 64, texHeight = 64;
@@ -302,7 +299,7 @@ loadSpotlightTexture(void)
/*****************************************************************/
void
static void
checkErrors(void)
{
GLenum error;
@@ -311,7 +308,7 @@ checkErrors(void)
}
}
void
static void
drawCube(void)
{
glBegin(GL_QUADS);
@@ -360,7 +357,7 @@ drawCube(void)
glEnd();
}
void
static void
drawDodecahedron(void)
{
#define A (0.5 * 1.61803) /* (sqrt(5) + 1) / 2 */
@@ -446,7 +443,7 @@ drawDodecahedron(void)
}
}
void
static void
drawSphere(void)
{
int numMajor = 24;
@@ -573,7 +570,7 @@ drawTextureProjection(void)
/*****************************************************************/
void
static void
initialize(void)
{
GLfloat light0Pos[4] =
@@ -670,7 +667,7 @@ initialize(void)
}
}
void
static void
display(void)
{
int i;
@@ -755,10 +752,10 @@ display(void)
/*****************************************************************/
/* simple trackball-like motion control */
float lastPos[3];
int lastTime;
static float lastPos[3];
static int lastTime;
void
static void
ptov(int x, int y, int width, int height, float v[3])
{
float d, a;
@@ -774,7 +771,7 @@ ptov(int x, int y, int width, int height, float v[3])
v[2] *= a;
}
void
static void
startMotion(int x, int y, int but, int time)
{
if (but == GLUT_LEFT_BUTTON) {
@@ -789,13 +786,13 @@ startMotion(int x, int y, int but, int time)
ptov(x, y, winWidth, winHeight, lastPos);
}
void
static void
animate(void)
{
glutPostRedisplay();
}
void
static void
vis(int visible)
{
if (visible == GLUT_VISIBLE) {
@@ -807,7 +804,7 @@ vis(int visible)
}
}
void
static void
stopMotion(int but, int time)
{
if ((but == GLUT_LEFT_BUTTON && mode == MoveView) ||
@@ -829,7 +826,7 @@ stopMotion(int but, int time)
}
}
void
static void
trackMotion(int x, int y)
{
float curPos[3], dx, dy, dz;
@@ -854,7 +851,7 @@ trackMotion(int x, int y)
/*****************************************************************/
void
static void
object(void)
{
static int object;
@@ -881,7 +878,7 @@ nop(void)
{
}
void
static void
texture(void)
{
static int texture = 0;
@@ -912,7 +909,7 @@ texture(void)
}
}
void
static void
help(void)
{
printf("'h' - help\n");
@@ -927,7 +924,7 @@ help(void)
}
/* ARGSUSED1 */
void
static void
key(unsigned char key, int x, int y)
{
switch (key) {
@@ -966,7 +963,7 @@ key(unsigned char key, int x, int y)
glutPostRedisplay();
}
void
static void
mouse(int button, int state, int x, int y)
{
if (state == GLUT_DOWN)
@@ -976,7 +973,7 @@ mouse(int button, int state, int x, int y)
glutPostRedisplay();
}
void
static void
reshape(int w, int h)
{
winWidth = w;
@@ -985,7 +982,7 @@ reshape(int w, int h)
}
void
static void
menu(int selection)
{
if (selection == 666) {
@@ -1005,6 +1002,7 @@ main(int argc, char **argv)
assert(NumTextures <= MAX_TEX);
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowSize(500,500);
(void) glutCreateWindow("projtex");
glewInit();

View File

@@ -17,6 +17,7 @@
#define IMAGE_FILE "../images/girl.rgb"
static int ImgWidth, ImgHeight;
static int WinWidth, WinHeight;
static GLenum ImgFormat;
static GLubyte *Image = NULL;
@@ -27,6 +28,7 @@ static int CPosX, CPosY; /* copypixels */
static GLboolean DrawFront = GL_FALSE;
static GLboolean ScaleAndBias = GL_FALSE;
static GLboolean Benchmark = GL_FALSE;
static GLboolean Triangle = GL_FALSE;
static GLubyte *TempImage = NULL;
#define COMBO 1
@@ -150,11 +152,60 @@ Display( void )
/* draw original image */
glRasterPos2i(APosX, 5);
PrintString("Original");
glRasterPos2i(APosX, APosY);
glEnable(GL_DITHER);
SetupPixelTransfer(GL_FALSE);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
if (!Triangle) {
glRasterPos2i(APosX, APosY);
glEnable(GL_DITHER);
SetupPixelTransfer(GL_FALSE);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
}
else {
float z = 0;
glViewport(APosX, APosY, ImgWidth, ImgHeight);
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glDisable(GL_CULL_FACE);
/* Red should never be seen
*/
glBegin(GL_POLYGON);
glColor3f(1,0,0);
glVertex3f(-2, -2, z);
glVertex3f(-2, 2, z);
glVertex3f(2, 2, z);
glVertex3f(2, -2, z);
glEnd();
/* Blue background
*/
glBegin(GL_POLYGON);
glColor3f(.5,.5,1);
glVertex3f(-1, -1, z);
glVertex3f(-1, 1, z);
glVertex3f(1, 1, z);
glVertex3f(1, -1, z);
glEnd();
/* Triangle
*/
glBegin(GL_TRIANGLES);
glColor3f(.8,0,0);
glVertex3f(-0.9, -0.9, z);
glColor3f(0,.9,0);
glVertex3f( 0.9, -0.9, z);
glColor3f(0,0,.7);
glVertex3f( 0.0, 0.9, z);
glEnd();
glColor3f(1,1,1);
glViewport( 0, 0, WinWidth, WinHeight );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0.0, WinWidth, 0.0, WinHeight, -1.0, 1.0 );
}
/* might try alignment=4 here for testing */
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
@@ -218,6 +269,9 @@ Display( void )
static void
Reshape( int width, int height )
{
WinWidth = width;
WinHeight = height;
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
@@ -236,6 +290,9 @@ Key( unsigned char key, int x, int y )
case 'b':
Benchmark = GL_TRUE;
break;
case 't':
Triangle = !Triangle;
break;
case 's':
ScaleAndBias = !ScaleAndBias;
break;

View File

@@ -788,6 +788,7 @@ Key(unsigned char key, int x, int y)
exit(0);
break;
}
fflush(stdout);
glutPostRedisplay();
}
@@ -1014,6 +1015,7 @@ PrintHelp(void)
printf(" <shift> + cursor keys = rotate light source\n");
if (HaveEXTshadowFuncs)
printf(" o = cycle through comparison modes\n");
fflush(stdout);
}

View File

@@ -173,10 +173,20 @@ static void special(int k, int x, int y)
}
}
static void cleanup(void)
{
glDeleteTextures(1, &t1id);
glDeleteTextures(1, &t2id);
glDeleteLists(teapotdlist, 1);
glDeleteLists(basedlist, 1);
glDeleteLists(lightdlist, 1);
}
static void key(unsigned char k, int x, int y)
{
switch(k) {
case 27:
cleanup();
exit(0);
break;
@@ -670,6 +680,7 @@ int main(int ac, char **av)
glutIdleFunc(draw);
glutMainLoop();
cleanup();
return 0;
}

View File

@@ -202,11 +202,19 @@ special(int k, int x, int y)
}
}
static void
cleanup(void)
{
glDeleteTextures(1, &t1id);
glDeleteTextures(1, &t2id);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27:
cleanup();
exit(0);
break;
@@ -531,5 +539,6 @@ main(int ac, char **av)
glutMainLoop();
cleanup();
return 0;
}

View File

@@ -200,6 +200,13 @@ special(int k, int x, int y)
}
}
static void
cleanup(void)
{
glDeleteTextures(1, &t1id);
glDeleteTextures(1, &t2id);
}
static void
key(unsigned char k, int x, int y)
{
@@ -207,6 +214,7 @@ key(unsigned char k, int x, int y)
case 27:
glutDestroyWindow(channel[0]);
glutDestroyWindow(channel[1]);
cleanup();
exit(0);
break;
@@ -602,6 +610,7 @@ main(int ac, char **av)
calcposobs();
glutMainLoop();
cleanup();
return 0;
}

View File

@@ -210,11 +210,17 @@ static void Display(void)
glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 1.0, 1.0, 0.0, 0.0);
glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 0.0, 0.0, 1.0, 1.0);
glBegin(GL_TRIANGLES);
glColor3f(0,0,1);
glTexCoord3f(1,1,0);
glVertex3f( 0.9, -0.9, -30.0);
glColor3f(1,0,0);
glTexCoord3f(1,-1,0);
glVertex3f( 0.9, 0.9, -30.0);
glColor3f(0,1,0);
glTexCoord3f(-1,0,0);
glVertex3f(-0.9, 0.0, -30.0);
glEnd();

View File

@@ -0,0 +1,8 @@
!!ARBfp1.0
TEMP R0;
MUL R0.xy, fragment.texcoord[0], fragment.texcoord[0];
ADD R0.x, R0.x, R0.y;
SGE R0.y, R0.x, fragment.texcoord[0].w;
KIL -R0.y;
MOV result.color, fragment.color;
END

5
progs/fp/swz3.txt Normal file
View File

@@ -0,0 +1,5 @@
!!ARBfp1.0
TEMP R0, R1;
MOV R0, -fragment.color;
SWZ result.color, R0, -y, -x, z, 1;
END

View File

@@ -1,3 +1,4 @@
array
bitmap
brick
bump
@@ -6,10 +7,12 @@ deriv
extfuncs.h
fragcoord
identity
linktest
mandelbrot
multinoise
multitex
noise
noise2
pointcoord
points
readtex.c
@@ -20,6 +23,7 @@ shaderutil.c
shaderutil.h
shadow_sampler
skinning
texaaline
texdemo1
toyball
trirast

View File

@@ -5,45 +5,69 @@ include $(TOP)/configs/current
INCDIR = $(TOP)/include
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
LIB_DEP = \
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) \
$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
PROGS = \
bitmap \
brick \
bump \
convolutions \
deriv \
identity \
fragcoord \
mandelbrot \
multinoise \
multitex \
noise \
points \
pointcoord \
samplers \
samplers_array \
shadow_sampler \
skinning \
texdemo1 \
toyball \
twoside \
trirast \
vert-or-frag-only \
vert-tex
INCLUDE_DIRS = -I$(TOP)/progs/util
DEMO_SOURCES = \
array.c \
bitmap.c \
brick.c \
bump.c \
convolutions.c \
deriv.c \
fragcoord.c \
identity.c \
linktest.c \
mandelbrot.c \
multinoise.c \
multitex.c \
noise.c \
noise2.c \
pointcoord.c \
points.c \
samplers.c \
shadow_sampler.c \
skinning.c \
texaaline.c \
texdemo1.c \
toyball.c \
trirast.c \
twoside.c \
vert-or-frag-only.c \
vert-tex.c
UTIL_HEADERS = \
extfuncs.h \
shaderutil.h \
readtex.h
UTIL_SOURCES = \
shaderutil.c \
readtex.c
UTIL_OBJS = $(UTIL_SOURCES:.c=.o)
PROGS = $(DEMO_SOURCES:%.c=%)
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
# make .o file from .c file:
.c.o:
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) $< -o $@
# make executable from .c file:
.c: $(LIB_DEP)
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
# make executable from .o files
.o:
$(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(UTIL_OBJS) $(LIBS) -o $@
##### TARGETS #####
@@ -51,182 +75,163 @@ PROGS = \
default: $(PROGS)
##### 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 $< .
readtex.o: readtex.c readtex.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
shaderutil.c: $(TOP)/progs/util/shaderutil.c
cp $< .
shaderutil.h: $(TOP)/progs/util/shaderutil.h
cp $< .
shaderutil.o: shaderutil.c shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
bitmap.o: bitmap.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
bitmap: bitmap.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
brick.o: brick.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c
brick: brick.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
bump.o: bump.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c
bump: bump.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
convolutions.o: convolutions.c readtex.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
convolutions: convolutions.o readtex.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
deriv.o: deriv.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
deriv: deriv.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
identity.o: identity.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c
identity: identity.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@
fragcoord.o: fragcoord.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c
fragcoord: fragcoord.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@
mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
mandelbrot: mandelbrot.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@
multitex.o: multitex.c extfuncs.h readtex.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) multitex.c
multitex: multitex.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
noise.o: noise.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise.c
noise: noise.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
points.o: points.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) points.c
points: points.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
pointcoord: pointcoord.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
samplers.o: samplers.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) samplers.c
samplers: samplers.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@
samplers_array.o: samplers.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -DSAMPLERS_ARRAY -I$(INCDIR) $(CFLAGS) samplers.c -o samplers_array.o
samplers_array: samplers_array.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers_array.o readtex.o shaderutil.o $(LIBS) -o $@
skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
skinning: skinning.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
texdemo1: texdemo1.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
toyball.o: toyball.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
toyball: toyball.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
twoside.o: twoside.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
twoside: twoside.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
trirast.o: trirast.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
trirast: trirast.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
vert-or-frag-only.o: vert-or-frag-only.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c
vert-or-frag-only: vert-or-frag-only.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@
vert-tex.o: vert-tex.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c
vert-tex: vert-tex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@
clean:
-rm -f $(PROGS)
-rm -f *.o *~
-rm -f extfuncs.h
-rm -f shaderutil.*
##### Extra dependencies
extfuncs.h:
cp $(TOP)/progs/util/extfuncs.h .
readtex.c:
cp $(TOP)/progs/util/readtex.c .
readtex.h:
cp $(TOP)/progs/util/readtex.h .
shaderutil.c:
cp $(TOP)/progs/util/shaderutil.c .
shaderutil.h:
cp $(TOP)/progs/util/shaderutil.h .
array.o: $(UTIL_HEADERS)
array: array.o $(UTIL_OBJS)
bitmap.o: $(UTIL_HEADERS)
bitmap: bitmap.o $(UTIL_OBJS)
brick.o: $(UTIL_HEADERS)
brick: brick.o $(UTIL_OBJS)
bump.o: $(UTIL_HEADERS)
bump: bump.o $(UTIL_OBJS)
convolutions.o: $(UTIL_HEADERS)
convolutions: convolutions.o $(UTIL_OBJS)
deriv.o: deriv.c $(UTIL_HEADERS)
deriv: deriv.o $(UTIL_OBJS)
identity.o: $(UTIL_HEADERS)
identity: identity.o $(UTIL_OBJS)
fragcoord.o: $(UTIL_HEADERS)
fragcoord: fragcoord.o $(UTIL_OBJS)
linktest.o: $(UTIL_HEADERS)
linktest: linktest.o $(UTIL_OBJS)
mandelbrot.o: $(UTIL_HEADERS)
mandelbrot: mandelbrot.o $(UTIL_OBJS)
multinoise.o: $(UTIL_HEADERS)
multinoise: multinoise.o $(UTIL_OBJS)
multitex.o: $(UTIL_HEADERS)
multitex: multitex.o $(UTIL_OBJS)
noise.o: $(UTIL_HEADERS)
noise: noise.o $(UTIL_OBJS)
noise2.o: $(UTIL_HEADERS)
noise2: noise2.o $(UTIL_OBJS)
points.o: $(UTIL_HEADERS)
points: points.o $(UTIL_OBJS)
pointcoord.o: $(UTIL_HEADERS)
pointcoord: pointcoord.o $(UTIL_OBJS)
samplers.o: $(UTIL_HEADERS)
samplers: samplers.o $(UTIL_OBJS)
samplers_array.o: $(UTIL_HEADERS)
samplers_array: samplers_array.o $(UTIL_OBJS)
shadow_sampler.o: $(UTIL_HEADERS)
shadow_sampler: shadow_sampler.o $(UTIL_OBJS)
skinning.o: $(UTIL_HEADERS)
skinning: skinning.o $(UTIL_OBJS)
texaaline.o: $(UTIL_HEADERS)
texaaline: texaaline.o $(UTIL_OBJS)
texdemo1.o: $(UTIL_HEADERS)
texdemo1: texdemo1.o $(UTIL_OBJS)
toyball.o: $(UTIL_HEADERS)
toyball: toyball.o $(UTIL_OBJS)
twoside.o: $(UTIL_HEADERS)
twoside: twoside.o $(UTIL_OBJS)
trirast.o: $(UTIL_HEADERS)
trirast: trirast.o $(UTIL_OBJS)
vert-or-frag-only.o: $(UTIL_HEADERS)
vert-or-frag-only: vert-or-frag-only.o $(UTIL_OBJS)
vert-tex.o: $(UTIL_HEADERS)
vert-tex: vert-tex.o $(UTIL_OBJS)

261
progs/glsl/array.c Normal file
View File

@@ -0,0 +1,261 @@
/**
* Test variable array indexing in a vertex shader.
* Brian Paul
* 17 April 2009
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
#include "extfuncs.h"
#include "shaderutil.h"
/**
* The vertex position.z is used as a (variable) index into an
* array which returns a new Z value.
*/
static const char *VertShaderText =
"uniform sampler2D tex1; \n"
"uniform float HeightArray[20]; \n"
"void main() \n"
"{ \n"
" vec4 pos = gl_Vertex; \n"
" int i = int(pos.z * 9.5); \n"
" pos.z = HeightArray[i]; \n"
" gl_Position = gl_ModelViewProjectionMatrix * pos; \n"
" gl_FrontColor = pos; \n"
"} \n";
static const char *FragShaderText =
"void main() \n"
"{ \n"
" gl_FragColor = gl_Color; \n"
"} \n";
static GLuint fragShader;
static GLuint vertShader;
static GLuint program;
static GLint win = 0;
static GLboolean Anim = GL_TRUE;
static GLboolean WireFrame = GL_TRUE;
static GLfloat xRot = -70.0f, yRot = 0.0f, zRot = 0.0f;
static void
Idle(void)
{
zRot = 90 + glutGet(GLUT_ELAPSED_TIME) * 0.05;
glutPostRedisplay();
}
/** z=f(x,y) */
static float
fz(float x, float y)
{
return fabs(cos(1.5*x) + cos(1.5*y));
}
static void
DrawMesh(void)
{
GLfloat xmin = -2.0, xmax = 2.0;
GLfloat ymin = -2.0, ymax = 2.0;
GLuint xdivs = 20, ydivs = 20;
GLfloat dx = (xmax - xmin) / xdivs;
GLfloat dy = (ymax - ymin) / ydivs;
GLfloat ds = 1.0 / xdivs, dt = 1.0 / ydivs;
GLfloat x, y, s, t;
GLuint i, j;
y = ymin;
t = 0.0;
for (i = 0; i < ydivs; i++) {
x = xmin;
s = 0.0;
glBegin(GL_QUAD_STRIP);
for (j = 0; j < xdivs; j++) {
float z0 = fz(x, y), z1 = fz(x, y + dy);
glTexCoord2f(s, t);
glVertex3f(x, y, z0);
glTexCoord2f(s, t + dt);
glVertex3f(x, y + dy, z1);
x += dx;
s += ds;
}
glEnd();
y += dy;
t += dt;
}
}
static void
Redisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (WireFrame)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glPushMatrix();
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
glRotatef(zRot, 0.0f, 0.0f, 1.0f);
glPushMatrix();
DrawMesh();
glPopMatrix();
glPopMatrix();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glutSwapBuffers();
}
static void
Reshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -15.0f);
}
static void
CleanUp(void)
{
glDeleteShader_func(fragShader);
glDeleteShader_func(vertShader);
glDeleteProgram_func(program);
glutDestroyWindow(win);
}
static void
Key(unsigned char key, int x, int y)
{
const GLfloat step = 2.0;
(void) x;
(void) y;
switch(key) {
case 'a':
Anim = !Anim;
if (Anim)
glutIdleFunc(Idle);
else
glutIdleFunc(NULL);
break;
case 'w':
WireFrame = !WireFrame;
break;
case 'z':
zRot += step;
break;
case 'Z':
zRot -= step;
break;
case 27:
CleanUp();
exit(0);
break;
}
glutPostRedisplay();
}
static void
SpecialKey(int key, int x, int y)
{
const GLfloat step = 2.0;
(void) x;
(void) y;
switch(key) {
case GLUT_KEY_UP:
xRot += step;
break;
case GLUT_KEY_DOWN:
xRot -= step;
break;
case GLUT_KEY_LEFT:
yRot -= step;
break;
case GLUT_KEY_RIGHT:
yRot += step;
break;
}
glutPostRedisplay();
}
static void
Init(void)
{
GLfloat HeightArray[20];
GLint u, i;
if (!ShadersSupported())
exit(1);
GetExtensionFuncs();
vertShader = CompileShaderText(GL_VERTEX_SHADER, VertShaderText);
fragShader = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderText);
program = LinkShaders(vertShader, fragShader);
glUseProgram_func(program);
/* Setup the HeightArray[] uniform */
for (i = 0; i < 20; i++)
HeightArray[i] = i / 20.0;
u = glGetUniformLocation_func(program, "HeightArray");
glUniform1fv_func(u, 20, HeightArray);
assert(glGetError() == 0);
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
glEnable(GL_DEPTH_TEST);
glColor3f(1, 1, 1);
}
int
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Redisplay);
Init();
if (Anim)
glutIdleFunc(Idle);
glutMainLoop();
return 0;
}

View File

@@ -150,10 +150,11 @@ Redisplay(void)
static void
Reshape(int width, int height)
{
float ar = (float) width / (float) height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -15.0f);

258
progs/glsl/linktest.c Normal file
View File

@@ -0,0 +1,258 @@
/**
* Test linking of multiple compilation units.
* Brian Paul
* 28 March 2009
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
#include "extfuncs.h"
#include "shaderutil.h"
static GLfloat diffuse[4] = { 0.5f, 1.0f, 0.5f, 1.0f };
static GLfloat specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f };
static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 0.0f };
static GLfloat delta = 1.0f;
static GLuint VertShader1;
static GLuint VertShader2;
static GLuint FragShader1;
static GLuint FragShader2;
static GLuint Program;
static GLint uDiffuse;
static GLint uSpecular;
static GLint uTexture;
static GLint Win = 0;
static GLboolean anim = GL_TRUE;
static const char *FragShaderSource1 =
"float compute_dotprod(const vec3 normal) \n"
"{ \n"
" float dotProd = max(dot(gl_LightSource[0].position.xyz, \n"
" normalize(normal)), 0.0); \n"
" return dotProd; \n"
"} \n";
static const char *FragShaderSource2 =
"uniform vec4 diffuse;\n"
"uniform vec4 specular;\n"
"varying vec3 normal;\n"
"\n"
"// external function \n"
"float compute_dotprod(const vec3 normal); \n"
"\n"
"void main() \n"
"{ \n"
" float dotProd = compute_dotprod(normal); \n"
" gl_FragColor = diffuse * dotProd + specular * pow(dotProd, 20.0); \n"
"} \n";
static const char *VertShaderSource1 =
"vec3 compute_normal() \n"
"{ \n"
" return gl_NormalMatrix * gl_Normal; \n"
"} \n";
static const char *VertShaderSource2 =
"varying vec3 normal;\n"
"\n"
"// external function \n"
"vec3 compute_normal(); \n"
"\n"
"void main() \n"
"{ \n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; \n"
" normal = compute_normal(); \n"
"} \n";
static void
normalize(GLfloat *dst, const GLfloat *src)
{
GLfloat len = sqrt(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
dst[0] = src[0] / len;
dst[1] = src[1] / len;
dst[2] = src[2] / len;
dst[3] = src[3];
}
static void
Redisplay(void)
{
GLfloat vec[4];
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* update light position */
normalize(vec, lightPos);
glLightfv(GL_LIGHT0, GL_POSITION, vec);
glutSolidSphere(2.0, 10, 5);
glutSwapBuffers();
}
static void
Idle(void)
{
lightPos[0] += delta;
if (lightPos[0] > 25.0f || lightPos[0] < -25.0f)
delta = -delta;
glutPostRedisplay();
}
static void
Reshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -15.0f);
}
static void
CleanUp(void)
{
glDeleteShader_func(VertShader1);
glDeleteShader_func(VertShader2);
glDeleteShader_func(FragShader1);
glDeleteShader_func(FragShader2);
glDeleteProgram_func(Program);
glutDestroyWindow(Win);
}
static void
Key(unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch(key) {
case ' ':
case 'a':
anim = !anim;
if (anim)
glutIdleFunc(Idle);
else
glutIdleFunc(NULL);
break;
case 'x':
lightPos[0] -= 1.0f;
break;
case 'X':
lightPos[0] += 1.0f;
break;
case 27:
CleanUp();
exit(0);
break;
}
glutPostRedisplay();
}
static void
CheckLink(GLuint prog)
{
GLint stat;
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
glGetProgramInfoLog_func(prog, 1000, &len, log);
fprintf(stderr, "Linker error:\n%s\n", log);
}
}
static void
Init(void)
{
if (!ShadersSupported())
exit(1);
GetExtensionFuncs();
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
VertShader1 = CompileShaderText(GL_VERTEX_SHADER, VertShaderSource1);
VertShader2 = CompileShaderText(GL_VERTEX_SHADER, VertShaderSource2);
FragShader1 = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderSource1);
FragShader2 = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderSource2);
Program = glCreateProgram_func();
glAttachShader_func(Program, VertShader1);
glAttachShader_func(Program, VertShader2);
glAttachShader_func(Program, FragShader1);
glAttachShader_func(Program, FragShader2);
glLinkProgram_func(Program);
CheckLink(Program);
glUseProgram_func(Program);
uDiffuse = glGetUniformLocation_func(Program, "diffuse");
uSpecular = glGetUniformLocation_func(Program, "specular");
uTexture = glGetUniformLocation_func(Program, "texture");
printf("DiffusePos %d SpecularPos %d TexturePos %d\n",
uDiffuse, uSpecular, uTexture);
glUniform4fv_func(uDiffuse, 1, diffuse);
glUniform4fv_func(uSpecular, 1, specular);
glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
glEnable(GL_DEPTH_TEST);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 10.0f);
assert(glIsProgram_func(Program));
assert(glIsShader_func(VertShader1));
assert(glIsShader_func(VertShader2));
assert(glIsShader_func(FragShader1));
assert(glIsShader_func(FragShader2));
glColor3f(1, 0, 0);
}
int
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowSize(300, 300);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
if (anim)
glutIdleFunc(Idle);
Init();
glutMainLoop();
return 0;
}

369
progs/glsl/texaaline.c Normal file
View File

@@ -0,0 +1,369 @@
/**
* AA lines with texture mapped quads
*
* Brian Paul
* 9 Feb 2008
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
#include "extfuncs.h"
static GLint WinWidth = 300, WinHeight = 300;
static GLint win = 0;
static GLfloat Width = 8.;
/*
* Quad strip for line from v0 to v1:
*
1 3 5 7
+---+---------------------+---+
| |
| *v0 v1* |
| |
+---+---------------------+---+
0 2 4 6
*/
static void
QuadLine(const GLfloat *v0, const GLfloat *v1, GLfloat width)
{
GLfloat dx = v1[0] - v0[0];
GLfloat dy = v1[1] - v0[1];
GLfloat len = sqrt(dx*dx + dy*dy);
float dx0, dx1, dx2, dx3, dx4, dx5, dx6, dx7;
float dy0, dy1, dy2, dy3, dy4, dy5, dy6, dy7;
dx /= len;
dy /= len;
width *= 0.5; /* half width */
dx = dx * (width + 0.0);
dy = dy * (width + 0.0);
dx0 = -dx+dy; dy0 = -dy-dx;
dx1 = -dx-dy; dy1 = -dy+dx;
dx2 = 0+dy; dy2 = -dx+0;
dx3 = 0-dy; dy3 = +dx+0;
dx4 = 0+dy; dy4 = -dx+0;
dx5 = 0-dy; dy5 = +dx+0;
dx6 = dx+dy; dy6 = dy-dx;
dx7 = dx-dy; dy7 = dy+dx;
/*
printf("dx, dy = %g, %g\n", dx, dy);
printf(" dx0, dy0: %g, %g\n", dx0, dy0);
printf(" dx1, dy1: %g, %g\n", dx1, dy1);
printf(" dx2, dy2: %g, %g\n", dx2, dy2);
printf(" dx3, dy3: %g, %g\n", dx3, dy3);
*/
glBegin(GL_QUAD_STRIP);
glTexCoord2f(0, 0);
glVertex2f(v0[0] + dx0, v0[1] + dy0);
glTexCoord2f(0, 1);
glVertex2f(v0[0] + dx1, v0[1] + dy1);
glTexCoord2f(0.5, 0);
glVertex2f(v0[0] + dx2, v0[1] + dy2);
glTexCoord2f(0.5, 1);
glVertex2f(v0[0] + dx3, v0[1] + dy3);
glTexCoord2f(0.5, 0);
glVertex2f(v1[0] + dx2, v1[1] + dy2);
glTexCoord2f(0.5, 1);
glVertex2f(v1[0] + dx3, v1[1] + dy3);
glTexCoord2f(1, 0);
glVertex2f(v1[0] + dx6, v1[1] + dy6);
glTexCoord2f(1, 1);
glVertex2f(v1[0] + dx7, v1[1] + dy7);
glEnd();
}
static float Cos(float a)
{
return cos(a * M_PI / 180.);
}
static float Sin(float a)
{
return sin(a * M_PI / 180.);
}
static void
Redisplay(void)
{
int i;
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1, 1, 1);
glEnable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
for (i = 0; i < 360; i+=5) {
float v0[2], v1[2];
v0[0] = 150 + 40 * Cos(i);
v0[1] = 150 + 40 * Sin(i);
v1[0] = 150 + 130 * Cos(i);
v1[1] = 150 + 130 * Sin(i);
QuadLine(v0, v1, Width);
}
{
float v0[2], v1[2], x;
for (x = 0; x < 1.0; x += 0.2) {
v0[0] = 150 + x;
v0[1] = 150 + x * 40 - 20;
v1[0] = 150 + x + 5.0;
v1[1] = 150 + x * 40 - 20;
QuadLine(v0, v1, Width);
}
}
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
glutSwapBuffers();
}
static void
Reshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, width, 0, height, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
static void
CleanUp(void)
{
glutDestroyWindow(win);
}
static void
Key(unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch(key) {
case 'w':
Width -= 0.5;
break;
case 'W':
Width += 0.5;
break;
case 27:
CleanUp();
exit(0);
break;
}
#if 0
if (Width < 3)
Width = 3;
#endif
printf("Width = %g\n", Width);
glutPostRedisplay();
}
static float
ramp4(GLint i, GLint size)
{
float d;
if (i < 4 ) {
d = i / 4.0;
}
else if (i >= size - 5) {
d = 1.0 - (i - (size - 5)) / 4.0;
}
else {
d = 1.0;
}
return d;
}
static float
ramp2(GLint i, GLint size)
{
float d;
if (i < 2 ) {
d = i / 2.0;
}
else if (i >= size - 3) {
d = 1.0 - (i - (size - 3)) / 2.0;
}
else {
d = 1.0;
}
return d;
}
static float
ramp1(GLint i, GLint size)
{
float d;
if (i == 0 || i == size-1) {
d = 0.0;
}
else {
d = 1.0;
}
return d;
}
/**
* Make an alpha texture for antialiasing lines.
* Just a linear fall-off ramp for now.
* Should have a number of different textures for different line widths.
* Could try a bell-like-curve....
*/
static void
MakeTexture(void)
{
#define SZ 8
GLfloat tex[SZ][SZ]; /* alpha tex */
int i, j;
for (i = 0; i < SZ; i++) {
for (j = 0; j < SZ; j++) {
#if 0
float k = (SZ-1) / 2.0;
float dx = fabs(i - k) / k;
float dy = fabs(j - k) / k;
float d;
dx = 1.0 - dx;
dy = 1.0 - dy;
d = dx * dy;
#else
float d = ramp1(i, SZ) * ramp1(j, SZ);
printf("%d, %d: %g\n", i, j, d);
#endif
tex[i][j] = d;
}
}
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, SZ, SZ, 0, GL_ALPHA, GL_FLOAT, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
#undef SZ
}
static void
MakeMipmap(void)
{
#define SZ 64
GLfloat tex[SZ][SZ]; /* alpha tex */
int level;
glPixelStorei(GL_UNPACK_ROW_LENGTH, SZ);
for (level = 0; level < 7; level++) {
int sz = 1 << (6 - level);
int i, j;
for (i = 0; i < sz; i++) {
for (j = 0; j < sz; j++) {
if (level == 6)
tex[i][j] = 1.0;
else if (level == 5)
tex[i][j] = 0.5;
else
tex[i][j] = ramp1(i, sz) * ramp1(j, sz);
}
}
glTexImage2D(GL_TEXTURE_2D, level, GL_ALPHA,
sz, sz, 0, GL_ALPHA, GL_FLOAT, tex);
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
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);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
#undef SZ
}
static void
Init(void)
{
const char *version;
(void) MakeTexture;
(void) ramp4;
(void) ramp2;
version = (const char *) glGetString(GL_VERSION);
if (version[0] != '2' || version[1] != '.') {
printf("This program requires OpenGL 2.x, found %s\n", version);
exit(1);
}
GetExtensionFuncs();
glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
#if 0
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
#elif 0
MakeTexture();
#else
MakeMipmap();
#endif
}
static void
ParseOptions(int argc, char *argv[])
{
}
int
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowPosition( 0, 0);
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
ParseOptions(argc, argv);
Init();
glutMainLoop();
return 0;
}

View File

@@ -153,6 +153,7 @@ static void Benchmark( float xdiff, float ydiff )
double seconds, fps;
printf("Benchmarking...\n");
fflush(stdout);
draws = 0;
startTime = glutGet(GLUT_ELAPSED_TIME);
@@ -169,6 +170,7 @@ static void Benchmark( float xdiff, float ydiff )
seconds = (double) (endTime - startTime) / 1000.0;
fps = draws / seconds;
printf("Result: fps: %g\n", fps);
fflush(stdout);
}
@@ -263,6 +265,7 @@ void keyboard (unsigned char key, int x, int y)
default:
break;
}
fflush(stdout);
}
static void

View File

@@ -100,7 +100,7 @@ static void PrintColorStrings( void )
{
GLubyte ubbuf[3];
int i, xleft, xright;
char colorString[18];
char colorString[100];
xleft = 5 + windW/4;
xright = 5 + windW/2;

View File

@@ -14,22 +14,22 @@ arbvpwarpmesh
arraytexture
blendminmax
blendsquare
blendxor
bufferobj
bug_3050
bug_3101
bug_3195
bug_texstore_i8
bumpmap
calibrate_rast
copypixrate
crossbar
cva
dinoshade
drawbuffers
extfuncs.h
exactrast
fbotest1
fbotest2
fbotexture
fillrate
floattex
fog
@@ -38,12 +38,17 @@ fptest1
fptexture
getprocaddress
getproclist.h
glutfx
interleave
invert
jkrahntest
lineclip
manytex
mapbufrange
mapvbo
minmag
mipgen
mipmap_comp
mipmap_limits
mipmap_view
multipal
@@ -51,26 +56,29 @@ no_s3tc
packedpixels
pbo
prog_parameter
projtex
quads
random
readrate
readtex.c
readtex.h
rubberband
seccolor
sharedtex
shader_api
shaderutil.c
shaderutil.h
sharedtex
stencil_twoside
stencil_wrap
stencilwrap
stencil_wrap
streaming_rect
subtex
subtexrate
tex1d
texcmp
texcompress2
texdown
texfilt
texgenmix
texline
texobj
texobjshare
texrect
texwrap

View File

@@ -37,19 +37,18 @@ SOURCES = \
copypixrate.c \
crossbar.c \
cva.c \
dinoshade.c \
drawbuffers.c \
exactrast.c \
floattex.c \
fbotest1.c \
fbotest2.c \
fbotexture.c \
fillrate.c \
fog.c \
fogcoord.c \
fptest1.c \
fptexture.c \
getprocaddress.c \
glutfx \
interleave.c \
invert.c \
jkrahntest.c \
@@ -58,6 +57,8 @@ SOURCES = \
mapbufrange.c \
mapvbo.c \
minmag.c \
mipgen.c \
mipmap_comp.c \
mipmap_limits.c \
mipmap_view.c \
multipal.c \
@@ -65,7 +66,6 @@ SOURCES = \
packedpixels.c \
pbo.c \
prog_parameter.c \
projtex.c \
quads.c \
random.c \
readrate.c \
@@ -76,12 +76,15 @@ SOURCES = \
stencil_twoside.c \
stencilwrap.c \
stencil_wrap.c \
streaming_rect \
subtex \
subtexrate.c \
tex1d.c \
texcompress2.c \
texdown \
texfilt.c \
texline.c \
texobj.c \
texobjshare.c \
texrect.c \
texwrap.c \
@@ -184,6 +187,11 @@ mipmap_view: mipmap_view.o readtex.o
mipmap_view.o: mipmap_view.c readtex.h
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
mipmap_limits: mipmap_limits.o readtex.o
$(APP_CC) $(CFLAGS) mipmap_limits.o readtex.o $(LIBS) -o $@
mipmap_limits.o: mipmap_limits.c readtex.h
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
fillrate: fillrate.o readtex.o
$(APP_CC) $(CFLAGS) fillrate.o readtex.o $(LIBS) -o $@
@@ -195,10 +203,10 @@ fillrate.o: fillrate.c readtex.h
floattex: floattex.o readtex.o shaderutil.o
$(CC) $(CFLAGS) $(LDFLAGS) floattex.o readtex.o shaderutil.o $(LIBS) -o $@
$(APP_CC) $(CFLAGS) $(LDFLAGS) floattex.o readtex.o shaderutil.o $(LIBS) -o $@
floattex.o: floattex.c readtex.h shaderutil.h
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) floattex.c -o $@
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) floattex.c -o $@
readtex.o: readtex.c
@@ -224,7 +232,7 @@ shaderutil.h: $(TOP)/progs/util/shaderutil.h
cp $< .
shaderutil.o: shaderutil.c shaderutil.h
$(CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
$(APP_CC) -c -I$(INCDIR) $(INCLUDES) $(CFLAGS) shaderutil.c

View File

@@ -42,8 +42,8 @@ progs = [
'arbfptest1',
'arbfptexture',
'arbfptrig',
'arbnpot-mipmap',
'arbnpot',
'arbnpot-mipmap',
'arbvptest1',
'arbvptest3',
'arbvptorus',
@@ -61,19 +61,18 @@ progs = [
'copypixrate',
'crossbar',
'cva',
'dinoshade',
'drawbuffers',
'exactrast',
'ext422square',
'fbotest1',
'fbotest2',
'fbotexture',
'fillrate',
'floattex',
'fog',
'fogcoord',
'fptest1',
'fptexture',
'glutfx',
'interleave',
'invert',
'lineclip',
@@ -81,6 +80,8 @@ progs = [
'mapbufrange',
'mapvbo',
'minmag',
'mipgen',
'mipmap_comp',
'mipmap_limits',
'mipmap_view',
'multipal',
@@ -90,7 +91,6 @@ progs = [
'packedpixels',
'pbo',
'prog_parameter',
'projtex',
'quads',
'random',
'readrate',
@@ -100,13 +100,17 @@ progs = [
'stencil_twoside',
'stencil_wrap',
'stencilwrap',
'streaming_rect',
'subtex',
'subtexrate',
'tex1d',
'texcmp',
'texcompress2',
'texdown',
'texfilt',
'texgenmix',
'texline',
'texobj',
'texrect',
'texwrap',
'unfilledclip',

View File

@@ -442,8 +442,8 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 300, 300 );
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glewInit();
glutCreateWindow(argv[0] );
glewInit();
Init( argc, argv );

View File

@@ -1,6 +1,5 @@
/*
* Test floating point textures.
* No actual rendering, yet.
*/
@@ -103,7 +102,6 @@ Key(unsigned char key, int x, int y)
}
static void
InitTexture(void)
{
@@ -141,6 +139,8 @@ InitTexture(void)
GL_RGB, GL_FLOAT, ftex);
CheckError(__LINE__);
/* sanity checks */
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_TYPE_ARB, &t);
assert(t == GL_FLOAT);
@@ -152,32 +152,26 @@ InitTexture(void)
assert(t == GL_FLOAT);
free(image);
free(ftex);
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, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
#if 0
/* read back the texture and make sure values are correct */
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, tex2);
CheckError(__LINE__);
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
if (tex[i][j][0] != tex2[i][j][0] ||
tex[i][j][1] != tex2[i][j][1] ||
tex[i][j][2] != tex2[i][j][2] ||
tex[i][j][3] != tex2[i][j][3]) {
printf("tex[%d][%d] %g %g %g %g != tex2[%d][%d] %g %g %g %g\n",
i, j,
tex[i][j][0], tex[i][j][1], tex[i][j][2], tex[i][j][3],
i, j,
tex2[i][j][0], tex2[i][j][1], tex2[i][j][2], tex2[i][j][3]);
if (1) {
/* read back the texture and make sure values are correct */
GLfloat *tex2 = (GLfloat *)
malloc(imgWidth * imgHeight * 4 * sizeof(GLfloat));
glGetTexImage(GL_TEXTURE_2D, 0, imgFormat, GL_FLOAT, tex2);
CheckError(__LINE__);
for (i = 0; i < imgWidth * imgHeight * 4; i++) {
if (ftex[i] != tex2[i]) {
printf("tex[%d] %g != tex2[%d] %g\n",
i, ftex[i], i, tex2[i]);
}
}
}
#endif
free(ftex);
}
@@ -193,7 +187,9 @@ CreateProgram(void)
assert(program);
// InitUniforms(program, Uniforms);
glUseProgram_func(program);
InitUniforms(program, Uniforms);
return program;
}
@@ -211,8 +207,9 @@ Init(void)
exit(1);
}
if (!glutExtensionSupported("GL_MESAX_texture_float")) {
printf("Sorry, this test requires GL_MESAX_texture_float\n");
if (!glutExtensionSupported("GL_MESAX_texture_float") &&
!glutExtensionSupported("GL_ARB_texture_float")) {
printf("Sorry, this test requires GL_MESAX/ARB_texture_float\n");
exit(1);
}

View File

@@ -45,7 +45,7 @@ int main(int argc, char **argv)
if (argc < 2) {
fprintf(stderr, "This program tests GLX context switching.\n");
fprintf(stderr, "Usage: cxbug <n>\n");
fprintf(stderr, "Usage: jkrahntest <n>\n");
fprintf(stderr, "Where n is:\n");
fprintf(stderr, "\t1) Use two contexts and swap only when the context is current (typical case).\n");
fprintf(stderr, "\t2) Use two contexts and swap at the same time.\n");

207
progs/tests/mipgen.c Normal file
View File

@@ -0,0 +1,207 @@
/* Test GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL
* Brian Paul
* 10 May 2006
*/
/* Copyright (c) Mark J. Kilgard, 1994. */
/*
* (c) Copyright 1993, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies and that both the copyright notice
* and this permission notice appear in supporting documentation, and that
* the name of Silicon Graphics, Inc. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
* clause at DFARS 252.227-7013 and/or in similar or successor
* clauses in the FAR or the DOD or NASA FAR Supplement.
* Unpublished-- rights reserved under the copyright laws of the
* United States. Contractor/manufacturer is Silicon Graphics,
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
*
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
#include <stdlib.h>
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
static GLfloat LodBias = 6.0; /* make smallest miplevel visible */
static GLuint texImage;
#define WIDTH 2
#define HEIGHT 2
static void
InitValues(void)
{
LodBias = 6.0; /* make smallest miplevel visible */
}
static void MakeImage(void)
{
const GLubyte color0[4] = { 0xff, 0x80, 0x20, 0xff };
const GLubyte color1[4] = { 0x10, 0x20, 0x40, 0xff };
GLubyte img[WIDTH*HEIGHT*3];
int i, j;
for (i = 0; i < HEIGHT; i++) {
for (j = 0; j < WIDTH; j++) {
int k = (i * WIDTH + j) * 3;
int p = ((i+j)%2);
if (p == 0) {
img[k + 0] = color0[0];
img[k + 1] = color0[1];
img[k + 2] = color0[2];
}
else {
img[k + 0] = color1[0];
img[k + 1] = color1[1];
img[k + 2] = color1[2];
}
}
}
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, WIDTH, HEIGHT, 0,
GL_RGB, GL_UNSIGNED_BYTE, img);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
}
static void myinit(void)
{
InitValues();
glShadeModel(GL_FLAT);
glTranslatef(0.0, 0.0, -3.6);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &texImage);
glBindTexture(GL_TEXTURE_2D, texImage);
MakeImage();
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, -1);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 1);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST_MIPMAP_NEAREST);
}
static void display(void)
{
GLfloat tcm = 1.0;
glBindTexture(GL_TEXTURE_2D, texImage);
printf("Bias=%.2g\n", LodBias);
fflush(stdout);
glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
glTexCoord2f(tcm * 3000.0, tcm); glVertex3f(3000.0, 1.0, -6000.0);
glTexCoord2f(tcm * 3000.0, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
glEnd();
glFlush();
}
static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
static void
key(unsigned char k, int x, int y)
{
(void) x;
(void) y;
switch (k) {
case 'l':
LodBias -= 0.25;
break;
case 'L':
LodBias += 0.25;
break;
case ' ':
InitValues();
break;
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
static void usage(void)
{
printf("usage:\n");
printf(" l/L decrease/increase GL_TEXTURE_LOD_BIAS\n");
printf(" SPACE reset values\n");
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB );
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
glewInit();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
usage();
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

295
progs/tests/mipmap_comp.c Normal file
View File

@@ -0,0 +1,295 @@
/* Copyright (c) Mark J. Kilgard, 1994. */
/*
* (c) Copyright 1993, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies and that both the copyright notice
* and this permission notice appear in supporting documentation, and that
* the name of Silicon Graphics, Inc. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
* clause at DFARS 252.227-7013 and/or in similar or successor
* clauses in the FAR or the DOD or NASA FAR Supplement.
* Unpublished-- rights reserved under the copyright laws of the
* United States. Contractor/manufacturer is Silicon Graphics,
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
*
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
/* mipmap_comp
* Test compressed texture mipmaps
*
* Based on mipmap_limits
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
#define SIZE 16 /* not larger then 16 */
static GLint BaseLevel = 0, MaxLevel = 9;
static GLfloat MinLod = -1, MaxLod = 9;
static GLfloat LodBias = 0.0;
static GLboolean NearestFilter = GL_TRUE;
static GLuint texImage;
static void
initValues(void)
{
BaseLevel = 0;
MaxLevel = 9;
MinLod = -1;
MaxLod = 2;
LodBias = 5.0;
NearestFilter = GL_TRUE;
}
static void
makeImage(int level, int width, int height)
{
#if 0
GLubyte img[SIZE*SIZE*3];
int i, j;
(void)size;
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
int k = (i * width + j) * 3;
img[k + 0] = 255 * ((level + 1) % 2);
img[k + 1] = 255 * ((level + 1) % 2);
img[k + 2] = 255 * ((level + 1) % 2);
}
}
glTexImage2D(GL_TEXTURE_2D, level, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, width, height, 0,
GL_RGB, GL_UNSIGNED_BYTE, img);
#else
GLubyte img[128];
GLint size[] = {
128, /* 16x16 */
32, /* 8x8 */
8, /* 4x4 */
8, /* 2x2 */
8, /* 1x1 */
};
int i;
int value = ((level + 1) % 2) * 0xffffffff;
memset(img, 0, 128);
/* generate black and white mipmap levels */
if (value)
for (i = 0; i < size[level] / 4; i += 2)
((int*)img)[i] = value;
glCompressedTexImage2D(GL_TEXTURE_2D, level,
GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
width, height, 0,
size[level], img);
#endif
}
static void
makeImages(void)
{
int i, sz;
for (i = 0, sz = SIZE; sz >= 1; i++, sz /= 2) {
makeImage(i, sz, sz);
printf("Level %d size: %d x %d\n", i, sz, sz);
}
}
static void
myInit(void)
{
initValues();
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glShadeModel(GL_FLAT);
glTranslatef(0.0, 0.0, -3.6);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &texImage);
glBindTexture(GL_TEXTURE_2D, texImage);
makeImages();
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glEnable(GL_TEXTURE_2D);
}
static void
display(void)
{
GLfloat tcm = 1.0;
glBindTexture(GL_TEXTURE_2D, texImage);
printf("BASE_LEVEL=%d MAX_LEVEL=%d MIN_LOD=%.2g MAX_LOD=%.2g Bias=%.2g Filter=%s\n",
BaseLevel, MaxLevel, MinLod, MaxLod, LodBias,
NearestFilter ? "NEAREST" : "LINEAR");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLod);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLod);
if (NearestFilter) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST_MIPMAP_NEAREST);
}
else {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR);
}
glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
glTexCoord2f(tcm * 3000.0, tcm); glVertex3f(3000.0, 1.0, -6000.0);
glTexCoord2f(tcm * 3000.0, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
glEnd();
glFlush();
}
static void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
static void
key(unsigned char k, int x, int y)
{
(void) x;
(void) y;
switch (k) {
case 'b':
BaseLevel--;
if (BaseLevel < 0)
BaseLevel = 0;
break;
case 'B':
BaseLevel++;
if (BaseLevel > 10)
BaseLevel = 10;
break;
case 'm':
MaxLevel--;
if (MaxLevel < 0)
MaxLevel = 0;
break;
case 'M':
MaxLevel++;
if (MaxLevel > 10)
MaxLevel = 10;
break;
case 'l':
LodBias -= 0.25;
break;
case 'L':
LodBias += 0.25;
break;
case 'n':
MinLod -= 0.25;
break;
case 'N':
MinLod += 0.25;
break;
case 'x':
MaxLod -= 0.25;
break;
case 'X':
MaxLod += 0.25;
break;
case 'f':
NearestFilter = !NearestFilter;
break;
case ' ':
initValues();
break;
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
static void
usage(void)
{
printf("usage:\n");
printf(" b/B decrease/increase GL_TEXTURE_BASE_LEVEL\n");
printf(" m/M decrease/increase GL_TEXTURE_MAX_LEVEL\n");
printf(" n/N decrease/increase GL_TEXTURE_MIN_LOD\n");
printf(" x/X decrease/increase GL_TEXTURE_MAX_LOD\n");
printf(" l/L decrease/increase GL_TEXTURE_LOD_BIAS\n");
printf(" f toggle nearest/linear filtering\n");
printf(" SPACE reset values\n");
}
int
main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
glewInit();
myInit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
usage();
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -54,17 +54,22 @@
#include <GL/glew.h>
#include <GL/glut.h>
static GLint BaseLevel = 0, MaxLevel = 8;
#include "readtex.h"
#define TEXTURE_FILE "../images/girl.rgb"
static GLint BaseLevel = 0, MaxLevel = 9;
static GLfloat MinLod = -1, MaxLod = 9;
static GLfloat LodBias = 0.0;
static GLboolean NearestFilter = GL_TRUE;
static GLuint texImage, texColor, texCurrent;
static void
InitValues(void)
{
BaseLevel = 0;
MaxLevel = 8;
MaxLevel = 9;
MinLod = -1;
MaxLod = 9;
LodBias = 0.0;
@@ -75,7 +80,7 @@ InitValues(void)
static void MakeImage(int level, int width, int height, const GLubyte color[4])
{
const int makeStripes = 0;
GLubyte img[256*256*3];
GLubyte img[512*512*3];
int i, j;
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
@@ -99,87 +104,138 @@ static void MakeImage(int level, int width, int height, const GLubyte color[4])
}
static void makeImages(void)
static void makeImages(int image)
{
static const GLubyte colors[8][3] = {
{128, 128, 128 },
{ 0, 255, 255 },
{ 255, 255, 0 },
{ 255, 0, 255 },
{ 255, 0, 0 },
{ 0, 255, 0 },
{ 0, 0, 255 },
{ 255, 255, 255 }
};
int i, sz = 128;
#define WIDTH 512
#define HEIGHT 512
if (glutExtensionSupported("GL_SGIS_generate_mipmap") && image) {
/* test auto mipmap generation */
GLint width, height, i;
GLenum format;
GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format);
if (!image) {
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
exit(1);
}
/* resize */
if (width != WIDTH || height != HEIGHT) {
GLubyte *newImage = malloc(WIDTH * HEIGHT * 4);
gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
WIDTH, HEIGHT, GL_UNSIGNED_BYTE, newImage);
free(image);
image = newImage;
}
printf("Using GL_SGIS_generate_mipmap\n");
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D, 0, format, WIDTH, HEIGHT, 0,
format, GL_UNSIGNED_BYTE, image);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
free(image);
for (i = 0; i < 8; i++) {
MakeImage(i, sz, sz, colors[i]);
sz /= 2;
/* make sure mipmap was really generated correctly */
width = WIDTH; height = HEIGHT;
for (i = 0; i < 10; i++) {
GLint w, h;
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w);
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h);
printf("Level %d size: %d x %d\n", i, w, h);
width /= 2;
height /= 2;
}
} else {
static const GLubyte colors[10][3] = {
{128, 128, 128 },
{ 0, 255, 255 },
{ 255, 255, 0 },
{ 255, 0, 255 },
{ 255, 0, 0 },
{ 0, 255, 0 },
{ 0, 0, 255 },
{ 0, 255, 255 },
{ 255, 255, 0 },
{ 255, 255, 255 }
};
int i, sz = 512;
for (i = 0; i < 10; i++) {
MakeImage(i, sz, sz, colors[i]);
printf("Level %d size: %d x %d\n", i, sz, sz);
sz /= 2;
}
}
}
static void myinit(void)
{
InitValues();
InitValues();
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glShadeModel(GL_FLAT);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glShadeModel(GL_FLAT);
glTranslatef(0.0, 0.0, -3.6);
glTranslatef(0.0, 0.0, -3.6);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
makeImages();
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glEnable(GL_TEXTURE_2D);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &texImage);
glBindTexture(GL_TEXTURE_2D, texImage);
makeImages(1);
glGenTextures(1, &texColor);
glBindTexture(GL_TEXTURE_2D, texColor);
makeImages(0);
texCurrent = texImage;
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glEnable(GL_TEXTURE_2D);
}
static void display(void)
{
GLfloat tcm = 4.0;
printf("BASE_LEVEL=%d MAX_LEVEL=%d MIN_LOD=%.2g MAX_LOD=%.2g Bias=%.2g Filter=%s\n",
BaseLevel, MaxLevel, MinLod, MaxLod, LodBias,
NearestFilter ? "NEAREST" : "LINEAR");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel);
GLfloat tcm = 1.0;
glBindTexture(GL_TEXTURE_2D, texCurrent);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLod);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLod);
printf("BASE_LEVEL=%d MAX_LEVEL=%d MIN_LOD=%.2g MAX_LOD=%.2g Bias=%.2g Filter=%s\n",
BaseLevel, MaxLevel, MinLod, MaxLod, LodBias,
NearestFilter ? "NEAREST" : "LINEAR");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel);
if (NearestFilter) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST_MIPMAP_NEAREST);
}
else {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR);
}
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLod);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLod);
glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
if (NearestFilter) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST_MIPMAP_NEAREST);
}
else {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR);
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
glTexCoord2f(tcm, tcm); glVertex3f(3000.0, 1.0, -6000.0);
glTexCoord2f(tcm, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
glEnd();
glFlush();
glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
glTexCoord2f(tcm * 3000.0, tcm); glVertex3f(3000.0, 1.0, -6000.0);
glTexCoord2f(tcm * 3000.0, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
glEnd();
glFlush();
}
static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
static void
@@ -229,6 +285,12 @@ key(unsigned char k, int x, int y)
case 'f':
NearestFilter = !NearestFilter;
break;
case 't':
if (texCurrent == texColor)
texCurrent = texImage;
else
texCurrent = texColor;
break;
case ' ':
InitValues();
break;
@@ -251,6 +313,7 @@ static void usage(void)
printf(" x/X decrease/increase GL_TEXTURE_MAX_LOD\n");
printf(" l/L decrease/increase GL_TEXTURE_LOD_BIAS\n");
printf(" f toggle nearest/linear filtering\n");
printf(" t toggle texture color/image\n");
printf(" SPACE reset values\n");
}

View File

@@ -18,11 +18,27 @@
#define TEXTURE_FILE "../images/arch.rgb"
static int TexWidth = 256, TexHeight = 256;
#define LEVELS 8
#define SIZE (1<<LEVELS)
static int TexWidth = SIZE, TexHeight = SIZE;
static int WinWidth = 1044, WinHeight = 900;
static GLfloat Bias = 0.0;
static GLboolean ScaleQuads = GL_FALSE;
static GLboolean Linear = GL_FALSE;
static GLint Win = 0;
static GLint RenderTextureLevel = 0;
static GLuint TexObj;
static void
CheckError(int line)
{
GLenum err = glGetError();
if (err) {
printf("GL Error 0x%x at line %d\n", (int) err, line);
}
}
@@ -36,6 +52,178 @@ PrintString(const char *s)
}
static void
MipGenTexture( void )
{
/* test auto mipmap generation */
GLint width, height, i;
GLenum format;
GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format);
if (!image) {
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
exit(1);
}
/* resize to TexWidth x TexHeight */
if (width != TexWidth || height != TexHeight) {
GLubyte *newImage = malloc(TexWidth * TexHeight * 4);
fprintf(stderr, "rescale %d %d to %d %d\n", width, height,
TexWidth, TexHeight);
fflush(stderr);
gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
TexWidth, TexHeight, GL_UNSIGNED_BYTE, newImage);
free(image);
image = newImage;
}
printf("Using GL_SGIS_generate_mipmap\n");
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D, 0, format, TexWidth, TexHeight, 0,
format, GL_UNSIGNED_BYTE, image);
free(image);
/* make sure mipmap was really generated correctly */
width = TexWidth;
height = TexHeight;
for (i = 0; i < 9; i++) {
GLint w, h;
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w);
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h);
printf("Level %d size: %d x %d\n", i, w, h);
assert(w == width);
assert(h == height);
width /= 2;
height /= 2;
}
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
}
static void
ResetTextureLevel( int i )
{
GLubyte tex2d[SIZE*SIZE][4];
{
GLint Width = TexWidth / (1 << i);
GLint Height = TexHeight / (1 << i);
GLint s, t;
for (s = 0; s < Width; s++) {
for (t = 0; t < Height; t++) {
tex2d[t*Width+s][0] = ((s / 16) % 2) ? 0 : 255;
tex2d[t*Width+s][1] = ((t / 16) % 2) ? 0 : 255;
tex2d[t*Width+s][2] = 128;
tex2d[t*Width+s][3] = 255;
}
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, i, GL_RGB, Width, Height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, tex2d);
}
}
static void
ResetTexture( void )
{
#if 0
/* This doesn't work so well as the arch texture is 512x512.
*/
LoadRGBMipmaps(TEXTURE_FILE, GL_RGB);
#else
{
int i;
for (i = 0; i <= LEVELS; i++)
{
ResetTextureLevel(i);
}
}
#endif
}
static void
RenderTexture( void )
{
GLenum status;
GLuint MyFB;
fprintf(stderr, "RenderTextureLevel %d\n", RenderTextureLevel);
fflush(stderr);
/* gen framebuffer id, delete it, do some assertions, just for testing */
glGenFramebuffersEXT(1, &MyFB);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
assert(glIsFramebufferEXT(MyFB));
CheckError(__LINE__);
/* Render color to texture */
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, TexObj,
RenderTextureLevel);
CheckError(__LINE__);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -15.0);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
printf("Framebuffer incomplete!!!\n");
}
glViewport(0, 0,
TexWidth / (1 << RenderTextureLevel),
TexHeight / (1 << RenderTextureLevel));
glClearColor(0.5, 0.5, 1.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
CheckError(__LINE__);
glBegin(GL_POLYGON);
glColor3f(1, 0, 0);
glVertex2f(-1, -1);
glColor3f(0, 1, 0);
glVertex2f(1, -1);
glColor3f(0, 0, 1);
glVertex2f(0, 1);
glEnd();
/* Bind normal framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
CheckError(__LINE__);
glDeleteFramebuffersEXT(1, &MyFB);
CheckError(__LINE__);
glClearColor(0, 0, 0, 0);
}
static void
Display(void)
{
@@ -43,6 +231,8 @@ Display(void)
char str[100];
int texWidth = TexWidth, texHeight = TexHeight;
glViewport(0, 0, WinHeight, WinHeight);
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
@@ -53,6 +243,15 @@ Display(void)
glColor3f(1,1,1);
if (Linear) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
}
else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
y = WinHeight - 300;
x = 4;
@@ -116,7 +315,6 @@ Reshape(int width, int height)
{
WinWidth = width;
WinHeight = height;
glViewport(0, 0, width, height);
}
@@ -132,6 +330,24 @@ Key(unsigned char key, int x, int y)
case 'B':
Bias += 10;
break;
case 'l':
Linear = !Linear;
break;
case 'v':
RenderTextureLevel++;
break;
case 'V':
RenderTextureLevel--;
break;
case 'r':
RenderTexture();
break;
case 'X':
ResetTexture();
break;
case 'x':
ResetTextureLevel(RenderTextureLevel);
break;
case '0':
case '1':
case '2':
@@ -147,6 +363,14 @@ Key(unsigned char key, int x, int y)
case 's':
ScaleQuads = !ScaleQuads;
break;
case ' ':
MipGenTexture();
Bias = 0;
Linear = 0;
RenderTextureLevel = 0;
ScaleQuads = 0;
break;
case 27:
glutDestroyWindow(Win);
exit(0);
@@ -173,57 +397,15 @@ Init(void)
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if (1) {
/* test auto mipmap generation */
GLint width, height, i;
GLenum format;
GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format);
if (!image) {
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
exit(1);
}
/* resize to TexWidth x TexHeight */
if (width != TexWidth || height != TexHeight) {
GLubyte *newImage = malloc(TexWidth * TexHeight * 4);
gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
TexWidth, TexHeight, GL_UNSIGNED_BYTE, newImage);
free(image);
image = newImage;
}
printf("Using GL_SGIS_generate_mipmap\n");
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D, 0, format, TexWidth, TexHeight, 0,
format, GL_UNSIGNED_BYTE, image);
free(image);
/* make sure mipmap was really generated correctly */
width = TexWidth;
height = TexHeight;
for (i = 0; i < 9; i++) {
GLint w, h;
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w);
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h);
printf("Level %d size: %d x %d\n", i, w, h);
assert(w == width);
assert(h == height);
width /= 2;
height /= 2;
}
}
else {
if (LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
printf("Using gluBuildMipmaps()\n");
}
else {
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
exit(1);
}
}
glGenTextures(1, &TexObj);
glBindTexture(GL_TEXTURE_2D, TexObj);
if (1)
MipGenTexture();
else
ResetTexture();
/* mipmapping required for this extension */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &maxBias);

View File

@@ -321,10 +321,18 @@ static void run_test(const char *name, void (*callback)(void))
int main(int argc, char **argv)
{
const char *version;
glutInit(&argc, argv);
glutCreateWindow("Mesa bug demo");
glewInit();
version = (const char *) glGetString(GL_VERSION);
if (version[0] == '1') {
printf("Sorry, this test requires OpenGL 2.x GLSL support\n");
exit(0);
}
RUN_TEST(test_uniform_size_type);
RUN_TEST(test_attrib_size_type);
RUN_TEST(test_uniform_array_overflow);

View File

@@ -7,7 +7,6 @@
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glx.h>
#include "readtex.c"
#define IMAGE_FILE "../images/arch.rgb"
@@ -52,7 +51,6 @@ TestSubTex(void)
GLboolean all = 0*GL_TRUE;
GLubyte *buffer;
GLint size, fmt;
int i;
glGetTexLevelParameteriv(Target, 0,
GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &size);
@@ -83,6 +81,23 @@ TestSubTex(void)
}
static void
TestGetTex(void)
{
GLubyte *buffer;
buffer = (GLubyte *) malloc(3 * ImgWidth * ImgHeight);
glGetTexImage(GL_TEXTURE_2D,
0,
GL_RGB,
GL_UNSIGNED_BYTE,
buffer);
free(buffer);
}
static void
LoadCompressedImage(const char *file)
{
@@ -147,7 +162,10 @@ LoadCompressedImage(const char *file)
glTexParameteri(Target, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, filter);
TestSubTex();
if (0)
TestSubTex();
else
TestGetTex();
}

View File

@@ -280,9 +280,9 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0);
glutInitWindowSize(400, 400);
if (glutCreateWindow("Isosurface") <= 0) {
glewInit();
exit(0);
}
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -128,7 +128,7 @@ static void Init( void )
glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
strlen(prog1),
(const GLubyte *) prog1);
assert(!glIsProgramNV(1));
assert(glIsProgramNV(1));
glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 2,
strlen(prog2),

View File

@@ -9,6 +9,7 @@ dlist-dangling
dlist-degenerate
dlist-edgeflag
dlist-edgeflag-dangling
draw2arrays
drawarrays
drawelements
drawrange
@@ -58,6 +59,7 @@ quad-tex-2d
quad-tex-3d
quad-tex-alpha
quad-tex-pbo
quad-tex-sub
quad-unfilled
quad-unfilled-clip
quad-unfilled-stipple
@@ -84,13 +86,17 @@ tri-dlist
tri-edgeflag
tri-fbo
tri-fbo-tex
tri-fbo-tex-mip
tri-flat
tri-flat-clip
tri-fog
tri-fp
tri-fp-const-imm
tri-lit
tri-logicop-none
tri-logicop-xor
tri-mask-tri
tri-multitex-vbo
tri-orig
tri-query
tri-repeat

View File

@@ -30,6 +30,7 @@ SOURCES = \
fs-tri.c \
line-clip.c \
line-cull.c \
line-flat.c \
line-smooth.c \
line-stipple-wide.c \
line-userclip-clip.c \
@@ -70,6 +71,7 @@ SOURCES = \
quad-tex-3d.c \
quad-tex-alpha.c \
quad-tex-pbo.c \
quad-tex-sub.c \
quad-unfilled-clip.c \
quad-unfilled-stipple.c \
quad-unfilled.c \
@@ -94,6 +96,7 @@ SOURCES = \
tri-logicop-xor.c \
tri-dlist.c \
tri-edgeflag.c \
tri-fbo-tex-mip.c \
tri-fbo-tex.c \
tri-fbo.c \
tri-flat-clip.c \
@@ -109,6 +112,7 @@ SOURCES = \
tri-scissor-tri.c \
tri-stencil.c \
tri-stipple.c \
tri-multitex-vbo.c \
tri-tex.c \
tri-tex-3d.c \
tri-tri.c \
@@ -135,6 +139,7 @@ SOURCES = \
tristrip-flat.c \
tristrip.c \
vbo-drawarrays.c \
vbo-noninterleaved.c \
vbo-drawelements.c \
vbo-drawrange.c \
vp-array.c \
@@ -142,6 +147,7 @@ SOURCES = \
vp-clip.c \
vp-line-clip.c \
vp-tri.c \
vp-tri-invariant.c \
vp-tri-swap.c \
vp-tri-tex.c \
vp-tri-imm.c \

View File

@@ -26,6 +26,7 @@ progs = [
'fs-tri',
'line-clip',
'line-cull',
'line-flat',
'line-smooth',
'line-stipple-wide',
'line-userclip-clip',
@@ -66,6 +67,7 @@ progs = [
'quad-tex-3d',
'quad-tex-alpha',
'quad-tex-pbo',
'quad-tex-sub',
'quad-unfilled-clip',
'quad-unfilled-stipple',
'quad-unfilled',
@@ -88,6 +90,7 @@ progs = [
'tri-cull',
'tri-dlist',
'tri-edgeflag',
'tri-fbo-tex-mip',
'tri-fbo-tex',
'tri-fbo',
'tri-flat-clip',
@@ -105,6 +108,7 @@ progs = [
'tri-scissor-tri',
'tri-stencil',
'tri-stipple',
'tri-multitex-vbo',
'tri-tex',
'tri-tex-3d',
'tri-tri',
@@ -131,6 +135,7 @@ progs = [
'tristrip-flat',
'tristrip',
'vbo-drawarrays',
'vbo-noninterleaved',
'vbo-drawelements',
'vbo-drawrange',
'vp-array',
@@ -138,6 +143,7 @@ progs = [
'vp-clip',
'vp-line-clip',
'vp-tri',
'vp-tri-invariant',
'vp-tri-swap',
'vp-tri-tex',
'vp-tri-imm',

View File

@@ -27,6 +27,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {

View File

@@ -23,6 +23,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
}

View File

@@ -38,6 +38,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.3, 0.1, 0.3, 0.0);
}

View File

@@ -16,6 +16,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
}
static void Reshape(int width, int height)

View File

@@ -17,6 +17,7 @@ static void Init(void)
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fprintf(stderr, "Top right corner should be red\n");
fflush(stderr);
}
static void Reshape(int width, int height)

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -40,6 +40,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);

View File

@@ -40,6 +40,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);

View File

@@ -40,6 +40,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

147
progs/trivial/line-flat.c Normal file
View File

@@ -0,0 +1,147 @@
/*
* Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the name of
* Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
* ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <GL/glut.h>
#define CI_OFFSET_1 16
#define CI_OFFSET_2 32
GLenum doubleBuffer;
static void Init(void)
{
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}
static void Reshape(int width, int height)
{
glViewport(0, 0, (GLint)width, (GLint)height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
glMatrixMode(GL_MODELVIEW);
}
static void Key(unsigned char key, int x, int y)
{
switch (key) {
case 27:
exit(1);
default:
return;
}
glutPostRedisplay();
}
static void Draw(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glShadeModel(GL_FLAT);
glBegin(GL_LINES);
glColor3f(0,0,.7);
glVertex3f( 0.9, -0.9, -30.0);
glColor3f(.8,0,0);
glVertex3f( 0.9, 0.9, -30.0);
glColor3f(.8,0,0);
glVertex3f( 0.9, 0.9, -30.0);
glColor3f(0,.9,0);
glVertex3f(-0.9, 0.0, -30.0);
glColor3f(0,.9,0);
glVertex3f(-0.9, 0.0, -30.0);
glColor3f(0,0,.7);
glVertex3f( 0.9, -0.9, -30.0);
glEnd();
glFlush();
if (doubleBuffer) {
glutSwapBuffers();
}
}
static GLenum Args(int argc, char **argv)
{
GLint i;
doubleBuffer = GL_FALSE;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-sb") == 0) {
doubleBuffer = GL_FALSE;
} else if (strcmp(argv[i], "-db") == 0) {
doubleBuffer = GL_TRUE;
} else {
fprintf(stderr, "%s (Bad option).\n", argv[i]);
return GL_FALSE;
}
}
return GL_TRUE;
}
int main(int argc, char **argv)
{
GLenum type;
glutInit(&argc, argv);
if (Args(argc, argv) == GL_FALSE) {
exit(1);
}
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
type = GLUT_RGB;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
Init();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
return 0;
}

View File

@@ -44,10 +44,12 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glGetFloatv(GL_LINE_WIDTH_RANGE, aarange);
glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, range);
printf("Non-AA line width range: %f .. %f\n", range[0], range[1]);
printf("AA line width range: %f .. %f\n", aarange[0], aarange[1]);
fflush(stdout);
}

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -41,6 +41,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
glClipPlane(GL_CLIP_PLANE0, plane);

View File

@@ -41,6 +41,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
glClipPlane(GL_CLIP_PLANE0, plane);

View File

@@ -41,6 +41,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
glClipPlane(GL_CLIP_PLANE0, plane);

View File

@@ -41,6 +41,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
glClipPlane(GL_CLIP_PLANE0, plane);

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

View File

@@ -39,6 +39,7 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
fflush(stderr);
glClearColor(0.0, 0.0, 1.0, 0.0);
}

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