I have a common method in hlsli
/// RendererShaderTypes.hlsli
///
static inline float4 OverlayColor(float2 texOverlay, float4 videoColor)
{
float4 texColor = float4(imageMixTexture[4].Sample(imageMixSampler[4], texOverlay));
if (texColor.r == keyColor.r &&
texColor.g == keyColor.g &&
texColor.b == keyColor.b)
{
return videoColor;
}
return lerp(texColor, videoColor, transparency);
}
It's called from more than one hlsl pixel shaders.
#include "RendererShaderTypes.hlsli"
float4 main(PSPosTexOverlay input) : SV_TARGET
{
return OverlayColor(input.texOverlay, backColor);
}
also called to another pixel shader
#include "RendererShaderTypes.hlsli"
float4 main(PSPosVideoTexture input) : SV_TARGET
{
// lookup color of video
float4 mixColor = mul(colorMatrix[0], VideoColor(imageMixSampler[0], imageMixTexture[0], input.texImage));
mixColor.rgb *= mixColor.a;
mixColor.a = 1.0f;
return OverlayColor(input.texOverlay, mixColor);
}
when compiled shows following warning. Any idea why it's showing?
warning X4000: use of potentially uninitialized variable (OverlayColor)