diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-12-03 09:46:08 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-03 09:46:08 -0500 |
| commit | 80ff45f095db5a08db264921fda2db210788d529 (patch) | |
| tree | 6c1ed6922ce485a1ca9cdc8fc989d27807c75f73 /source/slang/slang-api.cpp | |
| parent | fb6cf46fd590ca6a72746fc839981e13b5bdde95 (diff) | |
Improvements to repro diagnostics (#2039)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Improvements to repro diagnostics.
* Fix typo.
Diffstat (limited to 'source/slang/slang-api.cpp')
| -rw-r--r-- | source/slang/slang-api.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/slang/slang-api.cpp b/source/slang/slang-api.cpp index 5ee384e4a..e8e9b602d 100644 --- a/source/slang/slang-api.cpp +++ b/source/slang/slang-api.cpp @@ -777,10 +777,13 @@ SLANG_API SlangResult spExtractRepro(SlangSession* session, const void* reproDat using namespace Slang; SLANG_UNUSED(session); + DiagnosticSink sink; + sink.init(nullptr, nullptr); + List<uint8_t> buffer; { MemoryStreamBase memoryStream(FileAccess::Read, reproData, reproDataSize); - SLANG_RETURN_ON_FAIL(ReproUtil::loadState(&memoryStream, buffer)); + SLANG_RETURN_ON_FAIL(ReproUtil::loadState(&memoryStream, &sink, buffer)); } MemoryOffsetBase base; @@ -801,10 +804,13 @@ SLANG_API SlangResult spLoadReproAsFileSystem( SLANG_UNUSED(session); + DiagnosticSink sink; + sink.init(nullptr, nullptr); + MemoryStreamBase stream(FileAccess::Read, reproData, reproDataSize); List<uint8_t> buffer; - SLANG_RETURN_ON_FAIL(ReproUtil::loadState(&stream, buffer)); + SLANG_RETURN_ON_FAIL(ReproUtil::loadState(&stream, &sink, buffer)); auto requestState = ReproUtil::getRequest(buffer); MemoryOffsetBase base; |
