From a95f10c16293af1d287f4fe52fc473a6dc2b468f Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 21 Feb 2020 13:27:06 -0500 Subject: [PATCH] Fail gracefully when encountering 'in fragmentProcessor' in raster backend SkSLSlide was triggering this assert - now it prints an error every frame, but doesn't crash. Bug skia:9941 Change-Id: I4c02a89c8d824acc71ab595af99e1df2f5fc980d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272639 Commit-Queue: Brian Osman Reviewed-by: Tyler Denniston Reviewed-by: Ethan Nicholas Auto-Submit: Brian Osman --- src/sksl/SkSLByteCodeGenerator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sksl/SkSLByteCodeGenerator.cpp b/src/sksl/SkSLByteCodeGenerator.cpp index 90a9dbb283..c9c69fa757 100644 --- a/src/sksl/SkSLByteCodeGenerator.cpp +++ b/src/sksl/SkSLByteCodeGenerator.cpp @@ -83,11 +83,12 @@ ByteCodeGenerator::Location ByteCodeGenerator::getLocation(const Variable& var) } case Variable::kGlobal_Storage: { if (is_in(var)) { - // If you trip this assert, it means the program is using raw 'in' variables. You + // If you see this error, it means the program is using raw 'in' variables. You // should either specialize the program (Compiler::specialize) to bake in the final // values of the 'in' variables, or not use 'in' variables (maybe you meant to use // 'uniform' instead?). - SkASSERT(false); + fErrors.error(var.fOffset, + "'in' variable is not specialized or has unsupported type"); return ByteCode::Pointer{0}; } bool isUniform = is_uniform(var);