Commit graph

18373 commits

Author SHA1 Message Date
Stephane Marchesin
db9de99925 Gallivm: cleanup soa storage. 2008-10-09 23:32:01 +02:00
Brian Paul
d48a92e880 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.
2008-10-08 20:44:32 -06:00
Brian Paul
a4e477433f cell: implement more built-in shader functions, link spu code with -lm 2008-10-08 20:34:35 -06:00
Brian Paul
feb5a26bb1 cell: increase SPU_MAX_FRAGMENT_PROGRAM_INSTS 2008-10-08 20:33:24 -06:00
Brian Paul
5c57cbec32 gallium: asst. clean-ups
Don't use register qualifier.  Doxygen-ize comments.  Remove 'extern'.
2008-10-08 16:35:40 -06:00
Brian Paul
73d00b9e93 gallium: better instruction printing for SPE code 2008-10-08 16:33:04 -06:00
Brian Paul
b99c39ea7b mesa: use the shaderutil.c helper functions 2008-10-07 16:24:43 -06:00
Brian Paul
800c350d71 cell: add support for fragment shader constant buffers 2008-10-07 16:16:27 -06:00
Brian Paul
ce416566bc cell: fix incorrect extended swizzle term code in get_src_reg() 2008-10-07 16:16:27 -06:00
Brian Paul
3008657cea cell: fix formatting 2008-10-07 16:16:27 -06:00
Brian Paul
e561058641 cell: remove old code 2008-10-07 16:16:27 -06:00
Stephane Marchesin
a0809c5271 Gallivm: reorder the functions alphabetically so I can work on it. 2008-10-07 23:43:21 +02:00
Stephane Marchesin
8463ddb740 Merge branch 'gallium-0.2' of git+ssh://marcheu@git.freedesktop.org/git/mesa/mesa into gallium-0.2 2008-10-07 23:42:48 +02:00
Stephane Marchesin
6f29c2ff2d Progs: hook the glsl identity example into the makefile. 2008-10-07 23:42:36 +02:00
Brian Paul
be3c070b6a cell: memset() key to zero 2008-10-07 14:50:06 -06:00
Brian Paul
44799c3b7e cell: use new keymap to save/re-use fragment ops code 2008-10-07 14:34:29 -06:00
Brian Paul
f192ad5ebc gallium: added general-purpose key->data map/lookup container 2008-10-07 14:34:29 -06:00
Stephane Marchesin
4ccbee2439 Progs: add a trivial glsl test, useful for gallium driver bringup/debug. 2008-10-07 21:21:20 +02:00
Stephane Marchesin
85e578bbc7 Gallivm: don't say hello, it's rude. 2008-10-07 21:13:49 +02:00
Stephane Marchesin
ba86520cf7 Merge branch 'gallium-0.2' of git+ssh://marcheu@git.freedesktop.org/git/mesa/mesa into gallium-0.2 2008-10-07 21:11:14 +02:00
Stephane Marchesin
94ba48bd85 Gallivm: fix the constant layout, this gets a bunch of progs/ working. Notably, gears doesn't. 2008-10-07 21:11:01 +02:00
José Fonseca
4d7394f892 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.
2008-10-07 14:25:09 +09:00
Stephane Marchesin
8e8208d6db Mesa: fix the case where there are no vertex attributes. 2008-10-06 19:48:57 +02:00
Robert Ellison
afaa53040b 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().
2008-10-03 18:05:14 -06:00
Keith Whitwell
22eb067c88 draw: modify prefetching slightly 2008-10-02 10:19:48 -04:00
Keith Whitwell
21f98ad30a draw: don't keep refetching constant inputs 2008-10-02 10:19:48 -04:00
Keith Whitwell
66d4beb874 rtasm: add prefetch instructions 2008-10-02 10:19:48 -04:00
Keith Whitwell
a15699c3f5 draw: add streamlined paths for fetching linear verts 2008-10-02 10:19:48 -04:00
Michal Krol
a77976d2ee mesa: Fix compiler warnings on Windows. 2008-10-02 10:19:48 -04:00
Stephane Marchesin
8bdb4d2b2f Gallivm: add slt. glxgears should be running, except it isn't. 2008-10-02 10:19:47 -04:00
Stephane Marchesin
3f4b67f5d7 Gallivm: port to llvm 2.4. 2008-10-02 10:19:47 -04:00
Stephane Marchesin
fdcaf569d4 Gallivm: fix off-by-one. 2008-10-02 10:19:47 -04:00
Stephane Marchesin
9859edc606 Gallivm: need to link with libstdc++ for llvm. 2008-10-02 10:19:47 -04:00
Stephane Marchesin
0116ea34e1 Gallivm: more instructions. 2008-10-02 10:19:47 -04:00
Stephane Marchesin
3f477e111a Gallivm: make it compile again, add some opcodes. 2008-10-02 10:19:47 -04:00
Brian Paul
5620c20b24 mesa: fix temp register allocation problems.
Complex texcombine modes were running out of registers (>32 registers for 8 tex units).
2008-10-02 10:19:47 -04:00
Brian Paul
2cb213ff23 egl: check for null ptr/name 2008-10-02 10:19:46 -04:00
Brian Paul
5b60d6d07b egl: remove space after -L flag 2008-10-02 10:19:46 -04:00
José Fonseca
23e325e55a Add -msse and -msse2 to the *-x86 configs. 2008-10-01 10:25:41 +09:00
José Fonseca
cb8a3ba433 util: No-op u_sse.h outside PIPE_ARCH_X86/X86_64. 2008-10-01 08:28:05 +09:00
José Fonseca
cbfce4175b tgsi: Include p_config.h. 2008-10-01 08:27:20 +09:00
Jonathan White
e3378790bb 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. 2008-09-30 15:38:38 -06:00
Jonathan White
5e585719eb cell: Moved X86 checks to wrap #include section so that Cell targets will compile again. 2008-09-30 14:07:09 -06:00
José Fonseca
8415d06d90 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.
2008-10-01 01:13:40 +09:00
José Fonseca
5dc8e67078 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).
2008-09-30 01:12:52 +09:00
José Fonseca
906336cd7c util: Header for SSE2 intrinsics portability. 2008-09-30 01:07:09 +09:00
José Fonseca
6607f2cf19 rtasm: Implement immediate group 1 instructions. Fix SIB emition. 2008-09-29 19:09:39 +09:00
Brian Paul
fe1c9872ae cell: checkpoint: more work in emit_function_call()
Simple function call works now, but we don't save/restore the caller's registers yet.
2008-09-26 17:59:19 -06:00
Brian Paul
55b65d3b42 cell: stub-out sin/cos function bodies to avoid trashing caller's stack for now 2008-09-26 17:57:01 -06:00
Brian Paul
938e12c1ca gallium: SPU register comments 2008-09-26 17:06:22 -06:00