diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-07-18 16:42:11 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-07-27 16:10:45 +0000 |
commit | 0bb760260eb055f813247bf9ef06e372cac219d3 (patch) | |
tree | b1d3fe9efcb88696c85bd390a261048f570e07ab /src/gui/opengl/qopenglengineshadersource_p.h | |
parent | e65371caf9d067a28566bfcf361ead445194b955 (diff) |
Fix tiling of NPOT textures on GL/ES
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ø <tor.arne.vestbo@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/opengl/qopenglengineshadersource_p.h')
-rw-r--r-- | src/gui/opengl/qopenglengineshadersource_p.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gui/opengl/qopenglengineshadersource_p.h b/src/gui/opengl/qopenglengineshadersource_p.h index 5d9ee8110b..3ac599b6c2 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\ |