return configs;
}
+static void
+set_max_gl_versions(struct intel_screen *screen)
+{
+#ifdef TEXTURE_FLOAT_ENABLED
+ bool has_texture_float = true;
+#else
+ bool has_texture_float = false;
+#endif
+
+ switch (screen->gen) {
+ case 7:
+ if (has_texture_float && screen->kernel_has_gen7_sol_reset) {
+ screen->max_gl_core_version = 31;
+ screen->max_gl_compat_version = 30;
+ screen->max_gl_es1_version = 11;
+ screen->max_gl_es2_version = 20;
+ } else {
+ screen->max_gl_core_version = 0;
+ screen->max_gl_compat_version = 21;
+ screen->max_gl_es1_version = 11;
+ screen->max_gl_es2_version = 20;
+ }
+ break;
+ case 6:
+ if (has_texture_float) {
+ screen->max_gl_core_version = 31;
+ screen->max_gl_compat_version = 30;
+ screen->max_gl_es1_version = 11;
+ screen->max_gl_es2_version = 20;
+ } else {
+ screen->max_gl_core_version = 0;
+ screen->max_gl_compat_version = 21;
+ screen->max_gl_es1_version = 11;
+ screen->max_gl_es2_version = 20;
+ }
+ break;
+ case 5:
+ case 4:
+ screen->max_gl_core_version = 0;
+ screen->max_gl_compat_version = 21;
+ screen->max_gl_es1_version = 11;
+ screen->max_gl_es2_version = 20;
+ break;
+ case 3: {
+ bool has_fragment_shader = driQueryOptionb(&screen->optionCache, "fragment_shader");
+ bool has_occlusion_query = driQueryOptionb(&screen->optionCache, "stub_occlusion_query");
+
+ screen->max_gl_core_version = 0;
+ screen->max_gl_es1_version = 11;
+
+ if (has_fragment_shader && has_occlusion_query) {
+ screen->max_gl_compat_version = 21;
+ } else {
+ screen->max_gl_compat_version = 14;
+ }
+
+ if (has_fragment_shader) {
+ screen->max_gl_es2_version = 20;
+ } else {
+ screen->max_gl_es2_version = 0;
+ }
+
+ break;
+ }
+ case 2:
+ screen->max_gl_core_version = 0;
+ screen->max_gl_compat_version = 13;
+ screen->max_gl_es1_version = 11;
+ screen->max_gl_es2_version = 0;
+ break;
+ default:
+ assert(!"unrecognized intel_screen::gen");
+ break;
+ }
+
+#ifndef FEATURE_ES1
+ screen->max_gl_es1_version = 0;
+#endif
+
+#ifndef FEATURE_ES2
+ screen->max_gl_es2_version = 0;
+#endif
+}
+
/**
* This is the driver specific part of the createNewScreen entry point.
* Called when using DRI2.
__DRIconfig **intelInitScreen2(__DRIscreen *psp)
{
struct intel_screen *intelScreen;
- unsigned int api_mask;
if (psp->dri2.loader->base.version <= 2 ||
psp->dri2.loader->getBuffersWithFormat == NULL) {
intel_override_separate_stencil(intelScreen);
- api_mask = (1 << __DRI_API_OPENGL);
-#if FEATURE_ES1
- api_mask |= (1 << __DRI_API_GLES);
-#endif
-#if FEATURE_ES2
- api_mask |= (1 << __DRI_API_GLES2);
-#endif
+ intelScreen->hw_has_swizzling = intel_detect_swizzling(intelScreen);
- if (IS_9XX(intelScreen->deviceID) || IS_965(intelScreen->deviceID))
- psp->api_mask = api_mask;
+ set_max_gl_versions(intelScreen);
- intelScreen->hw_has_swizzling = intel_detect_swizzling(intelScreen);
+ psp->api_mask = (1 << __DRI_API_OPENGL);
+ if (intelScreen->max_gl_es1_version > 0)
+ psp->api_mask |= (1 << __DRI_API_GLES);
+ if (intelScreen->max_gl_es2_version > 0)
+ psp->api_mask |= (1 << __DRI_API_GLES2);
psp->extensions = intelScreenExtensions;