From d895ca673d08bd128fc809857eadca75a9b57ca0 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Mon, 19 Jun 2017 14:39:43 -0400 Subject: Limit number of stages for Angle D3D for GLPrograms test Bug: skia:4717 Change-Id: I5ea613311d2c346bc45875040665a121b455f674 Reviewed-on: https://skia-review.googlesource.com/20228 Reviewed-by: Robert Phillips Commit-Queue: Greg Daniel --- tests/GLProgramsTest.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/GLProgramsTest.cpp') diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index cc61891dd4..66d6ceecec 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -342,7 +342,8 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { } #endif -static int get_glprograms_max_stages(GrContext* context) { +static int get_glprograms_max_stages(const sk_gpu_test::ContextInfo& ctxInfo) { + GrContext* context = ctxInfo.grContext(); GrGLGpu* gpu = static_cast(context->getGpu()); int maxStages = 6; if (kGLES_GrGLStandard == gpu->glStandard()) { @@ -359,11 +360,16 @@ static int get_glprograms_max_stages(GrContext* context) { maxStages = 3; #endif } + if (ctxInfo.type() == sk_gpu_test::GrContextFactory::kANGLE_D3D9_ES2_ContextType || + ctxInfo.type() == sk_gpu_test::GrContextFactory::kANGLE_D3D11_ES2_ContextType) { + // On Angle D3D we will hit a limit of out variables if we use too many stages. + maxStages = 3; + } return maxStages; } static void test_glprograms(skiatest::Reporter* reporter, const sk_gpu_test::ContextInfo& ctxInfo) { - int maxStages = get_glprograms_max_stages(ctxInfo.grContext()); + int maxStages = get_glprograms_max_stages(ctxInfo); if (maxStages == 0) { return; } -- cgit v1.2.3