diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-10-06 14:31:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-06 14:31:42 -0700 |
| commit | faf26afdcfd343c79517f56f215bf8dcd5e0b992 (patch) | |
| tree | 070bbc0acb2ed5c9a5e522ea522fbcfdc77af78c /tests/preprocessor/define-redefine.slang.expected | |
| parent | 3693bff4a2b822a2b29ac563d464d1012a3a3eda (diff) | |
Perform some transformations on IR to legalize for GLSL (#200)
When outputting GLSL from a Slang or HLSL entry point, we need to translate any parameters or results of an entry-point function into global declarations of `in` or `out` parameters, as needed by GLSL.
This change adds these transformations at the IR level, so that they don't need to complicate the emit logic.
More detailed changes:
- Make `render0` test use IR. It passes out of the box.
- Fix test runner to not always dump diffs on failures
I accidentally initialized an option to `true` instead of `false` when working on debugging the Travis CI failures.
- Special-case output for component-wise multiplication to handle GLSL `matrixCompMul()`
- Handle GLSL vs. HLSL output for calls to `mul()`
- Output proper `layout(std140)` on GLSL constant buffer declarations
- Require appropriate GLSL extension when emitting explicit `layout(offset = ...)` on constant buffer members
- TODO: Need to avoid requiring this extension in cases where the offsets are what would be computed anyway.
Realistically, should probably be emitting code with explicit padding, etc. to guarantee layouts.
- Add an IR-based pass to translate entry point functions by eliminating their input/output parameters and replacing them with global variables.
- Demangle names when calling target intrinsics
The lowering to the IR will turn a call like `sin(foo)` into a call to a function declaration with a mangled name like `_S3sin...`. This works fine when the user is calling their own functions, since the name mangling will apply to both the definition and use sites, but for builtin functions it obviously isn't what we want.
This change makes it so that we demangle the name of an instrinsic function just enough so that we can extract the original simple name, and make a call using that.
These changes do nor provide 100% of what we need when translating to GLSL, so the `cross-compile-entry-point` test *still* hasn't been flipped over to use the IR (even though that is the test case I've been using to develop these changes).
Diffstat (limited to 'tests/preprocessor/define-redefine.slang.expected')
0 files changed, 0 insertions, 0 deletions
