[Bug 31810] r600g: Sampling from an alpha texture in a fragment shader

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Nov 21 06:53:37 PST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=31810

Owen Taylor <otaylor at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #40447|0                           |1
        is obsolete|                            |

--- Comment #1 from Owen Taylor <otaylor at redhat.com> 2010-11-21 06:53:37 PST ---
Created an attachment (id=40449)
 View: https://bugs.freedesktop.org/attachment.cgi?id=40449
 Review: https://bugs.freedesktop.org/review?bug=31810&attachment=40449

Slightly simpler version of Piglit test

Here's a slightly simpler version of the test (gets rid of multiplying by a
color)

I'm a little reluctant to provide any of the results of my experiments trying
to understand this, since I'm still confused and maybe will just confuse
anybody following on, but in the SQ_TEX_WORD1 generated from:

 0: TEX TEMP[0], IN[0], SAMP[0], 2D

If I manually tweak the DST_SEL_X/DEST_SEL_Y/DEST_SEL_Z/DEST_SEL_W I see the
following results for the loaded stored into the temporary:

 Sel  Result
 xyzw xyzw
 ---------
 1000 1000
 0100 0100
 0010 0010
 0001 0001

 0w00 0000
 0w01 0001

 100w 1001
 1w00 1100 (example A)

 w000 w000
 w001 w001
 ww01 ww01 (example B)
 w100 w100
 w00w w00w

So, in the marked example A above, if I set DST_SEL_X to SQ_SEL_1 and DST_SEL_Y
to SQ_SEL_W and DST_SEL_Z and DST_SEL_W to SQ_SEL_0, then I end up with a value
that has 1's for x and y, and 0's for z and w.

Possibly wrong interpretation: In all the cases above what you an observe is
that the value of a component is the same as if you first replaced w with the
value selected by DST_SEL_X and then applied the actual selector.

So, DST_SEL_Y=SQ_SEL_W in example A gave us 1 because DST_SEL_X=SQ_SEL_1, but
in example B it gave us w because DST_SEL_X=SQ_SEL_1.

This might have something to do with the interaction with the swizzle inherent
to the A8 texture format that sets X,Y,Z=0 and W=X. That would match up with
this only occurring for A8 textures and not for RGBA textures.  but I don't
understand why a swizzle at texture load time would cause the selectors from
INST_TEX to have a double effect. Anyways, I'm still confused. I don't really
have time to work on this more, but if it isn't obvious, then one possible
approach would be to compare the bytecode and texture setup of the classic
driver (which works for this) to what the gallium driver is doing.

Oh, and I should mention that I did my testing on an RV710, in case it's a
r6xx/r7xx difference.

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


More information about the dri-devel mailing list