Commit Graph

45 Commits

Author SHA1 Message Date
José Fonseca
48ce928900 softpipe: Fix rgb_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE.
We must multiply the factor against the destination, not the source.

NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
Marek Olšák
fd3219962d softpipe: initialize quadColor2 to fix compile warnings 2012-10-09 01:14:24 +02:00
Dave Airlie
4b1c3b920e softpipe: add dual source blending support
This adds support for a single dual source blending MRT to softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Tom Stellard
6b63e25b3d gallium: Prefix #defines in tgsi_exec.h with TGSI_ 2012-01-30 13:37:00 -05:00
Dave Airlie
0fe2b397bb softpipe: enable clamping control
This enables fragment clamping in softpipe, it passes more
tests than it did previously with no regressions, There are still
a couple of failures in the SNORM types to investigate.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Morgan Armand
0a0d820f7b softpipe: don't clamp or do logical operations on floating-point buffers.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-08 08:36:39 -07:00
Brian Paul
3edbce32fb softpipe: use consistent indentation in sp_quad_blend.c 2011-09-15 16:18:14 -06:00
Brian Paul
a7109a3199 softpipe: fix blending for luminance/intensity surfaces
If we're drawing to a luminance, luminance/alpha or intensity surface
we have to adjust (rebase) the fragment/quad colors before writing them
to the tile cache.  The tile cache always stores RGBA colors but if
we're caching a L/A surface (for example) we need to be sure that R=G=B
so that subsequent reads from the surface cache appear to return L/A

We previously had a special case for RGB (no alpha) surfaces.  This
change generalizes that for the other base formats.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40408, but sRGB
formats are still failing.  That'll be addressed in a later patch.
2011-09-15 11:31:55 -06:00
Brian Paul
ec22b75be1 softpipe: implement blend color clamping
Per the GL spec, clamp incoming colors prior to blending depending on
whether the destination buffer stores normalized (non-float) values.
Note that the constant blend color needs to be clamped too (we always
get the unclamped color from Mesa).

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40412
2011-09-14 08:15:59 -06:00
Eric Anholt
f79e3518b4 softpipe: When doing write_all_cbufs, don't stomp over the color.
We have to make it through this loop processing the color multiple
times, so we can't go overwriting it on our first color buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-28 17:32:42 -07:00
Younes Manton
ac6455e9a2 gallium/softpipe: Don't clobber dest color/alpha before masking.
The blend_quad function clobbers the actual render target color/alpha
values while applying the destination blend factor, which results in
restoring the wrong value during the masking stage for write-disabled
channels.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-23 17:13:44 -04:00
Brian Paul
c534f11164 softpipe: implement fragment shader variants
We'll need shader variants to accomodate the new polygon stipple utility.
2011-07-21 09:57:37 -06:00
Brian Paul
4736c0ba86 softpipe: use tgsi_shader_info fields for fragcoord origin, center, etc. 2011-07-21 09:57:37 -06:00
Dave Airlie
2f4860f2ab softpipe: add support for color writes all color bufs property 2010-12-24 07:19:57 +10:00
Brian Paul
7a5a0b205e softpipe: fix incorrect blend func index passed to blend_quad()
Need to pass the index indicating which blend terms to use, not which
color buffer we're blending into.

Rename the parameter to blend_quad() and add comments to be more clear
about this.
2010-07-02 09:56:57 -06:00
Brian Paul
fbc6c316d2 softpipe: better assertions 2010-07-02 09:53:08 -06:00
José Fonseca
4885cd4ff7 softpipe: Fix alpha blending for formats without alpha channel.
Don't use the dst alpha channel from the tile cache when it does not
exist in the true format.
2010-05-03 00:13:36 +01:00
Brian Paul
0eea33b069 softpipe: index the correct blend/mask state index
Need to check pipe_blend_state::independent_blend_enable to determine
which render target/index to use when checking blend enable and colormask
state.

This is part of the fix for piglit/fbo-drawbuffers
2010-04-05 11:00:54 -06:00
Roland Scheidegger
9b346f83a7 Merge commit 'origin/perrtblend'
Conflicts:
	src/gallium/drivers/softpipe/sp_screen.c
	src/gallium/include/pipe/p_defines.h
2010-01-28 17:23:58 +01:00
Roland Scheidegger
df4395198c softpipe: enable new blend functionality
works with tests/drawbuffers2
2010-01-25 20:20:52 +01:00
Roland Scheidegger
4e6bfa6de1 softpipe: adapt to blend changes 2010-01-25 16:39:16 +01:00
Vinson Lee
e3cb614f93 softpipe: Remove unnecessary headers. 2010-01-20 00:08:54 -08:00
Vinson Lee
3a2f96f18a softpipe: Silence unintialized variable warnings. 2009-12-27 18:06:02 -08:00
José Fonseca
67034b9efc softpipe: Implement PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE for destination.
It is a valid and tested combination on D3D9.
2009-11-05 19:44:07 +00:00
Brian Paul
39daa763b5 softpipe: fix multi-drawbuffers regression
This is part of the fix for bug 24401.
2009-10-10 09:24:22 -06: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
1295cf423e softpipe: rearrange blend fastpaths 2009-07-30 11:35:50 +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
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
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
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
Luca Barbieri
6b7b13b5eb softpipe: limit blend results to [0,1] 2009-07-15 11:34:36 -06:00
Brian
7925274da3 softpipe: rename sp_headers.h to sp_quad.h
This header describes the quad-related datatypes afterall.
2009-02-11 21:33:59 -07:00
Brian
ed6f41e2f4 softpipe: rename sp_quad.[ch] -> sp_quad_pipe.[ch]
Be more consistant with 'draw' module.
2009-02-11 21:25:10 -07:00
Zack Rusin
2299f21f8d gallium: standardize api on the prefix "nr" 2009-01-27 12:20:25 -05:00
Michal Krol
01f9e51203 softpipe: Split changing fields of quad_header into input, inout and output parts. 2008-09-08 17:25:46 +02:00
Brian Paul
4f25420bdd gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.h
Also, rename p_tile.[ch] to u_tile.[ch]
2008-08-24 17:48:55 -06:00
Brian Paul
809bc8f9ad gallium: move logicop test outside of loop 2008-04-23 11:38:40 -06:00
Brian Paul
2221cb9f74 gallium: fix broken PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE 2008-04-23 11:38:40 -06:00
Brian Paul
f7e475280a gallium: fix bug in PIPE_BLENDFACTOR_INV_DST_ALPHA case 2008-04-09 14:20:43 -06:00
Brian
c7daa68ca3 gallium: begin reworking quad stages for multiple color outputs 2008-04-07 21:59:12 -06:00
José Fonseca
b721bc8792 gallium: WinCE portability fixes. 2008-03-10 14:00:13 +00:00
José Fonseca
b642730be9 Code reorganization: move files into their places.
This is in a separate commit to ensure renames are properly preserved.
2008-02-15 17:45:40 +09:00