From 7f8a9994d0bd99a171a1daa0bce46d92c02ccffd Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 21 May 2021 16:38:33 -0700 Subject: [gfx] Support StructuredBuffer. (#1851) Co-authored-by: T. Foley --- source/slang/slang-emit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index af870d02b..74b11079d 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -849,7 +849,13 @@ SlangResult emitEntryPointsSourceFromIR( } // There may be global-scope modifiers that we should emit now + // Supress emitting line directives when emitting preprocessor directives since + // these preprocessor directives may be required to appear in the first line + // of the output. An example is that the "#version" line in a GLSL source must + // appear before anything else. + sourceWriter.supressLineDirective(); sourceEmitter->emitPreprocessorDirectives(); + sourceWriter.resumeLineDirective(); RefObject* extensionTracker = sourceEmitter->getExtensionTracker(); -- cgit v1.2.3