Mesa (master): st/mesa: be more careful about state validation in st_Bitmap()

Brian Paul brianp at kemper.freedesktop.org
Wed Jan 6 22:54:10 UTC 2016


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

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Jan  5 18:11:14 2016 -0700

st/mesa: be more careful about state validation in st_Bitmap()

If the only dirty state is mesa's _NEW_PROGRAM_CONSTANTS flag, we can
skip state validation before drawing a bitmap since that state doesn't
effect bitmap rendering.

This further increases the performance of the ipers demo on llvmpipe
to about what it was before commit 36c93a6fae27561.

Reviewed-by: José Fonseca <jfonseca at vmware.com>

---

 src/mesa/state_tracker/st_cb_bitmap.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index c2cbcbd..191f144 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -622,7 +622,14 @@ st_Bitmap(struct gl_context *ctx, GLint x, GLint y,
    if (width == 0 || height == 0)
       return;
 
-   st_validate_state(st);
+   /* We only need to validate state of the st dirty flags are set or
+    * any non-_NEW_PROGRAM_CONSTANTS mesa flags are set.  The VS we use
+    * for bitmap drawing uses no constants and the FS constants are
+    * explicitly uploaded in the draw_bitmap_quad() function.
+    */
+   if ((st->dirty.mesa & ~_NEW_PROGRAM_CONSTANTS) || st->dirty.st) {
+      st_validate_state(st);
+   }
 
    if (!st->bitmap.vs) {
       /* create pass-through vertex shader now */




More information about the mesa-commit mailing list