Commit Graph

127 Commits

Author SHA1 Message Date
Brian Paul 7319ae0954 llvmpipe: remove tile clipping code
The surface is always a multiple of the tile size now.
2010-01-20 17:47:26 -07:00
Brian Paul ec459f2aec llvmpipe: asst. task-related clean-ups 2010-01-19 16:58:25 -07:00
Brian Paul 0fccfc9cc0 llvmpipe: remove unneeded DEBUG checks, use step var 2010-01-19 09:30:44 -07:00
Brian Paul 62623c4dc5 llvmpipe: added show_tiles and show_subtiles debug options
These options draw lines over the tiles to show the 64x64 tile
bounds and 16x16 sub-tile bounds.  For debugging/visualization.
2010-01-18 13:10:14 -07:00
Keith Whitwell 591401ff05 llvmpipe: use new u_ringbuffer for scene queue 2010-01-17 00:30:23 +00:00
Brian Paul 2797f2bf57 llvmpipe: generate two shader varients, one omits triangle in/out testing
When we know that a 4x4 pixel block is entirely inside of a triangle
use the jit function which omits the in/out test code.

Results in a few percent speedup in many tests.
2010-01-15 11:21:16 -07:00
Brian Paul 2ba1c8189a llvmpipe: use one loop in lp_rast_clear_zstencil()
This is just a tiny bit faster.
2010-01-13 18:58:42 -07:00
Brian Paul f94a99170e llvmpipe: optimize lp_rast_clear_color() for non-gray colors
This makes a big difference in progs that clear to a non-gray color.
Some demos are 30-50% faster.
2010-01-13 18:54:50 -07:00
Keith Whitwell 4231006e29 llvmpipe: add bin debugger
Adjust definition of empty_bin according to what's actually in empty
bins.  We often have a state packet before/after load commands.

Still need to do something about the fence packets.
2010-01-13 20:14:04 +00:00
Keith Whitwell 95ee14f147 llvmpipe: implement lp_rast_load_zstencil
Load zbuffer contents for binned scenes that don't start with a clear
and which have a bound zbuffer.
2010-01-13 16:52:44 +00:00
Keith Whitwell db83ad4b43 llvmpipe: improve empty-bin test further
Remove unused param, add comments.  Thanks to Brian for review.
2010-01-13 16:29:39 +00:00
Keith Whitwell f4b29e6ad3 llvmpipe: improve empty-bin test
We emit at most two clear packets (color and z respectively).
2010-01-13 15:49:24 +00:00
Keith Whitwell da45f49cc6 llvmpipe: quick hack to short-circuit empty bins 2010-01-13 15:18:32 +00:00
Keith Whitwell c1a0441602 llvmpipe: initial mrt support
Non-mrt apps work, and the code looks correct, but not many mrt test apps
handy atm...
2010-01-10 17:22:09 +00:00
José Fonseca 080c40ab32 Merge remote branch 'origin/master' into lp-binning
Conflicts:
	src/gallium/auxiliary/util/u_surface.c
	src/gallium/drivers/llvmpipe/Makefile
	src/gallium/drivers/llvmpipe/SConscript
	src/gallium/drivers/llvmpipe/lp_bld_arit.c
	src/gallium/drivers/llvmpipe/lp_bld_flow.c
	src/gallium/drivers/llvmpipe/lp_bld_interp.c
	src/gallium/drivers/llvmpipe/lp_clear.c
	src/gallium/drivers/llvmpipe/lp_context.c
	src/gallium/drivers/llvmpipe/lp_context.h
	src/gallium/drivers/llvmpipe/lp_draw_arrays.c
	src/gallium/drivers/llvmpipe/lp_jit.c
	src/gallium/drivers/llvmpipe/lp_jit.h
	src/gallium/drivers/llvmpipe/lp_prim_vbuf.c
	src/gallium/drivers/llvmpipe/lp_setup.c
	src/gallium/drivers/llvmpipe/lp_setup_point.c
	src/gallium/drivers/llvmpipe/lp_state.h
	src/gallium/drivers/llvmpipe/lp_state_blend.c
	src/gallium/drivers/llvmpipe/lp_state_derived.c
	src/gallium/drivers/llvmpipe/lp_state_fs.c
	src/gallium/drivers/llvmpipe/lp_state_sampler.c
	src/gallium/drivers/llvmpipe/lp_state_surface.c
	src/gallium/drivers/llvmpipe/lp_tex_cache.c
	src/gallium/drivers/llvmpipe/lp_tex_cache.h
	src/gallium/drivers/llvmpipe/lp_tex_sample.h
	src/gallium/drivers/llvmpipe/lp_tile_cache.c
