KhronosGroup / KhronosGroup/SPIRV-Tools
Request: allow SpirvToolsEliminateDeadInputComponents() to strip non-trailing members from blocks
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
Sending the the following fragment shader through SpirvToolsEliminateDeadInputComponents() and SpirvToolsAnalyzeDeadOutputStores() results in `t` getting eliminated, but not `pos`. Can't `pos` also be eliminated? The analyze pass is correctly detecting that only `c` is being used, and only returning it as part of the livelocs.
And then similarly, SpirvToolsEliminateDeadOutputStores() would need to also to remove `pos`.
Vertex
```
out Vertex
{
vec3 pos;
vec4 c;
vec2 t;
} oVert;
void main()
{
oVert.pos = vec3(0.5);
oVert.c = vec4(1.0);
oVert.t = vec2(0.4);
gl_Position = vec4(0.0);
}
```
Fragment
```
in Vertex
{
vec3 pos;
vec4 c;
vec2 t;
} iVert;
out vec4 fragColor;
void main()
{
vec4 color = vec4(iVert.c);
fragColor = color;
}
```
Compiled using 'auto map locations'.
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.