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

Ensure GLSL variables are initialized #918

Merged
merged 1 commit into from
Aug 16, 2017
Merged

Conversation

dsrbecky
Copy link
Contributor

The compat layer sometimes creates code which uses uninitialized
variables. Although the output is technically correct, it makes
my driver complain a lot.

@dsrbecky dsrbecky requested a review from ben-clayton August 15, 2017 18:16
The compat layer sometimes creates code which uses uninitialized
variables.  Although the output is technically correct, it makes
my driver complain a lot.
// Explicitly initialize locals. This is a work around for SPIR-V cross problem
// where it may generate code which reads locals before initializing them.
// For example, "v.x = 42.0;" becomes "v = vec4(42.0, v.y, v.z, v.w);"
void SpvManager::initLocals() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a good thing to upstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, the proper fix would be in SPIRV-Cross. I have investigated that approach for a bit, but gave up. I just ended fixing a bug.

@dsrbecky dsrbecky merged commit e70530c into google:master Aug 16, 2017
@dsrbecky dsrbecky deleted the glsl branch August 16, 2017 10:51
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