Bug 176335

Summary: WSL StructTypes and Funcs should be type-specializable
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: WebGPUAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: mmaxfield
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 176199, 177784    

Description Filip Pizlo 2017-09-04 13:55:15 PDT
I think that we should generalize the power of casts.  Specifically, make it possible to say:

void foo<|int>() { ... }
void foo<|double>() { ... }

Then when you call foo<int>(), you get the first one, and if you call foo<double>(), you get the second one.  If you call foo<bool>(), you get an error.

In general, the syntax would be:

void foo<typeVariables | typeParameters>()

So you could say:

void foo<T, U:numeric | vec4<T>, U>() { ... }

You'd get that function if you called:

foo<vec4<int>, double>();
Comment 1 Myles C. Maxfield 2018-08-29 17:04:08 PDT
We've removed generics from the language, so this bug doesn't make much sense any more.
Comment 2 Myles C. Maxfield 2018-10-13 16:59:08 PDT
Migrated to https://github.com/gpuweb/WHLSL/issues/151