Commit graph

580 commits

Author SHA1 Message Date
Fredrik Höglund
8bc586e613 kwin: Add overloads for setUniform() that take a location. 2011-02-04 19:57:19 +01:00
Martin Gräßlin
859dadffd8 Drop addQuadVertices from kwinglutils.
KWin does not use GL_QUADS anymore for rendering windows.
This makes this method rather useless and isn't used anywhere either.
2011-02-04 19:46:20 +01:00
Martin Gräßlin
2e2a7948fb Remove renderGLGeometry from kwinglutils.
Not used anymore - completely replaced by VBO.
2011-02-04 19:38:27 +01:00
Fredrik Höglund
f7633fff23 kwin: Static member variables shouldn't have the m prefix. 2011-02-04 17:32:13 +01:00
Fredrik Höglund
9dfc0332c6 kwin: Fix a compiler warning about initialization order. 2011-02-04 17:06:28 +01:00
Fredrik Höglund
f21ccf028a kwin: Clean up the shader compilation code a bit. 2011-02-04 17:03:56 +01:00
Fredrik Höglund
9f41472085 kwin: Change the shader source code parameters from QStrings to QByteArrays.
This eliminates the QByteArray -> QString -> QByteArray conversions.
2011-02-04 16:41:55 +01:00
Christoph Thielecke
f95b82a907 define missing macros for systems which have only EXT defines.
these are:
- GL_FRAMEBUFFER
- GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
- GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
- GL_FRAMEBUFFER_UNSUPPORTED
- GL_COLOR_ATTACHMENT0
- GL_FRAMEBUFFER_COMPLETE
2011-02-04 08:34:19 +01:00
Martin Gräßlin
d9dc5afae4 Only link against GLES if building for GLES.
It took me two hours to figure out that kwineffects linked the GLES libraries
and that was causing my kwin not to work :-(
2011-02-03 22:30:14 +01:00
Martin Gräßlin
27c2b599b7 Bump the effects API version for 4.7.
Better late than never. As always keeping a buffer for API breaks in stable branch.
2011-02-01 23:05:21 +01:00
Martin Gräßlin
0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Fredrik Höglund
3ada211c30 Don't enable loose binding with Gallium drivers in Mesa 7.10.
It's currently broken because of a regression in the mesa state tracker.

FIXED-IN: 4.6.0
BUG: 259872

svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1213870
2011-01-30 15:07:40 +01:00
Fredrik Höglund
ee406e6d86 Tweak the debug output to make it more readable.
svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1213845
2011-01-30 15:07:40 +01:00
Fredrik Höglund
7d5d8213dd Don't print the GLSL version when GLSL isn't supported.
svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1213843
2011-01-30 15:07:40 +01:00
Fredrik Höglund
1643fdfc63 Add some missing radeon GPU's
svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1213842
2011-01-30 15:07:40 +01:00
Fredrik Höglund
83fd472bb3 Fix chipset detection with r300g
svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1213841
2011-01-30 15:07:02 +01:00
Martin Gräßlin
cf94a0e8f8 Binding shaders moved explicitly to ShaderManager. 2011-01-30 14:24:49 +01:00
Martin Gräßlin
19f6b9667b Remove ShaderEffect from KWinEffects Library.
The class is not used by any effect any more and the
design of the ShaderEffect makes it hardly usable.
For most effects just rendering the windows with the Shader
attached to it makes more sense than rendering the complete
screen into a FBO and apply the shader on the off-screen texture.
2011-01-30 14:20:05 +01:00
Martin Gräßlin
36daa74589 Combine custom vertex with built-in fragment shader. 2011-01-30 14:12:06 +01:00
Martin Gräßlin
a478fc7ff3 Allow creating shaders from code directly. 2011-01-30 14:12:05 +01:00
Martin Gräßlin
f78d838fc7 Better support custom shaders. 2011-01-30 14:12:05 +01:00
Martin Gräßlin
61615ea7ff Need to copy QPixmap to QImage in GLES.
The Image extension seems to need the pixmap around and that's something
we cannot guarantee in the generic case.
2011-01-30 14:12:05 +01:00
Martin Gräßlin
d683ce560c Adding new uniform to enforce that alpha becomes 1.0
When rendering opaque (RGB-only) windows the alpha ends up to be 0
with blending disabled. This breaks subsequent rendering steps which
require blenden (e.g. Lanczos). Therefore a uniform is used to ensure
that the alpha channel is set to 1.
2011-01-30 14:12:04 +01:00
Martin Gräßlin
6252421a70 Disable clipping when rendering infiniteRegion 2011-01-30 14:12:04 +01:00
Martin Gräßlin
efb82daf30 Adding high-level method for glLoadMatrix 2011-01-30 14:12:03 +01:00
Martin Gräßlin
e49345872c Add high-level functions for <push|pop|mult>Matrix.
All methods are no-ops for GLES which allows to use them from
effects without checks for GLES.
2011-01-30 14:12:03 +01:00
Martin Gräßlin
460ca2729a Make KWin-GLES branch compile with desktop GL 2011-01-30 14:12:03 +01:00
Martin Gräßlin
7adc29efd7 Remove warnings when building with GLES 2011-01-30 14:12:03 +01:00
Martin Gräßlin
4e36027924 Drop unused bindAttribute Location function. 2011-01-30 14:12:03 +01:00
Martin Gräßlin
990001c5d7 Drop GLVertexBuffer::useShader.
The vertex buffer implementation uses the shader manager to decide
whether core painting should be used or not. Shader manager is only
used by shaders using vertex attributes instead of gl_Vertex etc.
2011-01-30 14:12:02 +01:00
Martin Gräßlin
a4e4752109 Combine built-in vertex with custom fragment shader
ShaderManager supports a new concept to load just a fragment shader from file
and use a built-in shader for the vertex shader. This allows an effect to use
a custom fragment shader.
2011-01-30 14:12:02 +01:00
Martin Gräßlin
1ba818044f Read a matrix uniform back from shader.
Might require additions to kwinglutils_func in desktop profile
2011-01-30 14:12:01 +01:00
Martin Gräßlin
cab9154723 Simple vertex shaders use projection matrix and offset 2011-01-30 14:12:01 +01:00
Martin Gräßlin
5c6e32eaed GLPlatform compiles on EGL 2011-01-30 14:12:01 +01:00
Martin Gräßlin
69044f10c5 GLShader appends the ES specific commands to the shaders 2011-01-30 14:12:01 +01:00
Martin Gräßlin
45f42cdea9 Adding a shared VBO for streaming data. 2011-01-30 14:12:00 +01:00
Martin Gräßlin
a352a0e6a8 Remove implemented TODO marker 2011-01-30 14:12:00 +01:00
Martin Gräßlin
910ba17444 VBO uses ShaderManager to get current bound shader 2011-01-30 14:12:00 +01:00
Martin Gräßlin
753df55973 Set Color as a uniform 2011-01-30 14:12:00 +01:00
Martin Gräßlin
3c6e7309f2 New ShaderManager
The ShaderManager provides the built-in shaders for scene and effects.
Scene and effects can simply push one of those built-in shaders or a
custom one on a stack ensuring that the previously bound shader will be
rebound when the shader is poped again.

The class will be extended to not only have built-in shaders but also to
load custom shaders and being the only way to bind a shader at all.
2011-01-30 14:11:59 +01:00
Martin Gräßlin
a182744648 Fix color rendering 2011-01-30 14:11:59 +01:00
Martin Gräßlin
9bbb852f0c Resolve EGL and GLES function pointers 2011-01-30 14:11:59 +01:00
Martin Gräßlin
70fefbbbae Adding an initEGL method and check for required extension 2011-01-30 14:11:59 +01:00
Martin Gräßlin
d12c4e58fd Support new translate for textures 2011-01-30 14:11:58 +01:00
Martin Gräßlin
ae95ab0c43 Adding color to VBO.
A color can be specified to render the geometry of the VBO.
For legacy painting glColor is used, for shader a uniform is set.
In order to allow rendering without texcoords, it is possible to pass
a null pointer as texcoords.
Shader added to scene which just renders a colored geometry without texturing.
2011-01-30 14:11:58 +01:00
Martin Gräßlin
d31c00ed0e Better CMake detection for building ES or desktop 2011-01-30 14:11:58 +01:00
Martin Gräßlin
a2e214d326 Enable PaintClipper on core VBO again.
Need to disable clearing screen on EGL for that.
With Mesa swapping buffer is sufficient, though a better solution will be required for other drivers
2011-01-30 14:11:57 +01:00
Martin Gräßlin
f240fc2196 Support QMatrix4x4 as Uniform value 2011-01-30 14:11:57 +01:00
Martin Gräßlin
5804417acc And here comes the working OpenGL ES backend 2011-01-30 14:11:57 +01:00
Martin Gräßlin
f5dbeb8fab More ifdefing for ES 2011-01-30 14:11:57 +01:00