Vulkan support

For code related discussions and questions
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: Vulkan support

Post by Berg » 14 Jul 2019, 00:00

Thank you pastdue Keep up the good work!

User avatar
moltengear
Trained
Trained
Posts: 163
Joined: 22 Jul 2017, 15:05

Re: Vulkan support

Post by moltengear » 17 Jul 2019, 10:01

A new version of Raspberry PI has been released.
Most likely for the new gpu they will release a vulkan api.

https://forums.wz2100.net/viewtopic.php?f=30&t=15172
Compressed texture patterns of models (units, structures) are displayed correctly.
But with compressed landscape textures, textures with an alpha channel are not displayed correctly, unlike version 3.1.5.
For me, this is a mystery.
But even so it was possible to reduce the download time of the beginning of the battle.
And also increase the FPS, which favorably affects the delay in multiplayer on weak machines.
We can use compressed textures only to the models at this stage.

I think it makes no sense to implement the lighting, but just take what Nvidia offers.
hardware lighting is always better than software in terms of speed. Other manufacturers will sometime implement hardware lighting anyway.

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 875
Joined: 26 Sep 2016, 19:56

Re: Vulkan support

Post by Berserk Cyborg » 24 Jul 2019, 04:36

Setup the Vulkan sdk and all that on my Ubuntu-mate 19.04 install. Was successfully able to compile your latest branch and tested it a few times. At least the Vulkan backend doesn't get all laggy in fullscreen mode like it did for me with Windows, though maybe that is because I compiled Warzone myself. Runs smooth for both backends.

That upload assert can happen with the OpenGL backend too:

Code: Select all

info    |21:07:52: [upload:242] Attempt to upload to buffer more than once per frame
info    |21:07:52: [upload:242] Assert in Warzone: ../lib/ivis_opengl/gfx_api_gl.cpp:242 (lastUploaded_FrameNum != current_FrameNum), last script event: '<none>'
I think it can be triggered by viewing the research in the intelligence screen as well.

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3776
Joined: 03 Aug 2006, 19:39

Re: Vulkan support

Post by Per » 20 Aug 2019, 23:33

Interesting. Do you have a git branch for this work?

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 875
Joined: 26 Sep 2016, 19:56

Re: Vulkan support

Post by Berserk Cyborg » 21 Aug 2019, 00:15

Per wrote:
20 Aug 2019, 23:33
Interesting. Do you have a git branch for this work?
Follow pastdue's latest gfx_api branches. I know version 12 works as that was the last iteration I tried.

pastdue
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 262
Joined: 13 Aug 2017, 17:44

Re: Vulkan support

Post by pastdue » 26 Jan 2020, 23:34

Request for testers.

The latest Vulkan builds for Windows are here:

New Builds (2020-01-26a)
Full Installer (Windows x86): https://ci.appveyor.com/api/buildjobs/u ... taller.zip
Portable Build (Windows x86): https://ci.appveyor.com/api/buildjobs/u ... rtable.zip

To select your backend, you can use:
- the new "Graphics Backend" option in the Video Options menu
- the command-line option "--gfxbackend=" <opengl, opengles, vulkan, directx>

Graphics backend options on Windows:
- OpenGL
- OpenGL ES*
- Vulkan
- DirectX (via LibANGLE)

* The OpenGL ES option will use your graphics driver's native OpenGL ES support, if available. If not, it may fall back to LibANGLE.

To enable additional 3D-graphics-related logging, use:
warzone2100.exe --debug=3d
(We'll need this extra logging information if you have any issues.)

Some additional notes:
- Adds new "Adaptive Vsync" option (where supported), in addition to Vsync on + off
- Includes "Allow optional per-vertex normals in PIE format"
- Includes numerous fixes for the Vulkan backend, gfx driver compatibility, OpenGL ES, and more

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 875
Joined: 26 Sep 2016, 19:56

Re: Vulkan support

Post by Berserk Cyborg » 27 Jan 2020, 23:10

Looking for anything in particular? Vulkan and OpenGL backends are working fine on my end. Tested with simulating bot battles and entering Beta campaign.

Trying DirectX or OpenGLES (which falls back to libANGLE) gives this error and the graphics are... pixelated to say the least.

Code: Select all

error   |17:49:53: [sdl_OpenGL_Impl::createGLContext:188] SDL_GL_GetAttribute failed to get value for SDL_GL_DOUBLEBUFFER (OpenGL error: GL_INVALID_ENUM)
error   |17:49:53: [sdl_OpenGL_Impl::createGLContext:189] Double buffering is required for this game - if it isn't actually enabled, things will fail!

pastdue
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 262
Joined: 13 Aug 2017, 17:44

Re: Vulkan support

Post by pastdue » 28 Jan 2020, 00:41

Berserk Cyborg wrote:
27 Jan 2020, 23:10
Looking for anything in particular? Vulkan and OpenGL backends are working fine on my end. Tested with simulating bot battles and entering Beta campaign.
Just the usual testing. It should be much more stable than before, but I'd like to make sure the changes didn't break anything unexpected on different graphics drivers.

Berserk Cyborg wrote:
27 Jan 2020, 23:10
Trying DirectX or OpenGLES (which falls back to libANGLE) gives this error and the graphics are... pixelated to say the least.

Code: Select all

error   |17:49:53: [sdl_OpenGL_Impl::createGLContext:188] SDL_GL_GetAttribute failed to get value for SDL_GL_DOUBLEBUFFER (OpenGL error: GL_INVALID_ENUM)
error   |17:49:53: [sdl_OpenGL_Impl::createGLContext:189] Double buffering is required for this game - if it isn't actually enabled, things will fail!
Those specific errors are expected in OpenGL ES / DirectX mode (for now), but pixelated graphics are not. Can you provide a screenshot (versus the expected output in OpenGL / Vulkan mode on your system)?

EDIT: And also the log output from running with the --debug=3d command-line option?

(Also: what version of Windows, & what GPU / graphics drivers, are you using? The installer currently bundles a slightly older version of LibANGLE, so I may need to bump the vcpkg commit we use to get a newer LibANGLE version.)

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 875
Joined: 26 Sep 2016, 19:56

Re: Vulkan support

Post by Berserk Cyborg » 28 Jan 2020, 02:10

On second look, it's mostly the frontend backgrounds, structures, and the terrain that look bad on DirectX / OpenGLES. Using the latest feature update for Windows 10 and I have the latest graphics drivers (Vega 8 + Ryzen 3 APU). Might just be a side effect of those errors, though. Anyway, attached logs on every backend + a few screenshots.

logs.zip
(1.62 MiB) Downloaded 28 times

silenceko
New user
Posts: 1
Joined: 29 May 2020, 12:44

Re: Vulkan support

Post by silenceko » 29 May 2020, 13:00

I just wanted to tell you, that I not respond much, but that I am very awere of what you are doing. I hope you get the best out of this game. A graphicupdate would be the best thing now. Keep up the good work, I hope I see some updated models / terrain one time. There is no equal alternative out there for warzone.

Post Reply