Fixed illegal interface block reporting
DSL was improperly allowing interface blocks in runtime shaders, which
caused PipelineStageGenerator to get upset.
Bug: oss-fuzz:38131
Change-Id: I593e68f2cab3db9151d606e65e2826ffa9c494e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446324
Commit-Queue: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp
index 3e841fd..c623bf8 100644
--- a/src/sksl/SkSLIRGenerator.cpp
+++ b/src/sksl/SkSLIRGenerator.cpp
@@ -96,7 +96,7 @@
std::unique_ptr<Extension> IRGenerator::convertExtension(int offset, skstd::string_view name) {
if (this->programKind() != ProgramKind::kFragment &&
this->programKind() != ProgramKind::kVertex) {
- this->errorReporter().error(offset, "extensions are not allowed here");
+ this->errorReporter().error(offset, "extensions are not allowed in this kind of program");
return nullptr;
}
@@ -365,7 +365,8 @@
std::unique_ptr<ModifiersDeclaration> IRGenerator::convertModifiersDeclaration(const ASTNode& m) {
if (this->programKind() != ProgramKind::kFragment &&
this->programKind() != ProgramKind::kVertex) {
- this->errorReporter().error(m.fOffset, "layout qualifiers are not allowed here");
+ this->errorReporter().error(m.fOffset,
+ "layout qualifiers are not allowed in this kind of program");
return nullptr;
}
@@ -767,7 +768,8 @@
std::unique_ptr<SkSL::InterfaceBlock> IRGenerator::convertInterfaceBlock(const ASTNode& intf) {
if (this->programKind() != ProgramKind::kFragment &&
this->programKind() != ProgramKind::kVertex) {
- this->errorReporter().error(intf.fOffset, "interface block is not allowed here");
+ this->errorReporter().error(intf.fOffset,
+ "interface blocks are not allowed in this kind of program");
return nullptr;
}