added support for flat and noperspective modifiers in SPIR-V

Bug: skia:
Change-Id: I41f90464377be5de6813d6011b7e53dbac9230b6
Reviewed-on: https://skia-review.googlesource.com/26345
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
Ethan Nicholas 2017-07-24 14:36:40 -04:00 committed by Skia Commit-Bot
parent f41996e310
commit 45b0f15688

View File

@ -2932,6 +2932,13 @@ void SPIRVCodeGenerator::writeGlobalVars(Program::Kind kind, const VarDeclaratio
fCurrentBlock = 0;
}
this->writeLayout(var->fModifiers.fLayout, id);
if (var->fModifiers.fFlags & Modifiers::kFlat_Flag) {
this->writeInstruction(SpvOpDecorate, id, SpvDecorationFlat, fDecorationBuffer);
}
if (var->fModifiers.fFlags & Modifiers::kNoPerspective_Flag) {
this->writeInstruction(SpvOpDecorate, id, SpvDecorationNoPerspective,
fDecorationBuffer);
}
}
}