• Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    I am finding that blitting with a mask varies from fast to horribly slow on an Efika with a Radeon, and I'd appreciate if some people could please run the following test to confirm it (on different hardware) :
    http://cshandley.co.uk/temp/MOS_MaskSpeedTest.lha

    Just reboot, then unpack it somewhere, then run MOS_MaskSpeedTest, and do nothing until the new window disappears (may take seconds or minutes). Then please post your results. Here are mine:

    Quote:

    Test using a 640 by 480 window, bitmap & mask.

    BltBitMapRastPort() took 1522 uS

    With a clear mask:
    BltMaskBitMapRastPort() took 12442 uS (8 times slower than no mask)

    With a set mask:
    BltMaskBitMapRastPort() took 280483 uS (184 times slower than no mask)

    With an alternating-line mask:
    BltMaskBitMapRastPort() took 148256 uS (97 times slower than no mask)

    With a chequered mask:
    BltMaskBitMapRastPort() took 146042 uS (96 times slower than no mask)

    With an alternating-thick-line mask:
    BltMaskBitMapRastPort() took 147892 uS (97 times slower than no mask)


    The first two results are about as expected; BltMaskBitMapRastPort() is around 10 times slower than BltBitMapRastPort(). This also happens on OS4, although on emulated VESA AROS it is no slower.

    But the remaining results are strange & pretty bad; when the mask contains some transparent pixels, it can take up to 20 times *longer* to blit, meaning up to 200 times worse than without a mask! Such a masked blit is taking up to 0.3 seconds, which is clearly ridiculous. (OS4 & AROS do not slow down at all for transparent pixels.)

    Interestingly the speed degredation is proportional to the number of transparent pixels, suggesting that the "blit" is CPU dependant. If other peoples' results confirm this, then either MOS has a bug, or I'm doing something wrong. If anyone can suggest my mistake, that would be great.

    The source code is included, but you can also read it here:
    http://cshandley.co.uk/temp/MOS_MaskSpeedTest.cpp


    [ Edited by ChrisH 24.10.2011 - 22:23 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »22.10.11 - 15:15
    Profile Visit Website