https://github.com/shader-slang/slang
Revision 1a0a7f60df92e7aeb0043362900db3cbfa2a1ad0 authored by Tim Foley on 15 November 2017, 18:50:15 UTC, committed by GitHub on 15 November 2017, 18:50:15 UTC
- Change function mangling so we use `p<parameterCount>p` instead of just `p<parameterCount>` to avoid the parameter count running into digits at the start of a mangled type name and tripping up the un-mangling logic.
  - We really need to step back at some point and define our mangling scheme a bit more carefully, especially if we are going to keep going down this road where un-mangling things is important for generating HLSL output.

- Also allow the unmangling logic to unmangle a few more cases of generic parameters, so that it can skip over them to get to the parameter count of the underlying function.

- Add a notion of an `unreachable` instruction to the IR, and emit it as the terminator (if needed) at the end of the last block for a function with a non-void return type.
  - This does *not* implement any logic to emit a diagnostic if the `unreachable` turns out to be potentially reachable

- Fix a bug in IR specialization of generics where we can't create two different specializations of the same function, because both get registered in the same hash map

With all these fixes, testing in Falcor modified to use the full Slang compiler and IR for all HLSL/Slang:

- The UI and text rendering shaders yield HLSL that compiles without error; no idea if they actually *work*

- The ModelViewer shaders yield HLSL, but there are some issues (looks like type legalization isn't applying to stuff inside constant buffers)
1 parent 59a4c0c
History
Tip revision: 1a0a7f60df92e7aeb0043362900db3cbfa2a1ad0 authored by Tim Foley on 15 November 2017, 18:50:15 UTC
Various IR fixes for Falcor (#280)
Tip revision: 1a0a7f6
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-- 36.5 KB
slang.sln -rw-r--r-- 9.1 KB
test.bat -rw-r--r-- 1.4 KB

README.md

back to top