Commit Graph

92 Commits

Author SHA1 Message Date
Brian Paul 4bef3575e6 llvmpipe: change 'in' to boolean, add comments 2010-01-15 11:25:13 -07:00
Brian Paul ca12e30d97 llvmpipe: minor comment update 2010-01-14 19:08:19 -07:00
Brian Paul f19f218e7a llvmpipe: minor assorted clean-ups 2010-01-13 18:01:45 -07:00
José Fonseca a1acbff299 llvmpipe: Reset the bin when shading a whole tile with an opaque shader. 2010-01-13 21:51:47 +00:00
Brian Paul 212f3a6cb3 llvmpipe: tweak subpixel_snap() arithmetic
This adjustment fixes some rasterization differences between llvmpipe
and softpipe (and other renderers).
2010-01-13 09:32:21 -07:00
Brian Paul 214ffad015 llvmpipe: clamp maxx,maxy to framebuffer size (in terms of tiles)
In some corner cases the right-most / bottom-most vertex can be
right on the edge of the framebuffer.  Because the maxx, maxy vals
are computed with a series of float/int, pixel/tile transformations
we can end up with maxx >= scene->x_tiles or maxy >= scene->y_tiles.
This leads to putting data into bins that never get processed, or
reset.  This becomes stale data that can lead to segfaults.

Clamping fixes this.
2010-01-12 17:08:07 -07:00
Keith Whitwell 094525fb23 llvmpipe: remove opencoded constant 2010-01-11 11:06:15 +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
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
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 22b07b8be4 llvmpipe: use new lp_setup_get_current_bins() function
This stub function will interface to the queue system...
2009-12-09 12:28:59 -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 d9dc3d5976 llvmpipe: move bin-related structures and functions into new lp_bin.[ch]
And put lp_ prefixes on some functions.
2009-12-04 12:54:37 -07:00
Brian Paul 5c7d1b592a llvmpipe: remove lp_rast_triangle::oneoverarea field
Makes lp_rast_triangle a little smaller (now 280 bytes on a 32-bit system).
2009-12-04 11:58:26 -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 1796ffd3bc llvmpipe: fix typo, whitespace 2009-12-04 09:19:09 -07:00
Brian Paul 04e12e31b2 llvmpipe: dynamic allocation of triangle a0/dadx/dady arrays
Much less memory per triangle now.
2009-12-04 09:14:42 -07:00
Brian Paul 30c122a4c9 llvmpipe: new comment in do_triangle_ccw() 2009-12-03 17:27:10 -07:00
Brian Paul 7505510c7b llvmpipe: add a bunch of comments 2009-11-30 14:02:01 -07:00
Keith Whitwell 694f05ac18 llvmpipe: remove one of two definitions of TILESIZE 2009-10-21 15:21:11 +01:00
Keith Whitwell 341edde1d2 llvmpipe: remove dead code 2009-10-21 14:35:54 +01:00
Keith Whitwell cccb184209 llvmpipe: minor opts to setup_tri 2009-10-20 10:11:52 +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 3fd6b724cc llvmpipe: pre-multiply some constants by fixed_one 2009-10-19 14:55:05 +01:00
Keith Whitwell 0580079864 llvmpipe: fixed-point rasterization 2009-10-19 13:36:55 +01:00
Keith Whitwell 269342d916 llvmpipe: correctly scale top/left fill adjustments
Was overdoing it previously.
2009-10-19 11:29:05 +01:00
Keith Whitwell d9f44abe3b llvmpipe: fix typo correcting for fill convention
Adjustments for top-left fill convention were being lost.
2009-10-19 11:23:43 +01:00
Keith Whitwell b4924d62c7 llvmpipe: fill in tri min/max values 2009-10-09 16:59:24 +01:00
José Fonseca 6464ec4836 llvmpipe: Remove partial tile override. 2009-10-09 16:50:32 +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 da1808ccc9 llvmpipe: just bin whole tiles for now 2009-10-09 15:10:15 +01:00
Keith Whitwell e215f94f15 llvmpipe: get lp_setup_tri building 2009-10-09 12:19:49 +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
Keith Whitwell 415b271b51 llvmpipe: hook up some state, add stub line and point functions 2009-10-09 10:44:07 +01:00
Keith Whitwell de902d3275 llvmpipe: more wip on coefficients 2009-10-09 10:23:53 +01:00
Keith Whitwell 0718c77005 llvmpipe: work on clears and coefficients 2009-10-08 19:58:54 +01:00
Keith Whitwell 931210424b llvmpipe: wip me harder 2009-10-08 15:46:29 +01:00
Keith Whitwell 5e13dfe618 llvmpipe: whip out the intra-tile code from lp_setup_tri.c
The "setup" module handles building per-tile display lists.
Intra-tile rendering is handled by lp_rast*.c
2009-10-08 12:15:12 +01:00
Keith Whitwell e529170c11 llvmpipe: more wipping 2009-10-08 11:49:49 +01:00
Keith Whitwell 89498d0153 llvmpipe: import experimental softpipe rasterizer code, wip binning code
WIP, does't build or run.

Rasterizer code is based on Nick Capen's devmaster posts and the
larrabee articles, but currently doesn't share either the performance
or correctness of either...
2009-10-08 08:32:43 +01:00