Bug 176977 - WSL should support enum
Summary: WSL should support enum
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords: InRadar
Depends on:
Blocks: 176199
  Show dependency treegraph
 
Reported: 2017-09-14 21:32 PDT by Filip Pizlo
Modified: 2018-10-13 16:40 PDT (History)
2 users (show)

See Also:


Attachments
almost done (24.68 KB, patch)
2017-09-18 17:40 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (49.14 KB, patch)
2017-09-18 20:18 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the ptach (49.71 KB, patch)
2017-09-18 20:21 PDT, Filip Pizlo
mmaxfield: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2017-09-14 21:32:20 PDT
...
Comment 1 Filip Pizlo 2017-09-18 12:02:49 PDT
Ima do this next.
Comment 2 Filip Pizlo 2017-09-18 17:40:57 PDT
Created attachment 321158 [details]
almost done
Comment 3 Filip Pizlo 2017-09-18 20:18:24 PDT
Created attachment 321178 [details]
the patch
Comment 4 Filip Pizlo 2017-09-18 20:21:58 PDT
Created attachment 321179 [details]
the ptach
Comment 5 Myles C. Maxfield 2017-09-18 20:35:46 PDT
Comment on attachment 321179 [details]
the ptach

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

> Tools/WebGPUShadingLanguageRI/Intrinsics.js:111
> +                type.formatValueFromDoubleLiteral = value => value;

No rounding?

> Tools/WebGPUShadingLanguageRI/SynthesizeEnumFunctions.js:27
> +function synthesizeEnumFunctions(program)

Wow, this is cool! Dynamically generating functions!

I wish I knew how to do this with clang (without emitting a giant string)

> Tools/WebGPUShadingLanguageRI/Test.js:3929
> +        Foo war()
> +        {
> +            return Foo.War;
> +        }
> +        Foo famine()
> +        {
> +            return Foo.Famine;
> +        }
> +        Foo pestilence()
> +        {
> +            return Foo.Pestilence;
> +        }
> +        Foo death()
> +        {
> +            return Foo.Death;
> +        }

Couldn't you do, like, months of the year or something?
Comment 6 Filip Pizlo 2017-09-18 20:44:15 PDT
(In reply to Myles C. Maxfield from comment #5)
> Comment on attachment 321179 [details]
> the ptach
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=321179&action=review
> 
> > Tools/WebGPUShadingLanguageRI/Intrinsics.js:111
> > +                type.formatValueFromDoubleLiteral = value => value;
> 
> No rounding?

Oh!  Fixed.

> 
> > Tools/WebGPUShadingLanguageRI/SynthesizeEnumFunctions.js:27
> > +function synthesizeEnumFunctions(program)
> 
> Wow, this is cool! Dynamically generating functions!
> 
> I wish I knew how to do this with clang (without emitting a giant string)
> 
> > Tools/WebGPUShadingLanguageRI/Test.js:3929
> > +        Foo war()
> > +        {
> > +            return Foo.War;
> > +        }
> > +        Foo famine()
> > +        {
> > +            return Foo.Famine;
> > +        }
> > +        Foo pestilence()
> > +        {
> > +            return Foo.Pestilence;
> > +        }
> > +        Foo death()
> > +        {
> > +            return Foo.Death;
> > +        }
> 
> Couldn't you do, like, months of the year or something?

;-)
Comment 7 Filip Pizlo 2017-09-18 20:44:45 PDT
Landed in https://trac.webkit.org/changeset/222200/webkit
Comment 8 Radar WebKit Bug Importer 2017-09-27 12:36:10 PDT
<rdar://problem/34693578>
Comment 9 Myles C. Maxfield 2018-10-13 16:40:02 PDT
Migrated to https://github.com/gpuweb/WHLSL/issues/133