Update tier0 (#230)

* update tier0

* update libs

* inline the functions

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
This commit is contained in:
Benoist 2024-04-19 15:56:34 +02:00 committed by GitHub
parent 017978fef7
commit c489fe84ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 32 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -983,6 +983,16 @@ PLATFORM_INTERFACE void Plat_DebugString( const char * );
#define Plat_DebugString(s) ((void)0)
#endif
#if defined(_WIN32)
PLATFORM_INTERFACE bool Plat_IsChromeOS();
PLATFORM_INTERFACE bool Plat_IsGamescope();
PLATFORM_INTERFACE bool Plat_IsSteamConsoleMode();
PLATFORM_INTERFACE bool Plat_IsSteamDeck();
PLATFORM_INTERFACE bool Plat_IsSteamOS();
PLATFORM_INTERFACE bool Plat_IsSteamOS3();
PLATFORM_INTERFACE bool Plat_IsTesla();
#endif
//-----------------------------------------------------------------------------
// XBOX Components valid in PC compilation space
//-----------------------------------------------------------------------------

View File

@ -208,13 +208,15 @@ inline int64 ThreadInterlockedCompareExchange64( int64 volatile *p, int64 value,
inline bool ThreadInterlockedAssignIf64( int64 volatile *p, int64 value, int64 comperand ) { Assert( (size_t)p % 8 == 0 ); return ( _InterlockedCompareExchange64( p, value, comperand ) == comperand ); }
#endif
#else
TT_INTERFACE int32_t ThreadInterlockedIncrement( int32_t volatile * );
TT_INTERFACE int32_t ThreadInterlockedDecrement( int32_t volatile * );
TT_INTERFACE int32_t ThreadInterlockedExchange( int32_t volatile *, int32_t value );
TT_INTERFACE int32_t ThreadInterlockedExchangeAdd( int32_t volatile *, int32_t value );
TT_INTERFACE int32_t ThreadInterlockedCompareExchange( int32_t volatile *, int32_t value, int32_t comperand );
TT_INTERFACE bool ThreadInterlockedAssignIf( int32_t volatile *, int32_t value, int32_t comperand );
#else // USE_INTRINSIC_INTERLOCKED
inline int32_t ThreadInterlockedIncrement( int32_t volatile * pDest ) { Assert( (size_t)pDest % 4 == 0 ); return __atomic_add_fetch( pDest, 1, __ATOMIC_ACQ_REL ); }
inline int32_t ThreadInterlockedDecrement( int32_t volatile * pDest ) { Assert( (size_t)pDest % 4 == 0 ); return __atomic_sub_fetch( pDest, 1, __ATOMIC_ACQ_REL ); }
inline int32_t ThreadInterlockedExchange( int32_t volatile * pDest, int32_t value ) { Assert( (size_t)pDest % 4 == 0 ); return __atomic_exchange_n( pDest, value, __ATOMIC_ACQ_REL ); }
inline int32_t ThreadInterlockedExchangeAdd( int32_t volatile * pDest, int32_t value ) { Assert( (size_t)pDest % 4 == 0 ); return __atomic_fetch_add( pDest, value, __ATOMIC_ACQ_REL ); }
inline int32_t ThreadInterlockedCompareExchange( int32_t volatile * pDest, int32_t value, int32_t comperand ) { Assert( (size_t)pDest % 4 == 0 ); int32* alignedComperand = (int32*)aligned_alloc(4, sizeof(int32)); *alignedComperand = comperand; auto initial = __atomic_load_n( pDest, __ATOMIC_ACQUIRE ); __atomic_compare_exchange_n( pDest, alignedComperand, value, false, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED ); free(alignedComperand); return initial; }
inline bool ThreadInterlockedAssignIf( int32_t volatile * pDest, int32_t value, int32_t comperand ) { Assert( (size_t)pDest % 4 == 0 ); return __atomic_compare_exchange_n( pDest, &comperand, value, false, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED ); }
#endif
inline int32_t ThreadInterlockedExchangeSubtract( int32_t volatile *p, int32_t value ) { return ThreadInterlockedExchangeAdd( (int32_t volatile *)p, -value ); }

View File

@ -52,6 +52,8 @@ public:
void Validate( CValidator &validator, tchar *pchName ); // Validate our internal structures
BOOL IsClaimed(void const *) const;
private:
CValObject *m_pValObjectFirst; // Linked list of all ValObjects

View File

@ -269,8 +269,10 @@ public:
#ifdef DBGFLAG_VALIDATE
void Validate( CValidator &validator, tchar *pchName ); // Validate our internal structures
#endif // DBGFLAG_VALIDATE
protected:
#ifdef _WIN32
void DumpSingleNode(CVProfNode *, CVProfNode *, int, bool);
#endif
// Used by vprof record/playback.
private:
@ -386,6 +388,11 @@ enum CounterGroup_t
COUNTER_GROUP_TEXTURE_PER_FRAME // Per-frame texture usage counters.
};
class DBG_CLASS CVProfManager
{
};
class DBG_CLASS CVProfile
{
public:
@ -451,6 +458,8 @@ public:
#endif
void RegisterNode(CVProfNode *pNode);
void EnterScope( const tchar *pszName, int detailLevel, const tchar *pBudgetGroupName, bool bAssertAccounted );
void EnterScope( const tchar *pszName, int detailLevel, const tchar *pBudgetGroupName, bool bAssertAccounted, int budgetFlags );
void ExitScope();