microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
2.98k stars 665 forks source link

Make the location map run per entry point #6688

Closed s-perron closed 2 weeks ago

s-perron commented 2 weeks ago

The code that adds the input and output decoration in the entry points inputs and outputs assumes that there is a single entry point in the module. When using the lib profile that is not true.

This commit modifies the code so that it groups the stage variables by entry point, and runs the current code on each group separably.

I hesitate to make this change because it will change the locations for code that currently works, and will force users to update their applications accordingly. Or they could modify their shaders to use explicit locations attributes. Neither is great.

However, the advantage is that this allows the implicit locations to match what would happen if the shader were compiled individually. It also makes the locations more predictable because change in another shader would change all shader after it. This is a better design, and worth the breakage.

Fixes #6678 Fixes #5213