diff options
author | Axel Davy <[email protected]> | 2015-02-15 16:22:43 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-08-21 22:21:47 +0200 |
commit | a7ce3cd0d3a9f3580d02afe5a4fc6588d20aba6b (patch) | |
tree | 6456d87df115c9d955c2fd4b36c4b2aa1ade377e /src/gallium/state_trackers | |
parent | 5a2302b5ece2edf944b474eeb19ad7fc17906e7d (diff) |
st/nine: Avoid useless updates in SetSamplerState
Check for redundant settings
Signed-off-by: Axel Davy <[email protected]>
Reviewed-by: David Heidelberg <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 4aa58928d7c..a327bf87e04 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -2718,12 +2718,14 @@ NineDevice9_SetSamplerState( struct NineDevice9 *This, if (Sampler >= D3DDMAPSAMPLER) Sampler = Sampler - D3DDMAPSAMPLER + NINE_MAX_SAMPLERS_PS; - state->samp[Sampler][Type] = Value; - state->changed.group |= NINE_STATE_SAMPLER; - state->changed.sampler[Sampler] |= 1 << Type; + if (state->samp[Sampler][Type] != Value || unlikely(This->is_recording)) { + state->samp[Sampler][Type] = Value; + state->changed.group |= NINE_STATE_SAMPLER; + state->changed.sampler[Sampler] |= 1 << Type; - if (Type == D3DSAMP_SRGBTEXTURE) - state->changed.srgb = TRUE; + if (Type == D3DSAMP_SRGBTEXTURE) + state->changed.srgb = TRUE; + } return D3D_OK; } |