https://github.com/shader-slang/slang
Revision 6e591ada0eb652c320bba4bd8a46cd579946df01 authored by Yong He on 08 November 2017, 00:09:40 UTC, committed by Tim Foley on 08 November 2017, 00:09:40 UTC
* improve diagnostic messages and prevent fatal errors from crashing the compiler. * fix top level exception catching. * spelling fix * change wording of invalidSwizzleExpr diagnostic * add speculative GenericsApp expr parsing * add new test case of cascading generics call. * Fixing bugs in compiling cascaded generic function calls. Add implementation of DeclaredSubTypeWitness::SubstituteImpl() This is not needed by the type checker, but needed by IR specialization. When input source contains cascading generic function call, the arguments to `specialize` instruction is currently represented as a substitution. The arg values of this subsittution can be a `DeclaredSubTypeWitness` when a generic function uses one of its generic parameter to specialize another generic function. When the top level generics function is being specialized, this substitution argument, which is a `DeclaredSubTypeWitness`, needs to be substituted with the witness that used to specialize the top level function in the specialized specialize instruction as well. * add a test case for cascading generic function call. * parser bug fix * fixes #255 * add test case for issue #255 * Generate missing `specialize` instruction when calling a generic method from an interface constraint. When calling a generic method via an interface, we should be generating the following ir: ... f = lookup_interface_method(...) f_s = specailize(f, declRef) ... This commit fixes this `emitFuncRef` function to emit the needed `specialize` instruction. * fixes #260 This fix follows the second apporach in the disucssion. It generated mangled name for specialized functions by appending new substitution type names to the original mangled name. * Disabling removing and re-inserting specailized functions in getSpecalizeFunc() I am not sure why it is needed, it seems HLSL and GLSL backends are generating forward declarations anyways, so the order of functions in IRModule shouldn't matter. * cleanup and complete test cases. * fix warnings
1 parent 939688e
Tip revision: 6e591ada0eb652c320bba4bd8a46cd579946df01 authored by Yong He on 08 November 2017, 00:09:40 UTC
Support generic interface methods (#251)
Support generic interface methods (#251)
Tip revision: 6e591ad
File | Mode | Size |
---|---|---|
build | ||
docs | ||
examples | ||
external | ||
source | ||
tests | ||
tools | ||
.gitattributes | -rw-r--r-- | 95 bytes |
.gitignore | -rw-r--r-- | 398 bytes |
.gitmodules | -rw-r--r-- | 107 bytes |
.travis.yml | -rw-r--r-- | 1.6 KB |
CODE_OF_CONDUCT.md | -rw-r--r-- | 3.1 KB |
LICENSE | -rw-r--r-- | 1.1 KB |
Makefile | -rw-r--r-- | 6.3 KB |
README.md | -rw-r--r-- | 6.2 KB |
appveyor.yml | -rw-r--r-- | 3.5 KB |
slang.h | -rw-r--r-- | 35.7 KB |
slang.sln | -rw-r--r-- | 9.1 KB |
test.bat | -rw-r--r-- | 1.4 KB |
Computing file changes ...