diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-16 22:47:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-17 13:47:35 +0800 |
| commit | 216fc18661fd6e05053b4cc864396e6017e85b04 (patch) | |
| tree | 48dfd4aef767694f3063d3c79bcc0a1e3c184346 /source/slang/slang-spirv-val.cpp | |
| parent | a0ee2bf671d61d1e2b561db3966e57ffc802040f (diff) | |
Create storage types of different layouts for SPIRV emit. (#3116)
* Create storage types of different layouts for SPIRV emit.
* Fix.
* Fix.
* Fix.
* Update expected failure list.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-spirv-val.cpp')
| -rw-r--r-- | source/slang/slang-spirv-val.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/source/slang/slang-spirv-val.cpp b/source/slang/slang-spirv-val.cpp index c2381fa0e..29a4b8617 100644 --- a/source/slang/slang-spirv-val.cpp +++ b/source/slang/slang-spirv-val.cpp @@ -21,24 +21,27 @@ static SlangResult disassembleSPIRV(const List<uint8_t>& spirv, String& outErr, in->close(); // Wait for it to finish - if(!p->waitForTermination(1000)) - return SLANG_FAIL; - - // TODO: allow inheriting stderr in Process List<Byte> outData; - SLANG_RETURN_ON_FAIL(StreamUtil::readAll(out, 0, outData)); - outErr = String( - reinterpret_cast<const char*>(outData.begin()), - reinterpret_cast<const char*>(outData.end()) - ); + List<Byte> outErrData; + while (!out->isEnd() || !err->isEnd()) + { + if (!out->isEnd()) + StreamUtil::readAll(out, 0, outData); + if (!err->isEnd()) + StreamUtil::readAll(err, 0, outErrData); + } + SLANG_RETURN_ON_FAIL(p->waitForTermination(10)); - outData.clear(); - SLANG_RETURN_ON_FAIL(StreamUtil::readAll(err, 0, outData)); outDis = String( reinterpret_cast<const char*>(outData.begin()), reinterpret_cast<const char*>(outData.end()) ); + outErr = String( + reinterpret_cast<const char*>(outErrData.begin()), + reinterpret_cast<const char*>(outErrData.end()) + ); + const auto ret = p->getReturnValue(); return ret == 0 ? SLANG_OK : SLANG_FAIL; } |
