Skip to content

fix(extra-natives/rdr3): graphic natives flickering#4043

Open
Ehbw wants to merge 2 commits into
citizenfx:masterfrom
Ehbw:fix/rdr3-graphic-natives-race
Open

fix(extra-natives/rdr3): graphic natives flickering#4043
Ehbw wants to merge 2 commits into
citizenfx:masterfrom
Ehbw:fix/rdr3-graphic-natives-race

Conversation

@Ehbw

@Ehbw Ehbw commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Goal of this PR

Resolves flickering within several graphic natives (DRAW_BOX/DRAW_POLY/DRAW_LINE) caused by a race condition. This should also resolve several crashes tied to these natives but these crashes were unable to be reproduced. SET_DRAW_ORIGIN has been changed to fix #2450 and the flickering regression reported in #3082

How is this PR achieving the goal

Only allow the game to read imRequests when the main thread has finished for this frame.

This PR applies to the following area(s)

RedM

Successfully tested on

Tested with snippet provided from #4019

Tested with the following settings with/without the changes to confirm it works

  • 5 lines
  • 400 lines
  • 1024 lines

SET_DRAW_ORIGIN issue was tested with snippet provided from https://forum.cfx.re/t/draworigin-single-frame-positional-issue/5223033 and #3082 (comment)

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.

Fixes issues

fixes #4019
fixes #2450
https://forum.cfx.re/t/draworigin-single-frame-positional-issue/5223033

@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 Jun 25, 2026
@Ehbw Ehbw force-pushed the fix/rdr3-graphic-natives-race branch from 2aebfb8 to ced89ef Compare June 25, 2026 13:45
@github-actions github-actions Bot added triage Needs a preliminary assessment to determine the urgency and required action invalid Requires changes before it's considered valid and can be (re)triaged and removed invalid Requires changes before it's considered valid and can be (re)triaged triage Needs a preliminary assessment to determine the urgency and required action labels Jun 25, 2026
@Ehbw Ehbw force-pushed the fix/rdr3-graphic-natives-race branch from ced89ef to 806d428 Compare June 26, 2026 18:41
@Ehbw

Ehbw commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

PR has been updated to include fixes to SET_DRAW_ORIGIN to resolve https://forum.cfx.re/t/draworigin-single-frame-positional-issue/5223033 and the flickering regression tied to the previous fix.

@Ehbw Ehbw force-pushed the fix/rdr3-graphic-natives-race branch from 806d428 to b43f76b Compare June 27, 2026 17:30
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.

DRAW_LINE / DRAW_POLY flicker with associated crashes DrawOrigin Single Frame Positional Bug

1 participant