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

Combine the shader point and spot light lookup into one loop. #17510

Closed

Conversation

pcwalton
Copy link
Contributor

Point and spot lights are treated similarly. In fact, the point light calculations are part of the spot light calculations. So we can simplify the code by unifying the two loops. This might make life easier for the shader compiler too.

Point and spot lights are treated similarly. In fact, the point light
calculations are part of the spot light calculations. So we can simplify
the code by unifying the two loops. This might make life easier for the
shader compiler too.
@pcwalton pcwalton added A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change C-Performance A change motivated by improving speed, memory usage or compile times S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 23, 2025
@BenjaminBrienen BenjaminBrienen added D-Straightforward Simple bug fixes and API improvements, docs, test and examples D-Shaders This code uses GPU shader languages labels Jan 23, 2025
Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started an example run TheBevyFlock/bevy-example-runner#94

Code looks good

@Elabajaba
Copy link
Contributor

This regresses both VGPR and SGPR on my machine.

@pcwalton
Copy link
Contributor Author

@Elabajaba Ugh, that's so annoying. I wonder if it'll end up winning when we do more (like disable PCSS when not in use) though? This stuff is hard to predict.

@pcwalton
Copy link
Contributor Author

I'm going to close this for now because it regresses VGPR.

@pcwalton pcwalton closed this Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change C-Performance A change motivated by improving speed, memory usage or compile times D-Shaders This code uses GPU shader languages D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants