fixed some unitialized variables

This commit is contained in:
nillerusr 2022-08-19 23:27:37 +03:00
parent 0a66367243
commit a16123e4be
7 changed files with 24 additions and 8 deletions

View File

@ -2447,10 +2447,10 @@ bool CVoxelTree::EnumerateElementsAlongRay_ExtrudedRay( SpatialPartitionListMask
return true;
// Setup.
int nStep[3];
float tMax[3]; // amount of change in t along ray until we hit the next new voxel
float tMin[3]; // amount of change in t along ray until we leave the last voxel
float tDelta[3];
int nStep[3] = {0, 0, 0};
float tMax[3] = {0.f, 0.f, 0.f}; // amount of change in t along ray until we hit the next new voxel
float tMin[3] = {0.f, 0.f, 0.f}; // amount of change in t along ray until we leave the last voxel
float tDelta[3] = {0.f, 0.f, 0.f};
m_pVoxelHash[0].LeafListExtrudedRaySetup( ray, vecInvDelta, vecMin, vecMax, voxelBounds[0][0], voxelBounds[0][1], nStep, tMin, tMax, tDelta );
int nLastVoxel1[3];

View File

@ -1038,7 +1038,7 @@ inline T QWordSwapC( T dw )
// The typically used methods.
//-------------------------------------
#if (defined(__i386__) || (defined(__arm__) && defined(ANDROID))) && !defined(VALVE_LITTLE_ENDIAN)
#if (defined(__i386__) || defined(__amd64__) || (defined(__arm__) && defined(ANDROID))) && !defined(VALVE_LITTLE_ENDIAN)
#define VALVE_LITTLE_ENDIAN 1
#endif

View File

@ -277,6 +277,9 @@ enum GLDriverProvider_t
cGLDriverProviderIntel,
cGLDriverProviderIntelOpenSource,
cGLDriverProviderApple,
cGLDriverProviderARM,
cGLDriverProviderQualcomm,
cGLDriverProviderImagination,
cGLTotalDriverProviders
};

View File

@ -279,7 +279,7 @@ CSysModule *Sys_LoadModule( const char *pModuleName, Sys_Flags flags /* = SYS_NO
// prior to the call to this routine.
char szCwd[1024];
#ifdef POSIX
char szModuleName[1024];
char szModuleName[1024] = { 0 };
#endif
HMODULE hDLL = NULL;

View File

@ -2454,6 +2454,7 @@ static uint gPersistentBufferSize[kGLMNumBufferTypes] =
GLMContext::GLMContext( IDirect3DDevice9 *pDevice, GLMDisplayParams *params )
{
m_nNumDirtySamplers = 0;
// m_bUseSamplerObjects = true;
//
// // On most AMD drivers (like the current latest, 12.10 Windows), the PCF depth comparison mode doesn't work on sampler objects, so just punt them.

View File

@ -365,6 +365,12 @@ COpenGLEntryPoints::COpenGLEntryPoints()
m_nDriverProvider = cGLDriverProviderIntelOpenSource;
else if ( V_stristr( m_pGLDriverStrings[cGLVendorString], "apple" ) )
m_nDriverProvider = cGLDriverProviderApple;
else if ( V_stristr( m_pGLDriverStrings[cGLVendorString], "qualcomm" ) )
m_nDriverProvider = cGLDriverProviderQualcomm;
else if ( V_stristr( m_pGLDriverStrings[cGLVendorString], "arm" ) )
m_nDriverProvider = cGLDriverProviderARM;
else if ( V_stristr( m_pGLDriverStrings[cGLVendorString], "imagination technologies" ) )
m_nDriverProvider = cGLDriverProviderImagination;
pszString = ( const char * )glGetString(GL_RENDERER);
m_pGLDriverStrings[cGLRendererString] = strdup( pszString ? pszString : "" );

View File

@ -2359,10 +2359,16 @@ static uint gPersistentBufferSize[kGLMNumBufferTypes] =
GLMContext::GLMContext( IDirect3DDevice9 *pDevice, GLMDisplayParams *params )
{
m_nNumDirtySamplers = 0;
if( gGL->m_nDriverProvider == cGLDriverProviderARM )
m_bUseSamplerObjects = true;
if ( CommandLine()->CheckParm( "-gl_disablesamplerobjects" ) )
else
m_bUseSamplerObjects = false;
if ( CommandLine()->CheckParm( "-gl_enablesamplerobjects" ) )
m_bUseSamplerObjects = true;
// Try to get some more free memory by relying on driver host copies instead of ours.
// In some cases the driver will be able to discard their own host copy and rely on GPU
// memory, reducing memory usage.