From: Axel Davy Date: Sun, 15 Feb 2015 15:22:43 +0000 (+0100) Subject: st/nine: Avoid useless updates in SetSamplerState X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7ce3cd0d3a9f3580d02afe5a4fc6588d20aba6b;p=mesa.git st/nine: Avoid useless updates in SetSamplerState Check for redundant settings Signed-off-by: Axel Davy Reviewed-by: David Heidelberg --- 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; }