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

Crashes with dxCreateTexture with pixel count+:setPixels() #287

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

Crashes with dxCreateTexture with pixel count+:setPixels() #287

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

Comments

@Pirulax
Copy link
Contributor

Pirulax commented Aug 2, 2018

Describe the bug
So, I was doing some random thing, and for some reason I crashed a few times.
I was using dxCreateTexture() with some big pixel counts(12k+ on x and y)+setPixels()
I crashed out every time, but I dont know exactly caused the crash, but it has something to do with the mentioned functions.

To Reproduce
Maybe:

  1. C a texture(dxCreateTexture(20000, 20000))
  2. Set pixels on each axis:
    for x = 0, math.floor(20000/32), 32 do for y = 0, math.floor(20000/32), 32 do tex:setPixels(<Add pixels here from a 32x32 image>, x, y, 32, 32) end end
    This is how I crashed, or at least, it was like this.

Expected behavior
It should create the texture and set its pixels

MTA Client (please complete the following information):

  • Multi Theft Auto v1.5.5-release-12411
  • Running on Wine? Nein.

MTA Server (please complete the following information):

  • OS: Microsoft Windows [Version 10.0.17134.165]
  • 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
Copy link
Contributor Author

Pirulax commented Aug 2, 2018

https://upload.mtasa.com/u/896366106/texturecreatecrash.zip_
These two aren't the same actually.
One was because of drawing too much text, and this is caused by dxCreateTexture thing.

@patrikjuvonen patrikjuvonen added the bug Something isn't working label Aug 5, 2018
@botder botder added this to the Backlog milestone Mar 3, 2019
@Allerek
Copy link
Contributor

Allerek commented Apr 22, 2021

Link example resource and confirm its still a thing, i'll check on that.

@tederis
Copy link
Collaborator

tederis commented Apr 22, 2021

When it comes to operations with textures MTA is relying on D3D9 API. But the largest texture size is 4096 × 4096 in DX9. Of course you can try to create a bigger texture but it's unsafe and can result in unpredictable consequences.

@tederis
Copy link
Collaborator

tederis commented Apr 22, 2021

It's not a bug. The only thing you can do is to forbid to create textures with size bigger than 4096x4096 px.

@Lpsd
Copy link
Member

Lpsd commented May 4, 2021

A note for this should be added to the wiki page (regarding max texture size for D3D9).

Should we enforce this limit when using dxCreateTexture and throw an error if larger than 4096? Would be better than the client just crashing and having no idea what caused it.

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

Successfully merging a pull request may close this issue.

6 participants