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

[opengl] Speedup compilation for Nvidia cards #5430

Merged
merged 3 commits into from
Jul 15, 2022

Conversation

bobcao3
Copy link
Collaborator

@bobcao3 bobcao3 commented Jul 14, 2022

Nvidia GLSL compilers will try to extract statically accessed array elements and place all of them directly, and it is a bit too smart for its own good.

e.g.

int arr[];

arr[8000] = 3.0;

will be detected as static and the array will be replaced with a sized one: int arr[8000]. This slows down the driver's GLSL compiler as it places all 8000 elements. This PR sorts the fields according to the size so that all the statically accessed fields (mostly matrices and global states) come first and the driver will not place extra elements.

@netlify
Copy link

netlify bot commented Jul 14, 2022

Deploy Preview for docsite-preview canceled.

Name Link
🔨 Latest commit 5f6e4ea
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/62d0736253471600097fd053

@bobcao3 bobcao3 requested review from k-ye and turbo0628 July 14, 2022 19:48
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

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

LGMT, thanks!

@k-ye k-ye merged commit 4a08398 into taichi-dev:master Jul 15, 2022
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.

2 participants