Skip to content

Commit 32ca9c9

Browse files
committed
SSE2
FPO optimize more mathlib
1 parent 17ac0ec commit 32ca9c9

24 files changed

+53
-29
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,19 @@ config.cfg
5757
*.vcxproj.filters
5858
*.vcxproj.vpc_crc
5959
*.obj
60+
*.iobj
6061
*.pch
6162
*.pdb
63+
*.ipdb
6264

6365
# ignore vs-generated folders
6466
.vs/
67+
Retail/
68+
Retail_*/
6569
Release/
6670
Release_*/
6771
Debug/
72+
Debug_*/
6873
*.tlog/
6974

7075
# ignore generated protobufs

creategameprojects.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
devtools\bin\vpc.exe /2015 /define:WORKSHOP_IMPORT_DISABLE /define:SIXENSE_DISABLE /define:NO_X360_XDK /define:RAD_TELEMETRY_DISABLED /define:DISABLE_ETW /define:LTCG /NO_CEG /RETAIL /tf +game /mksln games.sln
1+
devtools\bin\vpc.exe /2015 /define:WORKSHOP_IMPORT_DISABLE /define:SIXENSE_DISABLE /define:NO_X360_XDK /define:RAD_TELEMETRY_DISABLED /define:DISABLE_ETW /define:LTCG /NO_CEG /RETAIL /nofpo /tf +game /mksln games.sln
22
PAUSE

