If there is no last fence, due to no rendering happening yet, just create a new signaled fence and return it, to match the expectations of the EGL sync fence API.
Fixes random "Could not create sync fence 0x3003" assertion failures from Skia on Android, coming from the following code: https://android.googlesource.com/platform/frameworks/base/+/master/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp#427 Reproducible especially with thread count >= 4. Signed-off-by: Tomasz Figa <[email protected]> --- src/gallium/drivers/llvmpipe/lp_setup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index b087369473..a6f1b54d69 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -360,7 +360,13 @@ lp_setup_flush( struct lp_setup_context *setup, set_scene_state( setup, SETUP_FLUSHED, reason ); if (fence) { - lp_fence_reference((struct lp_fence **)fence, setup->last_fence); + struct lp_fence *lp_fence = NULL; + + lp_fence_reference(&lp_fence, setup->last_fence); + if (!lp_fence) + lp_fence = lp_fence_create(0); + lp_fence_reference((struct lp_fence **)fence, lp_fence); + lp_fence_reference(&lp_fence, NULL); } } -- 2.18.0.865.gffc8e1a3cd6-goog _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
