Commit graph

24598 commits

Author SHA1 Message Date
Brian Paul
5dbedf3d7e softpipe: additional assertions 2009-09-22 16:59:28 -06:00
Brian Paul
0670df5cb2 softpipe: disable a _debug_printf() 2009-09-22 16:42:15 -06:00
Keith Whitwell
fe9ca0f718 softpipe: need to write depth/stencil values even when stencil fails 2009-09-22 20:47:37 +01:00
Keith Whitwell
207764894b softpipe: set quad->facing value 2009-09-22 20:47:07 +01:00
Keith Whitwell
b1139e9ad8 softpipe: fix polygon stipple 2009-09-22 19:38:34 +01:00
Keith Whitwell
b626176f06 softpipe: fix occlusion counting 2009-09-22 19:26:08 +01:00
Keith Whitwell
67d4a5b15c mesa/swrast: use one fewer divide in swrast's choose_cube_face also
Same change as for softpipe
2009-08-24 08:26:33 +01:00
Keith Whitwell
fd19e8adcd softpipe: use one fewer divide in sample_cube
GCC won't do this for us.  Makes a bigger difference to cubemap fps
than previous set of compilcated rearrangements.
2009-08-24 08:26:33 +01:00
Keith Whitwell
60adc15ba5 softpipe: separate out 2d and cube img filter functions 2009-08-24 08:26:32 +01:00
Keith Whitwell
81601d85ef softpipe: make the various get_texel routines more similar
Remove arguments, return const float * by default.  Add specialized 3d
versions and remove 3d texture support from the others.
2009-08-24 08:26:17 +01:00
Keith Whitwell
75312b6555 progs/demos: add fps output to cubemap 2009-08-23 23:53:41 +01:00
Keith Whitwell
153e474d22 softpipe: lift tex_address construction up to img_filter
For fastpaths at least, can avoid recalculating this sometimes.
2009-08-23 13:38:10 +01:00
Keith Whitwell
4fe0fc3eba softpipe: remove old prim_setup draw stage
Everything now goes through the draw_vbuf handler, the same as
regular drivers.
2009-08-23 11:22:41 +01:00
Keith Whitwell
47800c572f softpipe: add missing header 2009-08-23 11:13:20 +01:00
Keith Whitwell
7670102468 Merge branch 'tex-tilecache' into softpipe-opt
Conflicts:
	src/gallium/drivers/softpipe/sp_state_derived.c
	src/gallium/drivers/softpipe/sp_state_sampler.c
	src/gallium/drivers/softpipe/sp_tex_sample.c
	src/gallium/drivers/softpipe/sp_tex_sample.h
	src/gallium/drivers/softpipe/sp_tile_cache.c
2009-08-23 10:23:46 +01:00
Brian Paul
0f24886f92 softpipe: remove duplicate #include, move another 2009-08-21 14:07:37 -06:00
Brian Paul
d204659c8c softpipe: remove tex sample dependencies on softpipe
The texture sampling code doesn't really have any dependencies on the
rest of softpipe, just the tile cache.
2009-08-21 14:04:51 -06:00
Brian Paul
3adc8c3779 softpipe: minor code refactoring to remove softpipe/tile cache dependencies
The tile cache code now has no hard dependencies on softpipe.
2009-08-21 14:01:58 -06:00
Brian Paul
4256c5829f softpipe: remove unused #includes, white-space clean-up 2009-08-21 13:47:50 -06:00
Brian Paul
46fbc87288 softpipe: remove unneeded const qualifier 2009-08-21 13:45:16 -06:00
Brian Paul
a29447c33d softpipe: per-unit sampler varients
Can't share sampler varients across multiple tex units because the texture
pointer is in the sampler varient.  That prevents different textures per unit.

Fixes progs/demos/multiarb, progs/glsl/samplers, etc.
2009-08-21 12:44:04 -06:00
Brian Paul
87ec83afd5 softpipe: add missing PIPE_TEXTURE_CUBE case in get_lambda_func()
Fixes progs/demos/cubemap
2009-08-21 11:47:31 -06:00
Keith Whitwell
ecfa8be150 softpipe: add missing sp_sampler_varient_destroy 2009-08-21 18:44:56 +01:00
Brian Paul
cf102b031e softpipe: remove redundant comparison, make test easier to understand 2009-08-21 11:43:48 -06:00
Brian Paul
41483627f0 softpipe: fix min/mag filter typo 2009-08-21 11:41:29 -06:00
Brian Paul
4e5c385d21 softpipe: fix s/t/p typos 2009-08-21 11:40:33 -06:00
Keith Whitwell
4fc7d0345a softpipe: rework texture sampling code
Split into component pieces, stitch together at runtime using function
pointers.  Make it possible to utilize the existing fastpaths as image-level
filters for generic mip-filtering routines.

Remove special case for rectangle filtering, as it can now be handled by
the 2d path.

As most of the mesa demo texturing was already covered by fast paths, its
harder to find examples of speedups, but tunnel gets a boost as mip-nearest
filtering is now able to access the img_2d_linear_wrap_POT functions
for sampling within a mipmap level.
2009-08-21 18:14:19 +01:00
Keith Whitwell
b1cc196e6d util: add util_is_power_of_two function 2009-08-21 18:07:35 +01:00
Keith Whitwell
00c8359182 softpipe: allow the existing sampler routines to be hooked up directly
Let eg. sp_get_samples_rect be hooked directly in as the tgsi sampler
routine.

