From f70699c78235c33f909ffff87f8edf4b58b30c51 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 7 Jul 2017 13:27:00 -0700 Subject: Don't emit `[unroll]` or `[loop]` to GLSL - I really ought to make these semantically understood attributes, which might make this logic easier - Long-term if we start emitting SPIR-V directly, we should translte these, of course --- source/slang/emit.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/emit.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 6a10c4f03..5d85b4d57 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -1837,6 +1837,10 @@ struct EmitVisitor void EmitLoopAttributes(RefPtr decl) { + // Don't emit these attributes for GLSL, because it doesn't understand them + if (context->shared->target == CodeGenTarget::GLSL) + return; + // TODO(tfoley): There really ought to be a semantic checking step for attributes, // that turns abstract syntax into a concrete hierarchy of attribute types (e.g., // a specific `LoopModifier` or `UnrollModifier`). -- cgit v1.2.3