Mesa (master): mesa: only emit _NEW_MULTISAMPLE when min sample shading changes

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Tue Jun 6 09:53:23 UTC 2017


Module: Mesa
Branch: master
Commit: 11c6aab239fca9bc4e493107fb3c31016b3a28bd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=11c6aab239fca9bc4e493107fb3c31016b3a28bd

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Jun  2 17:52:49 2017 +0200

mesa: only emit _NEW_MULTISAMPLE when min sample shading changes

We usually check that given parameters are different before
updating the state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/main/multisample.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 16fe2b7ced..07786130d5 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -140,10 +140,13 @@ _mesa_MinSampleShading(GLclampf value)
       return;
    }
 
-   FLUSH_VERTICES(ctx, 0);
+   value = CLAMP(value, 0.0f, 1.0f);
+
+   if (ctx->Multisample.MinSampleShadingValue == value)
+      return;
 
-   ctx->Multisample.MinSampleShadingValue = CLAMP(value, 0.0f, 1.0f);
-   ctx->NewState |= _NEW_MULTISAMPLE;
+   FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+   ctx->Multisample.MinSampleShadingValue = value;
 }
 
 /**




More information about the mesa-commit mailing list