engine/cmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2806,7 +2806,7 @@ bool FASTCALL IsBoxIntersectingRayNoLowest( fltx4 boxMin, fltx4 boxMax,
28062806
Assert( boxMin[1] <= boxMax[1] );
28072807
Assert( boxMin[2] <= boxMax[2] );
28082808
*/
2809-
#if defined(_X360) && defined(DBGFLAG_ASSERT)
2809+
#if defined(DBGFLAG_ASSERT)
28102810
unsigned int r;
28112811
AssertMsg( (XMVectorGreaterOrEqualR(&r, SetWToZeroSIMD(boxMax),SetWToZeroSIMD(boxMin)), XMComparisonAllTrue(r)), "IsBoxIntersectingRay : boxmax < boxmin" );
28122812
#endif

engine/engine.vpc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $Configuration
3232

3333
$Compiler [$WIN32]
3434
{
35-
$EnableEnhancedInstructionSet "Streaming SIMD Extensions (/arch:SSE)"
35+
$EnableEnhancedInstructionSet "Streaming SIMD Extensions 2 (/arch:SSE2)"
3636
}
3737

3838
$Linker

engine/gl_lightmap.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,8 +1337,9 @@ void CacheAndUnloadLightmapData()
13371337
static void SortSurfacesByLightmapID( SurfaceHandle_t *pToSort, int iSurfaceCount )
13381338
{
13391339
SurfaceHandle_t *pSortTemp = (SurfaceHandle_t *)stackalloc( sizeof( SurfaceHandle_t ) * iSurfaceCount );
1340-
1340+
13411341
//radix sort
1342+
#pragma loop(no_vector)
13421343
for( int radix = 0; radix != 4; ++radix )
13431344
{
13441345
//swap the inputs for the next pass
@@ -1350,19 +1351,22 @@ static void SortSurfacesByLightmapID( SurfaceHandle_t *pToSort, int iSurfaceCoun
13501351

13511352
int iCounts[256] = { 0 };
13521353
int iBitOffset = radix * 8;
1354+
#pragma loop(no_vector)
13531355
for( int i = 0; i != iSurfaceCount; ++i )
13541356
{
1355-
uint8 val = (materialSortInfoArray[MSurf_MaterialSortID( pSortTemp[i] )].lightmapPageID >> iBitOffset) & 0xFF;
1357+
uint8 val = (materialSortInfoArray[MSurf_MaterialSortID(pSortTemp[i])].lightmapPageID >> iBitOffset) & 0xFF;
13561358
++iCounts[val];
13571359
}
13581360

13591361
int iOffsetTable[256];
13601362
iOffsetTable[0] = 0;
1363+
#pragma loop(no_vector)
13611364
for( int i = 0; i != 255; ++i )
13621365
{
13631366
iOffsetTable[i + 1] = iOffsetTable[i] + iCounts[i];
13641367
}
13651368

1369+
#pragma loop(no_vector)
13661370
for( int i = 0; i != iSurfaceCount; ++i )
13671371
{
13681372
uint8 val = (materialSortInfoArray[MSurf_MaterialSortID( pSortTemp[i] )].lightmapPageID >> iBitOffset) & 0xFF;

game/client/viewrender.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,15 +2481,10 @@ void CViewRender::DetermineWaterRenderInfo( const VisibleFogVolumeInfo_t &fogVol
24812481
// Gary says: I'm reverting this change so that water LOD works on dx9 for ep2.
24822482

24832483
// Check if the water is out of the cheap water LOD range; if so, use cheap water
2484-
#ifdef _X360
24852484
if ( !bForceExpensive && ( bForceCheap || ( fogVolumeInfo.m_flDistanceToWater >= m_flCheapWaterEndDistance ) ) )
24862485
{
24872486
return;
24882487
}
2489-
#else
2490-
if ( ( (fogVolumeInfo.m_flDistanceToWater >= m_flCheapWaterEndDistance) && !bLocalReflection ) || bForceCheap )
2491-
return;
2492-
#endif
24932488
// Get the material that is for the water surface that is visible and check to see
24942489
// what render targets need to be rendered, if any.
24952490
if ( !r_WaterDrawRefraction.GetBool() )

materialsystem/stdshaders/BaseVSShader.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@
1818
#include "convar.h"
1919
#include <renderparm.h>
2020

21-
#ifdef _X360
2221
#define SUPPORT_DX8 0
2322
#define SUPPORT_DX7 0
24-
#else
25-
#define SUPPORT_DX8 1
26-
#define SUPPORT_DX7 1
27-
#endif
23+
2824
//-----------------------------------------------------------------------------
2925
// Helper macro for vertex shaders
3026
//-----------------------------------------------------------------------------

materialsystem/stdshaders/DecalBaseTimesLightmapAlphaBlendSelfIllum_dx8.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,14 @@ BEGIN_VS_SHADER( DecalBaseTimesLightmapAlphaBlendSelfIllum_DX8, "" )
128128

129129
SHADER_DRAW
130130
{
131+
#if SUPPORT_DX8
131132
if( UsingFlashlight( params ) )
132133
{
133134
DrawFlashlight_dx80( params, pShaderAPI, pShaderShadow, false, -1, -1, -1,
134135
FLASHLIGHTTEXTURE, FLASHLIGHTTEXTUREFRAME, true, false, 0, -1, -1 );
135136
}
136137
else
138+
#endif
137139
{
138140
DrawDecal( params, pShaderAPI, pShaderShadow );
139141
}

materialsystem/stdshaders/WorldVertexTransition_dx8.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,11 @@ BEGIN_VS_SHADER( WorldVertexTransition_DX8,
269269

270270
void DrawFlashlightPass( IMaterialVar** params, IShaderDynamicAPI *pShaderAPI, IShaderShadow* pShaderShadow, int passID )
271271
{
272+
#if SUPPORT_DX8
272273
bool bBump = ( passID == 0 ) && ShouldUseBumpmapping( params ) && params[BUMPMAP]->IsTexture();
273274
DrawFlashlight_dx80( params, pShaderAPI, pShaderShadow, bBump, BUMPMAP, BUMPFRAME, BUMPTRANSFORM,
274275
FLASHLIGHTTEXTURE, FLASHLIGHTTEXTUREFRAME, true, true, passID, BASETEXTURE2, FRAME2 );
276+
#endif
275277
}
276278

277279
bool ShouldUseBumpmapping( IMaterialVar **params )

materialsystem/stdshaders/lightmappedgeneric_decal.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,14 @@ BEGIN_VS_SHADER( LightmappedGeneric_Decal,
122122

123123
SHADER_DRAW
124124
{
125+
#if SUPPORT_DX8
125126
if( UsingFlashlight( params ) )
126127
{
127128
DrawFlashlight_dx80( params, pShaderAPI, pShaderShadow, false, -1, -1, -1,
128129
FLASHLIGHTTEXTURE, FLASHLIGHTTEXTUREFRAME, true, false, 0, -1, -1 );
129130
}
130131
else
132+
#endif
131133
{
132134
DrawDecal( params, pShaderAPI, pShaderShadow );
133135
}

0 commit comments

Comments
 (0)