https://github.com/shader-slang/slang
Revision ccea5702442a7a8303e6735a038be86939c1ce7a authored by Tim Foley on 07 November 2017, 18:22:53 UTC, committed by Tim Foley on 07 November 2017, 19:00:02 UTC
The IR encodes `out` and `in out` function parameters as pointer types, so the emit logic needs to handle it. We had code to handle translation of pointers types into `out` declarations for function *declarations* but weren't handling it for function *definitions*. This change unifies the logic so that it is shared by function definitions and decalrations. This change does *not* deal with the following issues that need to be addressed sometime soon-ish: - We currently always translate pointers into `out`, even if they should be `in out`. This is obviously wrong. - If/when we eventually have targets that support true pointers (e.g., CUDA, NVIDIA OpenGL, etc.) we'll need a way to tell the difference between an `in` pointer parameter, and an `out` parameter. Both of these issues are meant to be addressed by having a few special cases of pointer types, for the `out` and `in out` cases, and only translating those (not all pointers). We need to plumb those through the IR more completely, but I'm not dealing with that here.
1 parent ed29b29
Tip revision: ccea5702442a7a8303e6735a038be86939c1ce7a authored by Tim Foley on 07 November 2017, 18:22:53 UTC
Emit pointer-type parameters as out params
Emit pointer-type parameters as out params
Tip revision: ccea570
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.4 KB |
slang.sln | -rw-r--r-- | 9.1 KB |
test.bat | -rw-r--r-- | 1.4 KB |
Computing file changes ...