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

Improve dxCreateTexture #590

Open
CrosRoad95 opened this issue Sep 25, 2018 · 1 comment
Open

Improve dxCreateTexture #590

CrosRoad95 opened this issue Sep 25, 2018 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@CrosRoad95
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Now if you trying load some textures ( mainly bigger ), it cause lags

Describe the solution you'd like
Add opportunity to load texture slowly but without lags ( like passwordHash but i tried and caused crash )

Describe alternatives you've considered

Additional context

@botder botder added the enhancement New feature or request label Oct 26, 2018
@botder botder added this to the Backlog milestone Mar 3, 2019
@Pirulax
Copy link
Contributor

Pirulax commented Nov 13, 2020

You can't just do something thats designed to run in sync async, thats why you have crashed.
Sadly, It's not really possible to optimize dxCreateTexture as the underlaying d3d9 API call is the slow part, not MTA code. The slowest part is converting the texture (and if you have a really really really shit HDD, then the IO as well).
When loading ARGB into ARGB its fast, but, for example, DXT3 to ARGB is very slow.

The solution would be to:

  • Load image data on a secondary thread (like with passwordHash, use Async task sched)
  • Convert the image an external lib like DirectXTex
  • Pass the raw texture data to d3d9, and hope it loads fast

My experience with this method is very weird, as passing in the preloaded(might have been a conversion issue) data was 10x slower than reading it from the disk.

@patrikjuvonen patrikjuvonen changed the title improve dxCreateTexture Improve dxCreateTexture Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants