iXit / Mesa-3D

Please use official https://gitlab.freedesktop.org/mesa/mesa/ !
https://github.com/iXit/Mesa-3D/wiki
66 stars 13 forks source link

Character models/textures are completely black in Final Fantasy XI #320

Closed svanheulen closed 6 years ago

svanheulen commented 6 years ago

Final Fantasy XI is actually a d3d8 game but I use it with d3d8to9. With wined3d everything works fine but in nine all of the character models are completely black.

I'm using an AMD RX 580 with Mesa 18.2.1 + LLVM 7.

I've uploaded an apitrace to the FTP server in the "major bugs" folder.

If there's any other info I can provide, please let me know.

iiv3 commented 6 years ago

I tried the trace. The bug is present with Mesa 18.3.0-devel (git-cb863de626) and with Radeon HD5670 (Redwoord Evergreen using r600 driver).

iiv3 commented 6 years ago

I picked frame 330 and located the draw operations for the body. The first draw is at 1631472, the last is at 1633461 (the next draw looks like shadow of the character). I recommend talking a look of 1633106, as it draw the last missing peace of the silhouette.

The textures are DXT3 format and are visible in apitrace.

There are no shaders in the frame. All draw operations use fixed functions.

axeldavy commented 6 years ago

I don't have time to investigate it for a few days.

iiv3, if you have time, you can try look at the ff shaders. NINE_DEBUG=all NINE_FF_DUMP=1

Then you replay until the draw call. after the draw call in the log it prints shader keys which can be used in the log to find the initial definition with the TGSI.

axeldavy commented 6 years ago

There was some state aliasing inside our stateblock implementation, and some stateblock was incorrectly setting the materials matrix in had stored (which was empty), and thus it was as if the character was in the dark.

svanheulen commented 6 years ago

Thanks so much! I just tested these patches and it works great :)