Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created November 19, 2015 00:04
Show Gist options
  • Select an option

  • Save AndrewRayCode/94913d8fa5081bd9a098 to your computer and use it in GitHub Desktop.

Select an option

Save AndrewRayCode/94913d8fa5081bd9a098 to your computer and use it in GitHub Desktop.
it('variables in main child scope (like for loop) that conflict get renamed correctly ', function() {
var combined = newComposedShader(
newSubShader({
fragment: `
void main() {
vec2 position = vec2( 1.0 );
for (int p = 0; p < 20; p++) {
vec2 other = position + p;
}
gl_FragColor = 1.0;
}
`
}),
newSubShader({
fragment: `
void main() {
vec2 position = vec2( 1.0 );
gl_FragColor = 1.0;
}
`
})
);
expect( combined.runtime.fragment.toString() ).not.to.contain( ' position + p' );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment