Remove [[maybe_unused]] workaround in MetalCodeGen.

This effectively rolls back http://review.skia.org/538045.

Change-Id: I9c457a6c9c9ba98d4c2e3a6af03c5dd80c76beb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540082
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
John Stiles 2022-05-13 10:47:00 -04:00 committed by SkCQ
parent a91ee035ed
commit 11f2740463

View File

@ -2148,16 +2148,6 @@ void MetalCodeGenerator::writeName(std::string_view name) {
}
void MetalCodeGenerator::writeVarDeclaration(const VarDeclaration& varDecl) {
// The graphite shaders include functions with `switch` statements using named constant labels.
// When called with known values, the switch is eliminated. This leaves unused variables like:
// const int kFoo = ...;
// All of these happen to be `const int`. As a hack, mark any `const int` as maybe_unused, to
// suppress warnings from the metal compiler when validation is enabled.
if ((varDecl.var().modifiers().fFlags & Modifiers::kConst_Flag) &&
varDecl.var().type().matches(*fContext.fTypes.fInt)) {
this->write("[[maybe_unused]] ");
}
this->writeModifiers(varDecl.var().modifiers());
this->writeType(varDecl.var().type());
this->write(" ");