mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-23 12:10:06 +00:00
Print the shader when module building failed
This commit is contained in:
parent
51a2484b36
commit
a90fc84779
@ -59,7 +59,8 @@ class PassTest : public TestT {
|
||||
std::tuple<std::string, bool> OptimizeAndDisassemble(
|
||||
opt::Pass* pass, const std::string& original, bool skip_nop = false) {
|
||||
std::unique_ptr<ir::Module> module = tools_.BuildModule(original);
|
||||
EXPECT_NE(nullptr, module);
|
||||
EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n"
|
||||
<< original << std::endl;
|
||||
if (!module) {
|
||||
return std::make_tuple(std::string(), false);
|
||||
}
|
||||
@ -69,7 +70,9 @@ class PassTest : public TestT {
|
||||
std::vector<uint32_t> binary;
|
||||
module->ToBinary(&binary, skip_nop);
|
||||
std::string optimized;
|
||||
EXPECT_EQ(SPV_SUCCESS, tools_.Disassemble(binary, &optimized));
|
||||
EXPECT_EQ(SPV_SUCCESS, tools_.Disassemble(binary, &optimized))
|
||||
<< "Disassembling failed for shader:\n"
|
||||
<< original << std::endl;
|
||||
return std::make_tuple(optimized, modified);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user