From 22a51912d103f6064137e271fa08be4bdc8477d0 Mon Sep 17 00:00:00 2001 From: sesankm <26676400+sesankm@users.noreply.github.com> Date: Sat, 13 Sep 2025 12:08:26 -0500 Subject: [PATCH] glx: vndcmds: save unecessary calls to clear current context for same vendor Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com> --- glx/vndcmds.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/glx/vndcmds.c b/glx/vndcmds.c index 4390fa3ae6..a79f8e9cf1 100644 --- a/glx/vndcmds.c +++ b/glx/vndcmds.c @@ -225,9 +225,6 @@ 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. @@ -236,7 +233,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) { + if (oldTag != NULL && oldTag->vendor != newVendor) { int ret = CommonLoseCurrent(client, oldTag); if (ret != Success) { return ret;