Navigate to the top level

Texcoord_carryover

Description
Tests the behavior when a texture stage consumes a texture coordinate that the vertex shader never wrote.
This test investigates behavior observed in "Driv3r"
https://github.com/xemu-project/xemu/issues/1614
The game draws with texture stage 3 in cube map mode, but its vertex shader never writes oT3.
These tests check whether an unwritten texture coordinate output keeps a stale value from previously processed vertices (as is the case for the fog coordinate, see
FogCarryoverTests
) or uses a fixed default. The behavior of a cube map lookup with a zero length direction is covered separately by TextureCubemapTests::CubemapZeroVector.
The "Stage*" tests render the texture coordinate directly as a color (texture shader mode PASS_THROUGH, with the combiner outputting TEX), so any carried value is visible without any texture lookup. Each row uses a different submission mode: IB (inline buffer), IE (inline elements), IA (inline array), DA (draw arrays). Quads are used except by PerVertex, which uses points so that no interpolation occurs. is 3 (the Driv3r case) or 0 (to see whether oT0 behaves like oT3).
Observations from HW:
Unwritten texture coordinate outputs do not carry over. In every test, every quad and point drawn with a shader that does not write oT0 or oT3 renders black, regardless of the values written by the preceding draws. Not writing a texture coordinate from the vertex shader results in (0, 0, 0) for that coordinate.
Unwritten texture coordinate outputs do not carry over. In every test, every quad and point drawn with a shader that does not write oT0 or oT3 renders black, regardless of the values written by the preceding draws. Not writing a texture coordinate from the vertex shader results in (0, 0, 0) for that coordinate.
Suite class def

Stage0Constant

As Stage3Constant, for oT0 using texture stage 0.

Image with alpha
Test result for Texcoord_carryover::Stage0Constant
Image as seen on display
No alpha test result for Texcoord_carryover::Stage0Constant

Stage0PerVertex

As Stage3PerVertex, for oT0 using texture stage 0.

Image with alpha
Test result for Texcoord_carryover::Stage0PerVertex
Image as seen on display
No alpha test result for Texcoord_carryover::Stage0PerVertex

Stage0Reprime

As Stage3Reprime, for oT0 using texture stage 0.

Image with alpha
Test result for Texcoord_carryover::Stage0Reprime
Image as seen on display
No alpha test result for Texcoord_carryover::Stage0Reprime

Stage3Constant

For each draw mode, the left quad is drawn twice (so that every vertex output buffer is covered) with a shader that writes oT3 = (0.25, 0.5, 0.75, 1.0) for every vertex. The right quad is then drawn with a shader that does not write oT3. Texture stage 3 is in PASS_THROUGH mode and the combiner outputs TEX3, so each quad shows its texture coordinate as a color. The right quad matches the left if oT3 carries over from the previous draw.

Image with alpha
Test result for Texcoord_carryover::Stage3Constant
Image as seen on display
No alpha test result for Texcoord_carryover::Stage3Constant

Stage3PerVertex

For each draw mode, draws 12 points on the top row with oT3 taken from a per-vertex attribute (12 distinct colors), then 12 points in the same columns on the bottom row with a shader that does not write oT3. Each point shows its texture coordinate as a color, so the color of a bottom point identifies the primed vertex it inherited from, if any (e.g., the six vertex round robin pattern observed for fog in

Image with alpha
Test result for Texcoord_carryover::Stage3PerVertex
Image as seen on display
No alpha test result for Texcoord_carryover::Stage3PerVertex

Stage3Reprime

For each draw mode, the left quad is drawn twice with oT3 = (1.0, 0.25, 0.0, 1.0), the middle quad twice with oT3 = (0.25, 0.5, 0.75, 1.0), then the right quad is drawn with a shader that does not write oT3. Each quad shows its texture coordinate as a color. The right quad matches the middle quad if oT3 carries over from the most recent draw.

Image with alpha
Test result for Texcoord_carryover::Stage3Reprime
Image as seen on display
No alpha test result for Texcoord_carryover::Stage3Reprime