Keith Whitwell [Fri, 10 Oct 2008 14:19:05 +0000 (15:19 +0100)]
Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:
src/gallium/auxiliary/gallivm/instructionssoa.cpp
src/gallium/auxiliary/gallivm/soabuiltins.c
src/gallium/auxiliary/rtasm/rtasm_x86sse.c
src/gallium/auxiliary/rtasm/rtasm_x86sse.h
src/mesa/main/texenvprogram.c
src/mesa/shader/arbprogparse.c
src/mesa/shader/prog_statevars.c
src/mesa/state_tracker/st_draw.c
src/mesa/vbo/vbo_exec_draw.c
Brian Paul [Fri, 10 Oct 2008 01:54:46 +0000 (19:54 -0600)]
cell: fix incorrect bitmask in spe_load_uint()
Brian Paul [Fri, 10 Oct 2008 01:50:57 +0000 (19:50 -0600)]
mesa: toggle colormask values with r/g/b keys in tri-mask-tri.c
Plus misc clean-up.
Brian Paul [Fri, 10 Oct 2008 01:48:53 +0000 (19:48 -0600)]
cell: implement basic TXP instruction in fragment shaders
Lots of restrictions for now (one 2D texture, no mipmaps, etc.) for now
but basic texture demos work.
TEX, TXD, TXP do the same thing for the time being.
Brian Paul [Fri, 10 Oct 2008 01:45:03 +0000 (19:45 -0600)]
mesa: simple multiple textures test
Brian Paul [Thu, 9 Oct 2008 16:56:25 +0000 (10:56 -0600)]
cell: better immediate value allocation, better comments
Brian Paul [Thu, 9 Oct 2008 14:52:31 +0000 (08:52 -0600)]
cell: massage the emit functions to get better instruction scheduling
Brian Paul [Thu, 9 Oct 2008 14:24:03 +0000 (08:24 -0600)]
cell: more accurate comments
Alan Hourihane [Fri, 10 Oct 2008 00:31:34 +0000 (01:31 +0100)]
gallium: silence warning
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.
Stephane Marchesin [Thu, 9 Oct 2008 21:32:01 +0000 (23:32 +0200)]
Gallivm: cleanup soa storage.
Brian Paul [Thu, 9 Oct 2008 02:44:32 +0000 (20:44 -0600)]
cell: implement function calls from shader code. fslight demo runs now.
Used for SIN, COS, EXP2, LOG2, POW instructions. TEX next.
Fixed some bugs in MIN, MAX, DP3, DP4, DPH instructions.
In rtasm code:
Special-case spe_lqd(), spe_stqd() functions so they take byte offsets but
low-order 4 bits are shifted out. This makes things consistant with SPU
assembly language conventions.
Added spe_get_registers_used() function.
Brian Paul [Thu, 9 Oct 2008 02:34:35 +0000 (20:34 -0600)]
cell: implement more built-in shader functions, link spu code with -lm
Brian Paul [Thu, 9 Oct 2008 02:33:24 +0000 (20:33 -0600)]
cell: increase SPU_MAX_FRAGMENT_PROGRAM_INSTS
Brian Paul [Wed, 8 Oct 2008 22:35:40 +0000 (16:35 -0600)]
gallium: asst. clean-ups
Don't use register qualifier. Doxygen-ize comments. Remove 'extern'.
Brian Paul [Wed, 8 Oct 2008 22:33:04 +0000 (16:33 -0600)]
gallium: better instruction printing for SPE code
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.
Brian Paul [Tue, 7 Oct 2008 22:24:43 +0000 (16:24 -0600)]
mesa: use the shaderutil.c helper functions
Brian Paul [Tue, 7 Oct 2008 22:14:27 +0000 (16:14 -0600)]
cell: add support for fragment shader constant buffers
Brian Paul [Tue, 7 Oct 2008 22:11:20 +0000 (16:11 -0600)]
cell: fix incorrect extended swizzle term code in get_src_reg()
Brian Paul [Tue, 7 Oct 2008 21:13:48 +0000 (15:13 -0600)]
cell: fix formatting
Brian Paul [Tue, 7 Oct 2008 20:58:05 +0000 (14:58 -0600)]
cell: remove old code
Stephane Marchesin [Tue, 7 Oct 2008 21:43:21 +0000 (23:43 +0200)]
Gallivm: reorder the functions alphabetically so I can work on it.
Stephane Marchesin [Tue, 7 Oct 2008 21:42:48 +0000 (23:42 +0200)]
Merge branch 'gallium-0.2' of git+ssh://marcheu@git.freedesktop.org/git/mesa/mesa into gallium-0.2
Stephane Marchesin [Tue, 7 Oct 2008 21:42:36 +0000 (23:42 +0200)]
Progs: hook the glsl identity example into the makefile.
Brian Paul [Tue, 7 Oct 2008 20:50:06 +0000 (14:50 -0600)]
cell: memset() key to zero
Brian Paul [Tue, 7 Oct 2008 20:34:08 +0000 (14:34 -0600)]
cell: use new keymap to save/re-use fragment ops code
Brian Paul [Tue, 7 Oct 2008 20:33:16 +0000 (14:33 -0600)]
gallium: added general-purpose key->data map/lookup container
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
Stephane Marchesin [Tue, 7 Oct 2008 19:21:20 +0000 (21:21 +0200)]
Progs: add a trivial glsl test, useful for gallium driver bringup/debug.
Stephane Marchesin [Tue, 7 Oct 2008 19:13:49 +0000 (21:13 +0200)]
Gallivm: don't say hello, it's rude.
Stephane Marchesin [Tue, 7 Oct 2008 19:11:14 +0000 (21:11 +0200)]
Merge branch 'gallium-0.2' of git+ssh://marcheu@git.freedesktop.org/git/mesa/mesa into gallium-0.2
Stephane Marchesin [Tue, 7 Oct 2008 19:11:01 +0000 (21:11 +0200)]
Gallivm: fix the constant layout, this gets a bunch of progs/ working. Notably, gears doesn't.
Keith Whitwell [Tue, 7 Oct 2008 18:12:26 +0000 (19:12 +0100)]
trivial: add more vp tests
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.
Keith Whitwell [Tue, 7 Oct 2008 15:44:24 +0000 (16:44 +0100)]
draw: don't assume output buffer pointer is aligned
Keith Whitwell [Tue, 7 Oct 2008 15:33:17 +0000 (16:33 +0100)]
mesa: update state after binding vertex list in dlist path
Keith Whitwell [Tue, 7 Oct 2008 12:09:05 +0000 (13:09 +0100)]
trivial: exercise vertprog sligtly
Keith Whitwell [Tue, 7 Oct 2008 11:31:31 +0000 (12:31 +0100)]
mesa: protect against segfault in get_fp_input_mask()
Keith Whitwell [Mon, 6 Oct 2008 11:22:55 +0000 (12:22 +0100)]
draw: add switch for drivers to force vertex data passthrough
Brian Paul [Tue, 7 Oct 2008 14:30:29 +0000 (08:30 -0600)]
mesa: remove old assertion
José Fonseca [Tue, 7 Oct 2008 05:25:09 +0000 (14:25 +0900)]
gallium: Introduce PIPE_ARCH_SSE define for SSE support.
Besides meaning x86 and x86-64 architecture, it also depends on SSE2
support enabled on gcc.
This fixes the linux-debug build.
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.
Brian [Mon, 6 Oct 2008 23:10:45 +0000 (17:10 -0600)]
mesa: fix convolve/convolution mix-ups
Stephane Marchesin [Mon, 6 Oct 2008 17:48:57 +0000 (19:48 +0200)]
Mesa: fix the case where there are no vertex attributes.
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.
Michal Krol [Mon, 6 Oct 2008 11:23:56 +0000 (13:23 +0200)]
draw: Fix compiler errors on Windows.
Keith Whitwell [Mon, 6 Oct 2008 10:54:22 +0000 (11:54 +0100)]
rtasm: fix debug build
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()
Keith Whitwell [Sat, 4 Oct 2008 11:41:56 +0000 (12:41 +0100)]
mesa: handle vertex program enabled case also in texenvprogram.c
Robert Ellison [Sat, 4 Oct 2008 00:00:43 +0000 (18:00 -0600)]
CELL: changes to generate SPU code for stenciling
This set of code changes are for stencil code generation
support. Both one-sided and two-sided stenciling are supported.
In addition to the raw code generation changes, these changes had
to be made elsewhere in the system:
- Added new "register set" feature to the SPE assembly generation.
A "register set" is a way to allocate multiple registers and free
them all at the same time, delegating register allocation management
to the spe_function unit. It's quite useful in complex register
allocation schemes (like stenciling).
- Added and improved SPE macro calculations.
These are operations between registers and unsigned integer
immediates. In many cases, the calculation can be performed
with a single instruction; the macros will generate the
single instruction if possible, or generate a register load
and register-to-register operation if not. These macro
functions are: spe_load_uint() (which has new ways to
load a value in a single instruction), spe_and_uint(),
spe_xor_uint(), spe_compare_equal_uint(), and spe_compare_greater_uint().
- Added facing to fragment generation. While rendering, the rasterizer
needs to be able to determine front- and back-facing fragments, in order
to correctly apply two-sided stencil. That requires these changes:
- Added front_winding field to the cell_command_render block, so that
the state tracker could communicate to the rasterizer what it
considered to be the front-facing direction.
- Added fragment facing as an input to the fragment function.
- Calculated facing is passed during emit_quad().
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.
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
Keith Whitwell [Fri, 3 Oct 2008 12:55:40 +0000 (13:55 +0100)]
mesa: add new internal state for tracking current vertex attribs
Keith Whitwell [Fri, 3 Oct 2008 12:53:07 +0000 (13:53 +0100)]
mesa: add missing state dependencies for various tracked constants
Keith Whitwell [Fri, 3 Oct 2008 12:51:56 +0000 (13:51 +0100)]
mesa: shrink texenvprogram state key struct
Keith Whitwell [Fri, 3 Oct 2008 12:50:34 +0000 (13:50 +0100)]
rtasm: add sse_movntps
Keith Whitwell [Thu, 2 Oct 2008 11:53:11 +0000 (12:53 +0100)]
draw: modify prefetching slightly
Keith Whitwell [Wed, 1 Oct 2008 17:40:01 +0000 (18:40 +0100)]
draw: don't keep refetching constant inputs
Keith Whitwell [Thu, 2 Oct 2008 11:46:01 +0000 (12:46 +0100)]
rtasm: add prefetch instructions
Keith Whitwell [Wed, 1 Oct 2008 12:34:38 +0000 (13:34 +0100)]
draw: add streamlined paths for fetching linear verts
Michal Krol [Wed, 1 Oct 2008 17:36:04 +0000 (19:36 +0200)]
mesa: Fix compiler warnings on Windows.
Stephane Marchesin [Tue, 30 Sep 2008 22:00:58 +0000 (00:00 +0200)]
Gallivm: add slt. glxgears should be running, except it isn't.
Stephane Marchesin [Tue, 30 Sep 2008 18:50:49 +0000 (20:50 +0200)]
Gallivm: port to llvm 2.4.
Stephane Marchesin [Sun, 28 Sep 2008 21:18:55 +0000 (23:18 +0200)]
Gallivm: fix off-by-one.
Stephane Marchesin [Sun, 28 Sep 2008 19:45:48 +0000 (21:45 +0200)]
Gallivm: need to link with libstdc++ for llvm.
Stephane Marchesin [Sun, 28 Sep 2008 17:48:26 +0000 (19:48 +0200)]
Gallivm: more instructions.
Stephane Marchesin [Sun, 28 Sep 2008 16:33:23 +0000 (18:33 +0200)]
Gallivm: make it compile again, add some opcodes.
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).
Brian Paul [Fri, 26 Sep 2008 17:17:09 +0000 (11:17 -0600)]
egl: check for null ptr/name
Brian Paul [Fri, 26 Sep 2008 17:16:44 +0000 (11:16 -0600)]
egl: remove space after -L flag
Keith Whitwell [Thu, 2 Oct 2008 11:53:11 +0000 (12:53 +0100)]
draw: modify prefetching slightly
Keith Whitwell [Wed, 1 Oct 2008 17:40:01 +0000 (18:40 +0100)]
draw: don't keep refetching constant inputs
Keith Whitwell [Thu, 2 Oct 2008 11:46:01 +0000 (12:46 +0100)]
rtasm: add prefetch instructions
Keith Whitwell [Wed, 1 Oct 2008 12:34:38 +0000 (13:34 +0100)]
draw: add streamlined paths for fetching linear verts
Michal Krol [Wed, 1 Oct 2008 17:36:04 +0000 (19:36 +0200)]
mesa: Fix compiler warnings on Windows.
José Fonseca [Wed, 1 Oct 2008 01:25:41 +0000 (10:25 +0900)]
Add -msse and -msse2 to the *-x86 configs.
José Fonseca [Tue, 30 Sep 2008 23:28:05 +0000 (08:28 +0900)]
util: No-op u_sse.h outside PIPE_ARCH_X86/X86_64.
José Fonseca [Tue, 30 Sep 2008 23:27:20 +0000 (08:27 +0900)]
tgsi: Include p_config.h.
Stephane Marchesin [Tue, 30 Sep 2008 22:00:58 +0000 (00:00 +0200)]
Gallivm: add slt. glxgears should be running, except it isn't.
Jonathan White [Tue, 30 Sep 2008 21:38:38 +0000 (15:38 -0600)]
cell: Fixed usage of MAX_INSTRUCTIONS to use new MAX_PROGRAM_INSTRUCTIONS instead of old MAX_NV_XXX definitions in order to allow Cell TGSI fragment program generator to work again.
Jonathan White [Tue, 30 Sep 2008 20:07:09 +0000 (14:07 -0600)]
cell: Moved X86 checks to wrap #include section so that Cell targets will compile again.
Stephane Marchesin [Tue, 30 Sep 2008 18:50:49 +0000 (20:50 +0200)]
Gallivm: port to llvm 2.4.
José Fonseca [Tue, 30 Sep 2008 16:13:40 +0000 (01:13 +0900)]
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.
José Fonseca [Mon, 29 Sep 2008 16:12:52 +0000 (01:12 +0900)]
tgsi: SSE2 optimized exp2, log2 and pow implementations.
Special care must be taken when calling compiler generated SSE2 functions
from the runtime generated SSE2: saving the xmm registers, and notify gcc
the stack is not 16byte aligned.
It would be more efficient to keep the stack pointer 16byte aligned, but
too hairy, and not consistent in all x86 architectures.
This has been tested in linux x86 and windows x86 userspace. Not tested on
x86-64 because it is broken for other reasons (even without this change).
José Fonseca [Mon, 29 Sep 2008 16:07:09 +0000 (01:07 +0900)]
util: Header for SSE2 intrinsics portability.
José Fonseca [Mon, 29 Sep 2008 10:09:39 +0000 (19:09 +0900)]
rtasm: Implement immediate group 1 instructions. Fix SIB emition.
Stephane Marchesin [Sun, 28 Sep 2008 21:18:55 +0000 (23:18 +0200)]
Gallivm: fix off-by-one.
Stephane Marchesin [Sun, 28 Sep 2008 19:45:48 +0000 (21:45 +0200)]
Gallivm: need to link with libstdc++ for llvm.
Stephane Marchesin [Sun, 28 Sep 2008 17:48:26 +0000 (19:48 +0200)]
Gallivm: more instructions.
Stephane Marchesin [Sun, 28 Sep 2008 16:33:23 +0000 (18:33 +0200)]
Gallivm: make it compile again, add some opcodes.
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).
Brian Paul [Fri, 26 Sep 2008 17:17:09 +0000 (11:17 -0600)]
egl: check for null ptr/name
Brian Paul [Fri, 26 Sep 2008 17:16:44 +0000 (11:16 -0600)]
egl: remove space after -L flag
Brian Paul [Fri, 26 Sep 2008 23:59:19 +0000 (17:59 -0600)]
cell: checkpoint: more work in emit_function_call()
Simple function call works now, but we don't save/restore the caller's registers yet.
Brian Paul [Fri, 26 Sep 2008 23:57:01 +0000 (17:57 -0600)]
cell: stub-out sin/cos function bodies to avoid trashing caller's stack for now
Brian Paul [Fri, 26 Sep 2008 23:06:22 +0000 (17:06 -0600)]
gallium: SPU register comments
Brian Paul [Fri, 26 Sep 2008 16:15:11 +0000 (10:15 -0600)]
cell: move command processing code into new spu_command.c file
Brian Paul [Fri, 26 Sep 2008 16:10:08 +0000 (10:10 -0600)]
cell: move debug-related declarations
Brian Paul [Fri, 26 Sep 2008 16:02:58 +0000 (10:02 -0600)]
cell: move debug macros into new spu_debug.h