iXit / wine-nine-standalone

Build Gallium Nine support on top of an existing WINE installation
GNU Lesser General Public License v2.1
276 stars 23 forks source link

Implement scaling of rendered content to window/screen size #21

Closed Oschowa closed 3 years ago

Oschowa commented 5 years ago

Hi,

currently when using nine to run a game with render resolution < window size the content is not streched/scaled to fill up the window, but only occupies a part of it. This happens with vanilla wine and proton, some examples of what i mean:

Screenshot from 2019-03-27 15-03-11

Screenshot from 2019-03-27 15-06-00

Now i don't know if nine-standalone is the right place to implement this, or if this is even feasible, but this works nicely with dx11 games running through dxvk, so I thought it won't hurt to ask.

edit: forgot to add: this also works with wined3d

dungeon007 commented 3 years ago

I dunno, first thing i would try is to disable decoration in winecfg there or maybe to switch to gdi renderer... who knows what else might collide with someones compositor 🤣

dungeon007 commented 3 years ago

Second thing to try is to build wine without opengl and without xcomposite, to see how that goes. or dunno maybe standalone have to depend and to be build with xcomposite in mind too to be gnome friendly or whatever like that 🤣

axeldavy commented 3 years ago

I can reproduce the mipmap issue with the trace, but I really don't understand what is going wrong. I looked at all states related to mipmap, the instructions, etc. Makes no sense so far.

dungeon007 commented 3 years ago

As i said game have -nomipmap switch, so i could do that trace too if you want... something may came by from such comparison 🤣

axeldavy commented 3 years ago

I have found the issue. The game passes a float as D3DSAMP_MAXANISOTROPY. But it seems that it should be an integer. As a result it should get maximum anisotropy -wined3d passes as is and gl clamps-. And we didn't clamp so the anisotropic state was invalid.

axeldavy commented 3 years ago

This https://github.com/iXit/Mesa-3D/commit/5fc0c748945190635f4aa7624a0ccd7cdc8e0f73 fixes the bad texture quality issue for me.

dungeon007 commented 3 years ago

As i said some filtering looks different 🤣 would try

dungeon007 commented 3 years ago

Looks fine to me too: https://i.postimg.cc/hPFFdn0s/game-fixed.png with anisotropy perf dropped, but still faster than dxvk 🤣

leipero commented 3 years ago

@axeldavy Not sure if this trace of any use to you, for an rendering issue... throws these invalid unsupported format i think, but anyway https://drive.google.com/file/d/15CS8_bq8urJMN6kdUmIcE7jb9Kzx5bsf/view?usp=sharing

What is the command line you used for a trace, I used WINEDEBUG but to get anything useful I end up with multi-gig files? Thanks. You are correct, NFS scaling seems to be GNOME related (not a gnome issue since it happens only when using nine), however, TMNF scaling issue is present on LXDE for example as well.

@axeldavy Compiled mesa with that fix, still nine have very low anisotropy in comparison to WINE D3D or DXVK, I can provide images if needed. I'm thinking of opening new bug report for texture issues in TMNF since it seems unrelated to the NFS HP2 one (https://github.com/iXit/Mesa-3D/commit/5fc0c748945190635f4aa7624a0ccd7cdc8e0f73 did not fixed it).

dungeon007 commented 3 years ago

Well, that max anosotropy works only if you set World Detail to the max. Default is not max. So, if it is default one or one or two steps bellow, it will be like before. At least i checked wined3d and dxvk acts like that, so i guess that only works on world detail manualy set to themax 🤣 So fix should be correct only there and of course trace was from maxed out settings...

dungeon007 commented 3 years ago

I mean, make sure when you comparing there that game does not revert back to its non maxed default there... i spotted that is reverts back to default when i try to do something else 🤣

dungeon007 commented 3 years ago

"You are correct, NFS scaling seems to be GNOME related (not a gnome issue since it happens only when using nine), however, TMNF scaling issue is present on LXDE for example as well." Hm, does that LXDE runs some sort of compositor? If it does, try to break it and check again 🤣

leipero commented 3 years ago

