We're experimenting with DX11 dynamic linking and ran into some weird warnings, leading to errors.
Has anyone any explanation for these? The internal error, for example, isn't very helpful :( When we inline the code from GetBias, some of the warnings disappear.
See below.
// WARNING X3578 HERE, line 246float GetBias(const float2 depthGrad, const float2 offset) { return dot(depthGrad, offset);}interface iShadowType { float getShadow(const float2 depthGrad, const float2 uv);};class cShadowTypeNone : iShadowType { // WARNING X3578, line 258 float getShadow(const float2 depthGrad, const float2 uv) { return 1; }};class cShadowTypePCF : iShadowType { float getShadow(const float2 depthGrad, const float2 uv) { float offset = 1; float sum = 0; if (uv.x == 1) { float bias = GetBias(depthGrad, offset); float shadow = shadowMap.SampleCmpLevelZero(sampCmpShadowMap, uv + offset, bias); sum += shadow; } else sum += 1; return sum; }};iShadowType shadowType;cbuffer cbShadowType { cShadowTypeNone shadowTypeNoneInstance; cShadowTypePCF shadowTypePCFInstance;};interface iShadowShader { float getShadow(const float2 depthGrad, const float2 uv);};class cShadowNone : iShadowShader { float getShadow(const float2 depthGrad, const float2 uv) { return 1; }};class cShadowNoPCSS : iShadowShader { float getShadow(const float2 depthGrad, const float2 uv) { return shadowType.getShadow(depthGrad, uv); }};iShadowShader shadowShader;cbuffer cbShadowShader { cShadowNone shadowNoneInstance; cShadowNoPCSS shadowNoPCSSInstance;};
The compilation log:
dynamicShadow.fxh(246,7): warning X3578: Output value 'GetBias' is not completely initializeddynamicShadow.fxh(246,7): warning X3578: Output value 'GetBias' is not completely initializedinternal error: no storage type for block outputdynamicShadow.fxh(246,7): warning X3578: Output value 'GetBias' is not completely initializeddynamicShadow.fxh(258,8): warning X3578: Output value 'cShadowTypeNone::getShadow' is not completely initializedshading.fx(310,19): There was an error compiling expression