Skip to content

Conversation

@DaniGP17
Copy link
Contributor

Goal of this PR

Allow to use the x-cfx-game-view in RedM sharing d3d12 & vulkan backbuffers with NUI. Already tested with screenshot-basic:

image

How is this PR achieving the goal

Implementing a dual-backend frame capture system that intercepts the game's rendered frames and makes them available to the NUI layer through a shared texture.

For the D3D12 backend, the implementation captures the backbuffer directly using D3D12 copy commands and transfers it to a D3D11 shared texture. The captured frame is exposed via a shared handle that NUI can consume through the CfxGameRenderHandle shared data structure.

The Vulkan backend required a more sophisticated approach. The solution hooks vkQueuePresentKHR to intercept frames after presentation, then implements a multi-stage async pipeline: swapchain image -> intermediate GPU image -> staging buffer -> D3D11 shared texture -> NUI.

This PR applies to the following area(s)

RedM

Successfully tested on

Game builds: 1491
Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions bot added RedM Issues/PRs related to RedM invalid Requires changes before it's considered valid and can be (re)triaged labels Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged RedM Issues/PRs related to RedM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant