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

Crash when using dxDrawText with very long strings #288

Open
Pirulax opened this issue Aug 2, 2018 · 7 comments
Open

Crash when using dxDrawText with very long strings #288

Pirulax opened this issue Aug 2, 2018 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@Pirulax
Copy link
Contributor

Pirulax commented Aug 2, 2018

Describe the bug
So, I made a stat resource, which displays stats, with, you nailed it: dxDrawText+dxDrawRectangle(bg)

To Reproduce
Steps to reproduce the behavior:

  1. Download this this resource
  2. Start it
  3. Let it run, and you'll start having frame drop. A lot of it.
  4. Craaash

MTA Client (please complete the following information):

  • Version: Multi Theft Auto v1.5.5-release-12411
  • Running in Wine? No

MTA Server (please complete the following information):

  • OS: Microsoft Windows [Version 10.0.17134.165]
  • Version Multi Theft Auto Server v1.5.5-release-12411
@Pirulax
Copy link
Contributor Author

Pirulax commented Aug 2, 2018

Ohh, yeah, and which crash dump should I post?
Because I have a few here.
I mean should I post only dumps/public, or I can post dumps/private too?

@Pirulax Pirulax changed the title d9dx9 crash d3dx9 crash Aug 2, 2018
@Pirulax
Copy link
Contributor Author

Pirulax commented Aug 2, 2018

Actually, I suppose what caused the issue was that I constantly made my text bigger, so the text always got bigger(every 1s) with ^2 of its size.
So, I suppose the text got too long, and thats what caused the issue.
Maybe clamping it'd solve the crash?

@qaisjp
Copy link
Contributor

qaisjp commented Aug 2, 2018 via email

@qaisjp
Copy link
Contributor

qaisjp commented Aug 2, 2018 via email

@Pirulax
Copy link
Contributor Author

Pirulax commented Aug 2, 2018

@patrikjuvonen patrikjuvonen added the bug Something isn't working label Aug 5, 2018
@botder botder added this to the Backlog milestone Mar 3, 2019
@sbx320 sbx320 changed the title d3dx9 crash Crash when using dxDrawText with very long strings Apr 26, 2020
@tederis
Copy link
Collaborator

tederis commented Apr 22, 2021

As far as I know ID3DXFont::DrawText is designed to rasterize a text on top of RT. If that is the case, the reason is pretty clear. DirectX 9 is limited to up to 4096x4096 pixels for texture sizes. When you are trying to draw a text that far exceeds that limit you happen to be in area where anything could happen. Well, I wouldn't call it 'a bug'. The only visible way in there is to check if a text is big enough and clamp it if needed.

@Lpsd
Copy link
Member

Lpsd commented May 4, 2021

Probably related to and can be resolved along with #287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants