fix address sanitizer issues #2

This commit is contained in:
nillerusr
2022-05-01 20:08:32 +03:00
parent ce68fffa3b
commit 61cd8d0afc
27 changed files with 119 additions and 91 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ BEGIN_VS_SHADER_FLAGS( DepthWrite, "Help for Depth Write", SHADER_NOT_EDITABLE )
vParms.y = 4000.0f; // arbitrary far
vParms.z = 0.0f;
vParms.w = 0.0f;
pShaderAPI->SetPixelShaderConstant( 1, vParms.Base(), 2 );
pShaderAPI->SetPixelShaderConstant( 1, vParms.Base(), 1 );
} // DYNAMIC_STATE
@@ -132,15 +132,16 @@ BEGIN_VS_SHADER_FLAGS( ParticleSphere_DX9, "Help for BumpmappedEnvMap", SHADER_N
// (It does this by seeing if the intensity*1/distSqr is > 1. If so, then it scales it so
// it is equal to 1).
const float *f = params[LIGHT_COLOR]->GetVecValue();
Vector vLightColor( f[0], f[1], f[2] );
Vector4D vLightColor( f[0], f[1], f[2], 0.f );
float flScale = max( vLightColor.x, max( vLightColor.y, vLightColor.z ) );
if ( flScale < 0.01f )
flScale = 0.01f;
float vScaleVec[3] = { flScale, flScale, flScale };
Vector4D vScaleVec = { flScale, flScale, flScale, 0.f };
vLightColor /= flScale;
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_1, vLightColor.Base() );
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_2, vScaleVec );
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_2, vScaleVec.Base() );
pShaderAPI->SetPixelShaderFogParams( PSREG_FOG_PARAMS );