From bd66d4f90086eeff339f076f8cedfbf78e1989b6 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 30 Mar 2018 16:53:07 -0700 Subject: Fix several issues discovered by Falcor (#467) Fixes #466 Most of these are Vulkan-related regressions. * Kludge the definition of `GroupMemoryBarrierWithGroupSync()` for GLSL so that it works around parentheses that the emit logic now introduces. * Don't emit `static` for global constants when targetting GLSL * Emit the `flat` modifier for varying input/output with integer type, when targetting GLSL * Avoid checking parameter default-value expressions more than once, because this can crash when the checking introduces syntax that is not expected to appear in the input AST --- source/slang/hlsl.meta.slang | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/slang/hlsl.meta.slang') diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index 7356eccbe..75d9a3d33 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -583,7 +583,12 @@ float2 GetRenderTargetSamplePosition(int Index); __target_intrinsic(glsl, "groupMemoryBarrier") void GroupMemoryBarrier(); -__target_intrinsic(glsl, "groupMemoryBarrier(); barrier()") +// Note: the unmatched parentheses in the GLSL lowering are +// to cancel out the parens that the emit logic uses, so that +// we can emit this as if it were an expression. +// +// TODO: investigate whether we can just use "operator comma" here. +__target_intrinsic(glsl, "groupMemoryBarrier()); (barrier()") void GroupMemoryBarrierWithGroupSync(); // Atomics -- cgit v1.2.3