Skip to content

Commit ee09a8e

Browse files
authored
Merge pull request #108 from RaphaelIT7/patch-6
[tier0] Fix a linux 64x vprof bug
2 parents 76fe8e0 + bc5764e commit ee09a8e

File tree

16 files changed

+58
-62
lines changed

16 files changed

+58
-62
lines changed

engine/host_saverestore.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static bool HaveExactMap( const char *pszMapName )
125125
static void FinishAsyncSave()
126126
{
127127
LOCAL_THREAD_LOCK();
128-
SaveMsg( "FinishAsyncSave() (%d/%d)\n", ThreadInMainThread(), ThreadGetCurrentId() );
128+
SaveMsg( "FinishAsyncSave() (%d/%lu)\n", ThreadInMainThread(), ThreadGetCurrentId() );
129129
if ( g_AsyncSaveCallQueue.Count() )
130130
{
131131
g_AsyncSaveCallQueue.CallQueued();
@@ -628,7 +628,7 @@ int CSaveRestore::SaveGameSlot( const char *pSaveName, const char *pSaveComment,
628628
Sys_Sleep( clamp( save_asyncdelay.GetInt(), 0, 3000 ) );
629629
}
630630

631-
SaveMsg( "Start save... (%d/%d)\n", ThreadInMainThread(), ThreadGetCurrentId() );
631+
SaveMsg( "Start save... (%d/%lu)\n", ThreadInMainThread(), ThreadGetCurrentId() );
632632
VPROF_BUDGET( "SaveGameSlot", "Save" );
633633
char hlPath[256], name[256], *pTokenData;
634634
int tag, i, tokenSize;

filesystem/QueuedLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct FileJob_t
9999
int m_SubmitTag;
100100
int m_nActualBytesRead;
101101
LoaderError_t m_LoaderError;
102-
unsigned int m_ThreadId;
102+
ThreadId_t m_ThreadId;
103103

104104
unsigned int m_bFinished : 1;
105105
unsigned int m_bFreeTargetAfterIO : 1;

game/shared/collisionproperty.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class CDirtySpatialPartitionEntityList : public CAutoGameSystem, public IPartiti
7373
private:
7474
CTSListWithFreeList<CBaseHandle> m_DirtyEntities;
7575
CThreadSpinRWLock m_partitionMutex;
76-
uint32 m_partitionWriteId;
76+
ThreadId_t m_partitionWriteId;
7777
CThreadLocalInt<> m_readLockCount;
7878
};
7979

gcsdk/jobmgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ int CJobMgr::CountJobs() const
12651265
//-----------------------------------------------------------------------------
12661266
void CJobMgr::CheckThreadID()
12671267
{
1268-
uint unCurrentThread = ThreadGetCurrentId();
1268+
ThreadId_t unCurrentThread = ThreadGetCurrentId();
12691269

12701270
if ( m_unFrameFuncThreadID == 0 )
12711271
{

materialsystem/cmaterialsystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void CMaterialSystem::CleanUpErrorMaterial()
349349
//-----------------------------------------------------------------------------
350350
CMaterialSystem::CMaterialSystem()
351351
{
352-
m_nRenderThreadID = 0xFFFFFFFF;
352+
m_nRenderThreadID = -1;
353353
m_hAsyncLoadFileCache = NULL;
354354
m_ShaderHInst = NULL;
355355
m_ShaderAPIFactory = NULL;
@@ -3364,7 +3364,7 @@ void CMaterialSystem::ThreadExecuteQueuedContext( CMatQueuedRenderContext *pCont
33643364
m_pRenderContext.Set( &m_HardwareRenderContext );
33653365
pContext->EndQueue( true );
33663366
m_pRenderContext.Set( pSavedRenderContext );
3367-
m_nRenderThreadID = 0xFFFFFFFF;
3367+
m_nRenderThreadID = -1;
33683368
}
33693369

33703370
IThreadPool *CMaterialSystem::CreateMatQueueThreadPool()

materialsystem/cmaterialsystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ class CMaterialSystem : public CTier2AppSystem< IMaterialSystemInternal >, publi
574574
MaterialLock_t Lock();
575575
void Unlock( MaterialLock_t );
576576
CMatCallQueue * GetRenderCallQueue();
577-
uint GetRenderThreadId() const { return m_nRenderThreadID; }
577+
ThreadId_t GetRenderThreadId() const { return m_nRenderThreadID; }
578578
void UnbindMaterial( IMaterial *pMaterial );
579579

580580
IMaterialProxy *DetermineProxyReplacements( IMaterial *pMaterial, KeyValues *pFallbackKeyValues );
@@ -700,15 +700,15 @@ class CMaterialSystem : public CTier2AppSystem< IMaterialSystemInternal >, publi
700700

701701
const char * m_pForcedTextureLoadPathID;
702702
FileCacheHandle_t m_hAsyncLoadFileCache;
703-
uint m_nRenderThreadID;
703+
ThreadId_t m_nRenderThreadID;
704704
bool m_bAllocatingRenderTargets;
705705
bool m_bInStubMode;
706706
bool m_bGeneratedConfig;
707707
bool m_bInFrame;
708708
bool m_bForcedSingleThreaded;
709709
bool m_bAllowQueuedRendering;
710710
std::atomic_bool m_bThreadHasOwnership;
711-
uint m_ThreadOwnershipID;
711+
ThreadId_t m_ThreadOwnershipID;
712712

713713
//---------------------------------
714714

materialsystem/ctexture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3980,7 +3980,7 @@ void CTexture::DeleteIfUnreferenced()
39803980
if ( ThreadInMainThread() )
39813981
{
39823982
// Render thread better not be active or bad things can happen.
3983-
Assert( MaterialSystem()->GetRenderThreadId() == 0xFFFFFFFF );
3983+
Assert( MaterialSystem()->GetRenderThreadId() == -1 );
39843984
TextureManager()->RemoveTexture( this );
39853985
return;
39863986
}

materialsystem/imaterialsysteminternal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ abstract_class IMaterialSystemInternal : public IMaterialSystem
223223
virtual CMatCallQueue *GetRenderCallQueue() = 0;
224224

225225
virtual void UnbindMaterial( IMaterial *pMaterial ) = 0;
226-
virtual uint GetRenderThreadId() const = 0 ;
226+
virtual ThreadId_t GetRenderThreadId() const = 0 ;
227227

228228
virtual IMaterialProxy *DetermineProxyReplacements( IMaterial *pMaterial, KeyValues *pFallbackKeyValues ) = 0;
229229
};

materialsystem/shaderapidx9/shaderdevicebase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ void CShaderDeviceBase::SetCurrentThreadAsOwner()
902902

903903
void CShaderDeviceBase::RemoveThreadOwner()
904904
{
905-
m_dwThreadId = 0xFFFFFFFF;
905+
m_dwThreadId = -1;
906906
}
907907

908908
bool CShaderDeviceBase::ThreadOwnsDevice()

materialsystem/shaderapidx9/shaderdevicebase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class CShaderDeviceBase : public IShaderDevice
184184

185185
int m_nWindowWidth;
186186
int m_nWindowHeight;
187-
uint32 m_dwThreadId;
187+
ThreadId_t m_dwThreadId;
188188
};
189189

190190

0 commit comments

Comments
 (0)