summaryrefslogtreecommitdiffstats
path: root/source/slang/reflection.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-10-19 09:04:41 -0700
committerGitHub <noreply@github.com>2017-10-19 09:04:41 -0700
commit5995b7a47b2b65025410b9d558dfe1820e4c42e0 (patch)
tree064b0a10e989f78e5f87ea0734a774b1d043dd6e /source/slang/reflection.cpp
parenta12480fe49d5ba7c0a9c2ac63363dc76b599ddbd (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 'source/slang/reflection.cpp')
0 files changed, 0 insertions, 0 deletions