2010-01-08 15:42:57 +00:00
Keith Whitwell c9240c4c8f llvmpipe: remove dead code 2010-01-06 17:00:26 +00:00
Brian Paul 808170a0ff llvmpipe: replace INT_MIN/2 with INT_MIN
Since changing the in/out test we can just use INT_MIN to be sure the
comparison against the step values always passes.
2009-12-17 09:01:01 -07:00
Brian Paul b9d33db0a4 llvmpipe: improve the in/out test a little
Instead of:
  s = c + step
  m = s > 0
Do:
  m = step > c  (with negated c)
2009-12-17 08:17:04 -07:00
Brian Paul ab94381930 llvmpipe: do final the pixel in/out triangle test in the fragment shader
The test to determine which of the pixels in a 2x2 quad is now done in
the fragment shader rather than in the calling C code.  This is a little
faster but there's a few more things to do.

Note that the step[] array elements are in a different order now.  Rather
than being in row-major order for the 4x4 grid, they're in "quad-major"
order.  The setup of the step arrays is a little more complicated now.
So is the course/intermediate tile test code, but some lookup tables
help with that.

Next steps:
 - early-cull 2x2 quads which are totally outside the triangle.
 - skip the in/out test for fully contained quads
 - make the in/out comparison code tighter/faster.
2009-12-16 16:10:05 -07:00
Brian Paul cdbcd96fdf llvmpipe: tighten up an assertion 2009-12-15 15:39:48 -07:00
Keith Whitwell 663750d556 llvmpipe: rename bins to scene
It was pretty confusing having an entity named "bin" and another named
"bins", not least because sometimes there was a need to talk about >1
of the "bins" objects, which couldn't be pluralized any further...

