Fix white soft shadows glitch

Assigning an integer to a float variable in HLSL causes undefined behaviour in RadeonSI/MESA.
This commit is contained in:
numas13 2020-08-17 23:14:20 +03:00
parent 3960b88cc4
commit 71dc2bc90b
2 changed files with 2 additions and 2 deletions

View file

@ -368,7 +368,7 @@ void main( PS_IN fragment, out PS_OUT result )
//float vogelPhi = InterleavedGradientNoiseAnim( fragment.position.xy, rpJitterTexOffset.w );
float shadowTexelSize = rpScreenCorrectionFactor.z * rpJitterTexScale.x;
for( float i = 0; i < numSamples; i += 1.0 )
for( float i = 0.0; i < numSamples; i += 1.0 )
{
float2 jitter = VogelDiskSample( i, numSamples, vogelPhi );

View file

@ -10316,7 +10316,7 @@ static const cgShaderDef_t cg_renderprogs[] =
" //float vogelPhi = InterleavedGradientNoiseAnim( fragment.position.xy, rpJitterTexOffset.w );\n"
"\n"
" float shadowTexelSize = rpScreenCorrectionFactor.z * rpJitterTexScale.x;\n"
" for( float i = 0; i < numSamples; i += 1.0 )\n"
" for( float i = 0.0; i < numSamples; i += 1.0 )\n"
" {\n"
" float2 jitter = VogelDiskSample( i, numSamples, vogelPhi );\n"
"\n"