diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-10-19 09:04:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-19 09:04:41 -0700 |
| commit | 5995b7a47b2b65025410b9d558dfe1820e4c42e0 (patch) | |
| tree | 064b0a10e989f78e5f87ea0734a774b1d043dd6e /tests/render | |
| parent | a12480fe49d5ba7c0a9c2ac63363dc76b599ddbd (diff) | |
Initial work on a pass to scalarize GLSL varying input/output (#223)
There was already a pass in place that transformed parameters and results of an entry-point function into global variables for GLSL, but this pass would just turn a `struct`-type parameter into a `struct`-type global, which has two problems:
- The standard GLSL language doesn't seem to allow `struct` types as vertex shader inputs or fragment shader outputs.
- If there are any members in such a `struct` that represent "system value" inputs or outputs, then these would need to be transformed into the equivalent `gl_*` variables.
This change adds a more complete scalarization process that applies to inputs/outputs during the legalization pass. In order to support this there is a little bit of a data strcuture for abstracting over tuples of values (this same idiom is used in a few other places, so perhaps the implementation could be done once and shared?).
System values are current handled in a painfully ad hoc (and incomplete) fashion during code emit. We need to come up with a better solution for mapping HLSL `SV_*` semantics over to `gl_*` variables.
In some cases this mapping might introduce more code than we can easily deal with during emit time, so it probably needs to be handled back at the IR level.
This implementation has many gaps, but it appears to be enough to get teh `render/cross-compile-entry-point` test working with IR-based cross-compilation.
Diffstat (limited to 'tests/render')
| -rw-r--r-- | tests/render/cross-compile-entry-point.slang | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/render/cross-compile-entry-point.slang b/tests/render/cross-compile-entry-point.slang index 018947228..7980ce17e 100644 --- a/tests/render/cross-compile-entry-point.slang +++ b/tests/render/cross-compile-entry-point.slang @@ -1,4 +1,4 @@ -//TEST(render):COMPARE_HLSL_CROSS_COMPILE_RENDER: +//TEST(render):COMPARE_HLSL_CROSS_COMPILE_RENDER:-xslang -use-ir // This is a test to ensure that we can cross-compile a complete entry point. |
