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>
This commit is contained in:
Adrienne Walker 2018-05-15 11:36:26 -07:00 committed by Skia Commit-Bot
parent fb8bafb352
commit 724afe8b2d
4 changed files with 14 additions and 0 deletions

View File

@ -10,4 +10,6 @@
disable_blend_equation_advanced) \
GPU_OP(DISABLE_DISCARD_FRAMEBUFFER, \
disable_discard_framebuffer) \
GPU_OP(MAX_TEXTURE_SIZE_LIMIT_4096, \
max_texture_size_limit_4096) \
// The End

View File

@ -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:

View File

@ -1,2 +1,3 @@
disable_blend_equation_advanced
disable_discard_framebuffer
max_texture_size_limit_4096

View File

@ -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;