-
Notifications
You must be signed in to change notification settings - Fork 131
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
Added GPUTextEngine #412
base: main
Are you sure you want to change the base?
Added GPUTextEngine #412
Conversation
Looks like stuff broke after pulling the latest changes. I am working on fixing them. |
Fixed. |
In general, this looks good so far! |
I have removed the hardcoded shader stuff and took the script from src/render/gpu/shader to build my shaders. I have only tested the workflow for spirv and vulkan since I only have access to a linux machine atm. I will appreciate if someone can help generate the shaders for other platforms or even provide some input about them. The renderer gpu backend doesn't seem to have any hlsl or msl shader present so I assume that the script generates them from spirv provided you have spirv-cross in your path. |
I have improved the example and also formatted it |
I have fixed the CI. |
I don't think you need to commit all files in the shaders directory. |
Now that we have a CLI for shadercross we should be building shaders with that instead, no need for another shader frontend dependency. |
Yeah, pushed them by mistake. I will remove those files. |
Note, the example seems to leak memory. But it's probably due to #425 and so not caused by me. |
You can verify by linking to SDL3_test, and calling |
Well it's show allocations and those are increasing. |
Just to make sure, this PR isn't waiting for something from my end right? |
@@ -0,0 +1,37 @@ | |||
License |
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.
Please don't include any fonts in the SDL_ttf project. There are plenty out there already for people to use.
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.
Copied from discord.
I actually decided to ship the font because if the font isn't monospaced the example will look quite weird and also different fonts will change the size of the text drastically due to the 3D rotation, it will be very hard to mitigate that only by changing the point size.
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.
This looks good to me!
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 this contribution! I'm implementing fonts in my project and this is a very good learning material!
Just noticed a minor typo
Done. Thanks for the review. |
libsdl-org/SDL#11398 was closed as not planned. So, this PR is again ready I hope? |
@captain0xff, can you rebase and resolve conflicts? |
Actually, never mind, I can squash this as a single commit. |
Yes, that will be better. Most of the commit messages are not very sensible. |
This PR extends the new text rendering api to support the gpu api. It's still not ready for merging but the reason I am creating the PR is so that the API can be reviewed.
Things that I still need to do:-
I will need some help with the shaders because I don't have much idea about the workflow needed for the Metal and Direct3D backends.