I want to use several different pixel shaders with several different vertex shaders in any combination. D3D11 seems to complain if the linkage doesn't match up perfectly, so to solve this I created the requirement that every vertex shader must use this and only this
struct VSCommonOut
{
float4 Position : SV_POSITION;
float2 TexCoord : TEXCOORD0;
float3 Normal : TEXCOORD1;
float3 WorldPos : TEXCOORD2;
float4 DiffuseColor : COLOR0;
};
as output, and every pixel shader must use this and only this as input. However I have a series of questions!
1. Will unwritten outputs be removed by the compiler as an optimization?
3. If so can I prevent this by writing dummy outputs (eg just 0 for unused texcoords and 1 for unused colors?)
4. If I do that, there might be several unnecessary outputs going to the pixel shader (eg texcoord and color going to a write-shadow-depth pixel shader), would that damage performance?
NB-1. Targeting vs_4_0_level_9_3
NB-2. Assume that the HLSL compiler I am using is the latest one, ie I downloaded the windows8 kit last week when I upgraded to 8






