We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4168 - Sharing resources via wglShareLists (i.e. SDL_GL_ShareLists)
Summary: Sharing resources via wglShareLists (i.e. SDL_GL_ShareLists)
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.8
Hardware: All Windows (All)
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-13 17:23 UTC by Charles Van Noland
Modified: 2018-11-11 01:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Van Noland 2018-05-13 17:23:14 UTC
With the existing functionality added that separated out the window handling from the GL rendering contexts it would be nice to be able to apply that to multithreaded resource generation (i.e. generating mesh vertex buffers, textures, etc) but this requires that a 2ndary rendering context interacted with by worker threads be able to generate resources and upload them to the GPU for the rendering context on the main thread to use for rendering. By default OpenGL does not share resources across rendering contexts within a program, this must be accomplished via wglShareLists (on Windoze systems) and there's nothing in SDL currently wrapping it, so users are forced to include OS-specific code in their SDL program in order to share GL resources between contexts.
Comment 1 Alex Szpakowski 2018-11-11 01:27:23 UTC
Does SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1) work for you when creating the second context?