i830: Validate API and version before calling i830CreateContext
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
2b63624326
commit
a81e4b3e92
|
@ -736,9 +736,27 @@ intelCreateContext(gl_api api,
|
||||||
success = i915CreateContext(api, mesaVis, driContextPriv,
|
success = i915CreateContext(api, mesaVis, driContextPriv,
|
||||||
sharedContextPrivate);
|
sharedContextPrivate);
|
||||||
} else {
|
} else {
|
||||||
|
switch (api) {
|
||||||
|
case API_OPENGL:
|
||||||
|
if (major_version > 1 || minor_version > 3) {
|
||||||
|
*error = __DRI_CTX_ERROR_BAD_VERSION;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case API_OPENGLES:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*error = __DRI_CTX_ERROR_BAD_API;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
intelScreen->no_vbo = true;
|
intelScreen->no_vbo = true;
|
||||||
success = i830CreateContext(mesaVis, driContextPriv,
|
success = i830CreateContext(mesaVis, driContextPriv,
|
||||||
sharedContextPrivate);
|
sharedContextPrivate);
|
||||||
|
if (!success) {
|
||||||
|
*error = __DRI_CTX_ERROR_NO_MEMORY;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
success = brwCreateContext(api, mesaVis,
|
success = brwCreateContext(api, mesaVis,
|
||||||
|
|
Loading…
Reference in New Issue