Summary: | Enabling color correction from kcm results in kwin crash if kwin_gles is used | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Dario Cambié <dariocambie> |
Component: | colorcorrection | Assignee: | Casian Andrei <casian> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | artem, kwin-bugs-null |
Priority: | NOR | ||
Version: | git master | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kde-workspace/2dba9dc11341d5746dbcb04c1c689f2fae5f411f | Version Fixed In: | |
Attachments: | Patch that should trigger error when enabling color correction with GLES < 3.0 |
Description
Dario Cambié
2013-02-18 21:48:24 UTC
did you get a "Color Scene Shader is not valid" konsole (1212) debug out? I got this: kwin(20267): Failed to compile fragment shader: "0:12(36): error: invalid type `sampler3D' in declaration of `u_ccLookupTexture' 0:27(47): error: `u_ccLookupTexture' undeclared 0:0(0): error: no matching function for call to `texture3D(, vec3)' 0:27(88): error: type mismatch 0:27(104): error: Operands to arithmetic operators must be numeric Application::crashHandler() called with signal 11; recent crashes: 1 KCrash: Application 'kwin_gles' crashing... KCrash: Attempting to start /home/kde/kde4/lib/kde4/libexec/drkonqi from kdeinit Yupp, basically the colorcorrection shader doesn't compile. I guess we've to deactivate it for gles unless this is a mesa bug. Nevertheless, the direct problem is the unconditional use of (this?) shader. Either needs testing or dummy shader. it's to be expected. Only OpenGL ES 3.0 supports supports 3D textures or through an extension. So for GLES we should probably check the extension. *** Bug 315607 has been marked as a duplicate of this bug. *** I think the best solution would be to try to compile a dummy shader when initializing color correction, and if it does not work out, disable the color correction. It should not be difficult to do. I will get to it sometime soon. (In reply to comment #6) > I think the best solution would be to try to compile a dummy shader when > initializing color correction, and if it does not work out, disable the > color correction. It should not be difficult to do. I will get to it > sometime soon. No, that's the wrong solution. It just needs to properly handle the 3D texture case for GLES by checking for the extension. (In reply to comment #7) > (In reply to comment #6) > > I think the best solution would be to try to compile a dummy shader when > > initializing color correction, and if it does not work out, disable the > > color correction. It should not be difficult to do. I will get to it > > sometime soon. > No, that's the wrong solution. It just needs to properly handle the 3D > texture case for GLES by checking for the extension. Ok. How about doing both? Trying to compile a shader with a sampler3D would be an additional check, that may provide robustness to the code (that would be a separate review request). (In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #6) > > > I think the best solution would be to try to compile a dummy shader when > > > initializing color correction, and if it does not work out, disable the > > > color correction. It should not be difficult to do. I will get to it > > > sometime soon. > > No, that's the wrong solution. It just needs to properly handle the 3D > > texture case for GLES by checking for the extension. > > Ok. How about doing both? Trying to compile a shader with a sampler3D would > be an additional check, that may provide robustness to the code (that would > be a separate review request). We nowhere do just compile a shader to test capabilities. It means some overhead at setup time which I don't like. Created attachment 79047 [details]
Patch that should trigger error when enabling color correction with GLES < 3.0
Does this patch avoid the crash?
I do not have a GLES implementation that works with KWin it seems - complains about missing support to bind pixmaps to EGLImages. So I am unable to test on my system now.
There was a "if" check for GLES 3.0, but it only printed an error message, and it was forgeting to abort color correction init. That's why I opted for this 2-line patch instead of checking for the extension, even if that would have been nicer.
Works for me :) Git commit 68c68ee3c2b54f968c4d8275f1e8a2e0ccc90dd7 by Casian Andrei. Committed on 24/06/2013 at 20:41. Pushed by casianandrei into branch 'master'. Fix many color correction problems with OpenGL ES On GLES, check for OES_texture_3D extension for color correction Remove a block of ugly hack code that was supposedly needed to build with OpenGL ES. Convert the lookup texture data to uint8 on OpenGL ES before sending it via glTexImage3D, because uint16 is not supported. Check if the shaders have been reinitialized successfuly when trying to activate color correction, prevent black screens when there are issues with the shaders. REVIEW: 111225 M +29 -25 kwin/libkwineffects/kwinglcolorcorrection.cpp M +9 -0 kwin/libkwineffects/kwinglutils_funcs.cpp M +6 -0 kwin/libkwineffects/kwinglutils_funcs.h http://commits.kde.org/kde-workspace/68c68ee3c2b54f968c4d8275f1e8a2e0ccc90dd7 Git commit 2dba9dc11341d5746dbcb04c1c689f2fae5f411f by Casian Andrei. Committed on 24/06/2013 at 20:41. Pushed by casianandrei into branch 'KDE/4.11'. Fix many color correction problems with OpenGL ES On GLES, check for OES_texture_3D extension for color correction Remove a block of ugly hack code that was supposedly needed to build with OpenGL ES. Convert the lookup texture data to uint8 on OpenGL ES before sending it via glTexImage3D, because uint16 is not supported. Check if the shaders have been reinitialized successfuly when trying to activate color correction, prevent black screens when there are issues with the shaders. REVIEW: 111225 (cherry picked from commit 68c68ee3c2b54f968c4d8275f1e8a2e0ccc90dd7) M +29 -25 kwin/libkwineffects/kwinglcolorcorrection.cpp M +9 -0 kwin/libkwineffects/kwinglutils_funcs.cpp M +6 -0 kwin/libkwineffects/kwinglutils_funcs.h http://commits.kde.org/kde-workspace/2dba9dc11341d5746dbcb04c1c689f2fae5f411f |