gl_hwdec_vda: refuse to work with old OpenGL versions

The way we use rectangle textures (required by VDA for no reason) works
onl in OpenGL 3.0 or higher. Below that, the shader will fail to
compile. We could add support for older OpenGL versions, but that would
be a major pain.

This normally doesn't matter; mpv itself always creates OpenGL 3.2
contexts on OSX. But it could matter if a client API user uses
vo_opengl_cb, and gives it a 2.1 context (which OSX also allows you to
create).
This commit is contained in:
wm4 2014-12-31 21:04:29 +01:00
parent 84fe12fab5
commit 3e12e79b8f
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,11 @@ static bool check_hwdec(struct gl_hwdec *hw)
return false;
}
if (hw->gl->version < 300) {
MP_ERR(hw, "need >= OpenGL 3.0 for core rectangle texture support\n");
return false;
}
if (!CGLGetCurrentContext()) {
MP_ERR(hw, "need cocoa opengl backend to be active");
return false;