[Mesa-dev] [PATCH 1/3] i965: Emit the BLEND_STATE pointer directly rather than via atoms.

Eric Anholt eric at anholt.net
Tue Jun 11 00:40:07 PDT 2013


Kenneth Graunke <kenneth at whitecape.org> writes:

> Previously, we would:
> 1. Emit the new indirect state.
> 2. Flag CACHE_NEW_BLEND_STATE.
> 3. Rely on later state atoms to notice CACHE_NEW_BLEND_STATE and emit a
>    pointer to the new indirect state.
>
> This is rather cumbersome: it requires two state atoms instead of one,
> and there's a strict ordering dependency in the list.  Plus, the code
> gets spread across two functions (or even files in the case of Gen7+).
>
> Gen7+ has a packet to update just the blend state pointer, so it makes a
> lot of sense to simply emit that right away.  Gen6 has a combined packet
> which updates blending, the color calculator, and depth/stencil state;
> however, each can still be modified independently.
>
> This drops the Gen6 micro-optimization where we tried to only emit one
> packet that changed all three states.  State updates are pretty cheap.

I was worried about the micro-optimization loss on gen6 in this series, but:

IVB cairo-gl (times in seconds, lower is better):

x before
+ after
+------------------------------------------------------------------------------+
|                                            +                                 |
|                 +    x      ++             +                                 |
|       +  +x+  + +   xxx+x  +** +       x   +                     x           |
|+    ++++*+***x*x**+x*****x*+**x*+x+***x**x**x*   xx xxx      +   xx        *x|
|           |_____|________AM__M___A______|_________|                          |
+------------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x  52     50.157545     51.597177     50.612076     50.686149    0.36185308
+  52      49.97308     51.585104     50.543709     50.521646    0.31808463
Difference at 95.0% confidence
	-0.164503 +/- 0.13095
	-0.324552% +/- 0.258355%

SNB cairo-gl:

x before
+ after
+------------------------------------------------------------------------------+
|                                  +                                           |
|                                  +                                           |
|                                  +                                           |
|                                  +  *                                        |
|                                  +  *                                        |
|                               + x+  *                                        |
|                               + *+  *                                        |
|                               + *+  *  x                                     |
|                             x++ *++ *  x                                     |
|                             *++**+++*+ x*+                                   |
|                             *++**+++*+ x*+                                   |
|                            x*++**+++** x*+                                   |
|                        x   x**+****+*****+                                   |
|                       x*x*xx**+****+******  +                                |
|                  x  x **x*xx*******+****** +*                                |
|                  x xx***x**********+****** +* +  +                           |
|                 xx *x**************+******x+*x*x +                           |
|                 xxx*x**********************+*x** +                           |
|              x+ xxx*x************************x** *                           |
|           +x *+x****x************************x**+* x+                        |
|          *** **x****x*****************************xx+*x+**x x       x        |
|x x x+x+*x**********************************************+***+x    + +x+  *   x|
|                     |__|________AA__________|                                |
+------------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x 349     15.681761     16.525272     16.042921     16.044848    0.12963522
+ 354     15.735747     16.484608     16.054073      16.05856    0.11731547
No difference proven at 95.0% confidence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130611/80125b4c/attachment.pgp>


More information about the mesa-dev mailing list