@dungeon007 Ofc. it's set to max, it didn't change settings on it's own, I did not experience that with this game. It's not the DE that is the problem here, it's gallium nine, as I've said already, no other condition behaves that way, so logically, it must be nine doing something different. Can you tell me how did you do trace so I can do it for other game? You can do it as well, it's free game, you can test it.

Anyway, for AF (and potentially shaders), same settings, here it is. gallium nine: 2021-03-19 10-17-59 DXVK (AA disabled for apple to apple comparison): 2021-03-19 10-21-19 Other game. gallium nine: 2021-03-19 10-27-06 DXVK: 2021-03-19 10-28-01

axeldavy commented 3 years ago

Does AMD_TEX_ANISO=16 (it replaces games anisotropy setting) help ?

leipero commented 3 years ago

Does AMD_TEX_ANISO=16 (it replaces games anisotropy setting) help ?

For NFS HP2 it does, it makes it look properly (as it should), for TMNF it doesn't change anything.

dungeon007 commented 3 years ago

NFSHP2 does not look like that for me with a patch applied... that looks to me like either you are running somehow without a patch or on lower settings... i dunno what else could be reallly. 🤣

dungeon007 commented 3 years ago

"For NFS HP2 it does, it makes it look properly (as it should), for TMNF it doesn't change anything." Good. So do a trace of TMNF, you have instructions on the wiki here how that goes: https://github.com/iXit/wine-nine-standalone/wiki/apitrace Other than that, kill it on the affected scene and do it quick and on some lower resolution to not become so big... 🤣

leipero commented 3 years ago

NFSHP2 does not look like that for me with a patch applied... that looks to me like either you are running somehow without a patch or on lower settings... i dunno what else could be reallly.

I'm running older package now, but when I tested it yesterday it had exact same issue, so really, it makes no difference with the patch, I've basically cloned mesa-3D repository where axeldavy commited a fix and built it.

Thanks, will do it now.

dungeon007 commented 3 years ago

So why you showing now pictures without a patch? I dont get that really, but OK anyway 🤣

leipero commented 3 years ago

So why you showing now pictures without a patch? I dont get that really, but OK anyway

Because I removed git version and I have to re-compile it again, it doesn't really matter since it did not change anything for TMNF and NFS HP2 (under assumption I've built it properly), so why would it matter?

dungeon007 commented 3 years ago

Hm, that trace seems look exactly the same here on nine and dxvk. So these looks different for you when you are replaying it on one or another?

dungeon007 commented 3 years ago

Diff on the sides, but still not like on pictures you posted... i expected something like this but what i see is not that... but OK, it could be that i am probably blind... 🤣

leipero commented 3 years ago

Oh, I see, well, if the whole point is to just replay it and see if it happens for you, then I see no purpose of it. The resolution is low, so you might be missing something, here is another one, pay attention on the turbo: https://drive.google.com/file/d/1JIAIGdg2QQo-FdCw2MURw1AhLD4cnIoA/view?usp=sharing

leipero commented 3 years ago

I don't really see a point of this apitrace, it plays exactly the same over nine and DXVK = with poor textures and whatever else is messed up.

axeldavy commented 3 years ago

If a trace taken on nine replays poor on dxvk, it means it is something to do with formats advertised, or caps.

In that case i guess a trace taken on dxvk replays nice on nine.

In that case we would need a pair of similar traces taken on each to understand the differences.

dungeon007 commented 3 years ago

Well i see difference now better on second one, axeldavy would see it too... Point of traces to fix a driver and not to make it look good, so dont worry about that 🤣

leipero commented 3 years ago

If a trace taken on nine replays poor on dxvk, it means it is something to do with formats advertised, or caps.

In that case i guess a trace taken on dxvk replays nice on nine.

In that case we would need a pair of similar traces taken on each to understand the differences.

I think I got it now. Anyway, to answer the question, apitrace taken with nine looks bad on both nine and dxvk, apitrace taken on dxvk looks good on bogh nine and dxvk.

