Commit Graph

63 Commits

Author SHA1 Message Date
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