summaryrefslogtreecommitdiff
path: root/source/slang/hlsl.meta.slang
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-03-30 16:53:07 -0700
committerGitHub <noreply@github.com>2018-03-30 16:53:07 -0700
commitbd66d4f90086eeff339f076f8cedfbf78e1989b6 (patch)
tree4fe943e2bc47015ea39444fb025e7b2f533dcac8 /source/slang/hlsl.meta.slang
parent87c50cf1644454cdc9e7f6d1262bee29bfc86e80 (diff)
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
Diffstat (limited to 'source/slang/hlsl.meta.slang')
-rw-r--r--source/slang/hlsl.meta.slang7
1 files changed, 6 insertions, 1 deletions
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