From 216fc18661fd6e05053b4cc864396e6017e85b04 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 16 Aug 2023 22:47:35 -0700 Subject: 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 --- source/slang/slang-spirv-val.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'source/slang/slang-spirv-val.cpp') 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& spirv, String& outErr, in->close(); // Wait for it to finish - if(!p->waitForTermination(1000)) - return SLANG_FAIL; - - // TODO: allow inheriting stderr in Process List outData; - SLANG_RETURN_ON_FAIL(StreamUtil::readAll(out, 0, outData)); - outErr = String( - reinterpret_cast(outData.begin()), - reinterpret_cast(outData.end()) - ); + List 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(outData.begin()), reinterpret_cast(outData.end()) ); + outErr = String( + reinterpret_cast(outErrData.begin()), + reinterpret_cast(outErrData.end()) + ); + const auto ret = p->getReturnValue(); return ret == 0 ? SLANG_OK : SLANG_FAIL; } -- cgit v1.2.3