diff options
author | Chad Versace <[email protected]> | 2012-11-21 15:08:27 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-01-15 13:44:29 -0800 |
commit | 4945086f36d3ccec041e499f1e2861dc1cc45a44 (patch) | |
tree | cfcc7bb5c4c16ef68bcec6ec6d06d0f144f2bcea /src/mesa/drivers/dri/i965/intel_pixel_draw.c | |
parent | 112e302481182d625e04ae1abeaa4f4f344a645e (diff) |
intel: Set screen's api mask according to hw capabilities (v3)
Before this patch, intelInitScreen2 set DRIScreen::api_mask with the hacky
heuristic below:
if (gen >= 3)
api_mask = GL | GLES1 | GLES2;
else
api_mask = 0;
This hack was likely broken on gen2 (i830), but I don't care enough to
properly investigate. It appears that every EGLConfig on i830 has
EGL_RENDERABLE_TYPE=0, and thus eglCreateContext will never succeed.
Anyway, moving on to living drivers...
With the arrival of EGL_OPENGL_ES3_BIT_KHR, this heuristic is now
insufficient. We must enable the GLES3 bit if and only if the driver is
capable of creating a GLES3 context. This requires us to determine the
maximum supported context version supported by the hardware/driver for
each api *during initialization of intel_screen*.
Therefore, this patch adds four new fields to intel_screen which indicate
the maximum supported context version for each api:
max_gl_core_version
max_gl_compat_version
max_gl_es1_version
max_gl_es2_version
The api mask is now correctly set as:
api_mask = GL;
if (max_gl_es1_version > 0)
api_mask |= GLES1;
if (max_gl_es2_version > 0)
api_mask |= GLES2;
Tested against gen6 with piglit egl-create-context-verify-gl-flavor.
Verified that this patch does not change the set of exposed EGL context
flavors.
v2:
- Replace the if-tree on gen with a switch, for Ian.
- Unconditionally enable the DRI_API_OPENGL bit, for Ian.
v3:
- Drop max gl version to 1.4 on gen3 if !has_occlusion_query,
because occlusion queries entered core in 1.5. For Ian.
v4:
- Drop ES2 version back to 2.0 due to rebase (Ian).
Signed-off-by: Chad Versace <[email protected]>
Reviewed-by: Ian Romanick <ian.d.romanick.intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_pixel_draw.c')
0 files changed, 0 insertions, 0 deletions