From 87785d5573d7262c58ee2af40bbd82d5a3d70784 Mon Sep 17 00:00:00 2001 From: Adrienne Walker Date: Thu, 9 Aug 2018 12:01:43 -0700 Subject: [PATCH] Add max_fragment_uniform_vectors_32 workaround Bug: chromium: 829614 Change-Id: I0ce008d8ebadd90758510ea069f0f4384a95751e Reviewed-on: https://skia-review.googlesource.com/146622 Reviewed-by: Brian Salomon Commit-Queue: Adrienne Walker --- include/gpu/GrDriverBugWorkaroundsAutogen.h | 2 ++ src/gpu/gl/GrGLCaps.cpp | 3 +++ src/gpu/gpu_workaround_list.txt | 1 + 3 files changed, 6 insertions(+) diff --git a/include/gpu/GrDriverBugWorkaroundsAutogen.h b/include/gpu/GrDriverBugWorkaroundsAutogen.h index 8b1e33eeaa..373db9f3e3 100644 --- a/include/gpu/GrDriverBugWorkaroundsAutogen.h +++ b/include/gpu/GrDriverBugWorkaroundsAutogen.h @@ -14,6 +14,8 @@ disallow_large_instanced_draw) \ GPU_OP(GL_CLEAR_BROKEN, \ gl_clear_broken) \ + GPU_OP(MAX_FRAGMENT_UNIFORM_VECTORS_32, \ + max_fragment_uniform_vectors_32) \ GPU_OP(MAX_MSAA_SAMPLE_COUNT_4, \ max_msaa_sample_count_4) \ GPU_OP(MAX_TEXTURE_SIZE_LIMIT_4096, \ diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index dd59648917..db16727977 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -91,6 +91,9 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); } } + if (fDriverBugWorkarounds.max_fragment_uniform_vectors_32) { + fMaxFragmentUniformVectors = SkMin32(fMaxFragmentUniformVectors, 32); + } GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); if (kGL_GrGLStandard == standard) { diff --git a/src/gpu/gpu_workaround_list.txt b/src/gpu/gpu_workaround_list.txt index 7f7af43856..736dbfd2d3 100644 --- a/src/gpu/gpu_workaround_list.txt +++ b/src/gpu/gpu_workaround_list.txt @@ -2,6 +2,7 @@ disable_blend_equation_advanced disable_discard_framebuffer disallow_large_instanced_draw gl_clear_broken +max_fragment_uniform_vectors_32 max_msaa_sample_count_4 max_texture_size_limit_4096 pack_parameters_workaround_with_pack_buffer