-
-
Notifications
You must be signed in to change notification settings - Fork 410
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 crash when dxCreateTexture higher than 4096 pixels #2737
Conversation
Assuming you've forgotten to uncomment the code? Also, the wording should be |
Hmm, github desktop automatically commented code out, weird. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This will break current behavior of dxCreateTexture. Also as far as I know it crashes (in really rare cases) only if setPixels is used. So if you wanna block anything higher than 4096 (in my opinion a bad idea) then it makes sense to patch setPixels leaving dxCreateTexture unchanged. Or better just don't patch anything and put a giant warning on wiki about dimensions higher than 4096. |
We shouldn't allow textures larger than the API specification regardless |
e? people are using bigger textures for radar, does it break backward compatibility? |
If you check test resource and code, you will notice it only blocks it when creating textures by giving pixels, using image that have even 20kx20k is fine. No idea why, and how it works - but it does. |
possibly. but I feel like we often make decisions based on bad practices in existing scripts and being scared of breaking those. We really should care less if someone's spaghetti script breaks in a major release (1.6) due to beneficial changes (conforming to API specifications) and they are unable to access original source or don't have the knowledge to upgrade it. Let's consider this for 1.6 You really don't need to be creating textures larger than 4096, and if for some reason you do need textures larger than this you can just use multiple textures... |
Breaking BWC for crash fixes was done before a lot of times, i think its ok to do this. |
This does precisely nothing. See MySQL module |
See discussion on MTA development discord (just search for The texture size limit comes from GPU, not the DX9 specification (100% sure it used to be in the specification by Microsoft, but later removed). We need to investigate #287 properly |
Should fix #287 according to
Test resource
texture_test.zip