mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
arm64 : fix intptr_t size
This commit is contained in:
@@ -338,7 +338,7 @@ public:
|
||||
Assert( m_VertexSize );
|
||||
Assert( !m_pVertexData );
|
||||
m_pVertexData = (byte *)m_pOwner->AllocVertices( numVerts, m_VertexSize );
|
||||
Assert( (unsigned)m_pVertexData % 16 == 0 );
|
||||
Assert( (uintp)m_pVertexData % 16 == 0 );
|
||||
|
||||
// Compute the vertex index..
|
||||
desc.m_nFirstVertex = 0;
|
||||
|
||||
@@ -2200,7 +2200,7 @@ int CMatRenderContext::CompareMaterialCombos( IMaterial *pMaterial1, IMaterial *
|
||||
if ( dLightmap )
|
||||
return dLightmap;
|
||||
|
||||
return (int)pMat1 - (int)pMat2;
|
||||
return (intp)pMat1 - (intp)pMat2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
class ITextureInternal;
|
||||
class CMaterialSystem;
|
||||
class CMatLightmaps;
|
||||
typedef int ShaderAPITextureHandle_t;
|
||||
typedef intp ShaderAPITextureHandle_t;
|
||||
class IMorphMgrRenderContext;
|
||||
class CMatCallQueue;
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#endif
|
||||
#include "colorspace.h"
|
||||
#include "string.h"
|
||||
#include <malloc.h>
|
||||
#include <stdlib.h>
|
||||
#include "utlmemory.h"
|
||||
#include "IHardwareConfigInternal.h"
|
||||
@@ -2577,7 +2576,7 @@ bool CTexture::SetRenderTarget( int nRenderTargetID, ITexture *pDepthTexture )
|
||||
|
||||
ShaderAPITextureHandle_t textureHandle = m_pTextureHandles[0];
|
||||
|
||||
ShaderAPITextureHandle_t depthTextureHandle = (unsigned int)SHADER_RENDERTARGET_DEPTHBUFFER;
|
||||
ShaderAPITextureHandle_t depthTextureHandle = (uintp)SHADER_RENDERTARGET_DEPTHBUFFER;
|
||||
|
||||
if ( m_nFlags & TEXTUREFLAGS_DEPTHRENDERTARGET )
|
||||
{
|
||||
@@ -2587,7 +2586,7 @@ bool CTexture::SetRenderTarget( int nRenderTargetID, ITexture *pDepthTexture )
|
||||
else if ( m_nFlags & TEXTUREFLAGS_NODEPTHBUFFER )
|
||||
{
|
||||
// GR - render target without depth buffer
|
||||
depthTextureHandle = (unsigned int)SHADER_RENDERTARGET_NONE;
|
||||
depthTextureHandle = (uintp)SHADER_RENDERTARGET_NONE;
|
||||
}
|
||||
|
||||
if ( pDepthTexture)
|
||||
@@ -4140,7 +4139,7 @@ bool CTexture::UpdateExcludedState( void )
|
||||
|
||||
void CTextureStreamingJob::OnAsyncFindComplete( ITexture* pTex, void* pExtraArgs )
|
||||
{
|
||||
const int cArgsAsInt = ( int ) pExtraArgs;
|
||||
const intp cArgsAsInt = ( intp ) pExtraArgs;
|
||||
|
||||
Assert( m_pOwner == NULL || m_pOwner == pTex );
|
||||
if ( m_pOwner )
|
||||
|
||||
@@ -453,7 +453,7 @@ public:
|
||||
|
||||
virtual void OnAsyncFindComplete( ITexture* pTex, void* pExtraArgs )
|
||||
{
|
||||
switch ( ( int ) pExtraArgs )
|
||||
switch ( ( intp ) pExtraArgs )
|
||||
{
|
||||
case Neutral:
|
||||
SafeAssign( &m_pTex, pTex );
|
||||
@@ -1202,7 +1202,7 @@ protected:
|
||||
|
||||
virtual void OnAsyncFindComplete( ITexture* pTex, void* pExtraArgs )
|
||||
{
|
||||
switch ( ( int ) pExtraArgs )
|
||||
switch ( ( intp ) pExtraArgs )
|
||||
{
|
||||
case Albedo:
|
||||
SafeAssign( &m_pTex, pTex );
|
||||
|
||||
@@ -38,7 +38,7 @@ COcclusionQueryMgr::COcclusionQueryMgr()
|
||||
OcclusionQueryObjectHandle_t COcclusionQueryMgr::CreateOcclusionQueryObject( )
|
||||
{
|
||||
m_Mutex.Lock();
|
||||
int h = m_OcclusionQueryObjects.AddToTail();
|
||||
intp h = m_OcclusionQueryObjects.AddToTail();
|
||||
m_Mutex.Unlock();
|
||||
return (OcclusionQueryObjectHandle_t)h;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void COcclusionQueryMgr::OnCreateOcclusionQueryObject( OcclusionQueryObjectHandl
|
||||
{
|
||||
for ( int i = 0; i < COUNT_OCCLUSION_QUERY_STACK; i++)
|
||||
{
|
||||
m_OcclusionQueryObjects[(int)h].m_QueryHandle[i] = g_pShaderAPI->CreateOcclusionQueryObject( );
|
||||
m_OcclusionQueryObjects[(intp)h].m_QueryHandle[i] = g_pShaderAPI->CreateOcclusionQueryObject( );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void COcclusionQueryMgr::OnCreateOcclusionQueryObject( OcclusionQueryObjectHandl
|
||||
void COcclusionQueryMgr::FlushQuery( OcclusionQueryObjectHandle_t hOcclusionQuery, int nIndex )
|
||||
{
|
||||
// Flush out any previous queries
|
||||
int h = (int)hOcclusionQuery;
|
||||
intp h = (intp)hOcclusionQuery;
|
||||
if ( m_OcclusionQueryObjects[h].m_bHasBeenIssued[nIndex] )
|
||||
{
|
||||
ShaderAPIOcclusionQuery_t hQuery = m_OcclusionQueryObjects[h].m_QueryHandle[nIndex];
|
||||
@@ -68,7 +68,7 @@ void COcclusionQueryMgr::FlushQuery( OcclusionQueryObjectHandle_t hOcclusionQuer
|
||||
|
||||
void COcclusionQueryMgr::DestroyOcclusionQueryObject( OcclusionQueryObjectHandle_t hOcclusionQuery )
|
||||
{
|
||||
int h = (int)hOcclusionQuery;
|
||||
intp h = (intp)hOcclusionQuery;
|
||||
Assert( m_OcclusionQueryObjects.IsValidIndex( h ) );
|
||||
if ( m_OcclusionQueryObjects.IsValidIndex( h ) )
|
||||
{
|
||||
@@ -133,7 +133,7 @@ void COcclusionQueryMgr::FreeOcclusionQueryObjects( void )
|
||||
//-----------------------------------------------------------------------------
|
||||
void COcclusionQueryMgr::ResetOcclusionQueryObject( OcclusionQueryObjectHandle_t hOcclusionQuery )
|
||||
{
|
||||
int h = (int)hOcclusionQuery;
|
||||
intp h = (intp)hOcclusionQuery;
|
||||
Assert( m_OcclusionQueryObjects.IsValidIndex( h ) );
|
||||
if ( m_OcclusionQueryObjects.IsValidIndex( h ) )
|
||||
{
|
||||
@@ -154,7 +154,7 @@ void COcclusionQueryMgr::ResetOcclusionQueryObject( OcclusionQueryObjectHandle_t
|
||||
//-----------------------------------------------------------------------------
|
||||
void COcclusionQueryMgr::BeginOcclusionQueryDrawing( OcclusionQueryObjectHandle_t hOcclusionQuery )
|
||||
{
|
||||
int h = (int)hOcclusionQuery;
|
||||
intp h = (intp)hOcclusionQuery;
|
||||
Assert( m_OcclusionQueryObjects.IsValidIndex( h ) );
|
||||
if ( m_OcclusionQueryObjects.IsValidIndex( h ) )
|
||||
{
|
||||
@@ -194,7 +194,7 @@ void COcclusionQueryMgr::BeginOcclusionQueryDrawing( OcclusionQueryObjectHandle_
|
||||
|
||||
void COcclusionQueryMgr::EndOcclusionQueryDrawing( OcclusionQueryObjectHandle_t hOcclusionQuery )
|
||||
{
|
||||
int h = (int)hOcclusionQuery;
|
||||
intp h = (intp)hOcclusionQuery;
|
||||
Assert( m_OcclusionQueryObjects.IsValidIndex( h ) );
|
||||
if ( m_OcclusionQueryObjects.IsValidIndex( h ) )
|
||||
{
|
||||
@@ -220,7 +220,7 @@ void COcclusionQueryMgr::EndOcclusionQueryDrawing( OcclusionQueryObjectHandle_t
|
||||
//-----------------------------------------------------------------------------
|
||||
void COcclusionQueryMgr::OcclusionQuery_IssueNumPixelsRenderedQuery( OcclusionQueryObjectHandle_t hOcclusionQuery )
|
||||
{
|
||||
int h = (int)hOcclusionQuery;
|
||||
intp h = (intp)hOcclusionQuery;
|
||||
Assert( m_OcclusionQueryObjects.IsValidIndex( h ) );
|
||||
if ( m_OcclusionQueryObjects.IsValidIndex( h ) )
|
||||
{
|
||||
@@ -253,6 +253,6 @@ int COcclusionQueryMgr::OcclusionQuery_GetNumPixelsRendered( OcclusionQueryObjec
|
||||
OcclusionQuery_IssueNumPixelsRenderedQuery( h );
|
||||
}
|
||||
|
||||
int nPixels = m_OcclusionQueryObjects[(int)h].m_LastResult;
|
||||
int nPixels = m_OcclusionQueryObjects[(intp)h].m_LastResult;
|
||||
return nPixels;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ EXPOSE_SINGLE_INTERFACE_GLOBALVAR( CVBAllocTracker, IVBAllocTracker,
|
||||
UtlHashFixedHandle_t CVBAllocTracker::TrackAlloc( void * buffer, int bufferSize, VertexFormat_t fmt, int numVerts, short allocatorHash )
|
||||
{
|
||||
AllocData newData( buffer, bufferSize, fmt, numVerts, allocatorHash );
|
||||
UtlHashFixedHandle_t handle = m_VBAllocTable.Insert( (int)buffer, newData );
|
||||
UtlHashFixedHandle_t handle = m_VBAllocTable.Insert( (intp)buffer, newData );
|
||||
if ( handle == m_VBAllocTable.InvalidHandle() )
|
||||
{
|
||||
Warning( "[VBMEM] VBMemAllocTable hash collision (grow table).\n" );
|
||||
@@ -247,7 +247,7 @@ UtlHashFixedHandle_t CVBAllocTracker::TrackAlloc( void * buffer, int bufferSize,
|
||||
|
||||
bool CVBAllocTracker::KillAlloc( void * buffer, int & bufferSize, VertexFormat_t & fmt, int & numVerts, short & allocatorHash )
|
||||
{
|
||||
UtlHashFixedHandle_t handle = m_VBAllocTable.Find( (int)buffer );
|
||||
UtlHashFixedHandle_t handle = m_VBAllocTable.Find( (intp)buffer );
|
||||
if ( handle != m_VBAllocTable.InvalidHandle() )
|
||||
{
|
||||
AllocData & data = m_VBAllocTable.Element( handle );
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "tier0/platform.h"
|
||||
|
||||
#if defined( DX10 ) && !defined( DX_TO_GL_ABSTRACTION )
|
||||
|
||||
#include <d3d10.h>
|
||||
@@ -113,13 +115,13 @@ typedef void *HardwareShader_t;
|
||||
//-----------------------------------------------------------------------------
|
||||
// The vertex and pixel shader type
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef int VertexShader_t;
|
||||
typedef int PixelShader_t;
|
||||
typedef intp VertexShader_t;
|
||||
typedef intp PixelShader_t;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Bitpattern for an invalid shader
|
||||
//-----------------------------------------------------------------------------
|
||||
#define INVALID_SHADER ( 0xFFFFFFFF )
|
||||
#define INVALID_SHADER (-1) // ( 0xFFFFFFFF )
|
||||
#define INVALID_HARDWARE_SHADER ( NULL )
|
||||
|
||||
#define D3DSAMP_NOTSUPPORTED D3DSAMP_FORCE_DWORD
|
||||
|
||||
@@ -184,7 +184,7 @@ protected:
|
||||
|
||||
int m_nWindowWidth;
|
||||
int m_nWindowHeight;
|
||||
uint32 m_dwThreadId;
|
||||
uintp m_dwThreadId;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -615,7 +615,7 @@ private:
|
||||
ShaderStaticCombos_t m_ShaderStaticCombos;
|
||||
DWORD m_Flags;
|
||||
int m_nRefCount;
|
||||
unsigned int m_hShaderFileCache;
|
||||
uintp m_hShaderFileCache;
|
||||
|
||||
// for queued loading, bias an aligned optimal buffer forward to correct location
|
||||
int m_nDataOffset;
|
||||
@@ -1017,7 +1017,7 @@ void CShaderManager::DestroyVertexShader( VertexShaderHandle_t hShader )
|
||||
if ( hShader == VERTEX_SHADER_HANDLE_INVALID )
|
||||
return;
|
||||
|
||||
VertexShaderIndex_t i = (VertexShaderIndex_t)hShader;
|
||||
VertexShaderIndex_t i = (VertexShaderIndex_t)(uintp)hShader;
|
||||
IDirect3DVertexShader9 *pVertexShader = m_RawVertexShaderDict[ i ];
|
||||
|
||||
UnregisterVS( pVertexShader );
|
||||
@@ -1053,7 +1053,7 @@ void CShaderManager::DestroyPixelShader( PixelShaderHandle_t hShader )
|
||||
if ( hShader == PIXEL_SHADER_HANDLE_INVALID )
|
||||
return;
|
||||
|
||||
PixelShaderIndex_t i = (PixelShaderIndex_t)hShader;
|
||||
PixelShaderIndex_t i = (PixelShaderIndex_t)(uintp)hShader;
|
||||
IDirect3DPixelShader9 *pPixelShader = m_RawPixelShaderDict[ i ];
|
||||
|
||||
UnregisterPS( pPixelShader );
|
||||
@@ -2522,7 +2522,7 @@ bool CShaderManager::LoadAndCreateShaders( ShaderLookup_t &lookup, bool bVertexS
|
||||
ShaderFileCache_t fileCacheLookup;
|
||||
fileCacheLookup.m_Name = lookup.m_Name;
|
||||
fileCacheLookup.m_bVertexShader = bVertexShader;
|
||||
int fileCacheIndex = m_ShaderFileCache.Find( fileCacheLookup );
|
||||
intp fileCacheIndex = m_ShaderFileCache.Find( fileCacheLookup );
|
||||
if ( fileCacheIndex == m_ShaderFileCache.InvalidIndex() )
|
||||
{
|
||||
// not found, create a new entry
|
||||
@@ -3286,7 +3286,7 @@ void CShaderManager::SetVertexShaderState( HardwareShader_t shader, DataCacheHan
|
||||
|
||||
void CShaderManager::BindVertexShader( VertexShaderHandle_t hVertexShader )
|
||||
{
|
||||
HardwareShader_t hHardwareShader = m_RawVertexShaderDict[ (VertexShaderIndex_t)hVertexShader] ;
|
||||
HardwareShader_t hHardwareShader = m_RawVertexShaderDict[ (VertexShaderIndex_t)(uintp)hVertexShader] ;
|
||||
SetVertexShaderState( hHardwareShader );
|
||||
}
|
||||
|
||||
@@ -3395,7 +3395,7 @@ void CShaderManager::SetPixelShaderState( HardwareShader_t shader, DataCacheHand
|
||||
|
||||
void CShaderManager::BindPixelShader( PixelShaderHandle_t hPixelShader )
|
||||
{
|
||||
HardwareShader_t hHardwareShader = m_RawPixelShaderDict[ (PixelShaderIndex_t)hPixelShader ];
|
||||
HardwareShader_t hHardwareShader = m_RawPixelShaderDict[ (PixelShaderIndex_t)(uintp)hPixelShader ];
|
||||
SetPixelShaderState( hHardwareShader );
|
||||
}
|
||||
|
||||
@@ -3594,7 +3594,7 @@ void CShaderManager::SpewVertexAndPixelShaders( void )
|
||||
{
|
||||
// only spew a populated shader file cache
|
||||
Msg( "\nShader File Cache:\n" );
|
||||
for ( int cacheIndex = m_ShaderFileCache.Head();
|
||||
for ( intp cacheIndex = m_ShaderFileCache.Head();
|
||||
cacheIndex != m_ShaderFileCache.InvalidIndex();
|
||||
cacheIndex = m_ShaderFileCache.Next( cacheIndex ) )
|
||||
{
|
||||
|
||||
@@ -61,6 +61,11 @@ public:
|
||||
Put( nValue );
|
||||
}
|
||||
|
||||
FORCEINLINE void PutIntPtr( intp nValue )
|
||||
{
|
||||
Put( nValue );
|
||||
}
|
||||
|
||||
FORCEINLINE void PutFloat( float nValue )
|
||||
{
|
||||
Put( nValue );
|
||||
@@ -335,7 +340,7 @@ public:
|
||||
{
|
||||
m_Storage.PutInt( CBCMD_BIND_SHADERAPI_TEXTURE_HANDLE );
|
||||
m_Storage.PutInt( nSampler );
|
||||
m_Storage.PutInt( hTexture );
|
||||
m_Storage.PutIntPtr( hTexture );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
//===========================================================================//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include "materialsystem_global.h"
|
||||
#include "string.h"
|
||||
#include "shaderapi/ishaderapi.h"
|
||||
@@ -787,8 +786,8 @@ protected:
|
||||
friend class AsyncReader;
|
||||
AsyncReader* m_pAsyncReader;
|
||||
|
||||
uint m_nAsyncLoadThread;
|
||||
uint m_nAsyncReadThread;
|
||||
ThreadId_t m_nAsyncLoadThread;
|
||||
ThreadId_t m_nAsyncReadThread;
|
||||
|
||||
int m_iSuspendTextureStreaming;
|
||||
};
|
||||
@@ -1131,7 +1130,7 @@ private:
|
||||
m_completedJobs.PushItem( pJob );
|
||||
}
|
||||
|
||||
static unsigned LoaderMain( void* _this )
|
||||
static uintp LoaderMain( void* _this )
|
||||
{
|
||||
ThreadSetDebugName( "Loader" );
|
||||
|
||||
@@ -1432,7 +1431,7 @@ private:
|
||||
mip_h = Max( 1, mip_h >> 1 );
|
||||
}
|
||||
}
|
||||
static unsigned ReaderMain( void* _this )
|
||||
static uintp ReaderMain( void* _this )
|
||||
{
|
||||
ThreadSetDebugName( "Helper" );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user