Bug 190452 - [WHSL -> MSL] Annotate semantics correctly in generated MSL
Summary: [WHSL -> MSL] Annotate semantics correctly in generated MSL
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: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-10 16:54 PDT by Dean Jackson
Modified: 2018-10-10 18:10 PDT (History)
3 users (show)

See Also:


Attachments
Patch (3.74 KB, patch)
2018-10-10 16:58 PDT, Dean Jackson
mmaxfield: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2018-10-10 16:54:59 PDT
[WHSL -> MSL] Annotate semantics correctly in generated MSL
Comment 1 Radar WebKit Bug Importer 2018-10-10 16:55:21 PDT
<rdar://problem/45178272>
Comment 2 Dean Jackson 2018-10-10 16:58:12 PDT
Created attachment 352000 [details]
Patch
Comment 3 Myles C. Maxfield 2018-10-10 17:02:34 PDT
Comment on attachment 352000 [details]
Patch

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

> Tools/WebGPUShadingLanguageRI/Metal/MSLBackend.js:338
>              if (structTypeAttributes.isVertexAttribute)
> -                annotations.push(`attribute(${index++})`);
> -            if (structTypeAttributes.isVertexOutputOrFragmentInput && fieldName === "wsl_Position")
> +                annotations.push(`attribute(${field._semantic._index})`);
> +            if (structTypeAttributes.isVertexOutputOrFragmentInput && field._semantic._name === "SV_Position")
>                  annotations.push("position");
> -            if (structTypeAttributes.isFragmentOutput && fieldName === "wsl_Color")
> -                annotations.push("color(0)");
> +            if (structTypeAttributes.isFragmentOutput && field._semantic._name == "SV_Target")
> +                annotations.push(`color(${field._semantic._extraArguments[0]})`);

Eventually we're going to need this to get much more complicated, but this is a good start.
Comment 4 Dean Jackson 2018-10-10 18:10:44 PDT
Committed r237022: <https://trac.webkit.org/changeset/237022>