st/nine: Catch redundant SetStreamSourceFreq calls

Some apps do redundant SetStreamSourceFreq calls.
Catch them to improve performance.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
Axel Davy 2015-12-12 19:11:10 +01:00
parent ea3f504f7c
commit 15ce2778fb
1 changed files with 3 additions and 0 deletions

View File

@ -3555,6 +3555,9 @@ NineDevice9_SetStreamSourceFreq( struct NineDevice9 *This,
(Setting & D3DSTREAMSOURCE_INDEXEDDATA)), D3DERR_INVALIDCALL);
user_assert(Setting, D3DERR_INVALIDCALL);
if (likely(!This->is_recording) && state->stream_freq[StreamNumber] == Setting)
return D3D_OK;
state->stream_freq[StreamNumber] = Setting;
if (Setting & D3DSTREAMSOURCE_INSTANCEDATA)