libcg / grvk

Vulkan-based Mantle API implementation
https://en.wikipedia.org/wiki/Mantle_(API)
zlib License
221 stars 14 forks source link

Battlefield Hardline #39

Open libcg opened 2 years ago

libcg commented 2 years ago

Meta-issue for Battlefield Hardline.

bazookaben commented 2 years ago

Does not work.

Got this error message when trying to start a match:

Microsoft Visual C++ Runtime Library

Assertion failed!

Program: D:\Origin Games\BFH\bfh.exe File: ../src/amdilc/amdilc_compiler.c Line: 1979

Expression: false

For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts

Press Retry to debug the application - JIT must be enabled

grvk.log

Cherser-s commented 2 years ago

Can you dump the shader binaries?

bazookaben commented 2 years ago

How would I do that?

niobium93 commented 2 years ago

Set the GRVK_DUMP_SHADERS=1 environment variable.

Cherser-s commented 2 years ago

Yup, then the game will probably dump it in "current" directory (which will be probably the game directory). There will be three files per each shader: AMD IL binary, AMD IL text and the resulting SPIRV code.

bazookaben commented 2 years ago

OK I brought up the Environment Variable window in Windows, so what do I put in "variable" and what do I put in "value"? Or am I in the wrong place

Cherser-s commented 2 years ago

well, in the snippet above, "1" is the value, while "GRVK_DUMP_SHADERS" is the key/name (or "variable").

Cherser-s commented 2 years ago

Actually, if you are using Steam, you can set an environment variable there as in GRVK_DUMP_SHADERS=1 %command%.

bazookaben commented 2 years ago

Ok, I tried the setting that environment variable both in the user and system categories, and in the "launch options" in the Origin launcher. No new files appeared in the game directory

Cherser-s commented 2 years ago

idk about windows, maybe you need to reboot your pc and check that env var is set through echoing inside cmd.exe. You can set GRVK_LOG_LEVEL variable to debug, so you get more data in logs (will be easier to find failing shaders). Also download newer grvk libraries, since I've implemented one of the instructions that are being used by the game and weren't implemented (maybe this will compile the shader correctly when you are joining the match, though tess shaders are still not implemented in the moment).

niobium93 commented 2 years ago

First open PowerShell in the games folder, then you can set variables easily in PowerShell:

$env:GRVK_DUMP_SHADERS = 1

Then launch the game from the same PowerShell session. Source: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.2 https://www.tutorialspoint.com/how-to-set-environment-variables-using-powershell

bazookaben commented 2 years ago

Yeah restarting my PC was the key

I used build #39, which didn’t crash but just basically ran as a background process I could see in task manager

GitHub won’t let me post a Zip for some reason, so here’s a drive link, includes the log : https://drive.google.com/file/d/1ugKijTgFRIan3xxf-FvaLpIF8WdkcqjC/view?usp=drivesdk

libcg commented 2 years ago

Unfortunately I can't test the game because Battlelog doesn't work on Linux...

Cherser-s commented 2 years ago

Ok, looks like your shaders get compiled properly with the exception of tessellation shaders, which aren't implemented. try compiling my branch: https://github.com/Cherser-s/grvk/tree/tessellation-new

bazookaben commented 2 years ago

Got an error when I tried to compile: meson-log.txt

Followed the instructions on the main page. pretty sure I installed all the necessary stuff on my Ubuntu laptop.

Cherser-s commented 2 years ago

Hmmmm it looks like it doesn't like the compiler you have installed considering how init tests fail

bazookaben commented 2 years ago

Do you use something other than meson?

Cherser-s commented 2 years ago

Nope, why would it compare sizeof(void*) to 15?? it isn't 128bit. Are you sure, that you configured it correctly?

bazookaben commented 2 years ago

I didn't do any configuration, just ran the commands on the main page here. Then downloaded a package that meson said I was missing. I wouldn't know where to begin trouble shooting something like this. I have zero programming experience, I'm only really helpful because I have four of the supported Frostbite games in my Origin library haha.

niobium93 commented 2 years ago

I just tried Battlefield Hardline and it runs fine. As long as Fullscreen Mode is set to Borderless and Terrain Quality to Medium. Here's the log: grvk.log

niobium93 commented 2 years ago

Here's a screenshot: 2022-07-12-17:49:44-screenshot

niobium93 commented 2 years ago

This same scene with the same settings on DXVK reaches 130-150 fps, so GRVK is a lot slower.

niobium93 commented 2 years ago

@Cherser-s I tried your tessellation-new branch and it indeed lets me run the game with max settings. Log: grvk.log Screenshot: 2022-07-12-18:19:15-screenshot It runs exactly as fast as regular GRVK and I can't really see any difference visually. Oh and the game always crashes when quitting. On either branch.

niobium93 commented 2 years ago

Do you guys need a shader dump or something before I uninstall this game?

Cherser-s commented 2 years ago

Do you guys need a shader dump

yes, it would be great

I can't really see any difference visually.

not a surprise, considering the game only uses the tessellation for terrain calculation

idk if there is a perf graph in this game, but can you also check the CPU overhead between grvk and dxvk?

niobium93 commented 2 years ago

@Cherser-s Here are the shaders

Log files with GRVK_LOG_LEVEL=trace: grvk_axl.log.zst grvk.log.zst

Is this enough info about the CPU overhead difference?: comparison

Cherser-s commented 2 years ago

No, it just shows the frametime, unfortunately mangohud can't show this. Open the in-game console and try the commands like PerfOverlay.DrawGraph 1 (idk how it looks in hardline, I've just written here the one from bf4).

niobium93 commented 2 years ago

GRVK: 2022-07-12-22:40:25-screenshot grvk

DXVK: 2022-07-12-22:42:56-screenshot dxvk

niobium93 commented 2 years ago

@Cherser-s is that enough?

Cherser-s commented 2 years ago

yes, thank you

niobium93 commented 2 years ago

You're welcome :smile: