diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-06-26 18:15:36 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-26 15:15:36 -0700 |
| commit | 4eef0424a657e19f51f2734ba0199b69ee7354bd (patch) | |
| tree | 1179cc7c49d50f707f5f7342ad0c061e819d2636 /source/slang/slang-emit-glsl.cpp | |
| parent | 7175f647f576a4d613928a87dc7140280df4217f (diff) | |
Handling SV_ClipDistance system semantic on GLSL/VK (#2942)
* Small fixes and improvements around reflection tool.
* Make PrettyWriter printing a class.
* WIP support for gl_ClipDistance
* Working but doesn't have layout.
* Check out param works with gl_ClipDistance.
* Test clip distance works with out parameters.
* Enable file check.
* Add a test that splits clip distance writing.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
| -rw-r--r-- | source/slang/slang-emit-glsl.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp index a86971bf5..64afb7ff1 100644 --- a/source/slang/slang-emit-glsl.cpp +++ b/source/slang/slang-emit-glsl.cpp @@ -826,6 +826,18 @@ void GLSLSourceEmitter::_maybeEmitGLSLBuiltin(IRGlobalParam* var, UnownedStringS emitType(varType, getName(var)); m_writer->emit(";\n\n"); } + else if (name == "gl_ClipDistance") + { + auto varType = var->getDataType(); + if (auto outType = as<IROutType>(varType)) + { + varType = outType->getValueType(); + } + + m_writer->emit("out "); + emitType(varType, getName(var)); + m_writer->emit(";\n\n"); + } } void GLSLSourceEmitter::_requireBaseType(BaseType baseType) |
