Skip to content

[RedM] Game-view capture is never published on RDR3, so screenshot-basic always returns black #4349

Open

Description

@BingoWings247

What happened?

Summary

On RedM, NUI never receives the game frame. The game-view producer (CaptureBufferOutput(),
which publishes the CfxGameRenderHandle shared texture) exists only in rage-graphics-five.
rage-graphics-rdr3 has no equivalent, so BindGameRenderHandle() in nui-core always finds a
null handle and returns. Every screenshot-basic-style resource on RedM produces an all-black image.

Evidence

The attached probe resource does what screenshot-basic does, plus a control. It activates a WebGL
texture with both sequences, once on an empty texture and once on a texture pre-filled with a
magenta/green checker, then reads pixels back over 120 frames. If the checker survives, the client
never swapped in the game frame.

Same PC (AMD Radeon RX 9070 XT; NUI WebGL = ANGLE D3D11), same resource, player spawned in world:

Probe RedM (2026-11-03 UTC) FiveM (2026-11-04 UTC)
Legacy sequence (CLAMP → MIRRORED → REPEAT), empty texture BLACK GAME_PIXELS
Legacy sequence, pre-filled checker checker unchanged GAME_PIXELS
0x47d87380, empty texture BLACK (INVALID_ENUM) GAME_PIXELS
0x47d87380, pre-filled checker checker unchanged (INVALID_ENUM) GAME_PIXELS

WebGL1 and WebGL2 gave identical results in every case.

Source (at 9f0e34e)

  • Producer, GTA V only: code/components/rage-graphics-five/src/GameViewCapture.cpp L452-585
    (CaptureBufferOutput), run from OnPostFrontendRender at L587-605.
  • Consumer: code/components/nui-core/src/NUIInitialize.cpp glTexParameterfHook L303-372.
    The legacy sequence is compiled only #if GTA_FIVE; the 0x47d87380 path is compiled for all
    games. Both call BindGameRenderHandle(), which returns when the share handle is null (L249-253).
  • git grep CfxGameRenderHandle matches only rage-graphics-five (producer), nui-core (consumer)
    and fxdk-main. Nothing in rage-graphics-rdr3 publishes it.

Expected result

The game frame reaches NUI on RedM the same way it does on FiveM, so screenshot-basic returns the actual game image.

Reproduction steps

Repro

  1. Add the attached bsd_capturetest to a RedM and a FiveM server, with ensure bsd_capturetest
    and set bsd_capturetest_public true (lets the server save reports).
  2. Join, spawn in with the world visible, and run capturetest 120 <label> in F8.
  3. Results print in F8; a JSON report (with a thumbnail when pixels arrive) is saved under
    the resource's reports/ folder.

Importancy

Slight inconvenience

Area(s)

RedM

Specific version(s)

RedM client: production channel (updated 2026-11-04). FiveM client for comparison: production, game build 3258. Servers: RedM 38317 linux, FiveM 35245 linux. Source refs at commit 9f0e34e.

Additional information

Notes for a fix

  • RedM forces the D3D12 sga driver unless -sgadriver is given (GfxSpec.cpp L805-806); NUI's
    WebGL runs on ANGLE/D3D11.
  • WrapEndDraw in GfxSpec.cpp (L506-522) already fetches the swapchain backbuffer every frame,
    which looks like a natural point to copy it into a shareable texture.
  • RDR3 already shares textures NUI → game on both D3D12 and Vulkan (GtaNui.cpp around L916-973,
    vk::CreateImageFromShareHandle). A game-view producer is the same plumbing in reverse.
  • On non-GTA_FIVE builds, NUI's shared textures use NT handles (NUIInitialize.cpp L727-744,
    L772-785), while BindGameRenderHandle uses EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE. The consumer
    may need adjusting if the producer exports an NT handle.
  • Side observation: on 2026-11-03 Chromium's WebGL validation rejected 0x47d87380 with
    INVALID_ENUM on both games; on 2026-11-04 FiveM accepted it. The WebGL renderer string also
    changed between runs, so the client likely updated.

Activity

  1. added
    triageNeeds a preliminary assessment to determine the urgency and required action
    on Nov 5, 2026
  2. BingoWings247 commented on Nov 5, 2026

    @BingoWings247
    Author

    Probe resource used for the results above (1.0.1, releases its WebGL contexts after each run):
    bsd_capturetest-1.0.1.zip

  3. BingoWings247 commented on Nov 5, 2026

    @BingoWings247
    Author

    Some history, for context:

    @Ehbw, was the RDR3 game-view capture held back from mr-972 on purpose (e.g. pending Vulkan support), and is it still planned?
    Happy to test builds on RedM (D3D12, AMD RX 9070 XT).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RedMIssues/PRs related to RedMbugtriageNeeds a preliminary assessment to determine the urgency and required action

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions