@@ -1196,9 +1196,15 @@ HRESULT Direct3DDevice9Ex_LSS<EnableSync>::SetTransform(D3DTRANSFORMSTATETYPE St
1196
1196
{
1197
1197
BRIDGE_DEVICE_LOCKGUARD ();
1198
1198
if (m_stateRecording) {
1199
+ if (memcmp (&m_stateRecording->m_captureState .transforms [idx], pMatrix, sizeof (D3DMATRIX)) == 0 ) {
1200
+ return S_OK;
1201
+ }
1199
1202
m_stateRecording->m_captureState .transforms [idx] = *pMatrix;
1200
1203
m_stateRecording->m_dirtyFlags .transforms [idx] = true ;
1201
1204
} else {
1205
+ if (memcmp (&m_state.transforms [idx], pMatrix, sizeof (D3DMATRIX)) == 0 ) {
1206
+ return S_OK;
1207
+ }
1202
1208
m_state.transforms [idx] = *pMatrix;
1203
1209
}
1204
1210
}
@@ -1367,9 +1373,15 @@ HRESULT Direct3DDevice9Ex_LSS<EnableSync>::SetLight(DWORD Index, CONST D3DLIGHT9
1367
1373
{
1368
1374
BRIDGE_DEVICE_LOCKGUARD ();
1369
1375
if (m_stateRecording) {
1376
+ if (memcmp (&m_stateRecording->m_captureState .lights [Index], pLight, sizeof (D3DLIGHT9)) == 0 ) {
1377
+ return S_OK;
1378
+ }
1370
1379
m_stateRecording->m_captureState .lights [Index] = *pLight;
1371
1380
m_stateRecording->m_dirtyFlags .lights [Index] = true ;
1372
1381
} else {
1382
+ if (memcmp (&m_state.lights [Index], pLight, sizeof (D3DLIGHT9)) == 0 ) {
1383
+ return S_OK;
1384
+ }
1373
1385
m_state.lights [Index] = *pLight;
1374
1386
}
1375
1387
}
@@ -1409,8 +1421,14 @@ HRESULT Direct3DDevice9Ex_LSS<EnableSync>::LightEnable(DWORD LightIndex, BOOL bE
1409
1421
{
1410
1422
BRIDGE_DEVICE_LOCKGUARD ();
1411
1423
if (m_stateRecording) {
1424
+ if (m_stateRecording->m_captureState .bLightEnables [LightIndex] == (bool )bEnable) {
1425
+ return S_OK;
1426
+ }
1412
1427
m_stateRecording->m_captureState .bLightEnables [LightIndex] = bEnable;
1413
1428
} else {
1429
+ if (m_state.bLightEnables [LightIndex] == (bool )bEnable) {
1430
+ return S_OK;
1431
+ }
1414
1432
m_state.bLightEnables [LightIndex] = bEnable;
1415
1433
}
1416
1434
}
@@ -1502,9 +1520,15 @@ HRESULT Direct3DDevice9Ex_LSS<EnableSync>::SetRenderState(D3DRENDERSTATETYPE Sta
1502
1520
{
1503
1521
BRIDGE_DEVICE_LOCKGUARD ();
1504
1522
if (m_stateRecording) {
1523
+ if (m_stateRecording->m_captureState .renderStates [State] == Value) {
1524
+ return S_OK;
1525
+ }
1505
1526
m_stateRecording->m_captureState .renderStates [State] = Value;
1506
1527
m_stateRecording->m_dirtyFlags .renderStates [State] = true ;
1507
1528
} else {
1529
+ if (m_state.renderStates [State] == Value) {
1530
+ return S_OK;
1531
+ }
1508
1532
m_state.renderStates [State] = Value;
1509
1533
}
1510
1534
}
@@ -2040,10 +2064,17 @@ HRESULT Direct3DDevice9Ex_LSS<EnableSync>::SetTextureStageState(DWORD Stage, D3D
2040
2064
{
2041
2065
BRIDGE_DEVICE_LOCKGUARD ();
2042
2066
if (m_stateRecording) {
2067
+ if (m_stateRecording->m_captureState .textureStageStates [stageIdx][typeIdx] == Value) {
2068
+ return S_OK;
2069
+ }
2043
2070
m_stateRecording->m_captureState .textureStageStates [stageIdx][typeIdx] = Value;
2044
2071
m_stateRecording->m_dirtyFlags .textureStageStates [stageIdx][typeIdx] = true ;
2072
+ } else {
2073
+ if (m_state.textureStageStates [stageIdx][typeIdx] == Value) {
2074
+ return S_OK;
2075
+ }
2076
+ m_state.textureStageStates [stageIdx][typeIdx] = Value;
2045
2077
}
2046
- m_state.textureStageStates [stageIdx][typeIdx] = Value;
2047
2078
}
2048
2079
{
2049
2080
ClientMessage c (Commands::IDirect3DDevice9Ex_SetTextureStageState, getId ());
@@ -2090,9 +2121,15 @@ HRESULT Direct3DDevice9Ex_LSS<EnableSync>::SetSamplerState(DWORD Sampler, D3DSAM
2090
2121
{
2091
2122
BRIDGE_DEVICE_LOCKGUARD ();
2092
2123
if (m_stateRecording) {
2124
+ if (m_stateRecording->m_captureState .samplerStates [samplerIdx][typeIdx] == Value) {
2125
+ return S_OK;
2126
+ }
2093
2127
m_stateRecording->m_captureState .samplerStates [samplerIdx][typeIdx] = Value;
2094
2128
m_stateRecording->m_dirtyFlags .samplerStates [samplerIdx][typeIdx] = true ;
2095
2129
} else {
2130
+ if (m_state.samplerStates [samplerIdx][typeIdx] == Value) {
2131
+ return S_OK;
2132
+ }
2096
2133
m_state.samplerStates [samplerIdx][typeIdx] = Value;
2097
2134
}
2098
2135
}
0 commit comments