-
Notifications
You must be signed in to change notification settings - Fork 3
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
GPU driver for SDL_render #192
GPU driver for SDL_render #192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a high level this looks great so far - we may change the shader pipeline to be more like testgpu but the core is what's most important and it's in good shape. I may defer to @icculus for some of the FIXMEs/TODOs since a lot of it depends on what SDL_Render prefers at a high level, and I'm not as familiar with that as I should be.
src/render/sdlgpu/SDL_shaders_gpu.c
Outdated
SDL_GpuShaderFormat format; | ||
} GPU_ShaderModuleSource; | ||
|
||
// FIXME Please fix this in the build system! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will have to be #ifdef
rather than just #if
, since that's how cmakedefines come out https://github.com/thatcosmonaut/SDL/blob/gpu/include/build_config/SDL_build_config.h.cmake#L447
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like SDL defines a bunch of undefined macros as 0s here, at least for the render backends: https://github.com/libsdl-org/SDL/blob/a7bed810b3499d157655ae6dcc7cd5e8a34fa549/src/SDL_internal.h#L194
GPU also uses #if
checks on its backend defines, which is technically not correct (clang throws a warning).
Maybe we could do something similar for GPU backends. I like them being 1/0 macros because it makes the implementation of GPU_FillSupportedShaderFormats
neat, but it's not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch - we can do the same for GPU.
I'm personally not a fan of the testgpu shader builder because it requires running on at least two different proprietary operating systems in order to rebuild all the shaders. I tried to make it reasonably portable, but it's your call. |
66aaf8e
to
c5fafed
Compare
8d15a6f
to
95bf26e
Compare
3b02992
to
3856fbc
Compare
3856fbc
to
7ef675e
Compare
Lots of missing and broken stuff, but it's a start
Shouldn't change the behavior, just makes the intent a little more clear.
We have to render everything into a faux-backbuffer to support this, because swapchain readback is pain and synchronous swapchain readback is gigapain.
I hate this but CI must pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest should be good enough for the first round of Beta reviews - they may complain about util.h and pipeline.c/h but that's an easy fix if it comes up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. There's some significant performance issues here that we should address before ship but the SDL_render tests are functional and the busywork is done, so that's good enough for now. Will squash and then commit a patch on top that fixes a sampler creation issue and notes some performance FIXMEs.
Yeah, I'm super-thrilled someone just jumped in to work on this, as it's going to be quite important, so thanks for that! |
A basic GPU driver for SDL_render. Mostly based on the GL driver with some reference to the Vulkan one.
I threw most of the stuff from the
test
directory at it and it all seems to work, includingtestautomation
. This is by no means comprehensive and I have yet to test it with a more serious program (probably through the sdl2-compat layer), or on anything that isn't Vulkan on Linux.Some known issues:
TODO
s andFIXME
s throughout the code.Closes #12