Skip to content

Commit a85e748

Browse files
committed
only init optional system's thread pools on use
temporarily disable glows fix RETAIL not actually being defined fix compile issues with _RETAIL fix DirectX math functions not defined in debug assert exclude UpdatePresentStats from dx device frame loop tighter timings for sound mixer, enabling 0 mixahead default to 64 stdio read on PC put distributed files and separate dev script in tree
1 parent 6fa92fe commit a85e748

File tree

15 files changed

+5389
-5339
lines changed

15 files changed

+5389
-5339
lines changed

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 /nofpo /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 /define:CERT /tf +game /mksln games.sln
22
PAUSE

creategameprojects_dev.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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 /define:CERT /nofpo /tf +game /mksln games.sln
2+
PAUSE

engine/audio/private/snd_dma.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static ConVar volume( "volume", "1.0", FCVAR_ARCHIVE | FCVAR_ARCHIVE_XBOX, "Soun
461461
// user configurable music volume
462462
ConVar snd_musicvolume( "snd_musicvolume", "1.0", FCVAR_ARCHIVE | FCVAR_ARCHIVE_XBOX, "Music volume", true, 0.0f, true, 1.0f );
463463

464-
ConVar snd_mixahead( "snd_mixahead", "0.0666667", FCVAR_ARCHIVE );
464+
ConVar snd_mixahead( "snd_mixahead", "0", FCVAR_ARCHIVE );
465465
ConVar snd_mix_async( "snd_mix_async", "1" );
466466
#ifdef _DEBUG
467467
static ConCommand snd_mixvol("snd_mixvol", MXR_DebugSetMixGroupVolume, "Set named Mixgroup to mix volume.");
@@ -6547,18 +6547,19 @@ void S_Update_Guts( float mixAheadTime )
65476547
}
65486548

65496549
#if !defined( _X360 )
6550-
#define THREADED_MIX_TIME 33
6550+
#define THREADED_MIX_TIME 7
65516551
#else
65526552
#define THREADED_MIX_TIME XMA_POLL_RATE
65536553
#endif
6554+
#define THREADED_MIX_TIME_S (THREADED_MIX_TIME) * 0.001f
65546555

65556556
ConVar snd_ShowThreadFrameTime( "snd_ShowThreadFrameTime", "0" );
65566557

65576558
bool g_bMixThreadExit;
65586559
ThreadHandle_t g_hMixThread;
65596560
void S_Update_Thread()
65606561
{
6561-
float frameTime = THREADED_MIX_TIME * 0.001f;
6562+
float frameTime = THREADED_MIX_TIME_S;
65626563
double lastFrameTime = Plat_FloatTime();
65636564

65646565
while ( !g_bMixThreadExit )
@@ -6568,15 +6569,24 @@ void S_Update_Thread()
65686569
// the 360 decoder has finite latency and cannot fulfill spike requests
65696570
float t0 = Plat_FloatTime();
65706571
S_Update_Guts( frameTime + snd_mixahead.GetFloat() );
6571-
int updateTime = ( Plat_FloatTime() - t0 ) * 1000.0f;
6572+
float tf = Plat_FloatTime();
6573+
float dt = tf - t0;
6574+
float nextFrameTime = tf + THREADED_MIX_TIME_S - dt;
6575+
int updateTime = (int)dt * 1000;
65726576

65736577
// try to maintain a steadier rate by compensating for fluctuating mix times
6574-
int sleepTime = THREADED_MIX_TIME - updateTime;
6578+
// leave 1 ms for tighter timings in loop
6579+
int sleepTime = THREADED_MIX_TIME - updateTime - 1;
65756580
if ( sleepTime > 0 )
65766581
{
65776582
ThreadSleep( sleepTime );
65786583
}
65796584

6585+
while (Plat_FloatTime() < nextFrameTime)
6586+
{
6587+
ThreadSleep();
6588+
}
6589+
65806590
// mimic a frametime needed for sound update
65816591
double t1 = Plat_FloatTime();
65826592
frameTime = t1 - lastFrameTime;

engine/cmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2808,7 +2808,7 @@ bool FASTCALL IsBoxIntersectingRayNoLowest( fltx4 boxMin, fltx4 boxMax,
28082808
*/
28092809
#if defined(DBGFLAG_ASSERT)
28102810
unsigned int r;
2811-
AssertMsg( (XMVectorGreaterOrEqualR(&r, SetWToZeroSIMD(boxMax),SetWToZeroSIMD(boxMin)), XMComparisonAllTrue(r)), "IsBoxIntersectingRay : boxmax < boxmin" );
2811+
AssertMsg( (DirectX::XMVectorGreaterOrEqualR(&r, SetWToZeroSIMD(boxMax),SetWToZeroSIMD(boxMin)), DirectX::XMComparisonAllTrue(r)), "IsBoxIntersectingRay : boxmax < boxmin" );
28122812
#endif
28132813

28142814
// test if delta is tiny along any dimension

0 commit comments

Comments
 (0)