Here is from dxvk: https://drive.google.com/file/d/1djR8KL9NR4_HLP4tillkuyhLTYUJfWU4/view?usp=sharing

@dungeon007 Got it now, yup, the difference is less obvious in some places.

axeldavy commented 3 years ago

The game seems to allocate smaller textures on gallium nine. The game detects a different amount of VRAM on the two (2GB on nine according to the trace and 4GB on dxvk) If you card is 4GB capable, with ixit/Mesa-3D this should be fixed btw. Still 2GB should be plenty enough for this game. Could it be that it detects a different card and resets the config (in that case you would need to set again the texture level to high).

dungeon007 commented 3 years ago

NINE https://i.postimg.cc/L4yV8PDK/nine.png DXVK https://i.postimg.cc/kXTMZJ7y/dxvk.png

I think there must be something wrong with his setup , because he get low textures in NFSHP2 even with dxvk up there. 🤣

dungeon007 commented 3 years ago

i cant make replicate such low textures, even if a set just 64MB VRAM in a BIOS on this APU 🤣

leipero commented 3 years ago

The game seems to allocate smaller textures on gallium nine. The game detects a different amount of VRAM on the two (2GB on nine according to the trace and 4GB on dxvk) If you card is 4GB capable, with ixit/Mesa-3D this should be fixed btw. Still 2GB should be plenty enough for this game. Could it be that it detects a different card and resets the config (in that case you would need to set again the texture level to high).

