From 6fcac0a7c4427329c53be9ee46b95df6c71ac88c Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Fri, 7 Jun 2024 21:27:19 -0700 Subject: [PATCH] Disable GLES sampler objects in Skia (#3502) Forces GLES 3.0 texture sampler units off in all Cobalt builds. Cobalt rendering code does not use samplers, and mixing Skia state that does, can result in rendering artifacts like pixelated textures. b/332330398 --- third_party/skia/src/gpu/gl/GrGLCaps.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/third_party/skia/src/gpu/gl/GrGLCaps.cpp b/third_party/skia/src/gpu/gl/GrGLCaps.cpp index 82e7e47523b4e..74d2398e32ee1 100644 --- a/third_party/skia/src/gpu/gl/GrGLCaps.cpp +++ b/third_party/skia/src/gpu/gl/GrGLCaps.cpp @@ -809,8 +809,13 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, } else if (GR_IS_GR_WEBGL(standard)) { fSamplerObjectSupport = version >= GR_GL_VER(2,0); } +#if defined(STARBOARD) + // Cobalt rendering code cannot interop with sampler objects. + fUseSamplerObjects = false; +#else // We currently use sampler objects whenever they are available. fUseSamplerObjects = fSamplerObjectSupport; +#endif if (GR_IS_GR_GL_ES(standard)) { fTiledRenderingSupport = ctxInfo.hasExtension("GL_QCOM_tiled_rendering");