-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
SDL_GPU Backend #8163
base: master
Are you sure you want to change the base?
SDL_GPU Backend #8163
Conversation
Added source sharder files for the SDL_GPU Backend and instructions on how to compile them
Update example_sdl3_sdlgpu.vcxproj
Changed sdl3-config --libs to pkg-config --libs sdl3 when linking libraries
I think I've added everything, now the Makefile works on both Linux and MacOS. Let me know if there's anything else to fix or add or test |
Forward-declare enums ad structs instead of including SDL_gpu.h in header file
This reverts commit 4ee6ce4.
I might be doing something wrong but when integrating this I had to change the target_info on the pipeline to match my other pipelines in order to have depth and stencil test configuration from the imgui pipeline properly applied. This is on Metal. Without the patch below the imgui content rendered behind, not in front of the scene:
|
If you want to apply it on top of other rendered geometry in an existing renderpass then yes, you would need to use a depth buffer, but I believe that usually you would render ImGui as the last renderpass of your application, so it gets drawn on top of everything else without problems or a zbuffer. I can add a custom pipeline input though, so you can pass what you need without problems |
Sounds like I need to separate out a render pass for imgui, in which case the imgui backend will work as-is. Thanks! (My knowledge of modern rendering APIs is limited.) |
I've added a custom pipeline input in |
I've made it work with a separate render pass. |
Good job, thanks! |
Please take your time, I'll keep working on it to improve some things anyways |
Accidentally left pipeline in ImGui_ImplSDLGPU_RenderDrawData
New PR because I irreparably messed up the commit history on the old one.
Now that SDL3 has reached ABI stability, I've added a SDL_Gpu backend to ImGui. The only notable difference from other backends lies in the fact that SDL_Gpu doesn't allow copy passes to occur during a renderpass.
There are two solutions to this problem (that I thought of):
I chose the second option because I thought it was the more useful one, but the code can be rewritten easily to support the former if deemed necessary. I've included shaders for SPIRV, DXCB and METALLIB for MacOS, I'll be able to compile the remaining ones for iOS and tvOS as soon as I'm able to install the SDKs for those.
I also wrote an example for the Visual Studio solution and added a Make file for other platforms