1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

Improve the compatibility of gl_has_extension

Fix infinite loop when running under RenderDoc

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-07-13 19:30:26 +01:00
parent 372f4f816e
commit 8a794e0ce1
No known key found for this signature in database
GPG key ID: 37C999F617EA1A47

View file

@ -162,9 +162,11 @@ static inline void gl_clear_err(void) {
* Check if a GLX extension exists.
*/
static inline bool gl_has_extension(const char *ext) {
for (int i = 0; ; i++) {
int nexts = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &nexts);
for (int i = 0; i < nexts || !nexts; i++) {
const char *exti = (const char *)glGetStringi(GL_EXTENSIONS, (GLuint)i);
if (exti == 0) {
if (exti == NULL) {
break;
}
if (strcmp(ext, exti) == 0) {