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

Use correct Y axis direction #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

2asoft
Copy link

@2asoft 2asoft commented Aug 30, 2020

WGPU 0.4 has Y axis pointing Down
nuklear-backend-wgpurs assumes (in projection matrix) it points up, but also knows it must point down and performs costly y coordinate fix by iterating all vertices.
This change removes the costly iteration, and changes the projection matrix to use WGPU 0.4's natural Y axis direction.

The effect is rather dramatic (on my machine, so YMMV).
The iteration (with const MAX_VERTEX_MEMORY: usize = 512 * 1024;) used to take 26-50ms, which increased frame render time.
With this gone, overhead of this backend is negligible.

WGPU 0.4 has Y axis pointing Down
nuklear-backend-wgpurs assumes (in projection matrix) it points up, but also knows it must point down and performs costly y coordinate fix by iterating all vertices.
This change removes the costly iteration, and changes the projection matrix to use WGPU 0.4's natural Y axis direction
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

Successfully merging this pull request may close these issues.

None yet

1 participant