From 4eef0424a657e19f51f2734ba0199b69ee7354bd Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 26 Jun 2023 18:15:36 -0400 Subject: 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 --- source/slang/slang-emit-glsl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/slang/slang-emit-glsl.cpp') 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 @@ -822,6 +822,18 @@ void GLSLSourceEmitter::_maybeEmitGLSLBuiltin(IRGlobalParam* var, UnownedStringS &IROutTypeBase::getValueType); SLANG_ASSERT(varType && "Indices mesh output dind't have an 'out' type"); + m_writer->emit("out "); + emitType(varType, getName(var)); + m_writer->emit(";\n\n"); + } + else if (name == "gl_ClipDistance") + { + auto varType = var->getDataType(); + if (auto outType = as(varType)) + { + varType = outType->getValueType(); + } + m_writer->emit("out "); emitType(varType, getName(var)); m_writer->emit(";\n\n"); -- cgit v1.2.3