mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 02:20:11 +01:00
i965: Allow creation of OpenGL 3.1 contexts
v2: Fix API_OPENGL_CORE handling when TEXTURE_FLOAT_ENABLED is not defined. Based on review feedback from Eric Anholt. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
2a33a99737
commit
0e0d664461
1 changed files with 19 additions and 0 deletions
|
|
@ -109,6 +109,25 @@ brwCreateContext(int api,
|
|||
case API_OPENGLES:
|
||||
case API_OPENGLES2:
|
||||
break;
|
||||
case API_OPENGL_CORE: {
|
||||
#ifdef TEXTURE_FLOAT_ENABLED
|
||||
const unsigned max_version =
|
||||
(screen->gen == 6 ||
|
||||
(screen->gen == 7 && screen->kernel_has_gen7_sol_reset))
|
||||
? 31 : 0;
|
||||
const unsigned req_version = major_version * 10 + minor_version;
|
||||
|
||||
if (req_version > max_version) {
|
||||
*error = (max_version == 0)
|
||||
? __DRI_CTX_ERROR_BAD_API : __DRI_CTX_ERROR_BAD_VERSION;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
#else
|
||||
*error = __DRI_CTX_ERROR_BAD_API;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
default:
|
||||
*error = __DRI_CTX_ERROR_BAD_API;
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue