From 684c145aa426f603ddf55b53a9e234f891ba19cd Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Thu, 24 Aug 2017 20:20:10 +0100 Subject: [PATCH] gles: Fix fallback for missing eglCreateContext. This logic was added to handle cases where tracing missed the context creation. It got broken over time. Fixes: #983 --- gapis/api/gles/api/egl.api | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gapis/api/gles/api/egl.api b/gapis/api/gles/api/egl.api index 134f1f1db8..dfad05919a 100644 --- a/gapis/api/gles/api/egl.api +++ b/gapis/api/gles/api/egl.api @@ -278,9 +278,12 @@ cmd EGLBoolean eglMakeCurrent(EGLDisplay display, _ = newMsg(SEVERITY_WARNING, new!WARN_UNKNOWN_CONTEXT(id: as!u64(context))) ctx := CreateContext(null) EGLContexts[context] = ctx + SetContext(ctx) + // The current context is fetched by ApplyStaticContextState() and + // ApplyDynamicContextState() so SetContext() must be set before these + // calls. ApplyStaticContextState(ctx, staticState) ApplyDynamicContextState(ctx, dynamicState) - SetContext(ctx) } else if context != null { // TODO: onEGLError(EGL_BAD_CONTEXT) _ = newMsg(SEVERITY_ERROR, new!ERR_CONTEXT_DOES_NOT_EXIST(id: as!u64(context)))