Bug 176977

Summary: WSL should support enum
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: WebGPUAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 176199    
Attachments:
Description Flags
almost done
none
the patch
none
the ptach mmaxfield: review+

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