From 9c53dd0a87d6ec529b2b43c857621420b0735063 Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Wed, 22 Oct 2025 13:14:07 +0300 Subject: [PATCH] glx: vndcmds: revert https://github.com/X11Libre/xserver/commit/22a51912d103f6064137e271fa08be4bdc8477d0 "glx: vndcmds: save unecessary calls to clear current context for same vendor" Looks like the answer to the commented question: ``` // TODO: For switching contexts in a single vendor, just make one // makeCurrent call? ``` is no. Fixes: https://github.com/X11Libre/xserver/issues/1246 Signed-off-by: stefan11111 --- glx/vndcmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/glx/vndcmds.c b/glx/vndcmds.c index 2ee446bf4..39a283ffb 100644 --- a/glx/vndcmds.c +++ b/glx/vndcmds.c @@ -226,6 +226,9 @@ static int CommonMakeCurrent(ClientPtr client, // The old and new values are all the same, so send a successful reply. reply.contextTag = oldTag->tag; } else { + // TODO: For switching contexts in a single vendor, just make one + // makeCurrent call? + // TODO: When changing vendors, would it be better to do the // MakeCurrent(new) first, then the LoseCurrent(old)? // If the MakeCurrent(new) fails, then the old context will still be current. @@ -234,7 +237,7 @@ static int CommonMakeCurrent(ClientPtr client, // But, if the recovery LoseCurrent(old) fails, then we're really in a bad state. // Clear the old context first. - if (oldTag != NULL && oldTag->vendor != newVendor) { + if (oldTag != NULL) { int ret = CommonLoseCurrent(client, oldTag); if (ret != Success) { return ret;