beyond-all-reason / beyond-all-reason/RecoilEngine

Proposal: add a native Vulkan rendering backend in stages

Open
#3,137 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

Summary:

I have been experimenting with a native Vulkan rendering backend for the RecoilEngine.

The long term goal is to support Vulkan as a optional renderer while preserving the existing OpenGL renderer. Because rendering is spread quite heavily across the engine and game facing APIS, i'd like to contribute this incrementally instead of submitting one large replacement, as well for the maintainers sanity.

There is already a working prototype in my fork. On windows it can initialize Vulkan, create swapchain, render engine UI, load map textures and display SMF terrain. The prototype is not ready to submit though. I would like to fix any issues and do a deep review against it due to using AI assistance.

Proposed first PR:

- An `ENABLE_VULKAN` Cmake option, disabled by default
- Vulkan Instance creation
- Optional validation layer setup
- SDL vulkan surface creation
- Vulkan 1.1 physical device selection
- Logical device creation
- Graphics and presentation queue selection
- clean initialization, shutdown, and reinitialization
- A small standalone smoke test

It would not switch the engine away from OpenGL or include swapchain rendering, shaders, textures, UI integration, or terrain rendering.

Possible follow up stages:

If the foundation is accepted, later changes could be submitted separately:

1. Swapchain and basic frame presentation
2. Buffer, texture, and pipeline infrastructure
3. Loading screen and built in UI rendering
4. Map shading, sky, and terrain rendering
5. Remaining engine and game integeration stages, (this would not be 1, just generalizing)

Current testing:

The foundation has been tested on Windows x64 with:

- NVIDIA GeForce RTX 4090
- Vulkan SDK 1.4.350
- Vulkan validation enabled
- Two complete initialization and shutdown cycles
- `engine-legacy` debug build
- `engine-headless` debug build
- Config with `ENABLE_VULKAN=OFF` and no Vulkan SDK available

No Vulkan validation errors were reported during the context smoke test.

Disclaimer though, testing has only been performed on windows so far. I am not claiming Linux or moltenVK support at this stage.

Would this staged Vulkan backend be acceptable for the RecoilEngine, and is the proposed foundation an appropriate first PR?
also, i am looking for feedback as this would be my first contribution here! thank you

AI DISCLOSURE:

Codex assisted with developing the prototype so far, it has mainly focused on boilerplate, validation, and assisting me with docs or finding methods. No pull request will be submitted without my review and testing.D

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the proposed ENABLE_VULKAN CMake option and the existing engine initialization path; no repository files are named in the issue. Run the standalone smoke test across the listed Windows configurations, including Vulkan enabled and disabled, and consider the foundation complete when initialization, shutdown, and reinitialization work without changing OpenGL or adding rendering stages.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.