GPU acceleration in Krita

Andrew Savonichev andrew.savonichev at gmail.com
Sun May 6 16:02:27 UTC 2018


Hi Dmitry,

>> I'm working on a prototype using OpenCL, and I was able to get a
>> *functionally* correct implementation of 'composite' algorithm
>> (KoCompositeOpAlphaBase.h), which is one of the performance bottlenecks
>> that I spotted. OpenCL version of 'composite' is currently sub-optimal,
>> but it passes a dozen of existing unit tests.
>
> Instead of trying to optimize the general-case KoCompositeOpAlphaBase
> composite op, you can try to optimize specific composite ops, like
> KoOptimizedCompositeOpOver{32,128} and
> KoOptimizedCompositeOpAlphaDarken{32,128}. They are used in 90% of the
> time

I'm not sure how I managed to get KoCompositeOpAlphaBase in hotspots,
but now I can definitely see OpOver and OpAlphaDarken taking 50% of CPU
time.

  - 49.34% KoColorSpace::bitBlt
     + 24.96% KoOptimizedCompositeOpAlphaDarken32<(Vc_1::Implementation)7>::composite
     + 24.37% KoOptimizedCompositeOpOver32<(Vc_1::Implementation)7>::composite

Thanks. I'll check them.

> Do you have any decision on how you are going to optimize data transfers
> between CPU and GPU? Some proxy object for KisPainter and KisPaintDevice, so
> that the data will not leave GPU?

This is a next major problem and I haven't really looked into it. Right
now memory management is super straightforward, just to get the algorithm
ready.

--
Andrew


More information about the kimageshop mailing list