[2/2] wined3d: wined3d: Take abs() of vertex z coordinate as FFP fog coordinate

Stefan Dösinger stefandoesinger at gmail.com
Tue Oct 28 06:57:27 CDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 2014-10-28 00:44, schrieb Joachim Priesner:
> +        {0, D3DFOG_NONE,   D3DFOG_LINEAR, C_UNFOGGED, C_HALF_FOGGED, C_HALF_FOGGED, C_FOGGED},
> +        {0, D3DFOG_LINEAR, D3DFOG_LINEAR, C_UNFOGGED, C_HALF_FOGGED, C_HALF_FOGGED, C_FOGGED},
> ...
> +    /* We are using an affine projection matrix, so pixel fog assumes fog start and end
> +     * to be in device space coordinates. Pixel fog will therefore be calculated from
> +     * z=-1 to z=1, whereas vertex fog will be calculated from z=0 to z=1. */
> +    start.f = 0.0f;
> +    end.f = 1.0f;
I think this comment is wrong. In d3d normalized Z coordiantes go from 0.0 to 1.0. In GL (sans GL_ARB_clip_control) they go from -1.0 to 1.0. The fog results above agree with this - otherwise you'd get C_UNFOGGED for table fog in the middle of the quad with the given projection matrix and fogstart and end.

Strictly speaking you don't have to set start = 0, end = 1, those are the default values. A comment stating that is enough.

> +        {0, D3DFOG_NONE,   D3DFOG_LINEAR, C_UNFOGGED, C_HALF_FOGGED, C_HALF_FOGGED, C_FOGGED},
> +        {0, D3DFOG_LINEAR, D3DFOG_LINEAR, C_UNFOGGED, C_HALF_FOGGED, C_HALF_FOGGED, C_FOGGED},
> +        {0, D3DFOG_LINEAR, D3DFOG_NONE,   C_FOGGED,   C_UNFOGGED,    C_FOGGED,     C_FOGGED},
> +        {0, D3DFOG_NONE,   D3DFOG_NONE,   C_FOGGED,   C_FOGGED,      C_FOGGED,      C_FOGGED},
There's a space missing in line 3.

Otherwise this patch looks good to me. It also passes on my Radeon X1600 GPU. I didn't retest the HD 5770, I assume it passes there as well. I also tested it on Vista with my GeForce 7400, it works as expected.

The Radeon 9000 GPU crashes on the vs1 ("non-foggy") + table fog tests. The other non-foggy shader tests run, but don't pass. I have attached the output in case you're interested, but otherwise don't bother about this. If I have time some day I'll try to find out where the driver's limitations are. I guess it's generally broken when fog is on and the shader does not write a fog coordinate. This is not the only fog-related problem on this card on Windows.

Thanks again for your hard work. I hope I didn't miss anything this time :-)

Cheers,
Stefan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJUT4SlAAoJEN0/YqbEcdMwYKoP/0UgSvtbxdM2sTto3Fmtl5dB
fHvudTRqxQJs/7ymaxcoknGOwgY8iyu4UB0lQ1vWgIG0kJAI3QK351AujXTEG2bm
Rbke87C//kTyb8DRMRYvpA05BnF1eMMtzZXD/+d1CDp8xqnUEwpdsCUz+5ZMymrk
z07+zmGyq6t7XKVT4yvVA58dkIB5FuJQ/XS7mkiJ+267A+ZN+odnFGrMP/rT/jnE
x/ySDcOatBsZ94LpsYqSLQH33COki+ngD2H0qAQG33Y1UAQnRb7l5g/fFwrs8vqS
o5P8Hq5zEKjyjfP9Gr/BdVUjLgNurTLrpgs7T06XwMGeVJvQV2HyEIffXjrKUsqg
T2H4fJaa9DHyehm+zB7YRdk+QKr0ibODA8/AG+m85nmcUFK7TZY0n+OMEHdwR8xk
g6pr01zw4mJg7bJZE+uVdLwNuWA/BhTsxCrjphI9GAUf7VVr/VdaZC30m2p7lTsn
rtH7vjh/UEBZg8vGwVgkpHNwaop8Cr1sfXH+uy4K6F1O/j+oLH0qpP15PCRkPqq4
HF39Lnj0/JYuI6Ak7M70K8Qw6ExP6KDs9KL9rn2znsomtPYRfkRyLe2uUCjeBHNz
OfCWB8zQUrYfV9VCmK77rNgqui7+/Nyb7+MODwbnkkgBIOF/dao7WNYz501Cubee
Ab85oRdj1ReT91QW2Awt
=k/GT
-----END PGP SIGNATURE-----
-------------- next part --------------
visual.c:5420: Driver string: "ati2dvag.dll"
visual.c:5421: Description string: "Mobility Radeon 9000"
visual.c:5424: Driver version 6.14.10.6614
visual.c:997: Test failed: fog vs1 ps0 fvm3 ftm0, y=120: got left color 00fd0200, expected 0000ff00+-5%
visual.c:1014: Test failed: fog vs1 ps0 fvm3 ftm0, y=360: got middle color 007f8000, expected 0000ff00+-5%
visual.c:1020: Test failed: fog vs1 ps0 fvm3 ftm0, y=360: got right color 00fe0100, expected 0000ff00+-5%
visual.c:1020: Test failed: fog vs1 ps1 fvm3 ftm0, y=120: got right color 00fd0200, expected 0000ff00+-5%
visual.c:997: Test failed: fog vs1 ps1 fvm3 ftm0, y=360: got left color 00ff0000, expected 0000ff00+-5%
visual.c:1014: Test failed: fog vs1 ps1 fvm3 ftm0, y=360: got middle color 00ff0000, expected 0000ff00+-5%
visual.c:1020: Test failed: fog vs1 ps1 fvm3 ftm0, y=360: got right color 00ff0000, expected 0000ff00+-5%
visual.c:997: Test failed: fog vs1 ps0 fvm0 ftm0, y=120: got left color 00fd0200, expected 0000ff00+-5%
visual.c:1014: Test failed: fog vs1 ps0 fvm0 ftm0, y=360: got middle color 007f8000, expected 0000ff00+-5%
visual.c:1020: Test failed: fog vs1 ps0 fvm0 ftm0, y=360: got right color 00fe0100, expected 0000ff00+-5%
visual.c:997: Test failed: fog vs1 ps1 fvm0 ftm0, y=120: got left color 00ff0000, expected 0000ff00+-5%
visual: 348 tests executed (0 marked as todo, 11 failures), 0 skipped.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.txt.sig
Type: application/pgp-signature
Size: 543 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141028/0685f72a/attachment.sig>


More information about the wine-devel mailing list