Open mbechard opened 3 months ago
As you are likely aware, moving non-trailing members of input blocks in vertex shaders is impossible and would cause incompatibility at the vertex input interface. Likewise for output blocks in frag shaders and the frag output interface.
Technically we could remove non-trailing members from other shader interfaces but we would have to add logic to remap any OpAccessChain instructions that index into the block because the positions of the remaining members would change. This is very do-able. It would not cause any changes to the larger workflow. It would just be some coding effort.
Yep, this is what I would expect. I'm only looking for this optimization in shader->shader interfaces, since those resources are quite limited.
Sending the the following fragment shader through SpirvToolsEliminateDeadInputComponents() and SpirvToolsAnalyzeDeadOutputStores() results in
t
getting eliminated, but notpos
. Can'tpos
also be eliminated? The analyze pass is correctly detecting that onlyc
is being used, and only returning it as part of the livelocs. And then similarly, SpirvToolsEliminateDeadOutputStores() would need to also to removepos
.Vertex
Fragment
Compiled using 'auto map locations'.
Thanks