Skip to content

Commit b735a74

Browse files
committed
glinject: Only check renderer string once
1 parent f0b999f commit b735a74

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/glinject.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,13 +978,22 @@ static bool gl_init(void *display, void *surface)
978978

979979
static bool gl_capture_disabled()
980980
{
981+
static int disabled = 0;
982+
983+
if (disabled != 0) {
984+
return disabled == 1;
985+
}
986+
987+
disabled = 1;
988+
981989
// Always use Vulkan capture with zink
982990
const char *renderer = (const char *)gl_f.GetString(GL_RENDERER);
983991
if (renderer && strncmp(renderer, "zink", 4) == 0) {
984992
hlog("GL capture disabled with zink");
985993
return true;
986994
}
987995

996+
disabled = -1;
988997
return false;
989998
}
990999

0 commit comments

Comments
 (0)