From f0ba756c2f982aac8095ff0928d048fc97548315 Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Mon, 26 Aug 2024 19:07:10 -0400 Subject: Fix Varying Variable Location Assignments With Hull Shaders (#4915) * Fix Varying Variable Location Assignments With Hull Shaders Fixes: #4913 Fixes: #4540 Changes: 1. Added `kIROp_ControlBarrier` to HLSL/GLSL emitting. 2. Added a method to track 'used' and 'unused' varyings for when legalizing GLSL. This allows us to assign correct offsets to automatically added varyings * Added a `ZeroLSB` check to UIntSet for this purpose * add missing return * code comment adjustment * cleanup * comment and HLSL controlBarrier mistake * assume space for glsl/spriv varying is irrelevant --- source/slang/slang-emit-hlsl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-emit-hlsl.cpp') diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp index d3757f534..a867d4c06 100644 --- a/source/slang/slang-emit-hlsl.cpp +++ b/source/slang/slang-emit-hlsl.cpp @@ -500,6 +500,11 @@ bool HLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu { switch (inst->getOp()) { + case kIROp_ControlBarrier: + { + m_writer->emit("GroupMemoryBatrierWithGroupSync();\n"); + return true; + } case kIROp_MakeVector: case kIROp_MakeMatrix: { -- cgit v1.2.3