Re: [PATCH 6/6] d3d9/tests: Add tests for different YUV texture layouts
Am 11.02.2014 um 12:14 schrieb Martin Storsjo <martin(a)martin.st>:
+#define D3DFMT_YV12 MAKEFOURCC('Y','V','1','2') +#define D3DFMT_I420 MAKEFOURCC('I','4','2','0') +#define D3DFMT_NV12 MAKEFOURCC('N','V','1','2’) There’s no need for global definitions. Other tests that use custom fourccs just use MAKEFOURCC in their code.
+ struct + { + DWORD color1, color2; + DWORD rgb1, rgb2; + } + test_data[] = + { + { 0x000000, 0xffffff, 0x00008800, 0x00ff7dff }, + { 0xff0000, 0x00ffff, 0x004aff14, 0x00b800ee }, + { 0x00ff00, 0xff00ff, 0x000024ee, 0x00ffe114 }, + { 0x0000ff, 0xffff00, 0x00b80000, 0x004affff }, + { 0xffff00, 0x0000ff, 0x004affff, 0x00b80000 }, + { 0xff00ff, 0x00ff00, 0x00ffe114, 0x000024ee }, + { 0x00ffff, 0xff0000, 0x00b800ee, 0x004aff14 }, + { 0xffffff, 0x000000, 0x00ff7dff, 0x00008800 }, + }; Please make this static const. The same applies to the formats[] table.
I’ll look at the details of the test and the other patches later today, when my headache is gone :-\ .
Oh, by the way: Were you able to test the texture rectangle codepath with your test? Am 11.02.2014 um 13:13 schrieb Stefan Dösinger <stefandoesinger(a)gmail.com>:
Am 11.02.2014 um 12:14 schrieb Martin Storsjo <martin(a)martin.st>:
+#define D3DFMT_YV12 MAKEFOURCC('Y','V','1','2') +#define D3DFMT_I420 MAKEFOURCC('I','4','2','0') +#define D3DFMT_NV12 MAKEFOURCC('N','V','1','2’) There’s no need for global definitions. Other tests that use custom fourccs just use MAKEFOURCC in their code.
+ struct + { + DWORD color1, color2; + DWORD rgb1, rgb2; + } + test_data[] = + { + { 0x000000, 0xffffff, 0x00008800, 0x00ff7dff }, + { 0xff0000, 0x00ffff, 0x004aff14, 0x00b800ee }, + { 0x00ff00, 0xff00ff, 0x000024ee, 0x00ffe114 }, + { 0x0000ff, 0xffff00, 0x00b80000, 0x004affff }, + { 0xffff00, 0x0000ff, 0x004affff, 0x00b80000 }, + { 0xff00ff, 0x00ff00, 0x00ffe114, 0x000024ee }, + { 0x00ffff, 0xff0000, 0x00b800ee, 0x004aff14 }, + { 0xffffff, 0x000000, 0x00ff7dff, 0x00008800 }, + }; Please make this static const. The same applies to the formats[] table.
I’ll look at the details of the test and the other patches later today, when my headache is gone :-\ .
On Tue, 11 Feb 2014, Stefan Dösinger wrote:
Oh, by the way: Were you able to test the texture rectangle codepath with your test?
Yes - now I extended the test to use a non-power-of-two texture size, and if I hack out the ARB_TEXTURE_NON_POWER_OF_TWO support (in wined3d/directx.c) the tests fail and crash. // Martin
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-02-11 14:23, schrieb Martin Storsjö:
Yes - now I extended the test to use a non-power-of-two texture size, and if I hack out the ARB_TEXTURE_NON_POWER_OF_TWO support (in wined3d/directx.c) the tests fail and crash. Alright, I guess I should have a look at it.
On which Windows systems(Windows version, GPU) did you test your test? I know that there are plenty of differences in YUV handling, so I'd like to run the tests on some of my Windows installations too. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJS+0r+AAoJEN0/YqbEcdMwqGAP/A68ghy8wMyYn/eioC2T/WbY pA47v2lGAMEZmVhBuJHX9YY+VkjO4l1xd8lPsGtnCs0eNXcoEUtonrs39LSv//w8 VeT2EuVmyl6KboA4uf3gVXKudZRvGmWwMMJmAlzPuTO+Dmll5Sm4bf/fJ0VIDj1c oKUS+D0MRJJPEab0g/irXzJDNIcmHZcXaJ30VaUYgkHx3c+2iRTDUhwKYj4ygxb1 TOA/PpTfn8Y6ZXhY9u8QWK2sSjHfDNA3JTa85CJJ/QyWhJ717/RwXek5MSMFqcml Pb4uit/BoAiddaVSty2esazBjbsa8tC3Mp3a2iTzB60NGMYo4Oh8MV6OiPxMVFH3 fH4lRcQrTZ7kYILLZgoEpgPAAzjPhp2QwRaIK5GzcO4vy4yhQasX09lN/oXAgM93 vTJZzMdcbKqI+OMSMoqbzsH7yeJUXtQXIRB18azK0/Vv/Vo3Oy8j+vJmK8HTe8Cs KqS828yuOJCZAt5s0ZNYguiOYRpkC/1AteULxO9oQYUioWeWZC2KlBME5sdpDTLH pJx0GpIqSwEIIwNBSqa9Pr9Xa2EWrK2bOwCphgkSPAVV2U/RQ7SIroWC8opVBlN+ EU+rFMuV4ASXnDe8u1PU2xGW7Xs4YbjEWoPeU33hF1obqdY0H6RFFH/ZA+rqh61Q tfjvovHdl0ynDaVg+A8p =OpGr -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-02-12 11:20, schrieb Stefan Dösinger:
Am 2014-02-11 14:23, schrieb Martin Storsjö:
Yes - now I extended the test to use a non-power-of-two texture size, and if I hack out the ARB_TEXTURE_NON_POWER_OF_TWO support (in wined3d/directx.c) the tests fail and crash. Alright, I guess I should have a look at it. It looks like I screwed up heightscale handling with my recent surface memory management rework. YUY2 and UYVY are regular block-based formats, but YV12, NV12 and I420 are not.
The block-based properties of those 3 formats (or lack thereof) could use some tests as well. I think I didn't test YV12 when I wrote / updated test_surface_blocks and test_volume_blocks in dlls/d3d9/tests/device.c because none of my cards supported it in d3d9. Maybe that's different with I420 and NV12 - I haven't checked on Windows yet. Ddraw has some YV12 tests in dlls/ddraw/tests/overlay.c. It shows that this format does not use a block-based offset calculation. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJS+069AAoJEN0/YqbEcdMwNAgP/A8tEN/u8cCzQLB+6AHAf2u+ 7NXGlVp/Fg5j3PCxjJZCF2KbRpfB95uw1NdLhK5RsIdMIc1Hp+5yqegCUysLu7hk YDxyg0Vpf7DpT5Dla2VCgRNo1EhdHTTtXCXmMiIcIEbNMnVNNiQFpzSU9LUg3XEc RqfyNHYB1jZL0DsaqjY4IcvKubxlb0biVmZr6+473lAzNYobstZbpQ1Bh/m7Inwk Sqed3dlsasP9C30Bz91M079no5g5sW6kR0Ve8eiXgWEEqAYdqCRUBXxEqRU5n4Fz ZwUj2FNeBgv/uxLqRf5Qc4e0FnbX3CyVrN/Re+Famko+ELze16oQ7azcZXnGx5iw KdBLauQkPP5rg2exl8PeJaJirjjRkm1IAsgWMhzZzZSUQX+rljVtwF6zeZrdQz7u 3TZ2OpmyTkrp33o+HeEHmeK7v6JRuhS6JVFESUDMAJTtc0aXD4R8dqrK+qj0FZVc UM34QRc+i57EAVFIdcIeHWINNe2KWB7sqL62UvITHNEwp2S6nrFlRpUK4AHqtRQ1 YDI/qpTKUDDrNSggJ2bUOsYWzO7UWE19FRy5gWGra3KoamNVYkOSQA06oY2x8+1S /fSf7hs9ZmFj3tSrNet+IiSIWTfSQy9cE3Dwy1Dpc5Ywwl6Gzc06hLH1nCZdeC5N pyFGw3SzvnHEe3BjdImM =pafk -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I sent two patches that should get rid of the texture_rectangle crashes. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJS+1rLAAoJEN0/YqbEcdMwmt0P/A1mB/aCzixb9Anw9NNvOkyL Ued/hk5aKfzC7Fbx3VOGsd1+2UcI5EHUFRTRU0Hxa/GQiG96nxIRXnYxCFfJVPxH nS5iqpRTD4ej8V0LyioID11hbueTARhKYUBCztXDJkglys2hgso2nKmoyzSn+Ftt JvCP5tTCU5abdDSyTxo/ae//1ZnzbzZvEGJ+ZUKNv/vzwXd50vPoTdstip8VnFzQ 8gq405aZ6AzrihfDowthekvO4++81xfZYzpim4HTio1tBJw64OkUbGPWa2UjKoCD mkLbiUbzuCEm5hj/DUbPralzGOl6a6TYoK5xbarQAVetQOKKgtCtt/+4EVvbr2lT lWKVG6ZRmV31bSMzO+ynvr1zzIlQ04RsAZfpI4RHTG9lEfC3OFMKt8Hw57d84Cnw 3jWWroAgmUtxwO3HWWsTyk6EUe8l2oMjgdgjh3bleCiaRJ0xrL8R4otjJR0nQYCQ GLRm6INJgXxMVkRwH7xYz7wKQFavSvgKRkqr3fIgEZ/BwnIiIJJImT0/uO0YWfUX WCUU3nuGIPhJ0nWUx1XoshL4JKYJh1cPwYoFXIxEoFN0YpRUrlpjj5KHEYg4y17V iYCKSmUcLve8NM9/Unj9gK88t+tCCHolhqaYqnQVCDlaef20536TSQ4U8OplLn8c d73F1YfiLxC7/caJzHNa =dp9a -----END PGP SIGNATURE-----
On Wed, 12 Feb 2014, Stefan Dösinger wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I sent two patches that should get rid of the texture_rectangle crashes.
Indeed, things seem to work fine now, and my YUV layout tests do succeed with ARB_TEXTURE_NON_POWER_OF_TWO disabled. Thanks for the prompt fix! // Martin
On Wed, 12 Feb 2014, Stefan Dösinger wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2014-02-11 14:23, schrieb Martin Storsjö:
Yes - now I extended the test to use a non-power-of-two texture size, and if I hack out the ARB_TEXTURE_NON_POWER_OF_TWO support (in wined3d/directx.c) the tests fail and crash. Alright, I guess I should have a look at it.
On which Windows systems(Windows version, GPU) did you test your test? I know that there are plenty of differences in YUV handling, so I'd like to run the tests on some of my Windows installations too.
I didn't really test my test properly on windows yet - how hard is it on a scale to compile and run them there? I only tested it briefly (by ripping out the relevant parts from visual.c and compiling that as a standalone C file without the wine test framework) on windows so far, on a VMware VM with XP, and the direct3d driver there doesn't support either NV12, YV12 nor I420, only UYVY/YUY2 (this is actually my original reason for trying anything of this in wine). The D3D rendering did seem to filter the texture when stretching though, but I chose sampling points within it that should resolve to the right color despite that. So unfortunately I'm not sure how much more I can test it on actual windows... Anyway, I'll resend my patchset with the last fixes from yesterday. // Martin
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-02-12 15:05, schrieb Martin Storsjö:
I didn't really test my test properly on windows yet - how hard is it on a scale to compile and run them there? It's not all that hard. You have 3 options: Install mingw on your linux system to cross-compile the tests with make crosstest. I've installed i686-w64-mingw32-gcc for 32 bit compiles and x86_64-pc-mingw32-gcc for 64 bit ones with Gentoo's tools. (I should probably switch the 64 bit one to mingw-w64 as well...)
The other option is to install mingw and msys on Windows and compile it there. That's a bit trickier. The third option is to create an account at testbot.winehq.org. It'll allow you to upload patches and give you a cross-compiled .exe. Actually, there's a fourth option: I have a hacky visual studio build system for the d3d parts of Wine. Tell me if you're interested and I'll write more instructions. You'll need msvc 2013 and it will most likely not work out of the box.
I only tested it briefly (by ripping out the relevant parts from visual.c and compiling that as a standalone C file without the wine test framework) on windows so far, on a VMware VM with XP, and the direct3d driver there doesn't support either NV12, YV12 nor I420, only UYVY/YUY2 (this is actually my original reason for trying anything of this in wine). Ok, I'll run your tests on my Windows boxes then. I've plenty of them for this purpose...
The D3D rendering did seem to filter the texture when stretching though, but I chose sampling points within it that should resolve to the right color despite that. That seems to be a common problem with YUV stretchrect. I'm using the same workaround in the YUY2 / UYVY tests.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJS+4HmAAoJEN0/YqbEcdMwSi4P/0hwyFkF298blerxDwl53km+ TIL82HBqlBV/JtOWDzIod+XnXUsEGDuz+mbRcDhmEbvEgEjtU0ziO+wT8MaQu14x YqfSLww1eURQGXcEpTOHmG8CVxbGrIu9CUF/DhfQEbAK34PQvGRUTt23R7DlWmII HzgXolMTGhIs387sqb7sTutECxsRVMAedhuO+eN4iaPKz9OFH+zoIUVeHiDn/2Kh 5hriL6L8f+y9tU7GUST0eiKbBPX74tooHeLKQtYh8rPkZQonXXVSIGMbzrYGGnaz hWkC9tZ122QhrqnJio3t5aPUWPWZ34Y/mxCTA0chmGOAw0bbDXLn+VRpFGHIIbX/ oWF9spjhyO3u0dBbMSfvEnQtU2vdp3cHu6TyQ2ObLiNHESdGq+t4HPo19hhmohOO cNiRqWDzfO5NizVDgyTyoHxq0IpVXWy/czaZ0KHI7fBlixj77/doQGj5+l70Lmxp KTnnzR1UpOoQnZL9YsnGy8VlzUU0gdMOHTnhZ7FIA+LI2VpeuPvRcCd/Awbxdyni SAIrnGDP2b14+M/Vxj092/VFNAQojUlyjfg7Y5lGkFs6tuhLUF+E9Hn7mPjAgYmo qLKZ/k3XwwBRzMEz1Wm5NVFEmmzKTjIXomNsdAy7uBiP27VW77JhKeb2HF5FmwBf H5jQwN86JTAdWTQe1VSX =8wrY -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-02-12 15:05, schrieb Martin Storsjö:
Anyway, I'll resend my patchset with the last fixes from yesterday. Before you do I'll have a closer look at the stuff I didn't look at yesterday. It shouldn't take long...
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJS+4K8AAoJEN0/YqbEcdMw7VwP/R4pK5DjZ6Edi4kuwU4+PFty r8y6bsNih1pdedxpU4hMFsWRSqv1ZTlpth7vQ48tQIsDaBaw7kI509g94twmAhiB XFwQxIuefiZdd0BiHt/kS9354vZ3ftpCcrjI51DRERyTHl0EPnTMtKNRpLNPeDg2 W2k/oFJpOjqDTqucqeqdj7r52ORaIXy29DqJhfRoho0rQNLFOoGAgSsB48ZggWqo PhGQZPQKFuCMXCdjsLrMv9nq2eIMgS4j+wy5BJISGjqZzVWjzEZ4uweCeb1GO8BL aQwbUmNPxwQD+C5ElIYSX1dhpailinplr0wCITn0MkDHdGXwWP/Z9G8o2Iv3zFRF 9iBIU1xGJkg7gkK1jI2oyONb/v+qJtUqAf4Pys4zoTUxEzTE7Jpuytm/u6PQOVW8 3X4rEK56YQrzWrlP9vNRwWj1BixUiEfGawL28qjBa66xWpLvZxROK0lckA72Si6X XU7LwGGNFh6YkKCSvZHli3/RGTjfKaYF0asCiUqlfyAHuXhtNYe2pth5cEf+S1zR xH/m0xMBP97me3HgxMYbCcPTCueZVdr4o7sje1kRzmaM1+2t8NKSuKzbzLdqlio+ yxBBAnmvuFzXF7ZyNLGQZ7RFkvl1XB5vAFzhFkcfdz2Q6cUNikLv8hSEbnRPZLpI n+zzBnN4VvZa7FfsXldK =EPpG -----END PGP SIGNATURE-----
participants (2)
-
Martin Storsjö -
Stefan Dösinger