Bug 201212 - [WHLSL] Matrices need to have correct alignment
Summary: [WHLSL] Matrices need to have correct alignment
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-27 19:44 PDT by Myles C. Maxfield
Modified: 2019-08-28 12:47 PDT (History)
2 users (show)

See Also:


Attachments
Needs tests (1.76 KB, patch)
2019-08-27 19:44 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Test (5.99 KB, text/html)
2019-08-27 23:31 PDT, Myles C. Maxfield
no flags Details
Patch (9.67 KB, patch)
2019-08-28 09:56 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (10.85 KB, patch)
2019-08-28 10:06 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (11.06 KB, patch)
2019-08-28 10:08 PDT, Myles C. Maxfield
rmorisset: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2019-08-27 19:44:02 PDT
[WHLSL] Matrices need to have 16-byte alignment
Comment 1 Myles C. Maxfield 2019-08-27 19:44:17 PDT
Created attachment 377418 [details]
Needs tests
Comment 2 Myles C. Maxfield 2019-08-27 23:31:00 PDT
Created attachment 377431 [details]
Test
Comment 3 Myles C. Maxfield 2019-08-28 09:56:34 PDT
Created attachment 377453 [details]
Patch
Comment 4 Myles C. Maxfield 2019-08-28 10:06:56 PDT
Created attachment 377456 [details]
Patch
Comment 5 Myles C. Maxfield 2019-08-28 10:08:10 PDT
Created attachment 377457 [details]
Patch
Comment 6 Robin Morisset 2019-08-28 10:49:28 PDT
Comment on attachment 377457 [details]
Patch

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

r=me

> Source/WebCore/ChangeLog:8
> +        Matrices have particular alignment requirements and size requirements.

Maybe document these requirements here?

> Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:125
> +            unsigned alignment = 16;

maybe "const unsigned alignment = columns == 2 ? 8 : 16;" ?
I was a bit surprised that for columns == 2 the if changes alignment, while for columns = 3 it does something completely different.
Not having the visual parallelism might make it clearer to someone skimming through (on top of being slightly shorter).
Comment 7 Myles C. Maxfield 2019-08-28 12:46:51 PDT
Committed r249214: <https://trac.webkit.org/changeset/249214>
Comment 8 Radar WebKit Bug Importer 2019-08-28 12:47:15 PDT
<rdar://problem/54803557>