aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Adrienne Walker <enne@chromium.org>2018-05-15 11:36:26 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-15 19:56:23 +0000
commit724afe8b2da2cd32394921096d5c738519b5a51e (patch)
tree37427063295330c5a2bc149a45c42956a31a100b /src/gpu
parentfb8bafb3520a522bb35768a71ab24f9bea06d1c4 (diff)
Driver bug workaround: max_texture_size_limit_4096
Bug: chromium: 829614 Change-Id: I127157fa04df2ec6505411aa42f1232910e251d4 Reviewed-on: https://skia-review.googlesource.com/126608 Commit-Queue: Adrienne Walker <enne@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp5
-rw-r--r--src/gpu/gpu_workaround_list.txt1
-rw-r--r--src/gpu/vk/GrVkCaps.cpp6
3 files changed, 12 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 2acc7ca91f..a20e049329 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -489,6 +489,11 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
}
GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureSize);
+
+ if (fDriverBugWorkarounds.max_texture_size_limit_4096) {
+ fMaxTextureSize = SkTMin(fMaxTextureSize, 4096);
+ }
+
GR_GL_GetIntegerv(gli, GR_GL_MAX_RENDERBUFFER_SIZE, &fMaxRenderTargetSize);
// Our render targets are always created with textures as the color
// attachment, hence this min:
diff --git a/src/gpu/gpu_workaround_list.txt b/src/gpu/gpu_workaround_list.txt
index dbded3f11c..c9867a6b22 100644
--- a/src/gpu/gpu_workaround_list.txt
+++ b/src/gpu/gpu_workaround_list.txt
@@ -1,2 +1,3 @@
disable_blend_equation_advanced
disable_discard_framebuffer
+max_texture_size_limit_4096
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 1c36a1494c..76a1417ff8 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -317,6 +317,12 @@ void GrVkCaps::initGrCaps(const VkPhysicalDeviceProperties& properties,
// give the minimum max size across all configs. So for simplicity we will use that for now.
fMaxRenderTargetSize = SkTMin(properties.limits.maxImageDimension2D, (uint32_t)INT_MAX);
fMaxTextureSize = SkTMin(properties.limits.maxImageDimension2D, (uint32_t)INT_MAX);
+ if (fDriverBugWorkarounds.max_texture_size_limit_4096) {
+ fMaxTextureSize = SkTMin(fMaxTextureSize, 4096);
+ }
+ // Our render targets are always created with textures as the color
+ // attachment, hence this min:
+ fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize);
// TODO: check if RT's larger than 4k incur a performance cost on ARM.
fMaxPreferredRenderTargetSize = fMaxRenderTargetSize;