Skip to content
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

Settle on a per-corner rounding impl #72

Open
WillPower3309 opened this issue Nov 1, 2024 · 4 comments
Open

Settle on a per-corner rounding impl #72

WillPower3309 opened this issue Nov 1, 2024 · 4 comments
Milestone

Comments

@WillPower3309
Copy link
Member

Right now we have two different ways to round specific corners. One is used in rects where we have a different shader for each corner, and the other is in the tex shader where we do some step magic. We should settle on one impl for all corners.

One alternative idea I have is to completely remove the round_rect shader and the corner rounding logic in the tex shader, and damage everything EXCEPT the corners. Then we could damage the corners and have a shader for each corner. We'd need to do some benchmarking here, because this could either improve or decrease perf depending on how expensive damaging is vs saving the extra GPU instructions in the tex and rect shaders would be

@WillPower3309
Copy link
Member Author

related to #70

@ErikReider
Copy link
Member

One alternative idea I have is to completely remove the round_rect shader and the corner rounding logic in the tex shader, and damage everything EXCEPT the corners. Then we could damage the corners and have a shader for each corner.

So it's either increase the CPU calls or increase the work of the GPU right. My gut feeling would be to go with the method we have now, but let's benchmark this! :D

@WillPower3309
Copy link
Member Author

One alternative idea I have is to completely remove the round_rect shader and the corner rounding logic in the tex shader, and damage everything EXCEPT the corners. Then we could damage the corners and have a shader for each corner.

So it's either increase the CPU calls or increase the work of the GPU right. My gut feeling would be to go with the method we have now, but let's benchmark this! :D

Exactly! At the end of the day it'd probably be so minimal that the simplest option is the best one, which is likely what we do now

@WillPower3309
Copy link
Member Author

At the end of the day this is primarily tracking the rect rounding impl matching the tex one

@WillPower3309 WillPower3309 added this to the scenefx 1.0 milestone Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants