community icon indicating copy to clipboard operation
community copied to clipboard

Shader bug on android

Open Neizvestnyj opened this issue 4 years ago • 2 comments

Software Versions

  • Python: 3.8.5
  • OS: android
  • Kivy: 2.0.0
  • Kivy installation method: pip

When I run this example and many others with same effect, app on android crashed and in console appear this error:

backtrace:
08-16 22:24:12.166 15040 15040 F DEBUG   :       #00 pc 0015ccd8  /vendor/lib/egl/libGLESv2_adreno.so (BuildId: 9dd9abbb04e97679f4d376327c3e1fe4)
08-16 22:24:12.166 15040 15040 F DEBUG   :       #01 pc 00155bef  /vendor/lib/egl/libGLESv2_adreno.so (BuildId: 9dd9abbb04e97679f4d376327c3e1fe4)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #02 pc 00015fd1  /system/lib/libEGL.so (android::eglQuerySurfaceImpl(void*, void*, int, int*)+144) (BuildId: 67aee0ee745c4df303c3d711821f89eb)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #03 pc 001eb0ed  /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::beginFrame(void*)+56) (BuildId: 20281a1fa4a57e28d153cce51608f033)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #04 pc 001eb091  /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::getFrame()+8) (BuildId: 20281a1fa4a57e28d153cce51608f033)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #05 pc 001f5d31  /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+160) (BuildId: 20281a1fa4a57e28d153cce51608f033)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #06 pc 001f534d  /system/lib/libhwui.so (android::uirenderer::renderthread::DrawFrameTask::run()+156) (BuildId: 20281a1fa4a57e28d153cce51608f033)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #07 pc 002028b9  /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+164) (BuildId: 20281a1fa4a57e28d153cce51608f033)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #08 pc 00202711  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+72) (BuildId: 20281a1fa4a57e28d153cce51608f033)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #09 pc 0000da67  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+214) (BuildId: ce62903dfc673891e06e78c4d553c990)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #10 pc 000a109b  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: 21ece86427ccb892a7d044a6b4b4babb)
08-16 22:24:12.171 15040 15040 F DEBUG   :       #11 pc 00058113  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: 21ece86427ccb892a7d044a6b4b4babb)

Full log Our discuss in discord About this bug in qualcomm forum (no answer)

Neizvestnyj avatar Aug 20 '21 14:08 Neizvestnyj

I had a similar problem and my solution was that in my fragment shader (glsl) when I assign the final color value I calculate it by adding the original texture, something like this:

gl_FragColor = gl_FragColor + (texture2D (texture0, tex_coord0) * vec4 (0.))

moonpyx avatar Sep 03 '21 03:09 moonpyx

I had a similar problem and my solution was that in my fragment shader (glsl) when I assign the final color value I calculate it by adding the original texture, something like this:

gl_FragColor = gl_FragColor + (texture2D (texture0, tex_coord0) * vec4 (0.))

Thank you, I was experiencing similar issue with EffectBase exclusively on Android, when referencing time.

EffectBase calls a supplied effect function.

Previous (Crashes)

vec4 effect(vec4 color, sampler2D texture, vec2 text_coords, vec2 coords) {
             ...
            return myvar
         }

New (Fixed)

vec4 effect(vec4 color, sampler2D texture, vec2 text_coords, vec2 coords) {
             ...
            return (texture2D (texture, text_coords) * myvar);
         }

estasney avatar Aug 14 '22 04:08 estasney