-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Shared Texture Support #6742
Comments
IIRC you can't share textures across multiple Metal contexts. IDK if you can have one Metal context that works across multiple windows. |
Metal can share textures just fine, as long as each context has the same |
Any updates on this? |
I am also interested in this topic. Is anyone working on this? |
It's been a bit, any updates? |
Feel free to add a PR for this! |
This would be quite desirable to get e.g. dear imgui multi-viewports working with SDL_Renderer without requiring user to enforce an OpenGL backend with My assumption is that this is quite easy to achieve. I believe the only design debate is whether this should be always on or opt-in. I would be in favor of always-on as I don't think any drawback and feel it would be simpler for everyone (users and implementations). With some backends it depending on how SDL implement its multi-window it might possibly even be extra work to guarantee a separation. (In case this may be of any use: Dear ImGui Backends for Metal, DX11, DX12, Vulkan, OpenGL and other support the sharing of resources in its backends: https://github.com/ocornut/imgui/tree/docking/backends. It is often a few lines of code) |
I dug into this a little bit today. First of all I made a branch with dear imgui multi-viewports support for SDL_Renderer3 (fyi this is what multi-viewports means for dear imgui). Branch is currently not working because of this issue and another, but I assumed having this as a test-bed might be useful to someone:
On this specific "shared texture support". In October 2023 I posted "My assumption is that this is quite easy to achieve." but I dug very briefly:
I think it would be an enabler and non-issue if all SDL_Renderer shared resources (when using same driver naturally), but I don't know how much work it would be for SDL_Renderer. I presume that generally work on e.g shaders support for SDL will naturally lead in that direction, aka people creating multiple SDL windows and multiple renderers are likely to want to share resources such as textures and shaders. |
Since SDL3 has begun its development, this may seem like the best time to support this feature.
In my case, this is needed primarily for imgui's viewports with SDL_Renderer. But, I imagine it'll also be very useful for other situations.
The comment that explains the need for this feature is here: ocornut/imgui#5835 (comment)
The text was updated successfully, but these errors were encountered: