From 0bb760260eb055f813247bf9ef06e372cac219d3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 18 Jul 2018 16:42:11 +0200 Subject: Fix tiling of NPOT textures on GL/ES MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The emulation was not working since the vertices are clamped before getting to the fragment shader. So instead just resize the brush if not supported. Change-Id: I856e47890cd3021874b77d869a6ff7162cadde10 Reviewed-by: Tor Arne Vestbø Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglengineshadersource_p.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/gui/opengl/qopenglengineshadersource_p.h') diff --git a/src/gui/opengl/qopenglengineshadersource_p.h b/src/gui/opengl/qopenglengineshadersource_p.h index 5d9ee8110b3..3ac599b6c23 100644 --- a/src/gui/opengl/qopenglengineshadersource_p.h +++ b/src/gui/opengl/qopenglengineshadersource_p.h @@ -303,17 +303,7 @@ static const char* const qopenglslPositionWithTextureBrushVertexShader = "\n\ static const char* const qopenglslAffinePositionWithTextureBrushVertexShader = qopenglslPositionWithTextureBrushVertexShader; -// OpenGL ES does not support GL_REPEAT wrap modes for NPOT textures. So instead, -// we emulate GL_REPEAT by only taking the fractional part of the texture coords. -// TODO: Special case POT textures which don't need this emulation -static const char* const qopenglslTextureBrushSrcFragmentShader_ES = "\n\ - varying highp vec2 brushTextureCoords; \n\ - uniform sampler2D brushTexture; \n\ - lowp vec4 srcPixel() { \n\ - return texture2D(brushTexture, fract(brushTextureCoords)); \n\ - }\n"; - -static const char* const qopenglslTextureBrushSrcFragmentShader_desktop = "\n\ +static const char* const qopenglslTextureBrushSrcFragmentShader = "\n\ varying highp vec2 brushTextureCoords; \n\ uniform sampler2D brushTexture; \n\ lowp vec4 srcPixel() \n\ @@ -795,7 +785,7 @@ static const char* const qopenglslPositionWithTextureBrushVertexShader_core = "\ static const char* const qopenglslAffinePositionWithTextureBrushVertexShader_core = qopenglslPositionWithTextureBrushVertexShader_core; -static const char* const qopenglslTextureBrushSrcFragmentShader_desktop_core = "\n\ +static const char* const qopenglslTextureBrushSrcFragmentShader_core = "\n\ in vec2 brushTextureCoords; \n\ uniform sampler2D brushTexture; \n\ vec4 srcPixel() \n\ -- cgit v1.2.3