[Bug 15334] Radeon EXA + Sampling off the edge of REPEAT_NONE sources

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Apr 4 21:52:05 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=15334





--- Comment #6 from Owen Taylor <otaylor at redhat.com>  2008-04-04 21:52:05 PST ---
Hmm, it took me drawing some pictures and working out the different cases
for edges and corners, but the "crazy idea" is actually exact.

(It's not obvious because modulation with alpha and bilinear filtering
can't generally be swapped  .. it works here because at the edges where
we are modulating with alpha the color is constant)

As far as I can see, other than creating a temporary alpha surface the
size of the source (which seems prohibitive) the main win of the idea
is making it simpler to implement the correct behavior with a shader ...
instead of having to implement the bilinear filtering from scratch
in the shader, you just have to sample the texture normally than 
multiply it by, say:

 clamp(0.5 + (s * width), 0, 1) *
 clamp(0.5 + ((1-s) * width), 0, 1) *
 clamp(0.5 + (t * height), 0, 1) *
 clamp(0.5 + ((1-t) * height), 0, 1)

But back to more immediately to this patch - how would you prefer to see
the test for "source has alpha" be done? I chose to use the pixman macros
because AFAIK they are as public as the pixman format constants that we use
in this file and the test was simple and compact that way.

(Yes, that should be alpha=0, I'll do a new rev of the patch that fixes
up both at once.)


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the xorg-driver-ati mailing list