Scene is a term used in a bunch of places to talk about what a binner
operates on, so it's a decent choice here.
2009-12-13 18:17:25 +00:00
Brian Paul 4b70af918d llvmpipe: added lp_rast_fence() bin function 2009-12-11 17:57:45 -07:00
Brian Paul 9323740738 llvmpipe: added lp_rast_get_num_threads() 2009-12-11 17:45:52 -07:00
Brian Paul 92dc0f92b0 llvmpipe: implement lp_rast_load_color() 2009-12-11 15:00:28 -07:00
Brian Paul 2bce5c195f llvmpipe: checkpoint: more thread/queuing changes
Now mapping/unmapping the framebuffer is done by a rasteizer thread
rather than the main calling thread.
2009-12-11 14:52:46 -07:00
Brian Paul de31b0e60c llvmpipe: remove unused lp_rasterizer::fb field 2009-12-11 11:56:22 -07:00
Brian Paul 156eabbaf9 llvmpipe: improve framebuffer/surface code 2009-12-11 11:46:23 -07:00
Brian Paul 205da96fc6 llvmpipe: remove unused fb parameter 2009-12-11 11:25:22 -07:00
Brian Paul 4e67f10331 llvmpipe: minor comment fix 2009-12-11 11:16:48 -07:00
Brian Paul 9509f73c21 llvmpipe: checkpoint: use empty/full bin queues 2009-12-10 14:56:30 -07:00
Brian Paul 96689d451a llvmpipe: added some debug/info code 2009-12-09 16:32:32 -07:00
Brian Paul 3bee8c2e7c llvmpipe: use the empty_bins queue now 2009-12-09 16:06:04 -07:00
Brian Paul d7dbc66636 llvmpipe: checkpoint: begin plugging in bin queue code 2009-12-09 14:53:33 -07:00
José Fonseca 7f457acabc llvmpipe: Use number of CPUs as default number of threads.
Also bump MAX_THREADS to 8.
2009-12-08 08:02:49 +00:00
Brian Paul 73e13c33fd llvmpipe: remove some left-over debug code 2009-12-07 18:18:37 -07:00
Brian Paul aab1ceceec llvmpipe: implement threaded rasterization
The LP_NUM_THREADS env var controls how many threads are created.
The default (and max) is 4, for now.
If LP_NUM_THREADS = 0, threading is not used.
2009-12-07 18:04:54 -07:00
Brian Paul 3a06c113c7 llvmpipe: repartition lp_rasterizer state for threading
Some of the state is per-thread.  Put that state in new lp_rasterizer_task
struct.
2009-12-07 18:04:54 -07:00
Brian Paul cdaea049c9 llvmpipe: use bin iteration functions when rasterizing bins 2009-12-07 18:04:54 -07:00
Brian Paul 8a23105fa0 llvmpipe: still more bin code reorganization
Move tiles_x,y fields from setup state into bin state.
Move more bin-adding commands into lp_bin.[ch].
2009-12-04 15:59:25 -07:00
Brian Paul 01b1900084 llvmpipe: reorganization of binning data structions and funtions
New lp_bins struct contains all bin information.
More move bin-related code into lp_bin.[ch]
Use new/updated bin-access functions to hide implementation details.
The result is more/cleaner separation between the setup and rast components.
This will make double-buffering of the bins easier, etc.
2009-12-04 15:31:09 -07:00
Brian Paul b533b56750 llvmpipe: move lp_rasterize_bin() into lp_rast.c
First step of moving bin rasterization/execution code out of lp_setup.c
2009-12-04 14:47:46 -07:00
Brian Paul a08d630216 llvmpipe: use LP_DBG() macro everywhere 2009-12-04 14:11:25 -07:00
Brian Paul b1659b9213 llvmpipe: bin state-change commands
Previously, each triangle had a pointer to the state to use for shading.
Now we insert state-change commands into the bins.  When we execute one
of those commands we just update a 'current state' pointer and use that
pointer when calling the jit shader.

