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

Refactor global state for built-in pixel shader effects #592

Merged
merged 11 commits into from
Oct 8, 2023

Conversation

Sergio0694
Copy link
Owner

Description

This PR refactors the internal Foo<T> type used by the built-in pixel shader effects, and switches that to use a Globals abstract class with all shader properties, and derived Globals<T> class implementing all properties for each shader type T. The factory will now pass that instance, and the pixel shader effect will use a GCHandle to resolve Globals instances and invoke members on it. This avoids the need to manually copy all properties from the shader at construction time, from the static constructor. Now they're all lazily initialized instead, as an additional bonus.

@Sergio0694 Sergio0694 added enhancement ✨ An improvement to existing APIs optimization 🚀 Performance improvement to existing APIs labels Oct 5, 2023
@Sergio0694 Sergio0694 force-pushed the dev/refactor-pse-shared-state branch from eacb096 to 38f1d37 Compare October 5, 2023 08:50
@Sergio0694 Sergio0694 force-pushed the dev/refactor-pse-shared-state branch from 534e7f7 to b13322a Compare October 7, 2023 10:56
@Sergio0694 Sergio0694 force-pushed the dev/refactor-pse-shared-state branch from b13322a to 73e0367 Compare October 7, 2023 17:31
@Sergio0694 Sergio0694 merged commit 392cf5c into main Oct 8, 2023
48 checks passed
@Sergio0694 Sergio0694 deleted the dev/refactor-pse-shared-state branch October 8, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ An improvement to existing APIs optimization 🚀 Performance improvement to existing APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant