Bug 179833 - FETurbulence: compute all 4 channels at once
Summary: FETurbulence: compute all 4 channels at once
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-17 11:41 PST by Simon Fraser (smfr)
Modified: 2017-11-18 09:08 PST (History)
9 users (show)

See Also:


Attachments
Patch (12.12 KB, patch)
2017-11-17 11:42 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (20.24 KB, patch)
2017-11-17 17:40 PST, Simon Fraser (smfr)
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2017-11-17 11:41:28 PST
We can compute all 4 channels in one pass.
Comment 1 Simon Fraser (smfr) 2017-11-17 11:42:17 PST
Created attachment 327203 [details]
Patch

This makes FETurbulence about 2x faster.
Comment 2 Simon Fraser (smfr) 2017-11-17 17:40:38 PST
Created attachment 327286 [details]
Patch
Comment 3 Sam Weinig 2017-11-17 17:57:01 PST
Comment on attachment 327286 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=327286&action=review

> Source/WebCore/platform/graphics/ColorUtilities.h:42
> +    FloatComponents& operator +=(const FloatComponents& rhs)

We don't usually put a space after 'operator'.

> Source/WebCore/platform/graphics/ColorUtilities.h:51
> +    FloatComponents operator +(float rhs) const

We don't usually put a space after 'operator'.

> Source/WebCore/platform/graphics/ColorUtilities.h:61
> +    FloatComponents operator /(float denominator) const

We don't usually put a space after 'operator'.

> Source/WebCore/platform/graphics/ColorUtilities.h:71
> +    FloatComponents operator *(float factor) const

We don't usually put a space after 'operator'.
Comment 4 Simon Fraser (smfr) 2017-11-17 18:32:32 PST
https://trac.webkit.org/r225009
Comment 5 Radar WebKit Bug Importer 2017-11-17 18:33:35 PST
<rdar://problem/35628662>
Comment 6 Sam Weinig 2017-11-18 09:08:04 PST
I know I already reviewed this, but I wonder if this could get an even bigger speedup if we used something like GCC's:

typedef float  float4  __attribute__((__vector_size__(16)))

or clangs:

typedef __attribute__((__ext_vector_type__(4))) float float4;