Compare commits

...

1189 Commits

Author SHA1 Message Date
Ian Romanick
022e8e582e intel: Bump driver data, add RC3 tag 2009-07-12 21:07:38 -07:00
Zack Rusin
1c1307e7c5 gallium: compare the actual register, not all the inputs
otherwise we decrement indexes for all registers
2009-07-11 13:48:41 -04:00
Brian Paul
cff2126f52 tgsi: update some assertions 2009-07-10 16:26:09 -06:00
Brian Paul
a79586ce18 tgsi: tgsi: add semantic_names[] string for TGSI_SEMANTIC_FACE
Same story as in the tgsi_dump.c code (see prev commit).
2009-07-10 15:44:48 -06:00
Brian Paul
f01af4dbd2 tgsi: add semantic_names[] string for TGSI_SEMANTIC_FACE
Fixes TGSI dump output when front/back-face register is declared.

Also, add some assertions to make sure the semantic/interpolate string
arrays have as many elements as there are tokens in the p_shader_tokens.h
file.  That should catch problems like this in the future.
2009-07-10 15:41:26 -06:00
Brian Paul
762c1d11ff st/mesa: implement indirect addressing for destination registers 2009-07-10 13:09:09 -06:00
Brian Paul
baa7ff47d5 tgis: implement indirect addressing for destination registers
Includes the TGSI interpreter, but not the SSE/PPC/etc code generators.
2009-07-10 13:09:09 -06:00
Brian Paul
ca1b71b78d vbo: fix vbo/dlist memory leak
Based on a patch by kristof.ralovich@gmail.com
2009-07-10 13:09:09 -06:00
Brian Paul
6ff1a5385e demos: set 4th component of texcoord to 1.0
Avoid potential randomness in resulting texcoords.
2009-07-10 13:09:09 -06:00
Michel Dänzer
cade071d52 Remove stale reference to non-Gallium nouveau driver from configure.ac. 2009-07-10 14:49:46 +02:00
Ian Romanick
fcd3572edf mesa: From float type modifier from values to large for singles
The values 2147483648.0 and 4294967294.0 are too larget to be stored in single
precision floats.  Forcing these to be singles causes bits to be lost, which
results in errors in some pixel transfer tests.

This fixes bug #22344.
(cherry picked from commit 70e72070fc)
2009-07-09 16:07:05 -07:00
Brian Paul
78af70be37 docs: document gl_TextureMatrix[i][j] array indexing bug fix 2009-07-09 08:04:07 -06:00
Brian Paul
c86b076668 glsl: do const parameter optimization for array element actual parameters
When a function parameter is const-qualified we can avoid making a copy
of the actual parameter (we basically do a search/replace when inlining).
This is now done for array element params too, resulting in better code
(fewer MOV instructions).

We should allow some other types of function arguments here but let's be
conservative for the moment.
2009-07-09 07:58:50 -06:00
Brian Paul
abdb0fdcc0 glsl: fix incorrect indexing for gl_TextureMatrix[i][j]
The two indexes were mixed up when accessing a row of a matrix in an array
of matrices.
2009-07-09 07:57:29 -06:00
Brian Paul
36e906aad6 docs: document glMaterial/glShadeModel display list optimization 2009-07-08 14:14:03 -06:00
Brian Paul
4adc9b4a5b mesa: only use fallback texture when using shaders, not fixed-function (take two)
The semantics are a little different for shaders vs. fixed-function when
trying to use an incomplete texture.  The fallback texture returning
(0,0,0,1) should only be used with shaders.  For fixed function, the texture
unit is truly disabled/ignored.

Fixes glean fbo test regression.
(cherry picked from commit 01e16befd4)
(cherry picked from commit 51325f44d1)
[anholt: squashed these two together from master, skipping the mess in between]
2009-07-07 16:02:45 -07:00
Zack Rusin
7b861b9b9e gallium: fixup register indexes for fog/frontface/point coord 2009-07-07 12:48:50 -07:00
Michel Dänzer
71633abafc gallium: Fixes for clobbering stencil values in combined depth/stencil textures.
Also fix one case where a 32 bit depth value was incorrectly converted to a
combined depth/stencil value.
2009-07-07 14:49:52 +02:00
Michel Dänzer
25b492b976 GLX/DRI1: Mark GLX visuals with depth != screen depth non-conformant.
Such visuals are subject to automatic compositing in the X server, so DRI1
can't render to them properly.
2009-07-07 13:59:59 +02:00
Michel Dänzer
96601ec8e0 gallium: Only set FRONT_STATUS_COPY_OF_BACK if there is a back buffer.
Fixes potential crash when SwapBuffers is called but there's no back buffer.
2009-07-07 12:17:04 +02:00
Zack Rusin
a4d952358d gallium: more fog extraction fixes
fix the cases when fog coord/front face/point coord are used in the same
shader.
2009-07-06 21:35:15 -04:00
Ian Romanick
7fb4becf98 demos: Fix vsync checking in glxgears
Of course glXGetVideoSyncSGI doesn't return the swap interval.  The feature
only exists in the Mesa extension... which is the whole reason I created the
Mesa extension!  Note that the Mesa extension allows drivers to default to a
swap interval of 0.  If the Mesa extension exists, use its value.  Only
consider the SGI extension when the Mesa extension is not available.

Fixes bug #22604.
2009-07-06 11:42:12 -07:00
José Fonseca
1068c15c61 wgl: Make the stw_framebuffer destructions threadsafe.
Ensure no other thread is accessing a framebuffer when it is being destroyed by
acquiring both the global and per-framebuffer mutexes. Normal access only
needs the global lock to walk the linked list and acquire the per-framebuffer
mutex.
2009-07-06 18:23:37 +01:00
José Fonseca
6f4167c8a2 wgl: Check for multiple threads before GET_CURRENT_CONTEXT.
Fixes wglthreads -- the 2nd thread MakeCurrent call was trying to flush
the first thread context while still in use.
2009-07-06 17:40:08 +01:00
José Fonseca
5470a67335 wgl: Listen to WM_WINDOWPOSCHANGED instead of WM_SIZE messages.
According to
http://blogs.msdn.com/oldnewthing/archive/2008/01/15/7113860.aspx
WM_SIZE is generated from WM_WINDOWPOSCHANGED by DefWindowProc so it
can be masked out by the application.

Also there were some weird bogus WM_SIZE 0x0 messages when starting
sharedtex_mt which we don't get like this.
2009-07-06 17:08:37 +01:00
Roland Scheidegger
fc6e02ce62 i965: fix fetching constants from constant buffer in glsl path
the driver used to overwrite grf0 then use implicit move by send instruction
to move contents of grf0 to mrf1. However, we must not overwrite grf0 since
it's still used later for fb write.
Instead, do the move directly do mrf1 (we could use implicit move from another
grf reg to mrf1 but since we need a mov to encode the data anyway it doesn't
seem to make sense).
I think the dp_READ/WRITE_16 functions may suffer from the same issue.
While here also remove unnecessary msg_reg_nr parameter from the dataport
functions since always message register 1 is used.
2009-07-04 15:35:07 +02:00
Eric Anholt
c30f23c123 i965: Remove bad constant buffer constant-reg-already-loaded optimization.
Thanks to branching, the state of c->current_const[i].index at the point
of emitting constant loads for this instruction may not match the actual
constant currently loaded in the reg at runtime.  Fixes a regression in my
GLSL program for idr's class since b58b3a786a.
2009-07-04 15:32:56 +02:00
Michel Dänzer
94e1117c9b intel: Also update stencil bits in intel_update_wrapper().
Fixes assertion failure when binding depth/stencil texture to FBO stencil
attachment.
2009-07-03 17:54:34 +02:00
Keith Whitwell
f580494bef progs: revert damage to progs/SConscript from recent compressed texture commit 2009-07-03 16:40:03 +01:00
Keith Whitwell
b928d18398 mesa/shaders: fix gl_NormalMatrix state parameters
gl_NormalMatrix is the inverse transpose of the modelview matrix, but
as every matrix here needs to be transposed, we end up with
{MODELVIEW_MATRIX, INVERSE}.
2009-07-03 14:31:07 +01:00
Keith Whitwell
aa98575ebb st/wgl: don't advertise WGL_EXT_swap_interval string
This is a tweak to a previous fix -- it's not necessary to actually
advertise this extension to prevent these games from crashing -- they
ignore the extension string anyway. It's sufficient to just have
GetProcAddress return some dummy function addresses for SwapInterval.

Given we don't really implement this funcitonality, this is a better
fix.
2009-07-03 14:31:06 +01:00
José Fonseca
cffe7c8bd0 wgl: Lookup framebuffers by HWND whenever possible.
Some applications create several HDCs for the same window, so spite the WGL
API is geared towards HDCs it is not reliable searching by HDC.
2009-07-03 14:21:55 +01:00
José Fonseca
2a2236606f mesa: Assume depth textures have a single level unless told otherwise. 2009-07-02 17:24:50 +01:00
Keith Whitwell
588c862571 mesa: s/TRUE/GL_TRUE
Fix compile breakage on Linux.
2009-07-02 14:44:06 +01:00
Keith Whitwell
798cd2a98d glapi: ensure _mesa_lookup_prim_by_nr() is not clobbered on regeneration
Propogate changes to enums.c back up to the python source.
2009-07-02 13:33:20 +01:00
Keith Whitwell
1668a679c4 Merge commit 'origin/dlist-statechange-shortcircuit' into mesa_7_5_branch
Conflicts:
	progs/trivial/Makefile

Pull in a minimal version of statechange shortcircuiting in display
list compilation.  This affects only glMaterial and glShadeModel state,
and includes quite a few tests to exercise various tricky cases.

If this goes well, will consider extending to all state in the future.
2009-07-02 13:29:46 +01:00
Keith Whitwell
b3e8e1cd4c mesa: ensure UsesFogFragCoord value is set for non-glsl shaders
With recent changes to support frontfacing in glsl, it is necessary
to ensure that the UsesFogFragCoord value is accurate in all shaders.
We were previously not setting it for fixed-function and ARB_fs shaders.
2009-07-02 11:28:56 +01:00
Keith Whitwell
1fa4cde757 mesa/vbo: fix compile and replay of nodes ending in a FALLBACK
Where vbo save nodes are terminated with a call to DO_FALLBACK(), as in
the case of a recursive CallList which is itself within a Begin/End pair,
there two problems:
1) The display list node's primitive information was incorrect, stating
the cut-off prim had zero vertices
2) On replay, we would get confused by a primitive that started in a
node, but was terminated by individual opcodes.

This change fixes the first problem by correctly terminating the last
primitive on fallback, and the second by forcing the display list to
use the Loopback path, converting all nodes into immediate-mode rendering.

The loopback fix is a performance hit, but avoiding this would require
a fairly large rework of this code.
2009-06-30 19:52:44 +01:00
Keith Whitwell
70ae7ba818 mesa/dlist: fixes and improvements for material caching
Only short-circuit material call if *all* statechanges from this call
are cached.  Some material calls (eg with FRONT_AND_BACK) change more
than one piece of state -- need to check all of them before returning.

Also, Material calls are legal inside begin/end pairs, so don't need
to be as careful about begin/end state as with regular statechanges
(like ShadeModel) when caching.  Take advantage of this and do better
caching.
2009-06-30 18:40:20 +01:00
Keith Whitwell
c48c01c9e7 progs/trivial: add dlist-mat-tri.c 2009-06-30 18:37:34 +01:00
Keith Whitwell
1ca836f0de progs/trivial: add test case for short-circuiting material changes
Similar to dlist-tri-flat-tri, but using glMaterial calls, which
have the extra property of being legal within Begin/End calls.
2009-06-30 18:17:39 +01:00
Keith Whitwell
d6c2347d79 mesa/dlist: don't cache state which may not be replayed on CallList
Statechanges which occur before the first End in a display list may
not be replayed when the list is called, in particular if it is called
from within a begin/end pair.

Recognize vulnerable statechanges and do not use them to fill in the
state cache.
2009-06-30 17:10:56 +01:00
Keith Whitwell
09a3a28fc8 progs/trivial: add dlist-flat-tri.c
State-change functions which precede the first call to glEnd() in
a compiled list are vulnerable to not being executed when that list
is called.

In particular this can happen if a list is invoked from within a
begin/end pair, as in this example.
2009-06-30 17:06:50 +01:00
Keith Whitwell
7e91d035b9 mesa/dlist: invalidate cached dlist compile state after CallList
When compiling a display list containing a CallList, it is necessary to
invalidate any assumption about the GL state after the recursive call
completes.
2009-06-30 17:04:11 +01:00
Keith Whitwell
2e570be852 progs/trivial: add dlist-recursive-call
When one display list calls another display list, it is possible
that the calling display list makes state-changes or other actions which
invalidate any attempt at caching or state-change elimination in the
calling list.

This test exercises one such case, where the called list consists of just
a single glShadeModel() call.
2009-06-30 17:02:16 +01:00
Keith Whitwell
1730eaa2a2 dlist-tri-flat-tri: make tri render differently if flatshade not enabled
When testing flat-shading, it helps to specify per-vertex colors so
that you can distinguish between flat & smooth shading.
2009-06-30 16:57:21 +01:00
Keith Whitwell
4147bb24d4 Merge branch 'mesa_7_5_branch' into dlist-statechange-shortcircuit
Need this to pick up fixes for per-vertex materials.
2009-06-30 16:28:54 +01:00
Keith Whitwell
6af783bea0 progs/trivial: add test case for lighting plus per-vertex materials
Exercise material-within-begin/end case.
2009-06-30 16:19:23 +01:00
Keith Whitwell
a9ae89d104 progs/isosurf: add materials mode for glVertex + TRISTRIP 2009-06-30 16:14:08 +01:00
Keith Whitwell
6dfb89e4a0 mesa: remove whitespace 2009-06-30 16:14:05 +01:00
Keith Whitwell
cea259f039 mesa: remove dead constant pointsize code from ffvertex_prog.c 2009-06-30 16:13:58 +01:00
Keith Whitwell
79047cc1dd mesa: remove dead vertex fog code from ffvertex_prog.c 2009-06-30 16:13:53 +01:00
Keith Whitwell
f6c8ca06f6 mesa: fix material inputs in ffvertex_prog.c
Varying material inputs were not being picked up from the same slots
where the VBO code is currently placing them (GENERIC0 and above).
Most often they were just being ignored.
2009-06-30 16:13:22 +01:00
Arthur HUILLET
4c31632817 mesa: fix transform_points_3d_no_rot using undefined values in %xmm0
Signed-off-by: Arthur HUILLET <arthur.huillet@free.fr>
2009-06-30 08:43:23 -06:00
Kristof Ralovich
fa5b0364f9 glx: plug a leak
Swrast was missing a free for the culmination of driConcatConfigs.

