static void autodetectGlExtensions(void) { const char *extensions = mpglGetString(GL_EXTENSIONS); const char *vendor = mpglGetString(GL_VENDOR); const char *version = mpglGetString(GL_VERSION); const char *renderer = mpglGetString(GL_RENDERER); int is_ati = vendor && strstr(vendor, "ATI") != NULL; int ati_broken_pbo = 0; mp_msg(MSGT_VO, MSGL_V, "[gl] Running on OpenGL '%s' by '%s', version '%s'\n", renderer, vendor, version); if (is_ati && strncmp(version, "2.1.", 4) == 0) { int ver = atoi(version + 4); mp_msg(MSGT_VO, MSGL_V, "[gl] Detected ATI driver version: %i\n", ver); ati_broken_pbo = ver && ver < 8395; } if (ati_hack == -1) ati_hack = ati_broken_pbo; if (force_pbo == -1) { force_pbo = 0; // memcpy is just too slow at least on PPC. if (ARCH_X86 && extensions && strstr(extensions, "_pixel_buffer_object")) force_pbo = is_ati; } if (use_rectangle == -1) { use_rectangle = 0; if (extensions) { // if (strstr(extensions, "_texture_non_power_of_two")) if (strstr(extensions, "_texture_rectangle")) use_rectangle = renderer && strstr(renderer, "Mesa DRI R200") ? 1 : 0; } } if (use_osd == -1) use_osd = mpglBindTexture != NULL; if (use_yuv == -1) use_yuv = glAutodetectYUVConversion(); if (is_ati && (lscale == 1 || lscale == 2 || cscale == 1 || cscale == 2)) mp_msg(MSGT_VO, MSGL_WARN, "[gl] Selected scaling mode may be broken on ATI cards.\n" "Tell _them_ to fix GL_REPEAT if you have issues.\n"); mp_msg(MSGT_VO, MSGL_V, "[gl] Settings after autodetection: ati-hack = %i, force-pbo = %i, rectangle = %i, yuv = %i\n", ati_hack, force_pbo, use_rectangle, use_yuv); }
static int isSoftwareGl(void) { const char *renderer = mpglGetString(GL_RENDERER); return !renderer || strcmp(renderer, "Software Rasterizer") == 0; }