Bug 176335 - WSL StructTypes and Funcs should be type-specializable
Summary: WSL StructTypes and Funcs should be type-specializable
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Blocks: 176199 177784
  Show dependency treegraph
Reported: 2017-09-04 13:55 PDT by Filip Pizlo
Modified: 2018-10-13 16:59 PDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
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