WIP: SPV Remapper: add remapper test framework

This commit is contained in:
steve-lunarg
2016-08-17 16:18:06 -06:00
parent 4c3a7fd100
commit a8456415b8
52 changed files with 3067 additions and 9 deletions

View File

@@ -217,10 +217,12 @@ void SpirvStream::outputIndent()
void SpirvStream::formatId(Id id, std::stringstream& idStream)
{
if (id >= bound)
Kill(out, "Bad <id>");
if (id != 0) {
// On instructions with no IDs, this is called with "0", which does not
// have to be within ID bounds on null shaders.
if (id >= bound)
Kill(out, "Bad <id>");
idStream << id;
if (idDescriptor[id].size() > 0)
idStream << "(" << idDescriptor[id] << ")";
@@ -334,7 +336,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
idDescriptor[resultId] = (const char*)(&stream[word]);
}
else {
if (idDescriptor[resultId].size() == 0) {
if (resultId != 0 && idDescriptor[resultId].size() == 0) {
switch (opCode) {
case OpTypeInt:
idDescriptor[resultId] = "int";