The issue is that game advertise 2GB on both dxvk and nine, nine falsely detects the GPU as R9 290 tho. (It's Vega 8 actually), not sure if that's relevant, because this issue did happen with R7 250 with dedicated 1GB VRAM as well, the game did work fine on nine on the very same GPU 2 years ago or so. I think all of this started happening when nine was decoupled from wine-staging (both scaling and low textures later on). I can't change texture settings ingame (only resolution, AF and AA). Here: 2021-03-20 01-52-39 2021-03-20 01-53-46

@dungeon007 I can't really speak for NFS HP2 (since way back I did not try it with DX8toDX9), but I can assure you that there's nothing wrong with the setup, it's a software bug, either on nine/mesa part, or standalone version.

dungeon007 commented 3 years ago

So you are on AMD Raven APU, how much you set UMA buffer size in BIOS? How about to let it go with Auto, which i think 1GB i am quite sure you have some else trouble there even before trying to use nine or dxvk. .

dungeon007 commented 3 years ago

Or why not to let set there what game recommeds for you and just fire up that AF16?

dungeon007 commented 3 years ago

" I can't really speak for NFS HP2 (since way back I did not try it with DX8toDX9), but I can assure you that there's nothing wrong with the setup, it's a software bug, either on nine/mesa part, or standalone version." Well compare mine pictures with yours and you will see that ground texture is blurry as hell on both nine and dxvk 🤣

dungeon007 commented 3 years ago

And for your pleasure just tried that Trackmania game on your exact setting posted using nine and on 512 MB set APU... https://i.postimg.cc/QNY71VmZ/tmnf.png And there you go, where is that issue i dont see it 🤣

dungeon007 commented 3 years ago

Maybei lighting is different versus vulkan, but such low textures nope nowhere.

dungeon007 commented 3 years ago

Maybe go to irc #radeon and ask what could be a problem with RR APUs, maybe it is AMD_DEBUG=nodcc maybe something else, i cant guess really 🤣

leipero commented 3 years ago

@dungeon007 It seems you are not reading what I wrote, I had the same issue with 1GB dedicated VRAM R7 250. Default UMA buffer is 2GB for me, but again, it's not relevant, you are heading towards wrong direction here, that's not the issue.

As for NFSHP, there's something really wrong with colour balance on your screenshots, it also seems that mipmaps are not used (or not used properly), it seems to me that you are not using the same settings (lack of fog, mipmaps etc.). So, if you look at the grass, you can clearly see "dots", that's undesirable behavior, and it's usually the result of "MipMap=0" in NFS HP2, so mipmaping makes it slightly blury in order to remove that and make it better while in motion.

Look, there's nothing wrong with APU..., it's the same thing with R7 250, your screenshot: https://i.postimg.cc/kXTMZJ7y/dxvk.png This is NOT how game should look on max settings, colors are off balance, fog effect is missing, mipmaps are missing or are inadequate. This is how game should look on max settings: https://user-images.githubusercontent.com/21347343/111760197-b9e5fd80-889e-11eb-9015-7a65d6bc6380.png

dungeon007 commented 3 years ago

"there's something really wrong with colour balance on your screenshots" Sure thing i know that, It is scrot's default 75% quality again as only an eye of a eagle could notice more 🤣

leipero commented 3 years ago

"there's something really wrong with colour balance on your screenshots" Sure thing i know that, It is scrot's default 75% quality again as only an eye of a eagle could notice more

No, the way game is rendered on your screenshot doesn't look like it's on the max settings, it's quite off for some reason, maybe related to the lack of mipmaping, grass (and trees) should be more "in line" with other objects, it's artistic choice. Car is also slightly off as well, it really looks like the game is on different settings.

dungeon007 commented 3 years ago

"https://i.postimg.cc/kXTMZJ7y/dxvk.png This is NOT how game should look on max settings, colors are off balance, fog effect is missing, mipmaps are missing or are inadequate." That was from DXVK and on NINE it is indifferent. And it is on max settings. And with nomipmap case it actually looks like this: https://i.postimg.cc/xdzLgQsT/nomipmap.png

dungeon007 commented 3 years ago

But even at lowest setting on everything, i still cannot replicate such low and blurry ground textures as yours, that is just mission impossible for me 🤣 https://i.postimg.cc/XvLsSdMD/lowest.png

dungeon007 commented 3 years ago

And that happen to you with both nine and dxvk, plus you call that proper 🤣 I mean, good bye really...

leipero commented 3 years ago

And that happen to you with both nine and dxvk, plus you call that proper I mean, good bye really...

Ok, so, you don't have an issue with TMNF, that doesn't mean there's no issue, you clearly have an issue with NFS HP2, because that's not how game should look. So how can I (or anyone) take your example as valid one? Do you see the issue here? I have to scrap all of your NFS HP2 results as invalid for the simple fact that your screenshot do not show proper rendering, I hope that makes sense. It's interesting that TMNF works well on nine for you, what's your APU? Because this issue is not exclusive to this APU, it's also on GCN 1.0 as well, and if I remember corectly on R600 also.

leipero commented 3 years ago

So here you go, in order to prevent conversation steering towards wrong direction, windows screenshot (forced AF x16, since default even on Windows seems to be x4 or x8): nfshp2win

dungeon007 commented 3 years ago

While you are there do also trace of that, usually you need to just drop apitrace's d3d9.dll in a game folder... trace should appear on desktop.

leipero commented 3 years ago

Not sure how useful it would be, as far as I'm concerned, NFS HP2 issue is fixed, AF levels are messed up even on Windows, it's only DXVK that doesn't have it that way. To add to that, I can't do apitrace under wine because game crashes with unhandled expectation (but unlike without apitrace, it doesn't continue). It may be helpful for issues you are facing, so here it is from Win: https://drive.google.com/file/d/1gpiGlv7IP13OqOWxJXcAqfYMOixSh7Km/view?usp=sharing

dungeon007 commented 3 years ago

And as you are not alone in this world, here is mine screenshot on Windows 🤣

https://i.postimg.cc/Jz53VtLW/nfsjp2.png

And as i dont force anyting above it, you can see AF does not work from a driver, only if you force it externaly. So there is nothing to fix there in a game from begening and you should use mentioned variable to force this if you like. 🤣 @axeldavy If we are for properness a la Windows way, maybe patch should reverted.

dungeon007 commented 3 years ago

And by the way maybe we have different versions of a game 🤣 , not sure which one is this, but that is how it looks like on max .

dungeon007 commented 3 years ago

" it's only DXVK that doesn't have it that way" DXVK is just translation layer, that is not really for properness 🤣 If something works there, it does not mean it should also work same way from a drivers, OK frontends like a nine.