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

0*vec3 gets optimized to 0 #147

Closed
LeStahL opened this issue Sep 23, 2022 · 2 comments
Closed

0*vec3 gets optimized to 0 #147

LeStahL opened this issue Sep 23, 2022 · 2 comments

Comments

@LeStahL
Copy link

LeStahL commented Sep 23, 2022

The shader

const vec3 x = 0.*vec3(1.,0.,1.);

gets minified to const vec3 f=0.;, resulting in compiler errors. Expected behavior would be const vec3 f=vec3(0.);.

Interestingly, glslang-validator will validate the output of shader_minifier as correct (?), which makes these kind of issues hard to debug.

Observed on version 1.2.

@laurentlb
Copy link
Owner

It's the same issue as #2.

I think we could propagate type information to avoid this kind of bug (at least for the simple cases).

@laurentlb
Copy link
Owner

Closing this issue as I've disabled the 0.*x optimization (#187).

I'll reintroduce it when we have a way to check the type of expressions.

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

No branches or pull requests

2 participants