mesa.git
15 years agopipebuffer: Ondemand buffer manager.
José Fonseca [Mon, 24 Nov 2008 14:17:49 +0000 (23:17 +0900)]
pipebuffer: Ondemand buffer manager.

A variation of malloc buffers which get transferred to real graphics memory
when there is an attempt to validate them.

15 years agopipebuffer: Implement proper buffer validation.
José Fonseca [Mon, 24 Nov 2008 04:59:06 +0000 (13:59 +0900)]
pipebuffer: Implement proper buffer validation.

15 years agogallium: Define convenience shortcuts for CPU/GPU READ/WRITE flag combinations.
José Fonseca [Mon, 24 Nov 2008 04:45:19 +0000 (13:45 +0900)]
gallium: Define convenience shortcuts for CPU/GPU READ/WRITE flag combinations.

15 years agomesa: Don't call fence_finish with a null fence.
José Fonseca [Mon, 24 Nov 2008 04:44:30 +0000 (13:44 +0900)]
mesa: Don't call fence_finish with a null fence.

15 years agoscons: Fix toolchain selection.
Michal Krol [Wed, 19 Nov 2008 19:31:38 +0000 (20:31 +0100)]
scons: Fix toolchain selection.

15 years agoscons: Support MinGW32 cross compiler.
José Fonseca [Tue, 18 Nov 2008 10:13:32 +0000 (19:13 +0900)]
scons: Support MinGW32 cross compiler.

To build an alternative opengl32.dll with Gallium's software-rasterizer from a
debian-based distribution run:

  sudo apt-get install mingw32
  scons platform=windows toolchain=crossmingw machine=x86 winsys=gdi dri=no

15 years agopython/retrace: Dump constants.
José Fonseca [Wed, 19 Nov 2008 16:02:03 +0000 (01:02 +0900)]
python/retrace: Dump constants.

15 years agopython: Allow to read from buffers.
José Fonseca [Wed, 19 Nov 2008 16:01:48 +0000 (01:01 +0900)]
python: Allow to read from buffers.

15 years agopython/retrace: Fix formatting of shaders.
José Fonseca [Wed, 19 Nov 2008 11:06:52 +0000 (20:06 +0900)]
python/retrace: Fix formatting of shaders.

15 years agopython/retrace: Ignore irrelevant calls.
José Fonseca [Wed, 19 Nov 2008 11:06:04 +0000 (20:06 +0900)]
python/retrace: Ignore irrelevant calls.

15 years agopython/retrace: Highlight the trace dump to help to visualize.
José Fonseca [Wed, 19 Nov 2008 08:17:06 +0000 (17:17 +0900)]
python/retrace: Highlight the trace dump to help to visualize.

15 years agopython/retrace: Use the usual BSD-style license.
José Fonseca [Wed, 19 Nov 2008 07:23:01 +0000 (16:23 +0900)]
python/retrace: Use the usual BSD-style license.

15 years agogallium: Use costum log2 for all windows builds.
José Fonseca [Mon, 17 Nov 2008 07:40:21 +0000 (16:40 +0900)]
gallium: Use costum log2 for all windows builds.

15 years agogallium: State when there are no memory leaks detected.
José Fonseca [Thu, 13 Nov 2008 11:34:10 +0000 (20:34 +0900)]
gallium: State when there are no memory leaks detected.

15 years agogallium: Make handle_table reentrant.
José Fonseca [Tue, 11 Nov 2008 14:27:27 +0000 (23:27 +0900)]
gallium: Make handle_table reentrant.

Ensure that the object has consistent state also when calling the destroy
callback. Namely, ensure the object passed to the callback is removed from
the table prior to calling the destroy callback to avoid a infinite loop or
double free.

15 years agogallium: increase table size for fast log/pow functions
Brian Paul [Fri, 14 Nov 2008 19:55:05 +0000 (12:55 -0700)]
gallium: increase table size for fast log/pow functions

The various conformance tests pass now.

15 years agoutil: Use OpenGL rasterization rules in blits and mipmap generation.
Brian Paul [Thu, 13 Nov 2008 15:58:47 +0000 (08:58 -0700)]
util: Use OpenGL rasterization rules in blits and mipmap generation.

