mesa.git
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.

15 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.

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

15 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.

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

15 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

15 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

15 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

15 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

15 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

15 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()

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

15 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.

15 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

15 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

15 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.

15 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

15 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.

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

15 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

15 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

15 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.

15 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.

15 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.

15 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

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

15 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.

15 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

15 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

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

15 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()

15 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

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

15 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.

15 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

15 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.

15 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.

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

15 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()

15 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

15 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.

15 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

15 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

15 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

15 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

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

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

15 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

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

15 years agodraw: add streamlined paths for fetching linear verts
Keith Whitwell [Wed, 1 Oct 2008 12:34:38 +0000 (13:34 +0100)]
draw: add streamlined paths for fetching linear verts

15 years agomesa: Fix compiler warnings on Windows.
Michal Krol [Wed, 1 Oct 2008 17:36:04 +0000 (19:36 +0200)]
mesa: Fix compiler warnings on Windows.

15 years agoGallivm: add slt. glxgears should be running, except it isn't.
Stephane Marchesin [Tue, 30 Sep 2008 22:00:58 +0000 (00:00 +0200)]
Gallivm: add slt. glxgears should be running, except it isn't.

15 years agoGallivm: port to llvm 2.4.
Stephane Marchesin [Tue, 30 Sep 2008 18:50:49 +0000 (20:50 +0200)]
Gallivm: port to llvm 2.4.

15 years agoGallivm: fix off-by-one.
Stephane Marchesin [Sun, 28 Sep 2008 21:18:55 +0000 (23:18 +0200)]
Gallivm: fix off-by-one.

15 years agoGallivm: need to link with libstdc++ for llvm.
Stephane Marchesin [Sun, 28 Sep 2008 19:45:48 +0000 (21:45 +0200)]
Gallivm: need to link with libstdc++ for llvm.

15 years agoGallivm: more instructions.
Stephane Marchesin [Sun, 28 Sep 2008 17:48:26 +0000 (19:48 +0200)]
Gallivm: more instructions.

15 years agoGallivm: make it compile again, add some opcodes.
Stephane Marchesin [Sun, 28 Sep 2008 16:33:23 +0000 (18:33 +0200)]
Gallivm: make it compile again, add some opcodes.

15 years agomesa: fix temp register allocation problems.
Brian Paul [Fri, 26 Sep 2008 17:18:06 +0000 (11:18 -0600)]
mesa: fix temp register allocation problems.

Complex texcombine modes were running out of registers (>32 registers for 8 tex units).

15 years agoegl: check for null ptr/name
Brian Paul [Fri, 26 Sep 2008 17:17:09 +0000 (11:17 -0600)]
egl: check for null ptr/name

15 years agoegl: remove space after -L flag
Brian Paul [Fri, 26 Sep 2008 17:16:44 +0000 (11:16 -0600)]
egl: remove space after -L flag

15 years agogallium: rename tgsi_translate_mesa_program() to st_translate_mesa_program()
Brian Paul [Fri, 19 Sep 2008 15:25:32 +0000 (09:25 -0600)]
gallium: rename tgsi_translate_mesa_program() to st_translate_mesa_program()

15 years agomesa: add some braces
Brian Paul [Fri, 19 Sep 2008 00:31:47 +0000 (18:31 -0600)]
mesa: add some braces

15 years agomesa: fix/simplify initialization of vertex/fragment program limits
Brian Paul [Fri, 26 Sep 2008 01:22:29 +0000 (19:22 -0600)]
mesa: fix/simplify initialization of vertex/fragment program limits

Defaults for program length, num ALU instructions, num indirections, etc.
basically indicate no limit for software rendering.  Driver should override
as needed.

15 years agomesa: increase MAX_INSTRUCTIONS
Brian Paul [Fri, 26 Sep 2008 00:40:16 +0000 (18:40 -0600)]
mesa: increase MAX_INSTRUCTIONS

15 years agomesa: fix swizzle failure, fix typo
Brian Paul [Fri, 26 Sep 2008 00:27:22 +0000 (18:27 -0600)]
mesa: fix swizzle failure, fix typo

15 years agomesa: fix default buffer object access value
Brian Paul [Thu, 25 Sep 2008 17:46:27 +0000 (11:46 -0600)]
mesa: fix default buffer object access value

15 years agomesa: Fix compiler error.
Michal Krol [Fri, 19 Sep 2008 17:11:37 +0000 (19:11 +0200)]
mesa: Fix compiler error.

15 years agomesa: Fix arb parse constants
Brian Paul [Fri, 19 Sep 2008 11:04:52 +0000 (13:04 +0200)]
mesa: Fix arb parse constants

15 years agomesa: Update ignores a bit
Jakob Bornecrantz [Fri, 19 Sep 2008 10:43:02 +0000 (12:43 +0200)]
mesa: Update ignores a bit

15 years agodestroy window on exit
Brian Paul [Thu, 18 Sep 2008 21:36:17 +0000 (15:36 -0600)]
destroy window on exit

15 years agogallium: if we run out of memory in st_TexImage, flush and try again.
Brian Paul [Thu, 18 Sep 2008 21:35:56 +0000 (15:35 -0600)]
gallium: if we run out of memory in st_TexImage, flush and try again.

If the driver buffers a scene flushing should release old textures and
make space for new ones.  Fixes problem with texdown.c test.

15 years agotgsi: Build tgsi_text with make
Jakob Bornecrantz [Thu, 18 Sep 2008 14:28:16 +0000 (16:28 +0200)]
tgsi: Build tgsi_text with make