Add a field to determine whether this is a vertex or fragment sampling
call, and massage parameters to match the tgsi call.
2009-08-20 18:36:57 +01:00
Keith Whitwell
0d9979d9ec softpipe: fix xpot calculation typo in sp_get_samples_2d_nearest_clamp_POT 2009-08-20 18:13:25 +01:00
Keith Whitwell
1fd40e506c softpipe: slightly optimized tiling calculation 2009-08-20 18:12:44 +01:00
Keith Whitwell
79a7ddb57a softpipe: fix glitch in texel lookups on fastpaths
Fixes two issues - firstly for mipmap levels with one or more
dimensions smaller than tilesize, the code was sampling off the edge
of the texture (but still within the tile).

Secondly, in the linear_mipmap_linear case, both the default code and
new fastpath were incorrect.  This change fixes the fastpath and adds
a comment to the default path, which still needs to be fixed.
Basically the issue is that the coordinates in the smaller texture
level are/were being computed by just dividing thecoordinates from the
larger texture level by two, as in:

               x0[j] /= 2;
               y0[j] /= 2;
               x1[j] /= 2;
               y1[j] /= 2;

The issues with this are signficant.  Initially x1 is most often equal
to x0+1, but after this, it will likely be equal to x0, so we will not
actually be performing the linear blend within the smaller mipmap.

The fastpath code avoided this (recalculated x1), but was still using
the weighting factors from the larger mipmap level (xw, yw), which
were incorrect.

Change the fastpath code to do two full, independent linear samples of
the two mipmap levels before blending.  The default code needs to do
the same thing.
2009-08-20 17:59:39 +01:00
Keith Whitwell
4f409da345 softpipe: optimized path for simple mipmap sampling
linear-mip-linear-repeat-POT sampling faspath, provides a very nice
speedup to apps that do this common type of texturing.

Test case: demos/terrain, turn fog off, turn texturing on.
Without patch: 12 fps
With patch: 20 fps.
2009-08-20 11:25:20 +01:00
Keith Whitwell
c84abe36a9 softpipe: fix typo in clear_tile 2009-08-18 16:55:10 +01:00
Keith Whitwell
80c78472ad softpipe: split texture and surface tile caches
These do similar jobs but with largely disjoint code.  Will want
to evolve them separately going forward.
2009-08-18 16:55:10 +01:00
Keith Whitwell
d12bae9368 softpipe: move flatshade-first check out of loop 2009-08-18 16:21:12 +01:00
Keith Whitwell
99ec78d946 Revert "softpipe: rearrange blend fastpaths"
This reverts commit 1295cf423e.

The original formulation was easier to understand & work with.  Will
revisit this later.
2009-08-11 18:23:28 +01:00
Keith Whitwell
da319095f2 softpipe: reduce textual differences between exec and sse shader paths
Unshare one function (setup_pos_vector) as we want to push this code
into the generated shader in the SSE case.
2009-08-11 18:06:16 +01:00
Keith Whitwell
b5c389721a softpipe: remove gallivm fragment shaders
However we do llvm integration, it will be different & more comprehensive
than this.
2009-08-11 18:03:01 +01:00
Keith Whitwell
95f7ed4638 softpipe: setup quad outputs from with fs->run 2009-07-30 11:59:32 +01:00
Keith Whitwell
1295cf423e softpipe: rearrange blend fastpaths 2009-07-30 11:35:50 +01:00
Keith Whitwell
73a6178a73 softpipe: add depth-lequal z16 path 2009-07-30 11:35:08 +01:00
Keith Whitwell
572c2fb5bb softpipe: remove unused variable in shade_quad 2009-07-30 11:34:36 +01:00
Keith Whitwell
5fdac2dcea softpipe: fix off-by-one in nearest texcoord routines
Stray '- 0.5' copied from linear versions.
2009-07-27 15:51:15 +01:00
Keith Whitwell
6142de393f softpipe: example fast paths for simple samplers
All these fastpaths are examples of the types of things we'd code-generate
in a more sophisticated version of softpipe.
2009-07-27 12:44:58 +01:00
Keith Whitwell
c611458205 softpipe: fastpath for interpolated z16 less depthtesting
Because this is interpolated (ie. early) depth, we can build in an
assumption about the quads emitted by triangle setup, ie that they
are actually linear spans.  Interpolate z over those spans in z16
format to save on math & conversion.
2009-07-27 12:11:16 +01:00
Keith Whitwell
1078844d18 softpipe: cope with nr_cbufs == 0
Disable blend code when no color buffer
2009-07-27 11:23:51 +01:00
Keith Whitwell
bac8e34c9e softpipe: move all depth/stencil/alpha pixel processing into one stage 2009-07-27 08:17:45 +01:00
Keith Whitwell
85613cc4f1 softpipe: fix error in scissor state dependencies 2009-07-25 11:01:48 +01:00
Keith Whitwell
ade8984f50 softpipe: cleanup framebuffer state routine slightly 2009-07-25 10:01:06 +01:00