15 years agotranslate: pull in prefetch and other optimizations from draw_vs_aos.c
Keith Whitwell [Fri, 14 Nov 2008 17:59:29 +0000 (17:59 +0000)]
translate: pull in prefetch and other optimizations from draw_vs_aos.c

15 years agotrivial: more tests
Keith Whitwell [Wed, 5 Nov 2008 11:31:57 +0000 (11:31 +0000)]
trivial: more tests

15 years agoutil: Optimise log2().
Michal Krol [Wed, 12 Nov 2008 18:02:41 +0000 (19:02 +0100)]
util: Optimise log2().

15 years agoutil: Add log2() definition for MSC.
Michal Krol [Wed, 12 Nov 2008 16:14:07 +0000 (17:14 +0100)]
util: Add log2() definition for MSC.

15 years agodraw: Add missing include.
Michal Krol [Wed, 12 Nov 2008 16:03:58 +0000 (17:03 +0100)]
draw: Add missing include.

15 years agomesa: restore the negate flag of dots in build_lighting.
Xiang, Haihao [Tue, 11 Nov 2008 05:36:32 +0000 (13:36 +0800)]
mesa: restore the negate flag of dots in build_lighting.

Dots is re-used if more than one light is enabled. Previously
the negate flag of dots may affect next light.

15 years agogallium: fix comment again. A half-closed interval was intended.
Brian [Tue, 11 Nov 2008 03:22:36 +0000 (20:22 -0700)]
gallium: fix comment again.  A half-closed interval was intended.

