Add more descriptive error message.

This commit is contained in:
Hans-Kristian Arntzen 2016-11-12 10:03:18 +01:00
Родитель 81c3caeeca
Коммит 526d06d0a4
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1632,6 +1632,13 @@ void Compiler::parse(const Instruction &instruction)
case OpFunctionEnd: case OpFunctionEnd:
{ {
if (current_block)
{
// Very specific error message, but seems to come up quite often.
throw CompilerError(
"Cannot end a function before ending the current block.\n"
"Likely cause: If this SPIR-V was created from glslang HLSL, make sure the entry point is valid.");
}
current_function = nullptr; current_function = nullptr;
break; break;
} }