From 1458a66d66b9da8a4165386ef27643816f03339c Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 10 Apr 2023 13:50:17 -0700 Subject: [PATCH] [Impeller] Some fixes to shader pipeline validation (flutter/engine#40925) [Impeller] Some fixes to shader pipeline validation --- .../src/flutter/impeller/entity/contents/content_context.h | 7 ++++++- .../renderer/backend/gles/pipeline_library_gles.cc | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/impeller/entity/contents/content_context.h b/engine/src/flutter/impeller/entity/contents/content_context.h index a135160e78..e5a8189f85 100644 --- a/engine/src/flutter/impeller/entity/contents/content_context.h +++ b/engine/src/flutter/impeller/entity/contents/content_context.h @@ -774,7 +774,12 @@ class ContentContext { // The prototype must always be initialized in the constructor. FML_CHECK(prototype != container.end()); - auto variant_future = prototype->second->WaitAndGet()->CreateVariant( + auto pipeline = prototype->second->WaitAndGet(); + if (!pipeline) { + return nullptr; + } + + auto variant_future = pipeline->CreateVariant( [&opts, variants_count = container.size()](PipelineDescriptor& desc) { opts.ApplyToPipelineDescriptor(desc); desc.SetLabel( diff --git a/engine/src/flutter/impeller/renderer/backend/gles/pipeline_library_gles.cc b/engine/src/flutter/impeller/renderer/backend/gles/pipeline_library_gles.cc index 25fa0ab632..8ad3bcc9aa 100644 --- a/engine/src/flutter/impeller/renderer/backend/gles/pipeline_library_gles.cc +++ b/engine/src/flutter/impeller/renderer/backend/gles/pipeline_library_gles.cc @@ -114,7 +114,7 @@ static bool LinkProgram( GLint frag_status = GL_FALSE; gl.GetShaderiv(vert_shader, GL_COMPILE_STATUS, &vert_status); - gl.GetShaderiv(vert_shader, GL_COMPILE_STATUS, &frag_status); + gl.GetShaderiv(frag_shader, GL_COMPILE_STATUS, &frag_status); if (vert_status != GL_TRUE) { LogShaderCompilationFailure(gl, vert_shader, descriptor.GetLabel(),