summaryrefslogtreecommitdiffstats
path: root/examples/model-viewer
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-09-13 14:32:13 -0700
committerGitHub <noreply@github.com>2018-09-13 14:32:13 -0700
commite1c934972509f4bbd2c05affe565f91e7a1e6c16 (patch)
tree7ba91ee54fb1eaeda5e16cc3cf7260a3830fbcf4 /examples/model-viewer
parent929745d75f0607ab5b2218083ca4ccb493eb6032 (diff)
Add a better error message for common global generic failure (#634)
A common mistake that seems to come up when using global generic type parameters: ```hlsl interface IHero { ... } type_param H : IHero; ParameterBlock<H> gHero; ``` is to accidentally try to specialize the type parameter `H` using `H` itself as the argument (instead of some concrete type like `Batman`). The current front-end checks naively let this pass, because `H` satisfies all the requirements (it sure does declare that it implements `IHero`, which is the only requirement we have). This currently leads to downstream failure when we generate code with generic type parameters still left in the IR. This change implements a simple fix which is to: - Check when we are trying to specialize a global generic parameter using another global generic parameter, since this is currently always a mistake - Add a special-case diagnostic for the 99% case of this failure, which is specializing a type parameter to itself This fix is primarily motivated by the way generics support will initially be implemented in Falcor.
Diffstat (limited to 'examples/model-viewer')
0 files changed, 0 insertions, 0 deletions