Commit Graph

24568 Commits

Author SHA1 Message Date
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 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
Keith Whitwell a2f7ab1d15 softpipe: move all color-combine code into sp_quad_blend.c
Consolidate the read-modify-write color combining code from
the blend, colormask and output stages.
2009-07-24 20:19:18 +01:00
Keith Whitwell 42f1757189 softpipe: fix typo 2009-07-24 20:18:52 +01:00
Keith Whitwell 333ec94380 softpipe: example fastpaths in blending 2009-07-24 18:46:17 +01:00
Keith Whitwell a1dbd7aa15 softpipe: actually pass >1 quad from triangle routine
First attempt
2009-07-24 18:17:05 +01:00
Keith Whitwell ab9fb51670 softpipe: expand quad pipeline to process >1 quad at a time
This is part one -- we still only pass a single quad down, but
the code can now cope with more.  The quads must all be from the same
tile.
2009-07-24 16:49:35 +01:00
Keith Whitwell 6153a1c28f softpipe: rip out old mulithread support 2009-07-24 16:12:48 +01:00
Keith Whitwell 93a026d4ba softpipe: avoid flushing depth buffer cache on swapbuffers
There's no need to push out depth buffer contents on swapbuffers.

Note that this change doesn't throw away depth buffer changes, it simply
holds them in the cache over calls to swapbuffers.  The hope is
that swapbuffers will be followed by a clear() which means in that case
we won't have to write the changes out.
2009-07-23 11:14:39 +01:00
Keith Whitwell 19097907ef softpipe: also shortcircuit non-texture tile lookups 2009-07-23 09:35:33 +01:00
Keith Whitwell f911c3b989 softpipe: shortcircuit repeated lookups of the same tile
The sp_tile_cache is often called repeatedly to look up the same
tile.  Add a cache (to the cache) of the single tile most recently
retreived and make a quick inline check to see if this matches the
subsequent request.

Add a tile_address bitfield struct to make this check easier.
2009-07-22 15:08:42 +01:00
Keith Whitwell 13e2d35764 softpipe: remove unused vars in sp_setup.c 2009-07-22 12:48:01 +01:00
Keith Whitwell 0ed99f4552 softpipe: use bitwise logic to setup quad masks in sp_setup 2009-07-22 12:48:00 +01:00
Keith Whitwell 73e7356385 softpipe: simplify flush_spans
No loss of performance, but simpler code.
2009-07-22 12:48:00 +01:00
Keith Whitwell b5d583efef softpipe: make some small steps to flush texture cache less frequently
No performance gain yet, but the code is a bit cleaner.
2009-07-22 12:48:00 +01:00
Keith Whitwell 07bb026900 gallium/xlib: use XSHM for swapbuffers
Makes some difference, but suprisingly little.  Barely worth the effort.
2009-07-22 12:47:59 +01:00
Keith Whitwell 0ac879dca7 util: _debug_printf should print even when DEBUG is not defined
The leading underscore is meaningful...  This function is used by
_warning and _error functions as well as the more common
debug_printf().

debug_printf (without underscore) gets turned off when DEBUG is
disabled, but warning/error messages still use this function to get
their message out.
2009-07-22 12:47:59 +01:00
Keith Whitwell aa5db68438 softpipe: remove backwards dependency from tilecache to softpipe
The tile cache is a utility, it shouldn't know anything about the
entity which is making use of it (ie softpipe).

Remove softpipe parameter to all the tilecache function calls, and
also remove the need to keep a softpipe pointer in the sampler structs.
2009-07-22 12:47:59 +01:00
Keith Whitwell ede9f3b52e gallium: remove multiple aliases for TGSI opcodes
This is a source of ongoing confusion.  TGSI has multiple names for
opcodes where the same semantics originate in multiple shader APIs.

For instance, TGSI includes both Mesa/GLSL and DX/SM30 names for
opcodes with the same semantics, but aliases those names to the same
underlying opcode number.

This makes it very difficult to visually inspect two sets of opcodes
(eg in state tracker & driver) and check if they implement the same
functionality.

This patch arbitarily rips out the versions of the opcodes not currently
favoured by the mesa state tracker and leaves us with a single name
for each distinct operation.
2009-07-22 12:42:09 +01:00
Keith Whitwell fd31f92cea gallium: simplify tgsi_full_immediate struct
Remove the need to have a pointer in this struct by just including
the immediate data inline.  Having a pointer in the struct introduces
complications like needing to alloc/free the data pointed to, uncertainty
about who owns the data, etc.  There doesn't seem to be a need for it,
and it is unlikely to make much difference plus or minus to performance.

Added some asserts as we now will trip up on immediates with more
than four elements.  There were actually already quite a few such asserts,
but the >4 case could be used in the future to specify indexable immediate
ranges, such as lookup tables.
2009-07-22 12:42:09 +01:00
Richard Li 5e3c62b550 r600: fix dst reg indexing for real
This fixes segfaults in apps like teapot and tunnel
2009-07-21 17:56:06 -04:00
Alex Deucher 7edb2a9eef Revert "r600: fix dst reg indexing"
This reverts commit cc893d9a98.

Richard has the proper fix.
2009-07-21 17:44:36 -04:00
Alex Deucher 72a3d8845f r600: add stencil support 2009-07-21 17:10:54 -04:00
Alex Deucher db0160bb9d r600: use state functions to set default state 2009-07-21 17:10:54 -04:00
Alex Deucher bd62cd735f r600: fill in point functions 2009-07-21 17:10:54 -04:00
Alex Deucher 5a615e7e65 r600: set provoking vertex to last vertex for OGL 2009-07-21 17:10:54 -04:00
Alex Deucher 60787df1e5 r600: fill in r700UpdateViewportOffset 2009-07-21 17:10:53 -04:00
Alex Deucher 549b8e6f1a r600: first pass at polyoffset support
not working yet
2009-07-21 17:10:53 -04:00
Jerome Glisse 7247446ba8 radeon: fix colorbuffer pitch emission regarding tiling in KMS/CS case
We need to emit a relocation for pitch register so that kernel can
check and properly setup tiling on the color buffer.
2009-07-21 21:14:19 +02:00
Alex Deucher ecead30111 R600: fix up some build problems 2009-07-21 11:09:05 -04:00
Alex Deucher 9e6d38f8a2 r600: add alpha test support 2009-07-21 10:53:20 -04:00
Michel Dänzer cf24119d38 Track Radeon driver symlinks in Git. 2009-07-21 10:47:42 +02:00