libcg / grvk

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

Implement amdmantle64.dll loader #11

Closed libcg closed 3 years ago

libcg commented 3 years ago

Required by Frostbite games (BF4 and Dragon Age: Inquisition). For now these files can be extracted from the Adrenalin 19.4.3 drivers, but not redistributed with GRVK. We need to write our own implementation.

xatornet commented 3 years ago

Don't forget mantleaxl64.dll

libcg commented 3 years ago

I just remembered that mantleaxl64.dll is the extension library that's partially documented. amdmantle64.dll is the loader.

Cherser-s commented 3 years ago

I doubt that amdmantle64.dll is really being used on itself by clients, although it does contain icdInit, which mantle64.dll uses as well as the real driver code, which is provided from this library through mantle64.dll. icdInit function itself is being called in grInitAndEnumerateGpus Mantle call from the original mantle64.dll.

I think that bf4.exe doesn't even require amdmantle64.dll, though it requires mantleaxl64.dll to work.

libcg commented 3 years ago

Interesting, that might not be an issue then. I will try BF4 myself soon.

Cherser-s commented 3 years ago

Good luck, if I'm correct, then at least the game menu will show that mantle "backend" is present

I think bf4 probably only uses mantleaxl64.dll for "Advanced msaa state". I wonder whether it's possible to properly map all the fields to vulkan, for basic msaa it seems straightforward, but will probably require to hold off graphics pipeline creation (maybe derivatives will help with perf though).

Cherser-s commented 3 years ago

As I expected, the game detects mantle if both mantle64.dll and mantleaxl64.dll do exist. I didn't yet risk to switch to Mantle backend though :D

But the option only shows up after I select "Open screen settings" or something like that. Idk, maybe it's due to renderer initialization, but if either of two libraries isn't present, then this option doesn't show up at all.

libcg commented 3 years ago

I can confirm that too. Closing.