1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
This is a revert of http://cgit.freedesktop.org/mesa/mesa/commit/?id=97217a40f97cdeae0304798b607f704deb0c3558
i915: Always enable GL 2.0 support.
There's no point in shipping a non-GL2 driver today.
From upstream mesa.
--- a/src/mesa/drivers/dri/i915/intel_extensions.c
+++ b/src/mesa/drivers/dri/i915/intel_extensions.c
@@ -95,8 +95,12 @@
ctx->Extensions.ATI_separate_stencil = true;
ctx->Extensions.ATI_texture_env_combine3 = true;
ctx->Extensions.NV_texture_env_combine4 = true;
- ctx->Extensions.ARB_fragment_shader = true;
- ctx->Extensions.ARB_occlusion_query = true;
+
+ if (driQueryOptionb(&intel->optionCache, "fragment_shader"))
+ ctx->Extensions.ARB_fragment_shader = true;
+
+ if (driQueryOptionb(&intel->optionCache, "stub_occlusion_query"))
+ ctx->Extensions.ARB_occlusion_query = true;
}
if (intel->ctx.Mesa_DXTn
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -62,6 +62,10 @@
DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).")
DRI_CONF_OPT_END
+ DRI_CONF_OPT_BEGIN_B(fragment_shader, "true")
+ DRI_CONF_DESC(en, "Enable limited ARB_fragment_shader support on 915/945.")
+ DRI_CONF_OPT_END
+
DRI_CONF_SECTION_END
DRI_CONF_SECTION_QUALITY
DRI_CONF_FORCE_S3TC_ENABLE("false")
@@ -75,6 +79,10 @@
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
+ DRI_CONF_OPT_BEGIN_B(stub_occlusion_query, "false")
+ DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.")
+ DRI_CONF_OPT_END
+
DRI_CONF_OPT_BEGIN_B(shader_precompile, "true")
DRI_CONF_DESC(en, "Perform code generation at shader link time.")
DRI_CONF_OPT_END
@@ -1121,12 +1129,26 @@
__DRIscreen *psp = screen->driScrnPriv;
switch (screen->gen) {
- case 3:
+ case 3: {
+ bool has_fragment_shader = driQueryOptionb(&screen->optionCache, "fragment_shader");
+ bool has_occlusion_query = driQueryOptionb(&screen->optionCache, "stub_occlusion_query");
+
psp->max_gl_core_version = 0;
psp->max_gl_es1_version = 11;
- psp->max_gl_compat_version = 21;
- psp->max_gl_es2_version = 20;
+
+ if (has_fragment_shader && has_occlusion_query) {
+ psp->max_gl_compat_version = 21;
+ } else {
+ psp->max_gl_compat_version = 14;
+ }
+
+ if (has_fragment_shader) {
+ psp->max_gl_es2_version = 20;
+ } else {
+ psp->max_gl_es2_version = 0;
+ }
break;
+ }
case 2:
psp->max_gl_core_version = 0;
psp->max_gl_compat_version = 13;
|