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

[SPIRV] Invalid SSA and missing OpPhi? #63

Closed
sylware opened this issue Aug 27, 2015 · 3 comments
Closed

[SPIRV] Invalid SSA and missing OpPhi? #63

sylware opened this issue Aug 27, 2015 · 3 comments

Comments

@sylware
Copy link

sylware commented Aug 27, 2015

version 450

layout(location = 0) in vec4 in_position;

void main()
{
float y;

    if(in_position[0]>50.0)
            y=1.0;
    else
            y=2.0;

    gl_Position[0] = y;

}

It seems to generate invalid SSA because it is assigning 2 times a variable, probably because it misses a phi SSA function.
Or do I miss something?

@mknejp
Copy link
Contributor

mknejp commented Aug 28, 2015

There are really two models that SPIR-V supports. The one chosen by glslang seems to be a load/store model without OpPhi. The alternative is to use only OpPhi and do without loads/stores where possible. Both are equally valid (if side effects are handled properly) and one can transform the former into the latter.

@sylware
Copy link
Author

sylware commented Aug 28, 2015 via email

@sylware
Copy link
Author

sylware commented Aug 29, 2015

It seems since spirv is based on ssa, but not formal ssa,
phi may be more an extra implementation burden than anything else.
There is a bug an khronos bugzilla for the spirv product.

@sylware sylware closed this as completed Aug 29, 2015
qingyuanzNV pushed a commit to qingyuanzNV/glslang that referenced this issue Oct 18, 2022
…sions

Add missing extensions for several symbols
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