[Mesa-dev] [PATCH 3/4] i965/blorp: Optimize clamping tex coords.

Kenneth Graunke kenneth at whitecape.org
Mon Feb 23 00:38:20 PST 2015

On Tuesday, February 10, 2015 11:09:59 AM Matt Turner wrote:
> Each emit_cond_mov() emits a CMP of its first to arguments using the
> specified conditional mod, followed by a predicated MOV of the fifth
> argument into the fourth. In all four cases here, it was just
> implementing MIN/MAX which we can do in a single SEL instruction.
> Also reorder the instructions for a slightly better schedule.
> ---
>  src/mesa/drivers/dri/i965/brw_blorp_blit.cpp  |  8 ++++----
>  src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h | 18 ++++++++++++++++++
>  2 files changed, 22 insertions(+), 4 deletions(-)

FWIW, I don't think it's worth spending any additional time optimizing
BLORP shaders.  (You've already done the work here, so we may as well
land it, but...)

Prior to your patches, BLORP vs Meta instruction counts were:

                            BLORP              Meta                     
    Simple 2D blit:    18 instructions    4 instructions
MSAA 4x downsample:    62 instructions   40 instructions
MSAA 8x downsample:   102 instructions   62 instructions

Topi was planning to look into combining the BLORP lightweight state
upload code with the Meta GLSL-based shaders, which are much easier to
read and actually run through the optimizer.  That would get us the
fastest CPU and GPU code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150223/355753c3/attachment.sig>

More information about the mesa-dev mailing list