Commit Graph

198 Commits

Author SHA1 Message Date
Brian Paul 2996ce72b1 llvmpipe: add a cast 2010-11-02 11:53:14 -06:00
Brian Paul 9fbf744389 llvmpipe: assign context's frag shader pointer before using it
The call to draw_bind_fragment_shader() was using the old fragment
shader.  This bug would have really only effected the draw module's
use of the fragment shader in the wide point stage.
2010-11-02 11:50:37 -06:00
José Fonseca 85a08f8fc7 gallivm: Remove the EMMS opcodes.
Unnecessary now that lp_set_target_options() successful disables MMX code
emission.
2010-10-28 20:42:02 +01:00
Keith Whitwell 0072acd447 Merge remote branch 'origin/master' into lp-setup-llvm
Conflicts:
	src/gallium/drivers/llvmpipe/lp_setup_coef.c
	src/gallium/drivers/llvmpipe/lp_setup_coef.h
	src/gallium/drivers/llvmpipe/lp_setup_coef_intrin.c
	src/gallium/drivers/llvmpipe/lp_setup_point.c
	src/gallium/drivers/llvmpipe/lp_setup_tri.c
	src/gallium/drivers/llvmpipe/lp_state_derived.c
	src/gallium/drivers/llvmpipe/lp_state_fs.h
2010-10-17 19:09:42 -07:00
José Fonseca a0add0446c llvmpipe: Fix bad refactoring.
'i' and 'chan' have random values here, which could cause a buffer
overflow in debug builds, if chan > 4.
2010-10-17 09:58:04 -07:00
Keith Whitwell ac98519c4e llvmpipe: validate color outputs against key->nr_cbufs 2010-10-15 14:49:13 +01:00
Keith Whitwell ffab84c9a2 llvmpipe: check shader outputs are non-null before using 2010-10-15 14:49:13 +01:00
Keith Whitwell 0a1c900103 llvmpipe: don't pass frontfacing as a float 2010-10-15 13:27:47 +01:00
Brian Paul 3d7479d705 llvmpipe: code to dump bytecode to file (disabled) 2010-10-14 17:28:24 -06:00
Keith Whitwell f0bd76f28d llvmpipe: don't try to emit non-existent color outputs 2010-10-14 14:08:20 +01:00
José Fonseca 95c18abb03 llvmpipe: Unbreak Z32_FLOAT.
Z32_FLOAT uses <4 x float> as intermediate/destination type,
instead of <4 x i32>.

The necessary bitcasts got removed with commit
5b7eb868fd

Also use depth/stencil type and build contexts consistently, and
make the depth pointer argument a ordinary <i8 *>, to catch this
sort of issues in the future (and also to pave way for Z16 and
Z32_FLOAT_S8_X24 support).
2010-10-13 15:25:15 +01:00
José Fonseca 986cb9d5cf llvmpipe: Use lp_tgsi_info. 2010-10-11 13:06:25 +01:00
José Fonseca 307df6a858 gallivm: Cleanup the rest of the flow module. 2010-10-09 21:39:14 +01:00
José Fonseca d45c379027 gallivm: Remove support for Phi generation.
Simply rely on mem2reg pass. It's easier and more reliable.
2010-10-09 20:14:03 +01:00
José Fonseca cc40abad51 gallivm: Don't generate Phis for execution mask. 2010-10-09 12:55:31 +01:00
Keith Whitwell 5b7eb868fd llvmpipe: clean up shader pre/postamble, try to catch more early-z
Specifically, can do early-depth-test even when alpahtest or
kill-pixel are active, providing we defer the actual z write until the
final mask is avaialable.

Improves demos/fire.c especially in the case where you get close to
the trees.
2010-10-09 11:44:45 +01:00
Keith Whitwell aa4cb5e2d8 llvmpipe: try to be sensible about whether to branch after mask updates
Don't branch more than once in quick succession.  Don't branch at the
end of the shader.
2010-10-09 11:44:45 +01:00
Keith Whitwell d2cf757f44 gallivm: specialized x8z24 depthtest path
Avoid unnecessary masking of non-existant stencil component.
2010-10-09 11:44:09 +01:00
Keith Whitwell 954965366f llvmpipe: dump fragment shader ir and asm when LP_DEBUG=fs
Better than GALLIVM_DEBUG if you're only interested in fragment shaders.
2010-10-09 11:43:23 +01:00
Keith Whitwell 40d7be5261 llvmpipe: use alloca for fs color outputs
Don't try to emit our own phi's, let llvm mem2reg do it for us.
2010-10-09 11:43:23 +01:00
Keith Whitwell 8009886b00 llvmpipe: defer attribute interpolation until after mask and ztest
Don't calculate 1/w for quads which aren't visible...
2010-10-09 11:42:48 +01:00
José Fonseca 1c32583581 gallivm: Only apply min/max_lod when necessary. 2010-10-06 18:50:57 +01:00
José Fonseca 446dbb9217 llvmpipe: Dump a few missing shader key flags. 2010-10-06 11:41:08 +01:00
Keith Whitwell 591e1bc34f llvmpipe: make debug_fs_variant respect variant->nr_samplers 2010-10-06 11:40:30 +01:00
José Fonseca 87267c71f6 llvmpipe: Make rgb/alpha bland func/factors match, when there is no alpha.
Makes AoS blending easier, and state more canonical.
2010-09-22 15:02:39 +01:00
José Fonseca b556bb7c44 llvmpipe: When failing free fs shader too. 2010-09-21 17:51:29 +01:00
Brian Paul 955d76c3d2 llvmpipe: maintain fragment shader state for draw module 2010-09-20 12:52:16 -06:00
Keith Whitwell 5b4c43d985 llvmpipe: use llvm for attribute interpolant calculation
Basically no change relative to hard-coded version, but this will
be useful for other changes later.
2010-09-18 08:40:17 +01:00
Keith Whitwell 0986355425 llvmpipe: add DEBUG_FS to dump variant information 2010-09-16 17:34:58 +01:00
Vinson Lee aeb83928fd llvmpipe: Initialize variable for potentially unhandled switch case. 2010-09-14 00:17:13 -07:00
Keith Whitwell 67b957781d llvmpipe: pass linear masks to fragment shader
Fragment shader can extract the correct bits for each quad.
2010-09-12 15:03:49 +01:00
José Fonseca 853953dc3c llvmpipe: Only generate the whole shader specialization for opaque shaders.
If not opaque, then the color buffer will have to be read any way,
therefore the specialization is pointless.
2010-09-12 10:15:48 +01:00
José Fonseca 277d768d10 llvmpipe: Don't store display the alpha ref value in the key.
It's never used.
2010-09-11 13:30:14 +01:00
Brian Paul 3ec296390c llvmpipe: remove redundant tgsi_dup_tokens() call
We were calling this twice so the first allocation was orphaned/leaked.
2010-09-09 10:04:39 -06:00
Keith Whitwell 9f6e8e1d6b llvmpipe: use opcodes instead of function pointers in bins
Also, move some state from rasterizer struct to the scene.
2010-09-07 14:02:15 +01:00
Keith Whitwell 71e27ef21c llvmpipe: put fs variant dumping in a function 2010-09-07 13:22:54 +01:00
José Fonseca 00989d5bfc llvmpipe: Relax the colormask constraint on opaque.
Also, include the color buffer in the key. Not having it there
causes a tight knots in the logic to determine when it is OK or not
to discard previous color buffer contents.
2010-09-05 10:17:51 +01:00
Keith Whitwell b6e03eafe3 llvmpipe: fence debugging, add llvmpipe_finish 2010-08-25 10:29:27 +01:00
Keith Whitwell 3d4b60f1f7 llvmpipe: reduce size of fragment shader variant key
Don't spend as much time comparing them.
2010-08-22 14:49:17 +01:00
Vinson Lee 078eff659a llvmpipe: Fix implicit declaration of lp_func_delete_body warnings. 2010-07-30 11:48:48 -07:00
Zack Rusin 042018a943 llvmpipe: delete function bodies after generating machine code 2010-07-30 16:25:29 +01:00
José Fonseca e3d2ebac11 llvmpipe: Avoid corrupting the FPU stack with MMX instructions on 32bit OSes.
Unfortunately LLVM doesn't emit EMMS itself, and there is no
easy/effective way to disable MMX.

http://llvm.org/bugs/show_bug.cgi?id=3287
2010-07-29 19:10:59 +01:00
Keith Whitwell d4b64167b5 llvmpipe: pass mask into fragment shader
Move this code back out to C for now, will generate separately.

Shader now takes a mask parameter instead of C0/C1/C2/etc.

Shader does not currently use that parameter and rasterizes whole
pixel stamps always.
2010-07-13 17:23:49 +01:00
Zack Rusin b5e381d978 llvmpipe: make geometry shaders and stream output work 2010-06-22 12:58:04 -04:00
José Fonseca 197636814e llvmpipe: s/lpfs/shader/ 2010-06-21 14:11:15 +01:00
José Fonseca d7f4250333 llvmpipe: Fix pointer dereference after free. 2010-06-18 17:37:37 +01:00
Roland Scheidegger 17c9d7eea7 llvmpipe: limit the number of fragment shader variants kept around
llvmpipe can create a large number of shader variants for a single shader
(which are quite big), and they were only ever deleted if the shader itself
was deleted. This is especially apparent in things like glean
blendFunc where a new variant is created for every different subtest, chewing
up all memory.
This change limits the numbers of fragment shader variants (for all shaders)
which are kept around to a fixed number. If that would be exceeded a fixed
portion of the cached variants is deleted (since without tracking the used
variants this involves flushing we don't want to delete only one).
Always the least recently used variants (from all shaders together) are
deleted.
For now this is all per-context.
Both the number of how many variants are cached (1024) as well as how many
will be deleted at once (1/4 of the cache size) are just rough guesses and
subject to further optimization.
2010-06-18 13:52:17 +01:00
Keith Whitwell a6d9d18fae llvmpipe: hook up basic gs and multiple constant buffer support 2010-06-07 16:39:02 +01:00
José Fonseca 81862bbbc8 llvmpipe: Number shaders/variants for more reproducible function names in the IR. 2010-06-03 14:32:56 +01:00
José Fonseca 147dc2354c llvmpipe: Centralize all position interpolation in lp_bld_interp.c. 2010-06-02 13:24:25 +01:00