[d3d9] FF: Apply transform flags count to generated texture coords
Fixes the bug in Phantasy Star Online that was reported after merging #4015.
I've tested this PR with both Phantasy Star Online apitraces, the Cold Fear apitrace and the Snowblind apitrace. Those were the games that I know were broken at some point because of fixed function texture coordinate processing. On top of that, I ran the Wine FF texcoord tests again and those were fine too.
Tests show that the count out of D3DTSS_TEXTURETRANSFORMFLAGS gets applied to generated texcoords like D3DTSS_TCI_CAMERASPACEPOSITION too.
At the same time, projection only gets applied (or renders something sensible) when used with FVF_XYZ and D3DTTFF_COUNT3 or higher. With lower values it either produces garbage like this:
(FVF_TEXCOORDSIZE1 + FLAGS_COUNT1)
or this:
(FVF_TEXCOORDSIZE2 + FLAGS_COUNT1/2)
https://docs.google.com/spreadsheets/d/1XfSsxl1qMMY0mmpn02l3Wph-6CyXiugcR9wkb0VwJg0/edit?usp=sharing
By writing a test app that uses fixed function vertex processing and a shader that does nothing except output the texcoord, I've now verified that native D3D9 also writes the component that gets used for projection into the w component just like we're doing here.
@nolrinale This PR fixes the ripples.
@nolrinale This PR fixes the ripples.
I just checked it, all working as intended, even the monsters with refraction cloaking too its amazing K0bin thank you so much for your work! now the game is working 100% under Linux/Deck without any graphic bugs left.
Happy 20th Anniversary PSOBB!~
Awesome, thanks for the good bug reports!
Thanks for doing all this :D