Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Lutz

glTexImage2D and multithreading

This topic is 5281 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey! I''ve loaded a texture and passed it to VRam with glTexImage2D while my engine is running. This way I noticed ugly slowdowns. So I''d like to do it in a separate thread. Because I''m quite new to multithreading, I''d like to know two things: 1) Will this solve the slowdowns or at least speed it up a bit? I don''t need the texture at once, so the separate thread may run for a few frames, I don''t care. 2) How will the graphics hardware react to multithreading? If my main thread happens to draw some triangles while the separate thread calls glTexImage2D, will it crash or will it work?

Share this post


Link to post
Share on other sites
Advertisement
The rendering context can only be active in a single thread at a time, so using multithreading for that is not possible.

Share this post


Link to post
Share on other sites
that''s why games have "loading" screens

1. render some text saying "loading"

2. load all models and the world

3. load all the textures that are needed for these models

4. begin to render the screen

the loading screen will remain on screen until step 4 (because nothing else is rendering), and will go away when you render the world.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!