When inserting state-change commands into a bin we check if the previous
command was also a state-change command and simply replace it.  This
avoids accumulating useless/redundant state-change commands.
2009-12-04 11:50:43 -07:00
Brian Paul e2f4634456 llvmpipe: checkpoint some initial state binning code 2009-12-03 16:05:12 -07:00
Brian Paul ffd0759973 llvmpipe: comments and a stub for lp_rast_set_state() 2009-12-03 14:57:44 -07:00
Brian Paul 51663f0506 llvmpipe: quick & dirty implementation of lp_rast_store_zstencil()
This allows us to do a glReadPixels(GL_DEPTH_COMPONENT) to see what's
in the depth buffer to help debugging.
2009-12-03 11:41:48 -07:00
Brian Paul 866e6856d3 llvmpipe: execute shaders on 4x4 blocks instead of 8x2
This matches the convention used by the recursive rasterizer.
Also fixed assorted typos, comments, etc.
Now tri-z.c, gears.c, etc look basically right but there's still some
cracks in triangle rasterization.
2009-12-02 15:13:47 -07:00
Brian Paul 7505510c7b llvmpipe: add a bunch of comments 2009-11-30 14:02:01 -07:00
Keith Whitwell 280c8acc43 llvmpipe: fix the worst of the depth regressions since switch to 4x4 2009-10-22 17:21:37 +01:00
Keith Whitwell 694f05ac18 llvmpipe: remove one of two definitions of TILESIZE 2009-10-21 15:21:11 +01:00
Keith Whitwell 7b116e13a2 llvmpipe: pass mask as a linear encoding of the 4x4 block 2009-10-20 03:17:17 +01:00
Keith Whitwell 7670628061 llvmpipe: precalculate some offsets 2009-10-20 02:46:00 +01:00
Keith Whitwell 5b07d4de38 llvmpipe: remove a leftover 8x2 usage 2009-10-19 17:10:48 +01:00
Keith Whitwell b0828b0adc llvmpipe: calculate masks in format desired by shader
Also remove branches calculating masks for quads.
2009-10-19 16:41:27 +01:00
José Fonseca 61f3eeb640 llvmpipe: Use framebuffer coords consistently. 2009-10-09 19:16:36 +01:00
José Fonseca 8c34c86d19 llvmpipe: Undo debug override. 2009-10-09 16:23:00 +01:00
Keith Whitwell 05131f7502 llvmpipe: properly clip tile writes 2009-10-09 16:20:56 +01:00
José Fonseca c2e926b72d llvmpipe: Pass framebuffer coords to shader. 2009-10-09 16:18:38 +01:00
Keith Whitwell 82ec7f018d llvmpipe: correct binning maths for iterating over whole tiles 2009-10-09 16:07:58 +01:00
José Fonseca 8599969582 llvmpipe: Get jit_context/jit_function across the rasterizer. 2009-10-09 15:53:53 +01:00
Keith Whitwell e0e2008f1d llvmpipe: trivial/clear works 2009-10-09 14:29:25 +01:00
Keith Whitwell 295aea0489 llvmpipe: more debug 2009-10-09 14:07:40 +01:00
Keith Whitwell 4e1334ced6 llvmpipe: debug, crash fixes 2009-10-09 14:02:39 +01:00
Keith Whitwell 4cdd10cb4b llvmpipe: use union lp_cmd_rast_arg directly, rather than through a pointer
The union itself consists of pointers.  We don't need to be passing
pointer to pointers.
2009-10-09 11:29:01 +01:00
José Fonseca 47510040a6 llvmpipe: Follow write_color/write_zstencil. 2009-10-09 10:37:24 +01:00
Keith Whitwell 84ab7dcf48 llvmpipe: calculate overall width and height, pass to rasterizer 2009-10-09 10:24:19 +01:00
Keith Whitwell 0718c77005 llvmpipe: work on clears and coefficients 2009-10-08 19:58:54 +01:00
José Fonseca 21489d2275 llvmpipe: Remove quad headers. 2009-10-08 19:56:01 +01:00
José Fonseca 07ee87e664 llvmpipe: Fix typo. 2009-10-08 19:18:52 +01:00
José Fonseca 86dba3e414 llvmpipe: Final adjustments to rasterizer methods. 2009-10-08 19:16:47 +01:00
José Fonseca ab76b2a8b8 llvmpipe: Complete more rasterizer methods.. 2009-10-08 19:03:14 +01:00
José Fonseca 37b86aa55c llvmpipe: Implement some of the rasterizer functions. 2009-10-08 17:59:44 +01:00
Keith Whitwell d0c918b87a llvmpipe: remove some old sampler support structs 2009-10-08 17:53:12 +01:00
José Fonseca 921584181e llvmpipe: Fix up lp_rast_shade_quads. 2009-10-08 17:26:13 +01:00
José Fonseca d614ced756 llvmpipe: Update includes and copyright headers. 2009-10-08 12:51:46 +01:00
José Fonseca a6676d896e llvmpipe: Add the rast -> jit shader glue.
Ugly code. Will eventually be reduced to a very thin inlined function.
2009-10-08 12:44:30 +01:00
Keith Whitwell e529170c11 llvmpipe: more wipping 2009-10-08 11:49:49 +01:00
Renamed from src/gallium/drivers/llvmpipe/lp_rasterizer.c (Browse further)