diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-08-26 20:32:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-26 20:32:53 -0400 |
| commit | 5c2c2cfc9918bb43225159e67a851e196e17759a (patch) | |
| tree | 216009d02afe9dc17b074fdd394141ef71472268 /source/compiler-core/slang-glslang-compiler.cpp | |
| parent | ef067bef2f2188a4b3c420cbcd8d223874888ed2 (diff) | |
DownstreamCompileOptions using POD types (#2381)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Make DownstreamCompileOptions use POD types.
* CharSliceAllocator -> SliceAllocator
Added SliceConverter
CharSliceCaster -> SliceCaster
* First attempt at zero terminating around blobs.
* Fix clang warning.
* Add SlangTerminatedChars
Make Blob implementations support it.
Make most blobs 'terminated'.
* Fix bug setting up sourceFiles for CommandLineDownstreamCompiler.
* Traffic in TerminatedCharSlice for sourceFiles.
Use ArtifactDesc to generate temporary file names for source.
* Fix typo in testing for shared library/C++.
Diffstat (limited to 'source/compiler-core/slang-glslang-compiler.cpp')
| -rw-r--r-- | source/compiler-core/slang-glslang-compiler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/compiler-core/slang-glslang-compiler.cpp b/source/compiler-core/slang-glslang-compiler.cpp index 3a96ed69d..a896e4278 100644 --- a/source/compiler-core/slang-glslang-compiler.cpp +++ b/source/compiler-core/slang-glslang-compiler.cpp @@ -98,7 +98,7 @@ SlangResult GlslangDownstreamCompiler::_invoke(glslang_CompileRequest_1_1& reque return err ? SLANG_FAIL : SLANG_OK; } -static SlangResult _parseDiagnosticLine(CharSliceAllocator& allocator, const UnownedStringSlice& line, List<UnownedStringSlice>& lineSlices, ArtifactDiagnostic& outDiagnostic) +static SlangResult _parseDiagnosticLine(SliceAllocator& allocator, const UnownedStringSlice& line, List<UnownedStringSlice>& lineSlices, ArtifactDiagnostic& outDiagnostic) { /* ERROR: tests/diagnostics/syntax-error-intrinsic.slang:13: '@' : unexpected token */ @@ -128,7 +128,7 @@ static SlangResult _parseDiagnosticLine(CharSliceAllocator& allocator, const Uno SlangResult GlslangDownstreamCompiler::compile(const CompileOptions& options, IArtifact** outArtifact) { // This compiler doesn't read files, they should be read externally and stored in sourceContents/sourceContentsPath - if (options.sourceFiles.getCount() > 0) + if (options.sourceFiles.count > 0) { return SLANG_FAIL; } @@ -156,7 +156,7 @@ SlangResult GlslangDownstreamCompiler::compile(const CompileOptions& options, IA request.sizeInBytes = sizeof(request); request.action = GLSLANG_ACTION_COMPILE_GLSL_TO_SPIRV; - request.sourcePath = options.sourceContentsPath.getBuffer(); + request.sourcePath = options.sourceContentsPath; request.slangStage = options.stage; @@ -201,9 +201,9 @@ SlangResult GlslangDownstreamCompiler::compile(const CompileOptions& options, IA if (SLANG_FAILED(invokeResult)) { - diagnostics->setRaw(CharSliceCaster::asCharSlice(diagnosticOutput)); + diagnostics->setRaw(SliceCaster::asCharSlice(diagnosticOutput)); - CharSliceAllocator allocator; + SliceAllocator allocator; SlangResult diagnosticParseRes = ArtifactDiagnosticUtil::parseColonDelimitedDiagnostics(allocator, diagnosticOutput.getUnownedSlice(), 1, _parseDiagnosticLine, diagnostics); SLANG_UNUSED(diagnosticParseRes); |
