libcg/grvk

Civilization: Beyond Earth

xatornet opened this issue ยท 21 comments

Games status:

  • Civilization: Beyond Earth --> Not Working (see log below)

BE requires mantleaxl32.dll

Game crash log

Unhandled Exception
Code:  EXCEPTION_ACCESS_VIOLATION
Error reading address 0x6100

Call Stack
-----------------------------------------------------
(0x0000000000400000 : 0x0060C61B) civilizationbe_mantle ! EXP_GetMovieEventSystem  (???, line 0)
(0x0000000000400000 : 0x0060C7EB) civilizationbe_mantle ! EXP_GetMovieEventSystem  (???, line 0)
(0x0000000000400000 : 0x003D6D0F) civilizationbe_mantle ! ForgeUI::ForgeUI_UIManager::GetColor  (???, line 0)
(0x0000000000400000 : 0x00701E54) civilizationbe_mantle ! GetSmallObjectAllocator  (???, line 0)
(0x0000000000000000 : 0x7682FA29) ??? ! ???  (???, line 0)
(0x0000000000000000 : 0x77AD7C7E) ??? ! ???  (???, line 0)
(0x0000000000000000 : 0x77AD7C4E) ??? ! ???  (???, line 0)

grvk log

=== GRVK 0.3.0 ===
I/grInitAndEnumerateGpus: app "CivTech" (00000000), engine "CivTech" (00000001), api 00016000
W/grInitAndEnumerateGpus: unhandled alloc callbacks

EDIT;
grvk_axl.log

=== GRVK 0.3.0 (AXL) ===

Tested on Windows 10 with a RTX 2060.

0,4,0 update: not working

Unhandled Exception
Code:  EXCEPTION_ACCESS_VIOLATION
Error reading address 0x6102

Call Stack
-----------------------------------------------------
(0x0000000000400000 : 0x0060C61B) civilizationbe_mantle ! EXP_GetMovieEventSystem  (???, line 0)
(0x0000000000400000 : 0x0060C7EB) civilizationbe_mantle ! EXP_GetMovieEventSystem  (???, line 0)
(0x0000000000400000 : 0x003D6D0F) civilizationbe_mantle ! ForgeUI::ForgeUI_UIManager::GetColor  (???, line 0)
(0x0000000000400000 : 0x00701E54) civilizationbe_mantle ! GetSmallObjectAllocator  (???, line 0)
(0x0000000000000000 : 0x75B8FA29) ??? ! ???  (???, line 0)
(0x0000000000000000 : 0x77617A7E) ??? ! ???  (???, line 0)
(0x0000000000000000 : 0x77617A4E) ??? ! ???  (???, line 0)

grvk.log

=== GRVK 0.4.0 ===
I/00000DBC/grInitAndEnumerateGpus: app "CivTech" (00000000), engine "CivTech" (00000001), api 00016000
W/00000DBC/grInitAndEnumerateGpus: unhandled alloc callbacks
E/00000DBC/grGetGpuInfo: unsupported info type 0x6102

grvk_axl.log

=== GRVK 0.4.0 (AXL) ===

EDIT: Never mind I was running DX11 Fallback

Works for me with Windows 10, R9 290X with 0.4.0.

However, there is a graphical glitch, character models do not display and the game display hangs, but the game continues and UI clicks are responsive. The game continues when I select an option that removes the character model:

image

This is roughly what I expect (From a different machine running DX11):

image

Logs show nothing.

Logs show nothing.

In that case you likely didn't run the mantle version of the game, the games often silently fallback to DirectX.

You're right I didn't realize there was a fallback, it was running DX11

With the above PR, I get this:

image

And I have attached the traces.

I intend to spend some time investigating what's missing to get this to move past this. One possibility is DMA queue support, i have a WIP branch to implement this i'll spend some more time on it in the coming weeks.

grvk.log
grvk_axl.log

Also, I deleted the DX11 Executable so I know I am not being fooled again!

libcg commented

Could be a missing queue type, or missing timestamp support that I disabled in cf49c10. Should be fairly easy to implement.

OK I implemented the DMA queue and it gets much farther. After that I discovered that it was crashing on a mem info size of less than 1024 for descriptor sets, so I just put in 4096 for testing (not sure what the latest mantle driver returns for these, if I can get it installed on this machine I might poke around to find out).

It now crashes inside vulkan from grvk on a particular shader compilation.

Will submit a PR for some of this after some cleanup probably this weekend.

Attached is the trace. Don't mind my hacky debug prints.

grvk.log

@dougvj Can you provide shader binary to look through? I know it's crashing because IL_DCL_CONST_BUFFER (which is a set of specialization constants actually or immediate constant array) isn't implemented, but I don't know how instructions with constant buffer as a source would look in AMD IL byte code as it isn't described sufficiently in docs.

libcg commented

I already implemented that instruction for BF4, it's just not pushed yet :)

It's not about instruction itself, it's also about spec constants support on pipeline creation.
btw, is bf4 working now?

libcg commented

For now only immediate constant buffers are implemented, hopefully that's all this game needs. BF4 is at the point where it's showing the menu.

Oh ok, I think I'll get to non-immediate constant buffer implementation after you push the changes.

libcg commented

Sorry, I had to delete your previous comment as the shader is potentially licensed. Please share it privately if possible.

libcg commented

Oh ok, I think I'll get to non-immediate constant buffer implementation after you push the changes.

Can you make sure at least one game uses the feature before implementing it. I think you're doing great work but I don't want to merge code unless it's actually required. Thanks.

Can you make sure at least one game uses the feature before implementing it.

Well there is the only way to find out anyway.
UPD: in this case it is probably immediate constant buffer, according to shader binary. idk whether bf4 uses non-immediate constant buffers or not rly. Still, it's not really a big problem to implement this functionality.

Sorry, I had to delete your previous comment as the shader is potentially licensed. Please share it privately if possible.

No problem, I should have thought of that.

BF4 is at the point where it's showing the menu.

it's still crashing at startup for me (maybe due to DMA queue missing)

OK with the immediate constant buffer stuff in place it keeps going then crashes in a later shader compilation:

image

grvk.log

libcg commented

Moving to #41