Use free(), not _mesa_free() since we shouldn't be calling any Mesa
functions from the GLX code.  driConcatConfigs() should probably use
regular malloc/free to be consistant but the Mesa functions just wrap
the libc functions anyway.
2009-06-30 08:43:22 -06:00
Brian Paul
52f895df51 glx: fix null pointer dereference segfault (bug 22546) 2009-06-30 08:43:22 -06:00
Keith Whitwell
14a2b5445a progs/util: make sure function pointers are initialized
Call Init() from CompileShaderFile, was previously only called for the
Text version of this function.
2009-06-30 15:41:43 +01:00
José Fonseca
6e09c1fd08 mesa: Set FLUSH_EXPLICIT_BIT flags when calling FlushMappedBufferRange.
As prescribed by ARB_map_buffer_range.
2009-06-30 15:33:53 +01:00
José Fonseca
18a6f0f1a7 util: Set PIPE_BUFFER_USAGE_FLUSH_EXPLICIT when calling buffer_flush_mapped_range. 2009-06-30 15:33:53 +01:00
José Fonseca
4ffe2844a4 gallium: New PIPE_BUFFER_USAGE_FLUSH_EXPLICIT flag for buffer_flush_mapped_range.
When a buffer was mapped for write and no explicit flush range was provided
the existing semantics were that the whole buffer would be flushed, mostly
for backwards compatability with non map-buffer-range aware code.

However if the buffer was mapped/unmapped with nothing really written --
something that often happens with the vbo -- we were unnecessarily assuming
that the whole buffer was written.

The new PIPE_BUFFER_USAGE_FLUSH_EXPLICIT flag (based from ARB_map_buffer_range
's GL_MAP_FLUSH_EXPLICIT_BIT flag) allows to clearly distinguish the
legacy usage from the nothing written usage.
2009-06-30 15:33:53 +01:00
Jakob Bornecrantz
578230dbbf st/gl: Add stubs for CompressedTexSubImage[1D|3D] 2009-06-30 14:11:49 +02:00
Jakob Bornecrantz
a4fd94a54a st/gl: Add support for glCompressedTexSubImage 2009-06-30 14:11:45 +02:00
Jakob Bornecrantz
ba7f45ac0c progs/tests: Add tests for glCompressedTexSubImage 2009-06-30 14:11:29 +02:00
José Fonseca
f2de2d5f37 util: Increase OutputDebugStringA to 4k.
According to http://unixwiz.net/techtips/outputdebugstring.html that's
how big the buffer is.

The 512bytes limitation is in kernel mode.
2009-07-01 19:10:50 +01:00
José Fonseca
e2a8ef4430 mesa: Unbind depth/stencil surface from pipe_framebuffer when none is attached. 2009-07-01 19:10:49 +01:00
Keith Whitwell
6c913411d3 st/wgl: dummy implementation of wgl swapinterval extension
Required as some applications
retrieve and call these functions regardless of the fact that we
don't advertise the extension and further more the results of
wglGetProcAddress are NULL.
2009-07-01 17:37:15 +01:00
Zack Rusin
1c04731b87 gallium: fix the front face semantics
mesa allocates both frontface and pointcoord registers within the fog
coordinate register, by using swizzling. to make it cleaner and easier
for drivers we want each of them in its own register. so when doing
compilation from the mesa IR to tgsi allocate new registers for both
and add new semantics to the respective declarations.
2009-07-01 10:45:55 -04:00
José Fonseca
e8c4663c11 wgl: Optimize wglGetProcAddress.
Do linear search only if prefix matches.
2009-07-01 10:03:59 +01:00
Eric Anholt
c72261f2a8 i915: Fix assertion failure on remapping a non-BO-backed VBO.
Failure to set the obj->Pointer back to null tripped up the assertion.
Bug #22428.
(cherry picked from commit 57a06d3a48)
2009-06-30 13:29:37 -07:00
Jon TURNEY
57955451f8 xdemos: Fix xdemos which default to using display :0.0 to default to $DISPLAY
Fix xdemos which default to using display :0.0 to default to $DISPLAY,
this is kind of irritating when testing on a display other than :0.0

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-06-30 13:58:21 -06:00
Keith Whitwell
e5cb11adda mesa/vbo: fix compile and replay of nodes ending in a FALLBACK
Where vbo save nodes are terminated with a call to DO_FALLBACK(), as in
the case of a recursive CallList which is itself within a Begin/End pair,
there two problems:
1) The display list node's primitive information was incorrect, stating
the cut-off prim had zero vertices
2) On replay, we would get confused by a primitive that started in a
node, but was terminated by individual opcodes.

This change fixes the first problem by correctly terminating the last
primitive on fallback, and the second by forcing the display list to
use the Loopback path, converting all nodes into immediate-mode rendering.

The loopback fix is a performance hit, but avoiding this would require
a fairly large rework of this code.
2009-06-30 19:59:38 +01:00
Keith Whitwell
53f8dccd0c progs/trivial: test case for dlist statechange elimination
Creates a display list with redundant call to glShadeModel.

View dlist contents with MESA_VERBOSE=list
2009-06-30 12:20:24 +01:00
Keith Whitwell
00438bb94a mesa/dlist: restore missing SAVE_FLUSH_VERTICES in save_ShadeModel
Reorganization of ShadeModel to avoid flushing vertices too often
ended up never flushing vertices due to omitted line of code.
2009-06-30 12:19:11 +01:00
Keith Whitwell
0846c88ec3 mesa/vbo: use _lookup_prim_by_nr for debugging
Switch over to specialized enum lookup for primitives
2009-06-30 12:16:41 +01:00
Keith Whitwell
aa688d1579 mesa: add debug printer for primitive name
Add a simple version of _mesa_lookup_enum_by_nr() which expects a primitive
enum (GL_POINTS..GL_POLYGON).  This avoids some annoying duplicates
when looking up primitives, such as the GL_FALSE/GL_POINTS clash.
2009-06-30 12:13:59 +01:00
Brian Paul
8d24160a40 progs/glsl: link with GLEW library
(cherry picked from commit b1f2f92d9b)
2009-06-30 11:47:51 +01:00
Keith Whitwell
47173cf67f mesa/dlist: shortcircuit some redundant statechanges at compile time
Currently, state-changes in mesa display lists are more or less
a verbatim recording of the GL calls made during compilation.

This change introduces a minor optimization to recognize and eliminate
cases where the application emits redundant state changes, eg:

  glShadeModel( GL_FLAT );
  glBegin( prim )
  ...
  glEnd()
  glShadeModel( GL_FLAT );
  glBegin( prim )
  ...
  glEnd()

The big win is when we can eliminate all the statechanges between two
primitive blocks and combine them into a single VBO node.

This commit implements state-change elimination for Material and ShadeModel
only.  This is enough to make a start on debugging, etc.
2009-06-30 09:55:33 +01:00
Brian Paul
4e43126a59 intel: added null ptr check
This fixes a segfault seen with piglit's fdo20701 test.
2009-06-29 15:26:28 -06:00
Brian Paul
b1f2f92d9b progs/glsl: link with GLEW library 2009-06-29 10:32:04 -06:00
Keith Whitwell
9014f475ff progs/util: make sure function pointers are initialized
Call Init() from CompileShaderFile, was previously only called for the
Text version of this function.
2009-06-29 16:07:14 +01:00
Keith Whitwell
b799af91d5 progs/glsl: compile with scons and glew
Get most of these working with scons.
2009-06-29 14:15:08 +01:00
José Fonseca
9a5ee12434 scons: Don't raise an exception when DXSDK is not found.
Unfortunately scons does not check if a tool exists before it invokes
its generate function.
2009-06-29 12:56:47 +01:00
José Fonseca
bb8f3090ba scons: Disable optimizations only for gcc-4.2
gcc-4.2's optimizer has a strange bug where it looses code from inner
loops in certain situations. For example, if the appearently innocent
looking code below is compiled with gcc-4.2 -S -O1, the inner loop's
code is missing from the outputed assembly.

   struct Size {
      unsigned width;
   };

   struct Command {
      unsigned length;
      struct Size sizes[32];
   };

   extern void emit_command(void *command, unsigned length);

   void
   create_surface( struct Size size, unsigned faces, unsigned levels)
   {
      struct Command cmd;
      unsigned face;
      unsigned level;

      cmd.length = faces*levels*sizeof(cmd.sizes[0]);

      for(face = 0; face < faces; ++face) {
	 for(level = 0; level < levels; ++level) {
	    cmd.sizes[face*levels + level] = size;
	    // This should generate a shrl statement, but the whole for body
	    // disappears in gcc-4.2 -O1/-O2/-O3!
	    size.width >>= 1;
	 }
      }

      emit(&cmd, sizeof cmd.length + cmd.length);
   }

Note that this is not specific to MinGW's gcc-4.2 crosscompiler (the
version typically found in debian/ubuntu's mingw32 packages). gcc-4.2 on
Linux also displays the same error. gcc-4.3 and above gets this
correctly though.

