Consider context promotion when validating share context
We were comparing a pre-promotion version with the post-promotion
version stored in the share context. This doesn't work.
Affects: dEQP-EGL.functional.sharing.*
Change-Id: I02c14681b7743c6aaef4404291ac52a48890832c
Reviewed-on: https://swiftshader-review.googlesource.com/20368
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/libEGL/libEGL.cpp b/src/OpenGL/libEGL/libEGL.cpp
index a4f078d..5c561b9 100644
--- a/src/OpenGL/libEGL/libEGL.cpp
+++ b/src/OpenGL/libEGL/libEGL.cpp
@@ -865,7 +865,10 @@
return EGL_NO_CONTEXT;
}
- if(shareContext && shareContext->getClientVersion() != majorVersion)
+ // Allow sharing between different context versions >= 2.0, but isolate 1.x
+ // contexts from 2.0+. Strict matching between context versions >= 2.0 is
+ // confusing for apps to navigate because of version promotion.
+ if(shareContext && ((shareContext->getClientVersion() >= 2) ^ (majorVersion >= 2)))
{
return error(EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
}