Never saw the [a,b[ notation before.

15 years agodri: alloc __DRIscreen object with calloc()
Brian Paul [Mon, 10 Nov 2008 19:37:08 +0000 (12:37 -0700)]
dri: alloc __DRIscreen object with calloc()

Conflicts:
        src/mesa/drivers/dri/common/dri_util.c

15 years agomesa: fix logic error in GLSL linker when looking for main() shaders
Brian Paul [Mon, 10 Nov 2008 17:45:50 +0000 (10:45 -0700)]
mesa: fix logic error in GLSL linker when looking for main() shaders

15 years agoMesa: fix number of buffers in st_draw_vbo().
Pekka Paalanen [Sat, 8 Nov 2008 23:02:10 +0000 (01:02 +0200)]
Mesa: fix number of buffers in st_draw_vbo().

The clean-up call to pipe->set_vertex_buffers() should use the same
number of buffers as the first call.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
15 years agogallium: fix typos in comments
Brian Paul [Mon, 10 Nov 2008 15:24:45 +0000 (08:24 -0700)]
gallium: fix typos in comments

15 years agogallium: actually flip the coordinates
Zack Rusin [Thu, 6 Nov 2008 21:07:28 +0000 (16:07 -0500)]
gallium: actually flip the coordinates

15 years agoutil: Fix util_fast_pow/exp2/log2.
Brian [Sun, 9 Nov 2008 17:15:32 +0000 (10:15 -0700)]
util: Fix util_fast_pow/exp2/log2.

- Use a lookup table for log2.

- Compute (float) (1 << ipart) by tweaking with the exponent directly to
avoid integer overflow and float conversion.

- Also table negative exponents to avoid float division and branching.

- Implement util_fast_exp as function of util_fast_exp2.

--------

Cherry-picked from gallium-0.2: 8415d06d90a197e16554dab98d160334fd9f9f93

This fixes some pow() glitches seen in fslight.c, spectex.c, etc.

Conflicts:
       src/gallium/auxiliary/util/u_math.h

15 years agogallium: _debug_vprintf() should be silent if DEBUG is not defined
Brian [Sun, 9 Nov 2008 03:43:38 +0000 (20:43 -0700)]
gallium: _debug_vprintf() should be silent if DEBUG is not defined

15 years agomesa: use _bfc0 instead of _col0 when building back face lighting.
Brian Paul [Fri, 7 Nov 2008 17:23:22 +0000 (10:23 -0700)]
mesa: use _bfc0 instead of _col0 when building back face lighting.

cherry-picked from master: 4550b0562d5b59890fccb0e7eb0dbef967d1ccf9

15 years agogallium: implement TGSI_OPCODE_NRM/NRM4 in tgsi_exec.c
Brian [Fri, 7 Nov 2008 02:24:47 +0000 (19:24 -0700)]
gallium: implement TGSI_OPCODE_NRM/NRM4 in tgsi_exec.c

15 years agomesa: update the shader programs->TexturesUsed array at link time
Brian Paul [Thu, 6 Nov 2008 22:04:11 +0000 (15:04 -0700)]
mesa: update the shader programs->TexturesUsed array at link time

If an application never calls glUniform() to set sampler variable values
they'll remain 0 (the default value/unit).
Now call _mesa_update_shader_textures_used() at link time in case glUniform()
is never called.  program->TextureUsed[] will then be correct for state
validation.

15 years agogallium: added st_print_shaders() function to help w/ debugging
Brian Paul [Thu, 6 Nov 2008 22:00:01 +0000 (15:00 -0700)]
gallium: added st_print_shaders() function to help w/ debugging

15 years agogallium: debug code to print vertex array data (disabled)
Brian Paul [Thu, 6 Nov 2008 21:57:20 +0000 (14:57 -0700)]
gallium: debug code to print vertex array data (disabled)

15 years agosoftpipe: debug code (disabled)
Brian Paul [Thu, 6 Nov 2008 21:56:59 +0000 (14:56 -0700)]
softpipe: debug code (disabled)

15 years agogallium: check execution mask in indirect register loads
Brian [Thu, 6 Nov 2008 03:04:49 +0000 (20:04 -0700)]
gallium: check execution mask in indirect register loads

Zero-out the index for disabled execution channels to avoid using potential
garbage values (thus avoiding bad array indexing).

15 years agogallium: don't range check tgsi register index for indirect accesses
Brian [Thu, 6 Nov 2008 02:26:20 +0000 (19:26 -0700)]
gallium: don't range check tgsi register index for indirect accesses

Fixes progs/vp/arl.txt test.

15 years agogallium: added check for degenerate drawing calls
Brian Paul [Wed, 5 Nov 2008 21:05:42 +0000 (14:05 -0700)]
gallium: added check for degenerate drawing calls

15 years agogallium: if VERBOSE_GLSL flag is set, check for non-initialized uniforms at draw...
Brian Paul [Wed, 5 Nov 2008 21:05:04 +0000 (14:05 -0700)]
gallium: if VERBOSE_GLSL flag is set, check for non-initialized uniforms at draw time

This will warn the user that the shader being run may be using uninitialized
uniform variables.

15 years agomesa: fix a GLSL array indexing codegen bug
Brian Paul [Wed, 5 Nov 2008 21:03:15 +0000 (14:03 -0700)]
mesa: fix a GLSL array indexing codegen bug

Expressions like array[i] + array[j] didn't work properly before.

15 years agogallium: call tgsi_set_exec_mask() and use exec mask in SSE ARL code
Brian Paul [Wed, 5 Nov 2008 21:02:07 +0000 (14:02 -0700)]
gallium: call tgsi_set_exec_mask() and use exec mask in SSE ARL code

This prevents vertex shaders from referencing invalid memory locations when
the shader is operating on less than four vertices or fragments.

15 years agogallium: added tgsi_set_exec_mask()
Brian Paul [Wed, 5 Nov 2008 20:56:20 +0000 (13:56 -0700)]
gallium: added tgsi_set_exec_mask()

15 years agogallium: added some sanity check assertions for constant buffer indexing
Brian Paul [Wed, 5 Nov 2008 20:55:56 +0000 (13:55 -0700)]
gallium: added some sanity check assertions for constant buffer indexing

15 years agomesa: remove extra \n from printf string
Brian Paul [Wed, 5 Nov 2008 16:33:48 +0000 (09:33 -0700)]
mesa: remove extra \n from printf string

15 years agomesa: add Initialized field to gl_uniform struct, for debugging purposes only
Brian Paul [Wed, 5 Nov 2008 16:14:19 +0000 (09:14 -0700)]
mesa: add Initialized field to gl_uniform struct, for debugging purposes only

15 years agogallium: added some debug code (disabled)
Brian Paul [Wed, 5 Nov 2008 15:58:40 +0000 (08:58 -0700)]
gallium: added some debug code (disabled)

15 years agogallium: disable some debug output
Brian Paul [Wed, 5 Nov 2008 15:57:11 +0000 (08:57 -0700)]
gallium: disable some debug output

15 years agoi915: Remove faulty assert
Jakob Bornecrantz [Wed, 5 Nov 2008 15:49:48 +0000 (16:49 +0100)]
i915: Remove faulty assert

15 years agodraw: Implement TGSI_OPCODE_TRUNC.
michal [Wed, 5 Nov 2008 10:58:11 +0000 (11:58 +0100)]
draw: Implement TGSI_OPCODE_TRUNC.

15 years agotgsi: Implement OPCODE_TRUNC.
michal [Wed, 5 Nov 2008 10:48:56 +0000 (11:48 +0100)]
tgsi: Implement OPCODE_TRUNC.

16 years agomesa: fix float-valued GLSL vertex attribute variables
Brian Paul [Tue, 4 Nov 2008 23:52:53 +0000 (16:52 -0700)]
mesa: fix float-valued GLSL vertex attribute variables

The swizzle mask for such variables wasn't set up properly.

16 years agomesa: silence warnings
Brian Paul [Sat, 1 Nov 2008 22:04:45 +0000 (16:04 -0600)]
mesa: silence warnings

16 years agomesa: do scope replacement for while/for loops too
Brian Paul [Sat, 1 Nov 2008 21:55:39 +0000 (15:55 -0600)]
mesa: do scope replacement for while/for loops too

This fixes a function inlining bug involving vars declared inside loop bodies.

16 years agomesa: glsl tree print improvements
Brian Paul [Sat, 1 Nov 2008 21:55:14 +0000 (15:55 -0600)]
mesa: glsl tree print improvements

16 years agomesa: fix assignment / parameter passing of sampler types
Brian Paul [Sat, 1 Nov 2008 22:02:32 +0000 (16:02 -0600)]
mesa: fix assignment / parameter passing of sampler types

16 years agomesa: additional debug flags for glsl debug/disassembly
Brian Paul [Sat, 1 Nov 2008 16:57:25 +0000 (10:57 -0600)]
mesa: additional debug flags for glsl debug/disassembly

16 years agomesa: fix some bugs with precision qualifier parsing
Brian Paul [Fri, 31 Oct 2008 23:29:54 +0000 (17:29 -0600)]
mesa: fix some bugs with precision qualifier parsing

16 years agomesa: do scope replacement for variable initializers too
Brian Paul [Fri, 31 Oct 2008 23:27:41 +0000 (17:27 -0600)]
mesa: do scope replacement for variable initializers too

16 years agomesa: fix copy/paste error in GLSL error msg
Brian Paul [Fri, 31 Oct 2008 23:22:13 +0000 (17:22 -0600)]
mesa: fix copy/paste error in GLSL error msg

16 years agogallium: new sanity assertions in mmAllocMem()
Brian Paul [Wed, 29 Oct 2008 23:02:56 +0000 (17:02 -0600)]
gallium: new sanity assertions in mmAllocMem()

16 years agogallium: fix copy&paste bug
Brian Paul [Wed, 29 Oct 2008 23:02:30 +0000 (17:02 -0600)]
gallium: fix copy&paste bug

16 years agogallium: fix alignment parameter passed to u_mmAllocMem()
Brian Paul [Wed, 29 Oct 2008 20:55:02 +0000 (14:55 -0600)]
gallium: fix alignment parameter passed to u_mmAllocMem()

Was 32, now 5.  The param is expressed as a power of two exponent.
The net effect is that the alignment was a no-op on X86 but on PPC we
always got the same memory address everytime rtasm_exec_malloc() was called.

16 years agogallium: recognize DEBUG as well as DBG for debugging
Keith Whitwell [Tue, 28 Oct 2008 16:28:56 +0000 (16:28 +0000)]
gallium: recognize DEBUG as well as DBG for debugging

16 years agomesa: note that texcoords are generated by setup routines when pointsprite enabled
Keith Whitwell [Mon, 20 Oct 2008 12:03:45 +0000 (13:03 +0100)]
mesa: note that texcoords are generated by setup routines when pointsprite enabled

16 years agogallium: add some checks for null surface pointers in state tracker
Brian Paul [Sat, 18 Oct 2008 15:55:54 +0000 (09:55 -0600)]
gallium: add some checks for null surface pointers in state tracker

Fixes some segfaults in low memory situations.

16 years agomesa: redraw upon keypress in trivial/tri.c
Brian Paul [Fri, 17 Oct 2008 19:37:11 +0000 (13:37 -0600)]
mesa: redraw upon keypress in trivial/tri.c

16 years agogallium: fix mis-matched malloc/free vs. aligned malloc/free
Brian Paul [Fri, 17 Oct 2008 19:35:42 +0000 (13:35 -0600)]
gallium: fix mis-matched malloc/free vs. aligned malloc/free

Use aligned malloc/free for teximage data everywhere to be consistant.
The mismatch didn't make any difference when HAVE_POSIX_MEMALIGN was defined.

16 years agotrivial: more vp tests
Keith Whitwell [Tue, 14 Oct 2008 12:56:12 +0000 (13:56 +0100)]
trivial: more vp tests

16 years agovp: add simple vertex transform test
Keith Whitwell [Tue, 14 Oct 2008 12:52:38 +0000 (13:52 +0100)]
vp: add simple vertex transform test

16 years agomesa: modify fixed function vertex programs not to reference constant attributes
Keith Whitwell [Tue, 14 Oct 2008 13:15:26 +0000 (14:15 +0100)]
mesa: modify fixed function vertex programs not to reference constant attributes

16 years agomesa: new _mesa_set_vp_override() function for driver-override of vertex program
Brian Paul [Fri, 10 Oct 2008 19:39:14 +0000 (13:39 -0600)]
mesa: new _mesa_set_vp_override() function for driver-override of vertex program

Patch provide by Keith.
Used in state tracker by DrawPixels to indicate that the state tracker (driver)
is using its own vertex program.  This prevents the texenvprogram code from
replacing conventional shader inputs with state vars.
Fixes glDraw/CopyPixels regressions.

16 years agomesa: rasterizer state depends on ST_NEW_VERTEX_PROGRAM
Brian Paul [Thu, 9 Oct 2008 22:39:59 +0000 (16:39 -0600)]
mesa: rasterizer state depends on ST_NEW_VERTEX_PROGRAM

Check for per-vertex point size must be done when vertex program changes.

16 years agomesa: in _mesa_combine_programs() take new STATE_CURRENT_ATTRIB color into account
Brian Paul [Wed, 8 Oct 2008 20:02:24 +0000 (14:02 -0600)]
mesa: in _mesa_combine_programs() take new STATE_CURRENT_ATTRIB color into account

Commit 1680ef869625dc1fe9cf481b180382a34e0738e7 changed the texenv program
to get color from a state register instead of a constant-valued vertex
attribute.  This broke program concatenation (so glDraw/CopyPixels broke).
Now check if the second program get's color from a constant register and
handle that case appropriately.

16 years agoMesa: fix the case where there are no vertex attributes.
Stephane Marchesin [Tue, 7 Oct 2008 19:28:38 +0000 (21:28 +0200)]
Mesa: fix the case where there are no vertex attributes.

This is a backport of 8e8208d6db8b764568539784a6473d545dec2265 to gallium-0.1

16 years agotrivial: add more vp tests
Keith Whitwell [Tue, 7 Oct 2008 18:12:26 +0000 (19:12 +0100)]
trivial: add more vp tests

16 years agomesa: replace GLuint with GLbitfield to be clearer about usage
Brian Paul [Tue, 7 Oct 2008 17:22:47 +0000 (11:22 -0600)]
mesa: replace GLuint with GLbitfield to be clearer about usage

Also, fix up some comments to be doxygen style.

16 years agodraw: don't assume output buffer pointer is aligned
Keith Whitwell [Tue, 7 Oct 2008 15:44:24 +0000 (16:44 +0100)]
draw: don't assume output buffer pointer is aligned

16 years agomesa: update state after binding vertex list in dlist path
Keith Whitwell [Tue, 7 Oct 2008 15:33:17 +0000 (16:33 +0100)]
mesa: update state after binding vertex list in dlist path

16 years agotrivial: exercise vertprog sligtly
Keith Whitwell [Tue, 7 Oct 2008 12:09:05 +0000 (13:09 +0100)]
trivial: exercise vertprog sligtly

16 years agomesa: protect against segfault in get_fp_input_mask()
Keith Whitwell [Tue, 7 Oct 2008 11:31:31 +0000 (12:31 +0100)]
mesa: protect against segfault in get_fp_input_mask()

16 years agodraw: add switch for drivers to force vertex data passthrough
Keith Whitwell [Mon, 6 Oct 2008 11:22:55 +0000 (12:22 +0100)]
draw: add switch for drivers to force vertex data passthrough

16 years agomesa: remove old assertion
Brian Paul [Tue, 7 Oct 2008 14:30:29 +0000 (08:30 -0600)]
mesa: remove old assertion

16 years agogallium: replace assertion with conditional/recovery code
Brian [Tue, 7 Oct 2008 00:31:56 +0000 (18:31 -0600)]
gallium: replace assertion with conditional/recovery code

The assertion failed when we ran out of exec memory.
Found with conform texcombine test.

16 years agomesa: fix convolve/convolution mix-ups
Brian [Mon, 6 Oct 2008 23:10:45 +0000 (17:10 -0600)]
mesa: fix convolve/convolution mix-ups

16 years agomesa: add missing GLcontext param to _mesa_delete_query().
Brian Paul [Mon, 6 Oct 2008 15:27:31 +0000 (09:27 -0600)]
mesa: add missing GLcontext param to _mesa_delete_query().

Fixes vtk crash and others.

16 years agodraw: Fix compiler errors on Windows.
Michal Krol [Mon, 6 Oct 2008 11:23:56 +0000 (13:23 +0200)]
draw: Fix compiler errors on Windows.

16 years agortasm: fix debug build
Keith Whitwell [Mon, 6 Oct 2008 10:54:22 +0000 (11:54 +0100)]
rtasm: fix debug build

16 years agomake draw's vertex_info struct smaller/quicker to compare with memcmp()
Keith Whitwell [Wed, 10 Sep 2008 10:39:43 +0000 (11:39 +0100)]
make draw's vertex_info struct smaller/quicker to compare with memcmp()

16 years agomesa: handle vertex program enabled case also in texenvprogram.c
Keith Whitwell [Sat, 4 Oct 2008 11:41:56 +0000 (12:41 +0100)]
mesa: handle vertex program enabled case also in texenvprogram.c

16 years agomesa: avoid generating constant vertex attributes in fixedfunc programs
Keith Whitwell [Fri, 3 Oct 2008 16:30:59 +0000 (17:30 +0100)]
mesa: avoid generating constant vertex attributes in fixedfunc programs

Keep track of enabled/active vertex attributes.
Keep track of potential vertex program outputs.

When generating fragment program, replace references to fragment attributes
which are effectively non-varying and non-computed passthrough attributes with
references to the new CURRENT_ATTRIB tracked state value.

Only downside is slight ugliness in VBO code where we need to validate state
twice in succession.

16 years agoMesa: short-circuit case when looking up the same program twice in cache
Keith Whitwell [Fri, 3 Oct 2008 15:46:48 +0000 (16:46 +0100)]
Mesa: short-circuit case when looking up the same program twice in cache

16 years agomesa: add new internal state for tracking current vertex attribs
Keith Whitwell [Fri, 3 Oct 2008 12:55:40 +0000 (13:55 +0100)]
mesa: add new internal state for tracking current vertex attribs

16 years agomesa: add missing state dependencies for various tracked constants
Keith Whitwell [Fri, 3 Oct 2008 12:53:07 +0000 (13:53 +0100)]
mesa: add missing state dependencies for various tracked constants

16 years agomesa: shrink texenvprogram state key struct
Keith Whitwell [Fri, 3 Oct 2008 12:51:56 +0000 (13:51 +0100)]
mesa: shrink texenvprogram state key struct

16 years agortasm: add sse_movntps
Keith Whitwell [Fri, 3 Oct 2008 12:50:34 +0000 (13:50 +0100)]
rtasm: add sse_movntps

16 years agodraw: modify prefetching slightly
Keith Whitwell [Thu, 2 Oct 2008 11:53:11 +0000 (12:53 +0100)]
draw: modify prefetching slightly

16 years agodraw: don't keep refetching constant inputs
Keith Whitwell [Wed, 1 Oct 2008 17:40:01 +0000 (18:40 +0100)]
draw: don't keep refetching constant inputs

16 years agortasm: add prefetch instructions
Keith Whitwell [Thu, 2 Oct 2008 11:46:01 +0000 (12:46 +0100)]
rtasm: add prefetch instructions