Skip to content

Ensure GLSL variables are initialized#918

Merged
dsrbecky merged 1 commit intogoogle:masterfrom
dsrbecky:glsl
Aug 16, 2017
Merged

Ensure GLSL variables are initialized#918
dsrbecky merged 1 commit intogoogle:masterfrom
dsrbecky:glsl

Conversation

@dsrbecky
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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