Opened 8 months ago

Closed 4 weeks ago

#6636 closed enhancement (fixed)

Add Vulkan renderer backend support

Reported by: Vladislav Belov Owned by: Vladislav Belov
Priority: Release Blocker Milestone: Alpha 27
Component: Core engine Keywords:
Cc: Patch:


Currently we're heavily CPU bound during rendering phase because of unoptimized art. As we might have a lot of draw calls (up to 50k in the worst case). Most of which can't be truly instanced.

To decrease CPU time during draw command processing we can add Vulkan and build draw commands lists by ourselves.

Change History (10)

comment:1 by Vladislav Belov, 6 months ago

In 27282:

Reduces shader inputs duplication and wraps them in a macro. Refs #6636

Tested By: Stan

Differential Revision:

comment:2 by Vladislav Belov, 5 months ago

In 27299:

Optimizes terrain materials to reduce the total number of used combinations. Refs #6636

Differential Revision:

comment:3 by Vladislav Belov, 5 months ago

In 27387:

Adds dependent libraries for Vulkan. Refs #6636

Tested By: phosit, Stan

Differential Revision:

comment:4 by Stan, 4 months ago

In 27488:

Add MoltenVK support to fix Vulkan on macOS.
Tested by: @Langbart, @real_tabasco_sauce, @wraitii

Refs #6636
Differential Revision:

comment:5 by Vladislav Belov, 4 months ago

In 27511:

Fixes descriptor set overwrite when multiple textures reference it with delayed deletion. Fixes #6717

Refs #6636

Comments By: phosit, Stan
Tested By: phosit, Stan

Differential Revision:

comment:6 by phosit, 8 weeks ago

Priority: Should HaveRelease Blocker

We made announcement and everything, so we can't release without Vulkan ;)

  • D4969 to generate the shaders.
  • Move the shaders from the mod to 0ad or modmod.

Is there more to be done for this ticket?

comment:7 by Stan, 8 weeks ago

Need to update the script to build the bundleas with shaders and rules.json. for now stuck cause vulkan sdk doesn't run on macos 13.6. need to try an older version

comment:8 by Vladislav Belov, 5 weeks ago

In 27627:

Adds script to generate SPIR-V from GLSL shaders. Refs #6636

Tested By: Stan

Differential Revision:

comment:9 by Stan, 4 weeks ago

In 27629:

Move some engine required files to the mod mod.

Most of the shaders are explicitely interned by the engine except for the one called "Model" which is not required (you can have maps with just terrain for visualization)
The rng files are called by the engine to validate structure.
The game has two overrides for high quality and normal water to be "ocean" and "default" respectively
The minimap flare folder is hardcoded see #6795
The default material now calls the dummy shader instead of the model one when in modmod
Move the default skybox, it will be required by _default.xml
The terrain materials are moved as well, for completeness, although they are currently not referenced.

This commit does not include atlas needed files as it cannot run without the public mod anyway for now. It will be done in a separate commit when we have the ingame editor that will require _default.xml for instance.

This commit is also needed to generate the spir-v shaders in the correct mods, in order to be able to launch the game with mod mod only.

Refs: #6636 #5366
Fixes: #6294

Differential Revision:

comment:10 by Stan, 4 weeks ago

Resolution: fixed
Status: assignedclosed

In 27633:

Add a script to build spir-v shaders for the bundle.

Fixes: #6636
Refs: #6718
Discussed with: @vladislavbelov

Differential Revision:

Note: See TracTickets for help on using tickets.