Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(extra-natives-five): DrawCorona 16-byte vector alignment for SIMD instructions #3133

Conversation

tens0rfl0w
Copy link
Contributor

Goal of this PR

The game function addLightCorona expects vectors to be aligned to a 16-byte memory boundary, but DirectX::XMFLOAT3 does not provide this alignment by default. This misalignment causes an access violation error when executing movaps xmm5, xmmword ptr [rax] in release builds.

How is this PR achieving the goal

  • Replaced the usage of DirectX::XMFLOAT3 with DirectX::XMVECTOR, which guarantees 16-byte alignment as required.
  • Function pattern has been simplified

This PR applies to the following area(s)

FiveM, Natives

Successfully tested on

Game builds: 1, 1604, 2060, 2189, 2372, 2545, 2612, 2699, 2802, 2944, 3095, 3258, 3407

Platforms: Windows (Client)

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 #3132

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Feb 6, 2025
@prikolium-cfx prikolium-cfx self-requested a review February 6, 2025 10:16
@prikolium-cfx prikolium-cfx added bug ready-to-merge This PR is enqueued for merging and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Feb 6, 2025
@prikolium-cfx prikolium-cfx merged commit 84444fe into citizenfx:master Feb 6, 2025
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ready-to-merge This PR is enqueued for merging
Projects
None yet
2 participants