Updated MinGW debian packages with gcc-4.3 are available from
http://people.freedesktop.org/~jrfonseca/debian/pool/main/m/
2009-06-28 11:12:22 +01:00
José Fonseca
72ad039d19 scons: Use -Bsymbolic linker option.
This prevents the error

  relocation R_X86_64_PC32 against symbol `_gl_DispatchTSD' can not be used when making a shared object; recompile with -fPIC

when building on x86_64 architecture.
2009-06-28 10:54:23 +01:00
Brian Paul
418987ff05 docs: detect when too many varying vars are used 2009-06-26 16:54:44 -06:00
Brian Paul
21320b24c5 glsl: check number of varying variables against the limit
Link fails if too many varying vars.

(cherry picked from master, commit cc58fbcf2c)
2009-06-26 16:53:46 -06:00
Brian Paul
4181a107cb docs: fix typos, remove old text from relnotes file 2009-06-26 16:47:57 -06:00
Brian Paul
2a41df86a3 docs: bring over news updates from 7.4 branch 2009-06-26 16:46:21 -06:00
Brian Paul
318122b60a docs: bring in 7.4.3 and 7.4.4 release notes, news 2009-06-26 16:45:54 -06:00
Brian Paul
dd585db687 docs: increase max varying vars to 16 2009-06-26 16:41:54 -06:00
Brian Paul
f08bebfe24 mesa: raise MAX_VARYING (number of shader varying vars) to 16
16 is the limit for now because of various 32-bit bitfields.

(cherry picked from master, commit 4e762395ef)
2009-06-26 16:41:04 -06:00
Ian Romanick
2d86503471 intel / DRI2: Additional flush of fake front-buffer to real front-buffer
To maintain correctness, the server will copy the real front-buffer to
a newly allocated fake front-buffer in DRI2GetBuffersWithFormat.
However, if the DRI2GetBuffersWithFormat is triggered by glViewport,
this will copy stale data into the new buffer.  Fix this by flushing
the current fake front-buffer to the real front-buffer in
intel_viewport.

Fixes bug #22288.
2009-06-26 13:32:26 -07:00
Brian Paul
077a06c140 mesa: bump version to 7.5-rc4 2009-06-26 13:16:34 -06:00
Brian Paul
62ad606065 docs: document for/continue bug fix 2009-06-26 13:16:34 -06:00
Brian Paul
928e1ce47f cell: PIPE_CAP_TGSI_CONT_SUPPORTED query 2009-06-26 13:16:34 -06:00
Brian Paul
af7fb892d8 softpipe: PIPE_CAP_TGSI_CONT_SUPPORTED query 2009-06-26 13:16:34 -06:00
Brian Paul
f5dc352e5f gallium: added PIPE_CAP_TGSI_CONT_SUPPORTED 2009-06-26 13:16:34 -06:00
Brian Paul
e80ecdf659 glsl: move/simplify error checking for 'return' statements 2009-06-26 13:16:34 -06:00
Brian Paul
8e6dd8bf79 glsl: overhaul 'return' statement handling
A new node type (SLANG_OPER_RETURN_INLINED) is used to denote 'return'
statements inside inlined functions which need special handling.

All glean glsl1 tests pass for EmitContReturn=FALSE and TRUE.
2009-06-26 13:16:34 -06:00
Brian Paul
aa48becb82 glsl: predicate assignments according to __returnFlag
Fixes glean "function with early return (3)" case (when EmitContReturn=FALSE).
2009-06-26 13:16:34 -06:00
Brian Paul
16787c513b glsl: added slang_variable::is_global field 2009-06-26 13:16:34 -06:00
Brian Paul
ac05996b81 glsl: silence a problem warning 2009-06-26 13:16:34 -06:00
Brian Paul
0efd25b502 glsl: code refactoring for return statements 2009-06-26 13:16:34 -06:00
Brian Paul
2ae297c318 glsl: fix assorted regressions related to early-return-removal 2009-06-26 13:16:34 -06:00
Brian Paul
ddf64be258 glsl: comments, field reordering 2009-06-26 13:16:34 -06:00
Brian Paul
f652f15e6d glsl: rework loop nesting code 2009-06-26 13:16:34 -06:00
Brian Paul
dd453fa37c glsl: remove test for loop unrolling when we hit conditional cont/break
This is no longer needed since we added the new
_slang_loop_contains_continue_or_break() function/test.
2009-06-26 13:16:34 -06:00
Brian Paul
2f1c5c58b3 glsl: checkpoint: predicate __retVal = expr with __returnFlag
The glean "function with early return (1)" test passes now.
2009-06-26 13:16:34 -06:00
Brian Paul
65eaafee25 glsl: use new helper functions in _slang_gen_logical_and/or() 2009-06-26 13:16:33 -06:00
Brian Paul
e139434d44 glsl: add comments 2009-06-26 13:16:33 -06:00
Brian Paul
b04605d544 glsl: checkpoint: replace 'return' with __returnFlag=true;
Needed for "remove early returns" transformation.
2009-06-26 13:16:33 -06:00
Brian Paul
515513b409 glsl: fix up scoping for parent/children in slang_operation_copy()
This will need more testing, but no regressions seen so far.
2009-06-26 13:16:33 -06:00
Brian Paul
09313043e7 glsl: fix uninitialized var in _slang_gen_for_without_continue() 2009-06-26 13:16:33 -06:00
Brian Paul
5951ab311d glsl: added slang_operation_free_children() 2009-06-26 13:16:33 -06:00
Brian Paul
e5b53c071b glsl: added slang_oper_num_children() helper 2009-06-26 13:16:33 -06:00
Brian Paul
3c6480ea42 glsl: check-point: declare _returnFlag 2009-06-26 13:16:33 -06:00
Brian Paul
fc0896b50b glsl: added slang_operation_insert_child() 2009-06-26 13:16:33 -06:00
Brian Paul
f4b1a69b7d glsl: use slang_generate_declaration() to consolidate some code 2009-06-26 13:16:33 -06:00
Brian Paul
454a717d94 glsl: remove obsolete comment 2009-06-26 13:16:33 -06:00
Brian Paul
02edc8da36 st/mesa: query PIPE_CAP_TGSI_CONT_SUPPORTED 2009-06-26 13:16:33 -06:00
Brian Paul
08025cd4a5 glsl: implement _slang_gen_while_without_continue() 2009-06-26 13:16:33 -06:00
Brian Paul
2102e301a7 glsl: fix a bug involving 'continue' in 'for' loops
Need to execute the for loop's increment code before we continue.
Add a slang_assemble_ctx::CurLoopOper field to keep track of the containing
loop and avoid the "cont if true" path in this situation.

Plus, assorted clean-ups.
2009-06-26 13:16:33 -06:00
Brian Paul
541594b044 glsl: added slang_oper_child_const() 2009-06-26 13:16:32 -06:00
Brian Paul
38ddbc5588 glsl: use _slang_loop_contains_continue_or_break() to check for unrolling
The previous test failed for nested loops.
2009-06-26 13:16:32 -06:00
Brian Paul
4dafac2b2f glsl: use new _slang_loop_contains_continue() helper function 2009-06-26 13:16:32 -06:00
Brian Paul
aba93643be glsl: implement continue->break translation for do-while loops 2009-06-26 13:16:32 -06:00
Brian Paul
7e0eaca201 glsl: added slang_operation_literal_int/bool() helper functions 2009-06-26 13:16:32 -06:00
Brian Paul
c1f74a6734 glsl: don't allocate 0-length children array in slang_operation_copy() 2009-06-26 13:16:32 -06:00
Brian Paul
f38872473c glsl: remove debug code, misc clean-up 2009-06-26 13:16:32 -06:00
Brian Paul
f66733bbee glsl: implement continue->break transformation for for-loops 2009-06-26 13:16:32 -06:00
Brian Paul
c4fd947bee glsl: added slang_operation_add_children() and slang_oper_child() helpers 2009-06-26 13:16:32 -06:00
Brian Paul
c20bb48d3a glsl: added slang_assemble_ctx::EmitContReturn field, init 2009-06-26 13:16:32 -06:00
Brian Paul
eb1eee03a6 demos: improve argv parsing in fslight.c 2009-06-26 13:16:32 -06:00
Brian Paul
4bc74a0756 glsl: don't unroll loops containing continue/break
Just search the AST in _slang_can_unroll_for_loop().
2009-06-26 13:16:32 -06:00
Brian Paul
625b0fe268 Revert "slang: if/else/break & if/else/continue work for unrolled loops"
We should just check if the loop contains a continue/break in the
_slang_can_unroll_for_loop() test function...

This reverts commit 989856bde4.

Conflicts:

	src/mesa/shader/slang/slang_codegen.h
2009-06-26 13:16:32 -06:00
Brian Paul
4031ea1520 glsl: Added gl_shader_state::EmitContReturn field
This is the start of a glsl-continue-return feature branch to support
a GLSL code generator option for 'continue' and 'return' statements.
Some targets don't support CONT or RET statements so we'll need to
try to generate code that does not use them...
2009-06-26 13:16:32 -06:00
Brian Paul
84c5e4805b docs: updated Mesa release instructions 2009-06-26 13:16:32 -06:00
José Fonseca
72aed16aee scons: Tool to build with DirectX SDK.
Also works with MinGW, as long as the path to the DirectX SDK top
directory is set in the DXSDK_DIR environment variable.
2009-06-26 19:57:47 +01:00
José Fonseca
25f6c936fe scons: Don't use C specific options with g++ 2009-06-26 19:57:46 +01:00
Keith Whitwell
3e94521912 tgsi: correct handling of return value from util_vsnprintf
We were failing to deal with:
  - vsnprintf returns negative value on error.
  - vsnprintf returns the number of chars that *would* have been
    written on truncation.
2009-06-26 13:45:34 +01:00
Keith Whitwell
c9f8c400ab aux/indices: don't use 'prim' value once it is known to be bad
Theoretical bugfix only - no known case where this might happen.
2009-06-26 13:44:20 +01:00
José Fonseca
c25534f30d wgl: Handle flush after a window is destroyed.
Fixes assertion failure with conform.
2009-06-24 15:23:44 +01:00
Brian Paul
b79e6a59d8 demos: fix issues in glxcontexts.c
The reshape() function was called when there was no GLX context so
the viewport/modelview/projection setup wasn't doing anything.  Move
the call to reshape() into draw().

Also, remove -stereo, -fullscreen options and do some general clean-up.
2009-06-23 09:31:27 -06:00
Roland Scheidegger
2f184d0d9f i965: handle OPCODE_SWZ in the glsl path
glsl compiler will not generate OPCODE_SWZ, and as a first step it would
be translated away to a MOV anyway (why?), but later internally this opcode is
generated (for EXT_texture_swizzling).
(cherry picked from commit 4ef1f8e3b5)
2009-06-22 15:15:20 -07:00
Owen W. Taylor
9d367d43b2 Disable SGI_swap_control extension for DRI2
We currently don't have support for SGI_swap_control for direct
contexts with DRI2, so disable reporting the extension. Reporting
the extension, and then having glXSwapIntervalSGI() "succeed"
but do nothing can confuse applications.

https://bugs.freedesktop.org/show_bug.cgi?id=22123
(cherry picked from commit 279143c6e8)
2009-06-22 15:15:20 -07:00
Michel Dänzer
0584b6e433 intel: intel_texture_drawpixels() can't handle GL_DEPTH_STENCIL.
Fixes glean depthStencil test.
(cherry picked from commit 3885b708fd)
2009-06-22 15:15:20 -07:00
Brian Paul
19218fe712 i965: added intelFlush() call in intel_get_tex_image()
Fixes the render-to-texture test in progs/tests/getteximage.c
(cherry picked from commit a03b349153)
2009-06-22 15:15:20 -07:00
Brian Paul
a5b7e0c7d7 mesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS/ in NV funcs
(cherry picked from commit 4dc426c016)
2009-06-22 15:15:20 -07:00
Brian Paul
54f425b5ce mesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBS
Be clearer that this is the number of generic vertex program/shader
attributes, not counting the legacy attributes (pos, normal, color, etc).
(cherry picked from commit 4a95185c9f)
2009-06-22 15:15:19 -07:00
Brian Paul
810df8317d mesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS
(cherry picked from commit d2a74d76c9)
2009-06-22 15:15:19 -07:00
Brian Paul
19ca5ee1db mesa: fix some potential state-restore issues in pop_texture_group()
Call the _mesa_set_enable() functions instead of driver functions, etc.

Also, add missing code for 1D/2D texture arrays.
(cherry picked from commit aac19609bf)
2009-06-22 15:15:19 -07:00
Brian Paul
ad0514b24d vbo: return VP_NONE from get_program_mode() if running fixed-func vertex program
If we're running a vertex program to emulated fixed-function, we still need
to treat vertex arrays/attributes as if we're in fixed-function mode.

This should probably be back-ported to Mesa 7.5 after a bit more testing.
(cherry picked from commit dda82137d2)
2009-06-22 15:15:19 -07:00
Brian Paul
00e203fe17 mesa: create/use a fallback texture when bound texture is incomplete
When a GLSL sampler reads from an incomplete texture it should
return (0,0,0,1).  Instead of jumping through hoops in all the drivers
to make this happen, just create/install a fallback texture with those
texel values.

Fixes piglit/fp-incomplete-tex on i965 and more importantly, fixes some
GPU lockups when trying to sample from missing surfaces.  If a binding
table entry is NULL, it seems that sampling sometimes works, but not
always (lockup).

Todo: create a fallback texture for each type of texture target?
(cherry picked from commit 3f25219c7b)
2009-06-22 15:15:19 -07:00
Eric Anholt
abfd56c24c intel: Fix other metaops versus GL_COMPILE_AND_EXECUTE dlists.
Fixes oglconform zbfunc.c and pxtrans-cidraw.c, at least.

(cherry picked from commit 405300bb19)
2009-06-19 16:57:06 -07:00
Eric Anholt
daacac1c24 intel: Fix glClear behavior versus display lists.
The CALL_DrawArrays was leaking the clear's primitives into the display
list with GL_COMPILE_AND_EXECUTE.  Use _mesa_DrawArrays instead, which
doesn't appear to leak.  Fixes piglit dlist-clear test.
(cherry picked from commit 64edde1004)
2009-06-19 16:54:59 -07:00
Roland Scheidegger
43bb78f2bb radeons: use dp4 for position invariant vertex programs
Fixes #22181. R200 requires this since DP4 is used in hw tnl mode.
R300 prefers it (should be faster due to no instruction dependencies), but
both methods should be correct (when sw tcl is used though, MUL/MAD might
be faster). Probably doesn't make much difference for R100 since vertex progs
are executed in software anyway, but let's just keep it the same there too.
2009-06-19 20:00:55 +02:00
Michel Dänzer
9dfce365c7 Also release direct rendering resources in glXDestroyGLXPixmap.
Fixes leak running compiz with direct rendering.
2009-06-19 18:00:49 +02:00
Michel Dänzer
a120778c72 Always free image offsets memory when re-initializing texture image fields.
Fixes leak running compiz with direct rendering.
2009-06-19 18:00:33 +02:00
José Fonseca
3cf92e936a scons: Output the friendly "Linking ..." message when creating DLLs with MinGW. 2009-06-19 16:08:38 +01:00
Brian Paul
0487656245 softpipe: return alpha=1 in shadow_compare() function
The alpha value wasn't set at all before so we got unpredictable results.

Note that we don't currently obey GL_DEPTH_TEXTURE_MODE in the state
tracker.  For now, we return the result in the default mode (r,r,r,1).
2009-06-19 08:53:15 -06:00
José Fonseca
8f382fd3f3 util: Add cast.
It is expected to loose precision here.
2009-06-18 14:54:09 +01:00
José Fonseca
21bfd0f4bd draw: Replace pointer arithmetic with cast.
Using uintptr_t as intermediate type for pointer -> integer conversions is
easier to understand and does not cause any size mismatch warnings.
uintptr_t is part of C99, and we already provide a suitable replacement
definition for all platforms we care about.
2009-06-18 14:54:09 +01:00
José Fonseca
d609df1dae trace: Use size_t consistently. 2009-06-18 14:54:09 +01:00
José Fonseca
2af0173e9e pipebuffer: Use a type consistently for sizes/offsets.
Avoids warnings on 64bit builds.

Use regular unsigned since that's what gallium expects, but use a
typedef to facilitate possible changes in the future.
2009-06-18 14:54:08 +01:00
José Fonseca
42882897c6 wgl: Fix window resizing in multithread applications.
In multithreading stw_call_window_proc can be called by a thread other
than the thread where the context is bound.
2009-06-18 14:54:07 +01:00
José Fonseca
4b4855c717 wgl: Move all thread related code together.
Not only for cosmetic reasons, but also because we need to set the
SetWindowsHookEx hook for threads created before the DllMain is called
(threads for each we don't get the DLL_THREAD_ATTACH notification).
2009-06-18 14:54:07 +01:00
Keith Whitwell
1b05b5b4fe glew: correct misspelling of glFramebufferTextureLayer
This was misspelt as glFramebufferTexturLayer (missing e), causing
conflicts with the correctly spelt version in glext.h and extfuncs.h.
2009-06-18 10:13:55 +01:00
Keith Whitwell
0491142152 mesa: protect Elements against multiple definitions
Mesa and gallium both have a definition of this macro
2009-06-18 09:53:45 +01:00
Brian Paul
39366ed995 intel: remove extra \n from warning string
(cherry picked from commit 42e9bde0fa)
2009-06-17 12:55:26 -07:00
Robert Ellison
d446d3acac i965: fix 1D texture borders with GL_CLAMP_TO_BORDER
With 1D textures, GL_TEXTURE_WRAP_T should be ignored (only
GL_TEXTURE_WRAP_S should be respected).  But the i965 hardware
seems to follow the value of GL_TEXTURE_WRAP_T even when sampling
1D textures.

This fix forces GL_TEXTURE_WRAP_T to be GL_REPEAT whenever 1D
textures are used; this allows the texture to be sampled
correctly, avoiding "imaginary" border elements in the T direction.

This bug was demonstrated in the Piglit tex1d-2dborder test.
With this fix, that test passes.
(cherry picked from commit ab6c4fa582)
2009-06-17 12:55:26 -07:00
Robert Ellison
56235ae504 i965: send all warnings through _mesa_warning()
One warning message:
   drm_i915_getparam: -22

was still being sent to fprintf().  This causes all Piglit tests to fail,
even with MESA_DEBUG=0.

Using _mesa_warning() to emit the message allows the general Mesa controls
for messages like this to be applied.
(cherry picked from commit bc3270e99f)
2009-06-17 12:55:26 -07:00
Robert Ellison
e15aebe10e i965: fix segfault on low memory conditions
When out of memory (in at least one case, triggered by a longrunning
memory leak), this code will segfault and crash.  By checking for the
out-of-memory condition, the system can continue, and will report
the out-of-memory error later, a much preferable outcome.
(cherry picked from commit 44a4abfd4f)
2009-06-17 12:55:26 -07:00
Ian Romanick
a70c45bdab Fast path when rebinding the same texture in single context environment
If there is no shared context, there is no purpose in rebinding the same
texture.  In some artificial tests this improves performance 10% - 30%.
(cherry picked from commit 7f8000db8b)
2009-06-17 12:55:26 -07:00
Eric Anholt
ff3da0966f i915: Don't put VBOs in graphics memory unless required for an operation.
This saves doing swtnl from uncached memory, which is painful.  Improves
clutter test-text performance by 10% since it started using VBOs.
(cherry picked from commit a945e203d4)
2009-06-17 11:08:36 -07:00
Eric Anholt
1b8e4dd2c8 i915: Fall back on NPOT textured metaops on 830-class.
(cherry picked from commit 8ec6e03679)
2009-06-17 11:08:28 -07:00
Eric Anholt
cee73ffdaf i915: Restore the Viewport and DepthRange functions on 8xx.
Fixes failed viewport updates on glxgears (and other apps) resize since
e41780fedc.

Bug #20473.
(cherry picked from commit 0e83e8f51a)
2009-06-17 11:08:13 -07:00
Eric Anholt
7805c3b57b i956: Make state dependency of SF on drawbuffer bounds match Mesa's.
Noticed while debugging a weird 1D FBO testcase that left its existing
viewport and projection matrix in place when switching drawbuffers.  Didn't
fix the testcase, though.
(cherry picked from commit 3a521d84ec)
2009-06-17 11:07:03 -07:00
Eric Anholt
97974b7e51 intel: Don't complain on falling back from PBO fastpaths.
Instead, stash the debug info under the handy debug flag.

Bug #20053
(cherry picked from commit 22690482e6)
2009-06-17 11:06:52 -07:00
Eric Anholt
957f3c8c3d mesa: Mark FBOs with compressed color attachments as FBO-incomplete.
Both EXT_fbo and ARB_fbo agree on this.  Fixes a segfault in the metaops
mipmap generation in Intel for SGIS_generate_mipmap of S3TC textures in
Regnum Online.

Bug #21654.
(cherry picked from commit 0307e609aa)
2009-06-17 11:06:46 -07:00
Eric Anholt
66bfd025c8 i915: Use Stencil.Enabled instead of Stencil._Enabled in DrawBuffers.
The _Enabled field isn't updated at the point that DrawBuffers is called,
and the Driver.Enable() function does the testing for stencil buffer
presence anyway.

bug #21608 for Radeon
(cherry picked from commit 4c6f829899)
2009-06-17 11:06:38 -07:00
Eric Anholt
fbd554d074 i915: Only use the new 945 cube layout for compressed textures.
The docs actually explain this, but not in a terribly clear manner.
This nearly fixes the piglit cubemap testcase, except that something's
going wrong with the nearest filtering at 2x2 sizes in the testcase.
Looks good by visual inspection, though.

Bug #21692
(cherry picked from commit 5c5a468848)
2009-06-17 11:06:25 -07:00
Eric Anholt
6e0df938d4 i965: Fix varying payload reg assignment for the non-GLSL-instructions path.
I don't have a testcase for this, but it seems clearly wrong.
(cherry picked from commit dc657f3929)
2009-06-17 11:05:55 -07:00
Eric Anholt
988b61be27 i965: Fix register allocation of GLSL fp inputs.
Before, if the VP output something that is in the attributes coming into
the WM but which isn't used by the WM, then WM would end up reading subsequent
varyings from the wrong places.  This was visible with a GLSL demo
using gl_PointSize in the VS and a varying in the WM, as point size is in
the VUE but not used by the WM.  There is now a regression test in piglit,
glsl-unused-varying.

(cherry picked from commit 0f5113deed)
2009-06-17 11:04:31 -07:00
Eric Anholt
320a303be0 intel: Use FRONT_AND_BACK for StencilOp as well.
(cherry picked from commit 64980125c7)
2009-06-17 10:52:56 -07:00
Eric Anholt
d9e35d51fd intel: Use GL_FRONT_AND_BACK for stencil clearing.
This comes from a radeon-rewrite fallback fix, but may also fix stencil
clear failure when the polygon winding mode is flipped.
(cherry picked from commit d866abeffc)
2009-06-17 10:52:54 -07:00
Eric Anholt
61a2c9668f intel: Skip the DRI2 renderbuffer update when doing Viewport on an FBO.
(cherry picked from commit d4a42b0ce6)
2009-06-17 10:52:49 -07:00
Eric Anholt
2770107d87 intel: Map write-only buffer objects through the GTT when possible.
This looks to be a win of a few percent in cairogears with new vbo code,
thanks to not polluting caches.
(cherry picked from commit aa422b2625)
2009-06-17 10:52:30 -07:00
Brian Paul
3f856c6b6b mesa: rework viewport/scissor initialization code
The first time a context is bound to a drawable, the viewport and scissor
bounds are initialized to the buffer's size.  This is actually a bit tricky.

A new _mesa_check_init_viewport() function is called in several places
to check if the viewport has been initialized.  We also use a new
ctx->ViewportInitialized flag instead of the overloaded
ctx->FirstTimeCurrent flag.
2009-06-17 08:38:38 -06:00
Brian Paul
d18c57aaea mesa: added null ptr check in Fake_glXCreatePixmap()
Fixes segfault in progs/xdemos/glxgears_pixmap.c
2009-06-17 08:38:38 -06:00
Brian Paul
3705f48688 st/glx: added null ptr check in Fake_glXCreatePixmap()
Fixes segfault in progs/xdemos/glxgears_pixmap.c
2009-06-17 08:38:38 -06:00
José Fonseca
c6f71eabd8 Revert "scons: Debug build by default."
Per Brian's request.

This reverts commit 25f0c33bb3.
2009-06-17 15:24:06 +01:00
José Fonseca
1bee650ef3 progs/wgl: Fix shreadtex_mt too. 2009-06-17 15:23:25 +01:00
José Fonseca
6e24fdeae5 progs/wgl: Tweak the initialization wait in wglthreads.
There was still a non-zero probability for wglShareLists of failing.
2009-06-17 15:23:25 +01:00
José Fonseca
557421b6de progs/wgl: Get wglShareLists working in wglthreads.
wglShareLists is a little picky -- it seems to check if it has exclusive
access to a lock, and fails if it doesn't.

This allows the texture to be shared with all windows.
2009-06-17 15:23:25 +01:00
José Fonseca
25f0c33bb3 scons: Debug build by default.
Match what autotools and other build systems do by default.
2009-06-17 15:23:24 +01:00
Brian Paul
c53705ed7b GLX: attempt to fix glean makeCurrent test cases.
Two parts to this:

One we don't keep pointers to possibly freed memory anymore once we unbind the
drawables from the context. Brian I need to figure out what the comment
you made there, can we get a glean/piglit test so we can fix it properly?

If the new gc is the same as the oldGC, we call the unbind even though
we just bound it in that function. doh.

(cherry picked from master, commit 77506dac8e)
2009-06-17 08:03:19 -06:00
José Fonseca
ebe0796ba2 docs: Document building with SCons. 2009-06-17 10:12:11 +01:00
José Fonseca
d22828f716 wgl: Factor out some repetitive code into inline functions. 2009-06-17 10:08:25 +01:00
José Fonseca
992000cce7 progs/wgl: Allow resizing wglthreads' windows. 2009-06-17 10:08:24 +01:00
Brian Paul
6b917d0b17 i965: fix bugs in projective texture coordinates
For the TXP instruction we check if the texcoord is really a 4-component
atttibute which requires the divide by W step.  This check involved the
projtex_mask field.  However, the projtex_mask field was being miscalculated
because of some confusion between vertex program outputs and fragment
program inputs.

1. Rework the size_masks calculation so we correctly set bits corresponding
to fragment program input attributes.

2. Rename projtex_mask to proj_attrib_mask since we're interested in more
than just texcoords (generic varying vars too).

3. Simply the indexing of the size_masks and proj_attrib_mask fields.

4. The tracker::active[] array was mis-dimensioned.  Use MAX_PROGRAM_TEMPS
instead of a magic number.

5. Update comments, add new assertions.

With these changes the Lightsmark demo/benchmark renders correctly, until
we eventually hit a GPU lockup...
2009-06-16 18:21:26 -06:00
Brian Paul
742ba08406 softpipe: fix out of bounds quad rasterization bug
For some triangles we can generate quads which lie just outside the
surface bounds.  Just check the quad's mask before trying to emit/process
the quad.

Fixes failed assertion in Lightsmark.
2009-06-16 15:41:49 -06:00
Brian Paul
3e48dd0445 mesa: fix incorrect viewport clamping in _mesa_set_viewport()
A 0 by 0 viewport size is legal.  Don't clamp against lower bound of one.
The error checking earlier in the function prevents negative values.
2009-06-16 09:34:35 -06:00
Brian Paul
ed7f4b4230 mesa: fix REMAINDER() macro
The results were incorrect for some negative values of A.
See bug 21872.
2009-06-16 08:45:56 -06:00
José Fonseca
3463b1479d gallium: Avoid atomic ops / locking when src is dst. 2009-06-16 13:05:25 +01:00
José Fonseca
077c5e62d8 progs/wgl: Quit after displaying usage for -h option. 2009-06-16 12:34:29 +01:00
José Fonseca
06075711af progs/wgl: Use appropriate types to silence msvc warnings. 2009-06-16 12:29:58 +01:00
José Fonseca
566bdbe67d progs/wgl: Fix assertion failure in wglthreads' texture creation. 2009-06-16 12:29:58 +01:00
Shuang He
d027e8feff intel: Release fb backing regions in intelDestroyBuffer()
Fixes memory leak when destroying framebuffers.
2009-06-15 16:19:30 -06:00
José Fonseca
227d233cff python/tests: Add is_depth_stencil_format utility function. 2009-06-15 19:22:35 +01:00
José Fonseca
7585cbffe0 python/tests: Cleanup texture_sample. 2009-06-15 19:21:58 +01:00
José Fonseca
c6af9b2947 mesa: Always return a value. 2009-06-15 19:20:25 +01:00
José Fonseca
053d8eb891 mesa: Use appropriate float/integer types. 2009-06-15 19:20:05 +01:00
José Fonseca
6214c7262f mesa: Use type modifier for float constants. 2009-06-15 19:19:29 +01:00
José Fonseca
37f2117cd1 mesa: Use integer type with appropriate sign. 2009-06-15 19:17:07 +01:00
José Fonseca
c33ef1f7c6 rtasm: Use 32bit constant.
As we're only using 32bit bitmasks.
2009-06-15 19:04:04 +01:00
José Fonseca
940cb7ce16 gallium: Ensure assert macro is defined before being used in p_thread.h 2009-06-15 18:57:45 +01:00
José Fonseca
5d0cf9ebb4 softpipe: Fix softpipe_is_texture_referenced.
Render results are only visible when the render cache is flushed.
softpipe_is_texture_referenced must reflect that or transfers to/from the
textures bound in the framebuffer won't be proceeded of the necessary
flush, causing transfer data to be outdated/clobbered.

This fixes conform drawpix test with softpipe.
2009-06-15 18:42:13 +01:00
José Fonseca
0e1abced56 progs/tests: Use opaque colors.
Transparency is not relevant for this example, and leads to distraction
due to different results in alpha visuals, when capturing images to disk.
2009-06-15 15:40:10 +01:00
Thomas Hellstrom
db22b35d21 dri st: Don't require the PIPE_TEXTURE_USAGE_RENDER_TARGET property for depth- and stencil renderbuffers.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-06-15 11:48:57 +02:00
Thomas Hellstrom
cbe5af766e gallium: Fix segfault and valgrind error introduced with commit 3f2e006b75
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-06-15 11:22:06 +02:00
Brian Paul
fb64365642 demos: update fbotexture.c to use EXT or ARB functions exclusively
When the -arb option is specified we use GL_ARB_framebuffer_object intead
of GL_EXT_framebuffer_object.

For some vendors' OpenGL it's important to call the ARB entrypoints
instead of the EXT entrypoints to get correct behaviour.  Use some
function pointer tricks to do this (instead of GLEW).
2009-06-12 08:15:33 -06:00
Brian Paul
476685c63c util: additional function pointers 2009-06-12 08:15:33 -06:00
Jakob Bornecrantz
c6de08fff4 mesa: Enable uploads of only depth to z24s8 textures 2009-06-12 12:29:02 +01:00
Brian Paul
3754c4135c mesa: rework vertex shader output / fragment shader input attribute matching
Before, if a vertex shader's outputs didn't exactly match a fragment
shader's inputs we could wind up with invalid TGSI shader declarations.
For example:

Before patch:
DCL OUT[0], POSITION
DCL OUT[1], COLOR[1]
DCL OUT[2], GENERIC[0]
DCL OUT[3], GENERIC[0] <- note duplicate [0]
DCL OUT[4], GENERIC[2]

After patch:
DCL OUT[0], POSITION
DCL OUT[1], COLOR[1]
DCL OUT[2], GENERIC[0]
DCL OUT[3], GENERIC[1]
DCL OUT[4], GENERIC[2]
2009-06-11 14:58:25 -06:00
Brian Paul
322e8556b9 mesa: add default function for ctx->Driver.CheckQuery() hook 2009-06-11 14:58:25 -06:00
José Fonseca
0ddc38309a python/retrace: Show the contents of the depth/stencil and surfaces before/after transfers. 2009-06-11 20:46:07 +01:00
José Fonseca
e1700009b7 python/retrace: Interpret is_texture_referenced/is_buffer_referenced. 2009-06-11 19:24:48 +01:00
José Fonseca
d5ba39ad08 wgl: Fix prototype. 2009-06-11 19:05:46 +01:00
José Fonseca
de413b1ba9 mesa: Use new pf_is_depth_and_stencil inline. 2009-06-11 19:02:59 +01:00
José Fonseca
3f2e006b75 gallium: New pf_is_depth_and_stencil / pf_is_depth_or_stencil inlines. 2009-06-11 19:02:59 +01:00
José Fonseca
7cafd49c93 mesa: Use PIPE_TEXTURE_USAGE_DEPTH_STENCIL for any depth or stencil format. 2009-06-11 19:02:59 +01:00
José Fonseca
862c7b8cd3 mesa: Remove dead code. 2009-06-11 19:02:59 +01:00
Brian Paul
bb0b954f12 st/mesa: fix typo s/BFC0/BFC1/ 2009-06-11 10:40:19 -06:00
Brian Paul
9d5479eeeb vbo: fix assertion, #define IMM_BUFFER_NAME
This was sometimes seen when Glean exited upon test failure when using
Gallium.
2009-06-11 09:46:02 -06:00
José Fonseca
cc09724a50 python/tests: Test sampling from a depth texture. 2009-06-11 16:22:17 +01:00
Jakob Bornecrantz
41cf681535 mesa: Only do read write when we don't have a depth value to write 2009-06-11 15:37:53 +01:00
José Fonseca
e3f14f2f3b progs: Port fp programs to GLEW. 2009-06-11 13:19:34 +01:00
José Fonseca
48d816b8ff mesa: Take the format from the right structure. 2009-06-11 12:23:09 +01:00
José Fonseca
96aca15c9d meas: Use a read/write transfer when writing stencil component, but not touching the depth component. 2009-06-11 11:47:20 +01:00
José Fonseca
337f559cd2 mesa: Reverse s8z24 into z24s8 as required by EXT_packed_depth_stencil.
Actually, after spotting this problem, I realized this is unreachable
code. However don't bother to enable this fast path now, given the normal
path is working just fine.
2009-06-10 21:29:25 +01:00
José Fonseca
8fa8669aeb mesa: Fix typo in bitmask. 2009-06-10 21:25:54 +01:00
José Fonseca
0a4fcabe44 mesa: Fix draw_stencil_pixels for PIPE_FORMAT_Z24S8_UNORM.
Reversed component order.

This fixes glean depthStencil test failures for PIPE_FORMAT_Z24S8_UNORM
visuals.
2009-06-10 20:05:00 +01:00
Brian Paul
dbab657fe7 glsl: fix warnings, update comments, s/TRUE/GL_TRUE/
(cherry picked from master, commit 7fdd64ab29)
2009-06-10 12:22:36 -06:00
Brian Paul
9225b67383 glsl: Handle continuation characters in preprocessor.
(cherry picked from master, commit cc22620e4b)
2009-06-10 12:21:56 -06:00
Brian Paul
88527220e4 swrast: fix state validation bug for changing program constants
Add _NEW_PROGRAM_CONSTANTS to _SWRAST_NEW_DERIVED.
This makes sure that we update the fragment shader's constants when state
vars (such as point size) changes.
Fixes the progs/glsl/points.c demo.
2009-06-10 09:31:01 -06:00
Brian Paul
506989b20e glsl: Fix symbol replacement handling in preprocessor.
(cherry picked from master, commit d9617deb00)
2009-06-10 09:31:01 -06:00
Brian Paul
6f50c9865d mesa: disable texture unit error check in _mesa_MatrixMode()
See comments for details.
2009-06-10 09:31:01 -06:00
Brian Paul
5450281ff7 docs: document GLSL preprocessor fixes 2009-06-10 09:31:01 -06:00
José Fonseca
4d16eb5e18 util: Single precision constants. 2009-06-10 15:39:47 +01:00
José Fonseca
978bca8b2a mesa: Single precision constants. 2009-06-10 15:39:34 +01:00
José Fonseca
52411a1951 mesa: Pure software accum buffer.
The existing implementation was already implemented on software, but relied
on the pipe driver to always support the R16G16B16A16_SNORM format. This
patch eliminates that, without prejudice against a future hardware-only
implementation.

It also avoids some of the short <-> float conversions, and only does a read
transfer of the color buffer on GL_RETURN if absolutely necessary.
2009-06-10 15:39:02 +01:00
José Fonseca
8bfbb7ec8b gallium: Shorthand functions for computing stride and sizes for a rect. 2009-06-10 15:31:12 +01:00
Keith Whitwell
76a1017e97 mesa/st: fix tracking of mapped buffer ranges
In st_bufferobj_map_range(), set obj->Offset consistently with its
usage elsewhere.
2009-06-09 18:32:18 +01:00
Keith Whitwell
9192347443 stw: ignore swapbuffer requests on singlebuffer
Return TRUE in this case.  Returning FALSE seems to result in
mis-rendering -- possibly opengl32.dll is trying to compensate by
doing a software blit??
2009-06-09 16:37:38 +01:00
Brian Paul
cb549775a5 glsl: Expand nested preprocessor macros.
(cherry picked from master, commit ef8caec29a)
2009-06-09 09:14:38 -06:00
Brian Paul
34bb024cf2 st/mesa: fix incorrect bufObj Length assignment, remove unneeded assertion 2009-06-08 16:11:17 -06:00
Jon TURNEY
7eed6ab5b5 Cygwin build fixes
Fix mklib to deal with NOPREFIX and use --enable-auto-image-base for cygwin
Teach configure.ac some basic facts about cygwin

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-06-08 14:30:46 -06:00
Brian Paul
304ba4bba4 glsl: Fix preprocessor define argument parsing for dead sections.
(cherry picked from master, commit 19a54d9f10)
2009-06-08 13:53:33 -06:00
Jakob Bornecrantz
77c329a277 pipebuffer: Silence out of heap space debug print 2009-06-08 19:54:55 +02:00
Brian Paul
b6753adbc7 st/mesa: remove invalid assertion
It's legal for ARB_vertex_program programs to not write to result.position.
The results are undefined in that case.  This assertion was causing us to
abort/exit though.
2009-06-08 10:46:46 -06:00
José Fonseca
e09f78d8dc mesa: Use matching signedness for the counter as upper bound. 2009-06-08 16:56:41 +01:00
José Fonseca
42678dba94 mesa: Allocate tokens from the heap.
The recent increase ST_MAX_SHADER_TOKENS to 8K causes stack overflows on
windows.

Failure to allocate is not being propagated to the caller. This is not
a regression since the previous _mesa_malloc result wasn't being
checked as well. Unfortunately it is not easy to fix, as the callers of
these functions do not have failure propagation mechanism either, and
so on. So leaving a just fixme note for now.
2009-06-08 16:56:41 +01:00
Brian Paul
33d6327770 mesa: better error message for invalid texture unit index 2009-06-08 09:53:00 -06:00
Brian Paul
0bced6a326 mesa: bump MAX_PROGRAM_ENV_PARAMS from 128 to 256
Also, MAX_NV_VERTEX_PROGRAM_PARAMS should be 96, not 128 (or 256).
2009-06-08 09:53:00 -06:00
Keith Whitwell
0d3c8fbf12 mesa/vbo: drop all references to vbo on destroy
We were adding references to the input arrays, but failing to drop
them on destruction.  This could lead to a 64kb buffer being leaked
each context destruction.
2009-06-08 16:27:43 +01:00
Brian Paul
fce4ee12a6 mesa: EXT_vertex_array_bgra fixes
1) Pass the correct format when calling update_array in
   _mesa_VertexAttribPointerARB.
2) glVertexAttribPointerNV accepts GL_BGRA format too.
3) raise INVALID_VALUE error when format is BGRA and normalized is
   false in glVertexAttribPointerARB

(cherry picked from commit 4adb190a16)
2009-06-08 07:25:24 -06:00
Jakob Bornecrantz
4d9d0e6230 stw: If stfb not set don't call into mesa 2009-06-08 14:45:56 +02:00
Jakob Bornecrantz
283e84bfb3 progs/tests: Add some scissor tests 2009-06-08 14:45:40 +02:00
José Fonseca
78dad27564 Revert "scons: Less aggressive optimizations for MSVC 64bit compiler."
This reverts commit fc7f924782.
2009-06-08 11:13:41 +01:00
Brian Paul
cfff2a6189 mesa: bump version to 7.5-rc3 2009-06-05 17:16:47 -06:00
Dan Nicholson
6453605785 osmesa: Link with -ldl for dlopen code
Now that the dlopen wrappers are built into libmesa.a, we need to link
standalone libOSMesa with libdl to resolve dlopen and friends on
platforms that need it.
(cherry picked from commit 4795dd5950)
2009-06-04 19:47:41 -07:00
Dan Nicholson
5df6468589 osmesa: Allow building standalone in all three channel widths
autoconf had been designating the 8 bit libOSMesa as the default
standalone osmesa, but the Makefile expected it to be linked to libGL.
Fix up the osmesa Makefile so that it allows any of the combinations of
standalone and channel width to be built.

Fixes bug #21980.
(cherry picked from commit 7441dcd90b)
2009-06-04 19:47:32 -07:00
Brian Paul
9424d81d18 softpipe: separate case for PIPE_PRIM_POLYGON in sp_vbuf_draw()
Because of flat shading, we can't use same code as PIPE_PRIM_TRIANGLE_FAN.
This is a follow-on to commit a59575d8fb.

(cherry picked from commit 086ecea179)
2009-06-04 13:13:14 -06:00
Brian Paul
6907650211 softpipe: fix incorrect tri vertex order for PIPE_PRIM_POLYGON rendering
This fixes incorrect front/back-face orientation.

(cherry picked from commit a64bbdaa3e)
2009-06-04 13:12:13 -06:00
Brian Paul
d37795c453 st/mesa: increase ST_MAX_SHADER_TOKENS to 8k 2009-06-04 13:10:31 -06:00
Brian Paul
45e744dddc tgsi: increase MAX_LABELS to 4096 2009-06-04 13:10:31 -06:00
José Fonseca
fc7f924782 scons: Less aggressive optimizations for MSVC 64bit compiler.
MSVC 64bit compiler takes forever on some of the files.

Might want to revisit this again later.
2009-06-02 18:41:12 -07:00
José Fonseca
0f50c4fab8 scons: Output nice summary messages instead of long command lines.
You can still get the old behavior by passing the option quiet=no to scons.
2009-06-02 18:23:12 -07:00
José Fonseca
273117ceed util: Unsaved change missing from last commit. 2009-06-02 16:41:45 -07:00
José Fonseca
840af5fd62 util: Support Z24S8/Z24X8 -> unsigned conversion. 2009-06-02 11:46:53 -07:00
José Fonseca
c91df4c153 util: Fix 24 to 32 bit expansion binary arithmetic expression.
When approaching y = x * 0xffffffff / 0xffffff with bit arithmetic, the
8 least significant bits of y should come from the
8 most significant bits of x.
2009-06-02 11:46:06 -07:00
Brian Paul
12e94d892e mesa: release VBO and PBO references upon context destruction 2009-06-02 10:29:39 -06:00
Brian Paul
cb3a9f984d mesa: add #define FEATURE_ARB_pixel_buffer_object 2009-06-02 10:29:38 -06:00
Ian Romanick
16fbd39129 intel: Clip to window after calling Driver.TexImage2D
This prevents the width / height from being clipped to the window size before
the texture is allocated.  This matches intelCopyTexImage1D.

This should fix bug #21227

Signed-off-by: Ian Romanick <ian.romanick@intel.com>
(cherry picked from commit 129f311673)
2009-06-02 16:52:03 +01:00
Keith Whitwell
1aef032d43 gallium/draw: Free specialized versions of driver shaders
The pstipple, aaline and aapoint code would create specialized versions
of shaders and upload them to the driver -- but never free them.
2009-06-01 20:35:38 -07:00
Keith Whitwell
003cfd4dd2 draw: free more token arrays
The AA line and point code also needs to free token arrays after
building driver shaders.
2009-06-01 20:35:38 -07:00
Keith Whitwell
69a765df1c draw: avoid leaking tokens when building pstipple fragment shader
Add missing FREE() after MALLOC().
2009-06-01 20:35:38 -07:00
Keith Whitwell
503632557e mesa/st: restore flush to copy_texsubimage (was previously finish)
Need a flush here even though the original finish was overkill.
2009-06-01 20:34:44 -07:00
José Fonseca
557d2bb423 wgl: Destroy the framebuffer when the window is destroyed. 2009-06-01 20:20:48 -07:00
Keith Whitwell
97f5953ced progs/vpglsl: add similar support for point rendering as progs/vp 2009-06-01 18:40:21 -07:00
Jakob Bornecrantz
f989390af6 st/gl: Fix mip gen for compressed textures 2009-06-01 18:40:12 -07:00
Keith Whitwell
00e7a60077 trivial/tri-z: add controls for depthrange min/max
Also add key to set up quake-1 style ztrick rendering with clear depth
1.0, deptrange(1.0, 0.0) and depthfunc GL_GREATER.
2009-06-01 18:39:58 -07:00
José Fonseca
3c756ed39f progs/wgl: Small cleanup to wglinfo. 2009-06-01 18:23:20 -07:00
José Fonseca
76ad2b4a5a progs/wgl: Use an invisible window in wglinfo. 2009-06-01 18:23:20 -07:00
Brian Paul
0e8a5a8474 st/mesa: fix incorrect sprite origin when drawing to FBO/texture
Need to take the draw buffer's up/down orientation into consideration
when setting the sprite_coord_mode field.

Fixes inverted sprites when drawing into an FBO.
2009-06-01 14:59:11 -06:00
Brian Paul
427554211b draw: reset extra_vp_outputs.slot to zero in widepoint_flush()
Fixes a crash when clearing the window with a quad after drawing large
points.  We were asking the draw module how many vertex shader outputs
there were and got 3 instead of 2.  This led to creating vertices with
too many attributes and trying to read invalid memory.

We reset extra_vp_outputs.slot to zero in the aaline/aapoint stage's
flush functions already.
This omission was just an oversight in the wide_point stage.
2009-06-01 14:28:57 -06:00
Brian Paul
a5d033e89b demos: add missing dependencies for util files 2009-06-01 11:23:39 -06:00
José Fonseca
ea3ee4791e wgl: Cleanup framebuffer destruction logic. 2009-05-31 17:16:26 -07:00
José Fonseca
0ea519f931 wgl: Ensure we only create framebuffers for HDC associated with a window. 2009-05-31 11:10:22 -07:00
José Fonseca
fe69b6bdc7 wgl: Use the right pixel format.
There is no current pixel format. Each HDC has its pixelformat which is
kept by gdi and set/get via the SetPixelFormat/GetPixelFormat functions.

Now the HDC's pixelformat is kept in the stw_framebuffer, which is
created during the SetPixelFormat.
2009-05-30 20:29:03 -07:00
José Fonseca
be7c56be06 wgl: Fix debugging output. 2009-05-30 20:29:03 -07:00
José Fonseca
76f2bacb07 wgl: Rename function. 2009-05-30 20:29:03 -07:00
José Fonseca
1124f786c1 wgl: Remove unused field. 2009-05-30 20:29:03 -07:00
José Fonseca
5bb2074798 mesa: Output warnings to debugger on Windows.
Stderr of Windows applications without console is not usually
visible.
2009-05-30 20:29:02 -07:00
José Fonseca
8aef306c34 mesa: Check/propagate return value on st_make_current.
Prevents segmentation fault when trying to set the viewport/scissor
after a context/drawable visual mismatch.
2009-05-30 20:29:02 -07:00
José Fonseca
29c6c8eb18 mesa: Add success/failures return value to _mesa_make_current. 2009-05-30 20:29:02 -07:00
Brian Paul
a59575d8fb softpipe: fix incorrect provoking vertex color for PIPE_PRIM_POLYGON
This fixes the incorrect colors seen when rendering flat-shaded polygons.
Note that clipped polygons were correct, but unclipped polygons were wrong.

See the glean/clipFlat test for regression testing.
2009-05-30 20:07:18 -06:00
Brian Paul
1045481dd9 mesa: fix loop over generic attribs in update_arrays() 2009-05-22 13:50:31 -06:00
Brian Paul
c3538969e1 vbo: fix crash in vbo_exec_bind_arrays()
When a vertex shader uses generic vertex attribute 0, but not gl_Vertex,
we need to set attribute[16] to point to attribute[0].  We were setting the
attribute size, but not the pointer.

Fixes crash in glsl/multitex.c when using the VertCoord attribute instead
of gl_Vertex.
2009-05-22 13:15:41 -06:00
Brian Paul
58fadc6242 demos: fix multitex.c VertCoord attribute mapping
If the multitex.vert shader uses the VertCoord generic vertex attribute
instead of the pre-defined gl_Vertex attribute, we need to make sure that
VertCoord gets bound to generic vertex attribute zero.

That's because we need to call glVertexAttrib2fv(0, xy) after all the other
vertex attributes have been set since setting generic attribute 0 triggers
vertex submission.  Before, we wound up issuing the vertex attributes in
the order 0, 1, 2 which caused the first vertex to be submitted before all
the attributes were set.  Now, the attributes are set in 1, 2, 0 order.
2009-05-22 13:00:49 -06:00
Brian Paul
995456f930 mesa: allow GL_BITMAP type in _mesa_image_image_stride()
It's possible to hand a GL_COLOR_INDEX/GL_BITMAP image to glTexImage3D()
which gets converted to RGBA via the glPixelMap tables.

This fixes a failure with piglit/fdo10370 with Gallium.
2009-05-22 09:35:02 -06:00
Brian Paul
42b747e57d mesa: added comment 2009-05-22 07:14:16 -06:00
Brian Paul
70c4b81e88 mesa: add missing glGet*() case for GL_VERTEX_ARRAY_BINDING_APPLE 2009-05-21 21:49:57 -06:00
Brian Paul
8da09e6924 vbo: fix incorrect loop limit in bind_array_obj()
The generic_array[] is 16 elements in size, but the loop was doing 32
iterations.  The out of bounds array write was clobbering the following
inputs[] array but as luck would have it, that didn't matter.
2009-05-21 16:54:35 -06:00
Brian Paul
d4fb7615b5 mesa: use MAX_ values instead of literals 2009-05-21 16:52:45 -06:00
Carl Worth
d2f4c2b632 minstall: Don't copy over an identical file
The rationale here is to avoid updating a timestamp for a file that
hasn't changed. Needless updates of the timestamp can ripple into
other projects, (xserver, etc.), useless recompiling due to a
'make install' in mesa that didn't actually change anything.
2009-05-21 07:52:13 -06:00
Mathias Fröhlich
042d9a5132 mesa: allow depth/stencil textures to be attached to GL_STENCIL_ATTACHMENT
See sourceforge bug #2793846.
2009-05-19 09:59:01 -06:00
Brian Paul
c99a60c40d mesa: assign trb->Base.StencilBits in update_wrapper().
When we render to a depth/stencil texture there are stencil bits.
2009-05-19 09:57:01 -06:00
Brian Paul
7ce105d2e6 st/mesa: fix incorrect src/dst stride params to _mesa_generate_mipmap_level()
The stride needs to be in texels, not bytes.
2009-05-18 10:28:04 -06:00
Brian Paul
adabd0e81e mesa: comments for _mesa_generate_mipmap_level() 2009-05-18 10:27:31 -06:00
Brian Paul
30320f0afb softpipe: add texture target sanity check assertion 2009-05-18 10:13:44 -06:00
Brian Paul
14e5bff97b st: fix incorrect target parameter to screen->is_format_supported()
We were passing a GL texture target instead of a pipe_texture_target enum.
2009-05-18 10:12:40 -06:00
Brian Paul
df37cde309 mesa: added linux-osmesa-static config
Contributed by Nicolas Noble.  See SF bug #2792536
2009-05-18 08:47:22 -06:00
Brian Paul
6e61700541 docs: link to 7.5 relnotes 2009-05-18 07:17:46 -06:00
Brian Paul
da0d4e1db6 docs: emphasize the incomplete status of the nouveau/R300 gallium drivers 2009-05-18 07:17:36 -06:00
Aidan Thornton
f2445dfd85 Initialize psp->waitX/waitGL for swrast_dri.so.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21053 .
2009-05-18 12:47:00 +02:00
Brian Paul
483e247804 mesa: bump version to 7.5-rc2 2009-05-15 08:03:56 -06:00
Brian Paul
65b9cd74e3 docs: updates from the 7.4 branch 2009-05-15 08:02:40 -06:00
Michel Dänzer
09c04db3c9 r300: Make sure to drop current hardware state reference to texture objects.
Fixes potential texture object leaks.
2009-05-14 11:13:06 +02:00
Brian Paul
99960393ed intel: added null ptr check
Fixes segfault in context tear-down when glClear was never called.
2009-05-13 11:33:16 -06:00
Brian Paul
2e4e346890 intel: create a private gl_array_object for intel_clear_tris(), fix bug 21638
gl_array_object encapsulates a set of vertex arrays (see the
GL_APPLE_vertex_array_object extension).
Create a private gl_array_object for drawing the quad for intel_clear_tris()
so we don't have to worry about the user's vertex array state.
This fixes the no-op glClear bug #21638 and removes the need to call
_mesa_PushClientAttrib() and _mesa_PopClientAttrib().
2009-05-13 10:28:00 -06:00
Brian Paul
3e74faa029 mesa: delete array objects before buffer objects during context tear-down
The former may point to the later.
2009-05-13 09:47:13 -06:00
Brian Paul
7ae4ce9e22 mesa: clean-up vertex array object VBO unbinding and delete/refcounting
Don't really delete vertex array objects until the refcount hits zero.
At that time, unbind any pointers to VBOs.
(cherry picked from commit 32b851c807)
2009-05-13 09:32:53 -06:00
Brian Paul
5568f2f601 mesa: reference counting for gl_array_object
Every kind of object that can be shared by multiple contexts should be
refcounted.
(cherry picked from commit 1030bf0ded)
2009-05-13 09:27:31 -06:00
Michel Dänzer
46b81b0cc8 glXChooseVisual: Only consider fbconfig if we can get the corresponding visual.
This can fail, e.g. when XLIB_SKIP_ARGB_VISUALS=1 is set.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524794 and
http://bugs.freedesktop.org/show_bug.cgi?id=21600 .
2009-05-12 09:34:13 +02:00
Ian Romanick
64f36ff9fb Test either GL_FRONT_LEFT or GL_FRONT for front-buffer rendering
For non-stereo visuals, which is all we support, we treat
GL_FRONT_LEFT as GL_FRONT.  However, they are technically different,
and they have different enum values.  Test for either one to determine
if we're in front-buffer rendering mode.

This fix was suggested by Pierre Willenbrock.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 2085cf2462)
2009-05-11 17:16:11 -07:00
Brian Paul
f104e4d666 st: do proper refcounting for framebuffer surfaces 2009-05-11 16:09:39 -06:00
Brian Paul
f5cf181c65 trivial: destroy window upon exit 2009-05-11 16:08:01 -06:00
Brian Paul
2223615e0a mesa: Fixed a texture memory leak
The current texture for any particular texture unit is given an additional
reference in update_texture_state(); but if the context is closed before
that texture can be released (which is quite frequent in normal use, unless
a program unbinds and deletes the texture and renders without it to force
a call to update_texture_state(), the memory is lost.

This affects general Mesa; but the i965 is particularly affected because
it allocates a considerable amount of additional memory for each allocated
texture.

(cherry picked from master, commit c230767d69)
2009-05-11 09:46:56 -06:00
Brian Paul
31865904d8 mesa: added more gallium Makefiles to tarball list 2009-05-09 16:21:16 -06:00
Hanno Böck
c8c0953294 gallium: replace lib with $(LIB_DIR) 2009-05-09 16:17:37 -06:00
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
985 changed files with 44275 additions and 16555 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:
@@ -124,6 +127,7 @@ linux-icc \
linux-icc-static \
linux-llvm \
linux-osmesa \
linux-osmesa-static \
linux-osmesa16 \
linux-osmesa16-static \
linux-osmesa32 \
@@ -178,7 +182,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.5-devel
VERSION=7.5-rc4
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
DEMO_NAME = MesaDemos-$(VERSION)
@@ -324,6 +328,7 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/*/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py \
$(DIRECTORY)/src/gallium/*/*/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/*/*/*.[ch] \
@@ -399,7 +404,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 +419,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 +428,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

@@ -66,8 +66,11 @@ if [ $# -ge 2 ] ; then
elif [ -f "$FILE" ] ; then
#echo "$FILE" is a regular file
$RM "$DEST/`basename $FILE`"
cp "$FILE" "$DEST"
# Only copy if the files differ
if ! cmp -s $FILE $DEST/`basename $FILE`; then
$RM "$DEST/`basename $FILE`"
cp "$FILE" "$DEST"
fi
if [ $MODE ] ; then
FILE=`basename "$FILE"`
chmod $MODE "$DEST/$FILE"

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
;;
@@ -839,6 +885,17 @@ case $ARCH in
CYGWIN*)
# GCC-based environment
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
echo "mklib: Making CYGWIN shared library: " ${LIBNAME}
OPTS="-shared -Wl,--enable-auto-image-base"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
rm -f ${LIBNAME}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
FINAL_LIBS=${LIBNAME}
else
CYGNAME="cyg${LIBNAME}" # prefix with "cyg"
LIBNAME="lib${LIBNAME}" # prefix with "lib"
@@ -855,11 +912,11 @@ case $ARCH in
# finish up
FINAL_LIBS=${LIBNAME}.a
else
OPTS="-shared -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
OPTS="-shared -Wl,--enable-auto-image-base -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}-${MAJOR}.dll
echo "mklib: Making" $ARCH "shared library: " ${CYGNAME}-${MAJOR}.dll
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
@@ -868,7 +925,8 @@ case $ARCH in
fi
# rm any old libs
rm -f ${LIBNAME}-${MAJOR}.dll
rm -f ${CYGNAME}-${MAJOR}.dll
rm -f ${LIBNAME}-${MAJOR}.dll.a
rm -f ${LIBNAME}.dll.a
rm -f ${LIBNAME}.a
@@ -881,6 +939,7 @@ case $ARCH in
# special case for installing in bin
FINAL_BINS="${CYGNAME}-${MAJOR}.dll"
fi
fi
;;
'example')

View File

@@ -46,22 +46,22 @@ 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'))
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
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

@@ -0,0 +1,37 @@
# Configuration for building static libOSMesa.a on Linux, no Xlib driver
# This doesn't really have any Linux dependencies, so it should be usable
# on other (gcc-based) systems.
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc -m32
CXX = g++ -m32
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
# Dependencies
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
$(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm

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*)
@@ -230,6 +222,8 @@ else
case "$host_os" in
darwin* )
LIB_EXTENSION='dylib' ;;
cygwin* )
LIB_EXTENSION='dll' ;;
* )
LIB_EXTENSION='so' ;;
esac
@@ -375,17 +369,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 +383,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 +405,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 +545,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 +596,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])
@@ -658,7 +642,7 @@ dnl Which drivers to build - default is chosen by platform
AC_ARG_WITH([dri-drivers],
[AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
[comma delimited DRI drivers list, e.g.
"swrast,i965,radeon,nouveau" @<:@default=auto@:>@])],
"swrast,i965,radeon" @<:@default=auto@:>@])],
[with_dri_drivers="$withval"],
[with_dri_drivers=yes])
if test "x$with_dri_drivers" = x; then
@@ -752,6 +736,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"
@@ -840,12 +828,12 @@ case "$mesa_driver" in
osmesa)
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
else
OSMESA_LIB_DEPS=""
fi
OSMESA_MESA_DEPS=""
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS"
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
;;
*)
# Link OSMesa to libGL otherwise
@@ -859,10 +847,7 @@ osmesa)
OSMESA_PC_REQ="gl"
;;
esac
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS"
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 +856,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 +982,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 +1041,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
@@ -1081,6 +1075,9 @@ if test "x$APP_LIB_DEPS" = x; then
solaris*)
APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
;;
cygwin*)
APP_LIB_DEPS="-lX11"
;;
*)
APP_LIB_DEPS="-lm"
;;
@@ -1118,8 +1115,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 +1129,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 +1248,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

@@ -123,48 +123,46 @@ These are the instructions for making a new Mesa release.
<H3>Get latest source files</H3>
<p>
Use "cvs update -dAP " to get the latest Mesa files from CVS.
Use git to get the latest Mesa files from the git repository, from whatever
branch is relevant.
</p>
<H3>Verify and update version info</H3>
<p>
Create/edit the docs/RELNOTES-X.Y file to document what's new in the release.
Add the new RELNOTES-X.Y file to <a href="relnotes.html">relnotes.html</a>.
Update the docs/VERSIONS file too.
Create/edit the docs/relnotes-x.y.html file to document what's new in the release.
Add the new relnotes-x.y.html file to <a href="relnotes.html">relnotes.html</a>.
</p>
<p>
Edit the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in
Update the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in
configs/default.
Also update the VERSION line in the top-level Makefile.
</p>
<p>
Make sure the values in src/mesa/main/version.h are correct.
</p>
<p>
Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and
DEMO_NAME are correct.
</p>
<p>
Update the docs/news.html file and docs/download.html files.
</p>
<p>
Check in all updates to CVS.
Check in all updates to git.
</p>
<p>
Tag the CVS files with the release name (in the form <b>mesa_X_Y</b>).
Tag the files with the release name (in the form <b>mesa_X_Y</b>)
with: <code>git tag -a mesa_X_Y</code>
Then: <code>git push origin mesa_X_Y</code>
</p>
<H3>Make the tarballs</H3>
<p>
Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
ln -s Mesa Mesa-6.3
<code>ln -s Mesa Mesa-7.5</code>
This is needed in order to make a correct tar file in the next step.
</p>
@@ -177,7 +175,7 @@ Make the distribution files. From inside the Mesa directory:
<p>
After the tarballs are created, the md5 checksums for the files will
be computed.
Add them to the docs/news.html file.
Add them to the docs/relnotes-X.Y.html file.
</p>
<p>
@@ -191,9 +189,21 @@ Follow the directions on SourceForge for creating a new "release" and
uploading the tarballs.
</p>
<p>
Basically, to upload the tarball files with:
<br>
<code>
rsync -avP ssh Mesa*-X.Y.* USERNAME@frs.sourceforge.net:uploads/
</code>
</p>
<p>
Update the web site by copying the docs/ directory's files to
/home/users/b/br/brianp/mesa-www/htdocs/
/home/users/b/br/brianp/mesa-www/htdocs/ with:
<br>
<code>
sftp USERNAME,mesa3d@web.sourceforge.net
</code>
</p>
<p>

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

@@ -21,6 +21,7 @@
<li><a href="#pkg-config">Building OpenGL programs with pkg-config
</ul>
<li><a href="#windows">Windows</a>
<li><a href="#scons">SCons</a>
<li><a href="#other">Other</a>
</ol>
<br>
@@ -328,13 +329,60 @@ For example, compiling and linking a GLUT application can be done with:
<H2>2. Windows Compilation and Installation</H1>
<p>
Please see the <a href="README.WIN32">README.WIN32</a> file.
Please see the <a href="#scons">instructions on building with SCons</a>.
Alternatively see <a href="README.WIN32">README.WIN32</a> file.
</p>
<a name="scons">
<H2>3. Building with SCons</H1>
<p>
To build Mesa with SCons on Linux or Windows do
</p>
<pre>
scons
</pre>
<p>
The build output will be placed in
build/<i>platform</i>-<i>machine</i>-<i>debug</i>/..., where <i>platform</i> is for
example linux or windows, <i>machine</i> is x86 or x86_64, optionally followed
by -debug for debug builds.
</p>
<p>
The sample programs are built seperately. To build them do
<pre>
scons -C progs
</pre>
And the build output will be placed in progs/build/...
</p>
<p>
To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler toolchain do
</p>
<pre>
scons platform=windows toolchain=crossmingw machine=x86 statetrackers=mesa drivers=softpipe,trace winsys=gdi
scons -C progs platform=windows toolchain=crossmingw machine=x86 -k
</pre>
<p>
This will create:
</p>
<ul>
<li>build/windows-x86-debug/gallium/winsys/gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
<li>build/windows-x86-debug/glut/glx/glut32.dll
<li>progs/build/windows-x86-debug/wgl/wglinfo.exe
<li>progs/build/windows-x86-debug/trivial/tri.exe
<li>and many other samples in progs/build/windows-x86-debug/...
</ul>
<p>
Put them all in the same directory to test them.
</p>
<a name="other">
<H2>3. Other systems</H1>
<H2>4. Other systems</H1>
<p>
Documentation for other environments (some may be very out of date):

View File

@@ -11,6 +11,42 @@
<H1>News</H1>
<h2>June 23, 2009</h2>
<p>
<a href="relnotes-7.4.4.html">Mesa 7.4.4</a> is released.
This is a stable release that fixes a regression in the i915/i965 drivers
that slipped into the 7.4.3 release.
</p>
<h2>June 19, 2009</h2>
<p>
<a href="relnotes-7.4.3.html">Mesa 7.4.3</a> is released.
This is a stable release fixing bugs since the 7.4.2 release.
</p>
<h2>May 15, 2009</h2>
<p>
<a href="relnotes-7.4.2.html">Mesa 7.4.2</a> is released.
This is a stable release fixing bugs since the 7.4.1 release.
</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>

74
docs/relnotes-7.4.2.html Normal file
View File

@@ -0,0 +1,74 @@
<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.2 Release Notes / May 15, 2009</H1>
<p>
Mesa 7.4.2 is a stable development release fixing bugs since the 7.4.1 release.
</p>
<p>
Mesa 7.4.2 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>
172f5193154dad731387f97bd44ab68f MesaLib-7.4.2.tar.gz
b10a76e32bde4645cfc34ea0416d7d8b MesaLib-7.4.2.tar.bz2
cc6dfc2efd424cc342b84e6bcd78ce5d MesaLib-7.4.2.zip
182a7e78aa7a480b3650a5c956dbddd1 MesaDemos-7.4.2.tar.gz
bf559a0485667a3bfa4513a23501579b MesaDemos-7.4.2.tar.bz2
5379e622b65e8c22022dba34aeb6f4f9 MesaDemos-7.4.2.zip
7cc43c1c35bf6a279a16e063dea3b8c5 MesaGLUT-7.4.2.tar.gz
e0dfc44d537904a030861e5b3c760c11 MesaGLUT-7.4.2.tar.bz2
4a6cf5bbbac190d6ba97448b3098b7f4 MesaGLUT-7.4.2.zip
</pre>
<h2>Bug fixes</h2>
<ul>
<li>Fixed segfault when rendering to front buffer with DRI 1.
<li>Fixed swrast texture rectangle bug when wrap mode = GL_CLAMP_TO_BORDER and
filter mode = GL_LINEAR. (bug 21461)
<li>Fixed texture object mem leak during context destruction.
<li>Fixed a state validation bug in glCopyTex[Sub]Image()
<li>Fixed some i965 GLSL bugs.
<li>Fixed an R300 driver texture object bad memory reference.
</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>

79
docs/relnotes-7.4.3.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.3 Release Notes / 19 June 2009</H1>
<p>
Mesa 7.4.3 is a stable development release fixing bugs since the 7.4.2 release.
</p>
<p>
Mesa 7.4.3 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>
34c5a6c47ed51f31c4fa36e269831352 MesaLib-7.4.3.tar.gz
70a983ba3deaa8bd63b18bbab283f698 MesaLib-7.4.3.tar.bz2
34f21b3205b271d575030aa98a2dda51 MesaLib-7.4.3.zip
56752b7adede212e6097afb10d0c0d59 MesaDemos-7.4.3.tar.gz
8ffa51c4833b1e298300a005e2d7ca2a MesaDemos-7.4.3.tar.bz2
0037d24d41400d6fb9800ae55b8c863f MesaDemos-7.4.3.zip
20e24f6692c0c90e7e3b220f79c4108d MesaGLUT-7.4.3.tar.gz
03a4beeef74fc5ef0b1d6d04710e5a8a MesaGLUT-7.4.3.tar.bz2
273788230adbdb9d57371309adedcf5f MesaGLUT-7.4.3.zip
</pre>
<h2>Bug fixes</h2>
<ul>
<li>Fixed texture object reference counting bug (bug 21756)
<li>Allow depth/stencil textures to be attached to GL_STENCIL_ATTACHMENT point
(SF bug 2793846)
<li>Added missing glGet case for GL_VERTEX_ARRAY_BINDING_APPLE
<li>Fixed some OSMesa build issues
<li>Fixed a vertex buffer object crash
<li>Fixed broken glTexImage3D() when image type = GL_BITMAP
<li>Fixed some GLSL preprocessor bugs
<li>Fixed framebuffer mem leak in i945/i965 DRI drivers
<li>Fixed texture coordinate repeat bug in swrast (bug 21872)
<li>Fixed incorrect viewport clamping (lower bound is zero, not one)
<li>GLX fix for glean's makeCurrent test case
</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>

68
docs/relnotes-7.4.4.html Normal file
View File

@@ -0,0 +1,68 @@
<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.4 Release Notes / 23 June 2009</H1>
<p>
Mesa 7.4.4 is a stable development release fixing bugs since the 7.4.3 release.
</p>
<p>
Mesa 7.4.4 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>
0b56fe5a88ab0c3c5b2da5068f63f416 MesaLib-7.4.4.tar.gz
b66528d314c574dccbe0ed963cac5e93 MesaLib-7.4.4.tar.bz2
2818076f3ba23fa87fdfe4602a637a18 MesaLib-7.4.4.zip
3e77b208386c47b18165bce5ae317e2c MesaDemos-7.4.4.tar.gz
628142ec9a54cd28cc027e6ce26cff47 MesaDemos-7.4.4.tar.bz2
d08a30d30ab7174859aa709cba6c726d MesaDemos-7.4.4.zip
e6e91ba16e274d40cf3a97ad3218af01 MesaGLUT-7.4.4.tar.gz
e14bbb52517e8121b31f1387515365ab MesaGLUT-7.4.4.tar.bz2
f10ed20469753c2b3d68c99854f80fd4 MesaGLUT-7.4.4.zip
</pre>
<h2>Bug fixes</h2>
<ul>
<li>Fixed i965/i915 segfault in screen destruction (bug 22408)
</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,19 @@ tbd
<h2>New features</h2>
<ul>
<li>Gallium3D - 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 (for NVIDIA GPUs) and R300 for (AMD/ATI R300).
<b>PLEASE NOTE: these drivers are incomplete and still under development.
It's probably NOT worthwhile to report any bugs unless you have patches.
</b>
</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 +67,27 @@ 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.
<li>Increased max number of generic GLSL varying variables to 16 (formerly 8).
<li>GLSL linker now detects when too many varying variables are used.
<li>Optimize-out redundant glMaterial and glShadeModel calls in display lists
<li>Fixed gl_TextureMatrix[i][j] array indexing bug in GLSL compiler.
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Lots of i965 driver bug fixes
<li>Fixed some GLSL preprocessor bugs
<li>GLSL: continue inside of a for-loop didn't work
</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

@@ -8,19 +8,16 @@
<H1>Release Notes</H1>
<p>
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 7.5) designate new developmental releases.
Even numbered versions (such as 7.4) designate stable releases.
</p>
<p>
The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
<LI><A HREF="relnotes-7.4.4.html">7.4.4 release notes</A>
<LI><A HREF="relnotes-7.4.3.html">7.4.3 release notes</A>
<LI><A HREF="relnotes-7.4.2.html">7.4.2 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

@@ -2702,7 +2702,7 @@ typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers);
typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURLAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);
@@ -2723,7 +2723,7 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum targ
#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers)
#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers)
#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer)
#define glFramebufferTexturLayer GLEW_GET_FUN(__glewFramebufferTexturLayer)
#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer)
#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D)
#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D)
#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D)
@@ -10563,7 +10563,7 @@ GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus;
GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers;
GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D;
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D;

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

@@ -1,6 +1,7 @@
SConscript([
'util/SConscript',
'demos/SConscript',
'glsl/SConscript',
'redbook/SConscript',
'samples/SConscript',
'tests/SConscript',
@@ -8,4 +9,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 \
@@ -147,6 +145,13 @@ engine.o: engine.c trackball.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) engine.c
fbotexture: fbotexture.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) fbotexture.o $(LIBS) -o $@
fbotexture.o: fbotexture.c extfuncs.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) fbotexture.c
fslight: fslight.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) fslight.o $(LIBS) -o $@

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

@@ -9,13 +9,13 @@
*/
#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "extfuncs.h"
/* For debug */
#define DEPTH 1
@@ -80,9 +80,9 @@ RenderTexture(void)
glTranslatef(0.0, 0.0, -15.0);
/* draw to texture image */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, MyFB);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
status = glCheckFramebufferStatus_func(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
printf("Framebuffer incomplete!!!\n");
}
@@ -171,7 +171,7 @@ RenderTexture(void)
#if DRAW
/* Bind normal framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, 0);
#endif
CheckError(__LINE__);
@@ -252,12 +252,12 @@ static void
CleanUp(void)
{
#if DEPTH
glDeleteRenderbuffersEXT(1, &DepthRB);
glDeleteRenderbuffers_func(1, &DepthRB);
#endif
#if STENCIL
glDeleteRenderbuffersEXT(1, &StencilRB);
glDeleteRenderbuffers_func(1, &StencilRB);
#endif
glDeleteFramebuffersEXT(1, &MyFB);
glDeleteFramebuffers_func(1, &MyFB);
glDeleteTextures(1, &TexObj);
@@ -318,14 +318,14 @@ AttachDepthAndStencilBuffers(GLuint fbo,
*depthRbOut = *stencilRbOut = 0;
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, fbo);
if (tryDepthStencil) {
GLuint rb;
glGenRenderbuffersEXT(1, &rb);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
glGenRenderbuffers_func(1, &rb);
glBindRenderbuffer_func(GL_RENDERBUFFER_EXT, rb);
glRenderbufferStorage_func(GL_RENDERBUFFER_EXT,
GL_DEPTH24_STENCIL8_EXT,
width, height);
if (glGetError())
@@ -333,7 +333,7 @@ AttachDepthAndStencilBuffers(GLuint fbo,
if (bindDepthStencil) {
/* attach to both depth and stencil at once */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
glFramebufferRenderbuffer_func(GL_FRAMEBUFFER_EXT,
GL_DEPTH_STENCIL_ATTACHMENT,
GL_RENDERBUFFER_EXT, rb);
if (glGetError())
@@ -341,21 +341,21 @@ AttachDepthAndStencilBuffers(GLuint fbo,
}
else {
/* attach to depth attachment point */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
glFramebufferRenderbuffer_func(GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, rb);
if (glGetError())
return GL_FALSE;
/* and attach to stencil attachment point */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
glFramebufferRenderbuffer_func(GL_FRAMEBUFFER_EXT,
GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, rb);
if (glGetError())
return GL_FALSE;
}
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
status = glCheckFramebufferStatus_func(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
return GL_FALSE;
@@ -367,22 +367,22 @@ AttachDepthAndStencilBuffers(GLuint fbo,
{
GLuint rb;
glGenRenderbuffersEXT(1, &rb);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
glGenRenderbuffers_func(1, &rb);
glBindRenderbuffer_func(GL_RENDERBUFFER_EXT, rb);
glRenderbufferStorage_func(GL_RENDERBUFFER_EXT,
GL_DEPTH_COMPONENT,
width, height);
if (glGetError())
return GL_FALSE;
/* attach to depth attachment point */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
glFramebufferRenderbuffer_func(GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, rb);
if (glGetError())
return GL_FALSE;
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
status = glCheckFramebufferStatus_func(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
return GL_FALSE;
@@ -393,26 +393,26 @@ AttachDepthAndStencilBuffers(GLuint fbo,
{
GLuint rb;
glGenRenderbuffersEXT(1, &rb);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
glGenRenderbuffers_func(1, &rb);
glBindRenderbuffer_func(GL_RENDERBUFFER_EXT, rb);
glRenderbufferStorage_func(GL_RENDERBUFFER_EXT,
GL_STENCIL_INDEX,
width, height);
if (glGetError())
return GL_FALSE;
/* attach to depth attachment point */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
glFramebufferRenderbuffer_func(GL_FRAMEBUFFER_EXT,
GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, rb);
if (glGetError())
return GL_FALSE;
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
status = glCheckFramebufferStatus_func(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
glDeleteRenderbuffersEXT(1, depthRbOut);
glDeleteRenderbuffers_func(1, depthRbOut);
*depthRbOut = 0;
glDeleteRenderbuffersEXT(1, &rb);
glDeleteRenderbuffers_func(1, &rb);
return GL_FALSE;
}
@@ -463,6 +463,37 @@ ParseArgs(int argc, char *argv[])
}
static void
SetupFunctionPointers(void)
{
GetExtensionFuncs();
if (Use_ARB_fbo) {
/* no-op: use the ARB functions as-is */
}
else {
/* set the ARB-flavor function pointers to point to the EXT functions */
glIsRenderbuffer_func = glIsRenderbufferEXT_func;
glBindRenderbuffer_func = glBindRenderbufferEXT_func;
glDeleteRenderbuffers_func = glDeleteRenderbuffersEXT_func;
glGenRenderbuffers_func = glGenRenderbuffersEXT_func;
glRenderbufferStorage_func = glRenderbufferStorageEXT_func;
glGetRenderbufferParameteriv_func = glGetRenderbufferParameterivEXT_func;
glIsFramebuffer_func = glIsFramebufferEXT_func;
glBindFramebuffer_func = glBindFramebufferEXT_func;
glDeleteFramebuffers_func = glDeleteFramebuffersEXT_func;
glGenFramebuffers_func = glGenFramebuffersEXT_func;
glCheckFramebufferStatus_func = glCheckFramebufferStatusEXT_func;
glFramebufferTexture1D_func = glFramebufferTexture1DEXT_func;
glFramebufferTexture2D_func = glFramebufferTexture2DEXT_func;
glFramebufferTexture3D_func = glFramebufferTexture3DEXT_func;
glFramebufferRenderbuffer_func = glFramebufferRenderbufferEXT_func;
glGetFramebufferAttachmentParameteriv_func = glGetFramebufferAttachmentParameterivEXT_func;
glGenerateMipmap_func = glGenerateMipmapEXT_func;
}
}
/*
* Make FBO to render into given texture.
*/
@@ -472,10 +503,10 @@ MakeFBO_RenderTexture(GLuint TexObj)
GLuint fb;
GLint sizeFudge = 0;
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glGenFramebuffers_func(1, &fb);
glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, fb);
/* Render color to texture */
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
glFramebufferTexture2D_func(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
TexTarget, TexObj, TextureLevel);
if (Use_ARB_fbo) {
@@ -512,26 +543,26 @@ MakeFBO_RenderTexture(GLuint TexObj)
{
GLint bits, w, h;
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
glBindRenderbuffer_func(GL_RENDERBUFFER_EXT, DepthRB);
glGetRenderbufferParameteriv_func(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_WIDTH_EXT, &w);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
glGetRenderbufferParameteriv_func(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_HEIGHT_EXT, &h);
printf("Color/Texture size: %d x %d\n", TexWidth, TexHeight);
printf("Depth buffer size: %d x %d\n", w, h);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
glGetRenderbufferParameteriv_func(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_DEPTH_SIZE_EXT, &bits);
printf("Depth renderbuffer size = %d bits\n", bits);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB);
glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
glBindRenderbuffer_func(GL_RENDERBUFFER_EXT, StencilRB);
glGetRenderbufferParameteriv_func(GL_RENDERBUFFER_EXT,
GL_RENDERBUFFER_STENCIL_SIZE_EXT, &bits);
printf("Stencil renderbuffer size = %d bits\n", bits);
}
/* bind the regular framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebuffer_func(GL_FRAMEBUFFER_EXT, 0);
return fb;
}
@@ -547,6 +578,8 @@ Init(void)
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
SetupFunctionPointers();
/* lighting */
{
static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 };
@@ -605,7 +638,6 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);

View File

@@ -583,10 +583,14 @@ ParseOptions(int argc, char *argv[])
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-fs") == 0) {
FragProgFile = argv[i+1];
FragProgFile = argv[++i];
}
else if (strcmp(argv[i], "-vs") == 0) {
VertProgFile = argv[i+1];
VertProgFile = argv[++i];
}
else {
fprintf(stderr, "unknown option %s\n", argv[i]);
break;
}
}
}

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

@@ -514,12 +514,27 @@ static void draw_surface( unsigned int with_state )
break;
case (GLVERTEX|STRIPS):
glBegin( GL_TRIANGLE_STRIP );
for (i=0;i<numverts;i++) {
glNormal3fv( &data[i][3] );
glVertex3fv( &data[i][0] );
if (with_state & MATERIALS) {
glBegin( GL_TRIANGLE_STRIP );
for (i=0;i<numverts;i++) {
if (i % 600 == 0 && i != 0) {
unsigned j = i / 600;
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, col[j]);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, col[j]);
}
glNormal3fv( &data[i][3] );
glVertex3fv( &data[i][0] );
}
glEnd();
}
else {
glBegin( GL_TRIANGLE_STRIP );
for (i=0;i<numverts;i++) {
glNormal3fv( &data[i][3] );
glVertex3fv( &data[i][0] );
}
glEnd();
}
glEnd();
break;
default:

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

@@ -11,7 +11,20 @@ env.Prepend(CPPPATH = [
env.Prepend(LIBS = ['$GLUT_LIB'])
env.Program(
target = 'fp-tri',
source = ['fp-tri.c'],
progs = [
'fp-tri',
'tri-depth',
'tri-depth2',
'tri-depthwrite',
'tri-depthwrite2',
'tri-inv',
'tri-param',
'tri-tex',
'point-position',
]
for prog in progs:
env.Program(
target = prog,
source = [prog + '.c'],
)

View File

@@ -89,7 +89,7 @@ static void Init( void )
}
fprintf(stderr, "%.*s\n", sz, buf);
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -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

View File

@@ -2,9 +2,8 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "GL/gl.h"
@@ -17,7 +16,7 @@ static void Init( void )
;
GLuint modulateProg;
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -109,6 +108,8 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
Init();
glutReshapeFunc(Reshape);

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

@@ -2,9 +2,8 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "GL/gl.h"
@@ -19,7 +18,7 @@ static void Init( void )
;
GLuint modulateProg;
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -89,8 +88,6 @@ int main(int argc, char **argv)
glutInit(&argc, argv);
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
type = GLUT_RGB;
@@ -101,6 +98,8 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
Init();
glutReshapeFunc(Reshape);

View File

@@ -2,9 +2,8 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "GL/gl.h"
@@ -21,7 +20,7 @@ static void Init( void )
;
GLuint modulateProg;
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -106,6 +105,8 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
Init();
glutReshapeFunc(Reshape);

View File

@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -16,7 +16,7 @@ static void Init(void)
;
GLuint modulateProg;
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -97,6 +97,8 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
Init();
glutReshapeFunc(Reshape);

View File

@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -16,7 +16,7 @@ static void Init(void)
;
GLuint modulateProg;
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -97,6 +97,8 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
Init();
glutReshapeFunc(Reshape);

View File

@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
@@ -17,7 +17,7 @@ static void Init( void )
;
GLuint modulateProg;
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -99,6 +99,8 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
Init();
glutReshapeFunc(Reshape);

View File

@@ -2,9 +2,9 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "GL/gl.h"
static void Init( void )
{
@@ -15,7 +15,7 @@ static void Init( void )
;
GLuint modulateProg;
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -104,6 +104,8 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
Init();
glutReshapeFunc(Reshape);

View File

@@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -23,7 +23,7 @@ static void Init( void )
GLuint modulateProg;
GLuint Texture;
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
if (!GLEW_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -120,6 +120,8 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
Init();
glutReshapeFunc(Reshape);

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)
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
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=%)
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
##### 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,164 @@ PROGS = \
default: $(PROGS)
clean:
-rm -f $(PROGS)
-rm -f *.o *~
-rm -f extfuncs.h
-rm -f shaderutil.*
-rm -f readtex.*
##### Extra dependencies
extfuncs.h: $(TOP)/progs/util/extfuncs.h
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
array.o: $(UTIL_HEADERS)
bitmap.o: bitmap.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
array: array.o $(UTIL_OBJS)
bitmap: bitmap.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
bitmap.o: $(UTIL_HEADERS)
brick.o: brick.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c
bitmap: bitmap.o $(UTIL_OBJS)
brick: brick.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
brick.o: $(UTIL_HEADERS)
bump.o: bump.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c
brick: brick.o $(UTIL_OBJS)
bump: bump.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
bump.o: $(UTIL_HEADERS)
convolutions.o: convolutions.c readtex.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
bump: bump.o $(UTIL_OBJS)
convolutions: convolutions.o readtex.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
convolutions.o: $(UTIL_HEADERS)
deriv.o: deriv.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
convolutions: convolutions.o $(UTIL_OBJS)
deriv: deriv.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
deriv.o: deriv.c $(UTIL_HEADERS)
identity.o: identity.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c
deriv: deriv.o $(UTIL_OBJS)
identity: identity.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@
identity.o: $(UTIL_HEADERS)
fragcoord.o: fragcoord.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c
identity: identity.o $(UTIL_OBJS)
fragcoord: fragcoord.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@
fragcoord.o: $(UTIL_HEADERS)
mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
fragcoord: fragcoord.o $(UTIL_OBJS)
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
linktest.o: $(UTIL_HEADERS)
multitex: multitex.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
linktest: linktest.o $(UTIL_OBJS)
noise.o: noise.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise.c
mandelbrot.o: $(UTIL_HEADERS)
noise: noise.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
mandelbrot: mandelbrot.o $(UTIL_OBJS)
points.o: points.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) points.c
multinoise.o: $(UTIL_HEADERS)
points: points.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
multinoise: multinoise.o $(UTIL_OBJS)
pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
multitex.o: $(UTIL_HEADERS)
pointcoord: pointcoord.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
multitex: multitex.o $(UTIL_OBJS)
samplers.o: samplers.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) samplers.c
noise.o: $(UTIL_HEADERS)
samplers: samplers.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@
noise: noise.o $(UTIL_OBJS)
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 $@
noise2.o: $(UTIL_HEADERS)
skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
noise2: noise2.o $(UTIL_OBJS)
skinning: skinning.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
points.o: $(UTIL_HEADERS)
texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
points: points.o $(UTIL_OBJS)
texdemo1: texdemo1.o readtex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
pointcoord.o: $(UTIL_HEADERS)
toyball.o: toyball.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
pointcoord: pointcoord.o $(UTIL_OBJS)
toyball: toyball.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
samplers.o: $(UTIL_HEADERS)
twoside.o: twoside.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
samplers: samplers.o $(UTIL_OBJS)
twoside: twoside.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
samplers_array.o: $(UTIL_HEADERS)
trirast.o: trirast.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
samplers_array: samplers_array.o $(UTIL_OBJS)
trirast: trirast.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
shadow_sampler.o: $(UTIL_HEADERS)
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
shadow_sampler: shadow_sampler.o $(UTIL_OBJS)
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 $@
skinning.o: $(UTIL_HEADERS)
vert-tex.o: vert-tex.c extfuncs.h shaderutil.h
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c
skinning: skinning.o $(UTIL_OBJS)
vert-tex: vert-tex.o shaderutil.o
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@
texaaline.o: $(UTIL_HEADERS)
texaaline: texaaline.o $(UTIL_OBJS)
clean:
-rm -f $(PROGS)
-rm -f *.o *~
-rm -f extfuncs.h
-rm -f shaderutil.*
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)

55
progs/glsl/SConscript Normal file
View File

@@ -0,0 +1,55 @@
Import('*')
if not env['GLUT']:
Return()
env = env.Clone()
env.Prepend(CPPPATH = [
'../util',
])
env.Prepend(LIBS = [
util,
'$GLUT_LIB'
])
if env['platform'] == 'windows':
env.Append(CPPDEFINES = ['NOMINMAX'])
env.Prepend(LIBS = ['winmm'])
progs = [
'array',
'bitmap',
'brick',
'bump',
'convolutions',
'deriv',
'fragcoord',
'identity',
'linktest',
'mandelbrot',
'multinoise',
'multitex',
'noise',
'noise2',
'pointcoord',
'points',
'samplers',
'shadow_sampler',
'skinning',
'texaaline',
'texdemo1',
'toyball',
'trirast',
'twoside',
'vert-or-frag-only',
'vert-tex',
]
for prog in progs:
env.Program(
target = prog,
source = prog + '.c',
)

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

@@ -0,0 +1,262 @@
/**
* 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/glew.h>
#include <GL/gl.h>
#include <GL/glut.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]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Redisplay);
Init();
if (Anim)
glutIdleFunc(Idle);
glutMainLoop();
return 0;
}

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -309,6 +310,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -191,6 +192,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

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);
@@ -287,6 +288,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -5,6 +5,8 @@
* Author: Zack Rusin
*/
#include <GL/glew.h>
#define GL_GLEXT_PROTOTYPES
#include "readtex.h"
@@ -455,6 +457,7 @@ int main(int argc, char **argv)
exit(1);
}
glewInit();
init();
glutReshapeFunc(reshape);

View File

@@ -13,6 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -228,6 +229,7 @@ main(int argc, char *argv[])
glutInitWindowSize(200, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -174,6 +175,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -195,6 +196,7 @@ main(int argc, char *argv[])
glutInitWindowSize(200, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

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

@@ -0,0 +1,260 @@
/**
* 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/glew.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]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
if (anim)
glutIdleFunc(Idle);
Init();
glutMainLoop();
return 0;
}

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -206,6 +207,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -270,6 +271,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include "GL/glut.h"
#include "readtex.h"
#include "extfuncs.h"
@@ -271,9 +272,24 @@ CreateProgram(const char *vertProgFile, const char *fragProgFile,
InitUniforms(program, uniforms);
VertCoord_attr = glGetAttribLocation_func(program, "VertCoord");
if (VertCoord_attr > 0) {
/* We want the VertCoord attrib to have position zero so that
* the call to glVertexAttrib(0, xyz) triggers vertex processing.
* Otherwise, if TexCoord0 or TexCoord1 gets position 0 we'd have
* to set that attribute last (which is a PITA to manage).
*/
glBindAttribLocation_func(program, 0, "VertCoord");
/* re-link */
glLinkProgram_func(program);
/* VertCoord_attr should be zero now */
VertCoord_attr = glGetAttribLocation_func(program, "VertCoord");
assert(VertCoord_attr == 0);
}
TexCoord0_attr = glGetAttribLocation_func(program, "TexCoord0");
TexCoord1_attr = glGetAttribLocation_func(program, "TexCoord1");
VertCoord_attr = glGetAttribLocation_func(program, "VertCoord");
printf("TexCoord0_attr = %d\n", TexCoord0_attr);
printf("TexCoord1_attr = %d\n", TexCoord1_attr);
printf("VertCoord_attr = %d\n", VertCoord_attr);
@@ -319,6 +335,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(Demo);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);

View File

@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -207,6 +208,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -195,6 +196,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);

View File

@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -248,6 +249,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -11,6 +11,7 @@ void main()
float two_n_dot_u = 2.0 * dot(n, u);
vec4 f;
f.xyz = u - n * two_n_dot_u;
f.w = 1.0;
// outputs
normal = n;

View File

@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include "GL/glut.h"
#include "readtex.h"
#include "extfuncs.h"
@@ -357,6 +358,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(Demo);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);

View File

@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -329,6 +330,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 300);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);

View File

@@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -266,6 +267,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

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

@@ -0,0 +1,371 @@
/**
* 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/glew.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]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
ParseOptions(argc, argv);
Init();
glutMainLoop();
return 0;
}

View File

@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include "GL/glut.h"
#include "readtex.h"
#include "extfuncs.h"
@@ -426,6 +427,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
win = glutCreateWindow(Demo);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -212,6 +213,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

View File

@@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -247,6 +248,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);

View File

@@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -293,6 +294,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);

View File

@@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -181,6 +182,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);

View File

@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -266,6 +267,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);

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,39 +38,51 @@ fptest1
fptexture
getprocaddress
getproclist.h
glutfx
interleave
invert
jkrahntest
lineclip
manytex
mapbufrange
mapvbo
minmag
mipgen
mipmap_comp
mipmap_limits
mipmap_view
multipal
no_s3tc
packedpixels
pbo
prim
prog_parameter
projtex
quads
random
readrate
readtex.c
readtex.h
rubberband
scissor
scissor-viewport
seccolor
sharedtex
shader_api
shaderutil.c
shaderutil.h
sharedtex
stencil_twoside
stencil_wrap
stencilwrap
stencil_wrap
streaming_rect
subtex
subtexrate
tex1d
texcmp
texcompress2
texcompsub
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,23 +66,28 @@ SOURCES = \
packedpixels.c \
pbo.c \
prog_parameter.c \
projtex.c \
quads.c \
random.c \
readrate.c \
rubberband.c \
scissor.c \
scissor-viewport.c \
seccolor.c \
shader_api.c \
sharedtex.c \
stencil_twoside.c \
stencilwrap.c \
stencil_wrap.c \
streaming_rect \
subtex \
subtexrate.c \
tex1d.c \
texcompress2.c \
texcompsub.c \
texdown \
texfilt.c \
texline.c \
texobj.c \
texobjshare.c \
texrect.c \
texwrap.c \
@@ -184,6 +190,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 +206,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 +235,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,23 +91,29 @@ progs = [
'packedpixels',
'pbo',
'prog_parameter',
'projtex',
'quads',
'random',
'readrate',
'rubberband',
'scissor',
'scissor-viewport',
'seccolor',
'shader_api',
'stencil_twoside',
'stencil_wrap',
'stencilwrap',
'streaming_rect',
'subtex',
'subtexrate',
'tex1d',
'texcmp',
'texcompress2',
'texcompsub',
'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);
}

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