~pali/+junk/mesa-lts-saucy-packaging

« back to all changes in this revision

Viewing changes to debian/patches/i915-dont-default-to-2.1.patch

  • Committer: Pali Rohár
  • Date: 2014-04-11 10:59:06 UTC
  • Revision ID: pali.rohar@gmail.com-20140411105906-qk25ix27pd6rdho8
Import debian packaging for mesa-lts-saucy version 9.2.1-1ubuntu3~precise1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
This is a revert of http://cgit.freedesktop.org/mesa/mesa/commit/?id=97217a40f97cdeae0304798b607f704deb0c3558
 
2
 
 
3
i915: Always enable GL 2.0 support.
 
4
There's no point in shipping a non-GL2 driver today.
 
5
 
 
6
From upstream mesa.
 
7
 
 
8
diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c
 
9
index 1e48231..7dc37d8 100644
 
10
--- a/src/mesa/drivers/dri/i915/intel_extensions.c
 
11
+++ b/src/mesa/drivers/dri/i915/intel_extensions.c
 
12
@@ -95,8 +95,12 @@ intelInitExtensions(struct gl_context *ctx)
 
13
       ctx->Extensions.ATI_separate_stencil = true;
 
14
       ctx->Extensions.ATI_texture_env_combine3 = true;
 
15
       ctx->Extensions.NV_texture_env_combine4 = true;
 
16
-      ctx->Extensions.ARB_fragment_shader = true;
 
17
-      ctx->Extensions.ARB_occlusion_query = true;
 
18
+
 
19
+      if (driQueryOptionb(&intel->optionCache, "fragment_shader"))
 
20
+        ctx->Extensions.ARB_fragment_shader = true;
 
21
+
 
22
+      if (driQueryOptionb(&intel->optionCache, "stub_occlusion_query"))
 
23
+        ctx->Extensions.ARB_occlusion_query = true;
 
24
    }
 
25
 
 
26
    if (intel->ctx.Mesa_DXTn
 
27
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
 
28
index 30a867e..2522b47 100644
 
29
--- a/src/mesa/drivers/dri/i915/intel_screen.c
 
30
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
 
31
@@ -58,6 +58,10 @@ PUBLIC const char __driConfigOptions[] =
 
32
         DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).")
 
33
       DRI_CONF_OPT_END
 
34
 
 
35
+      DRI_CONF_OPT_BEGIN_B(fragment_shader, "true")
 
36
+        DRI_CONF_DESC(en, "Enable limited ARB_fragment_shader support on 915/945.")
 
37
+      DRI_CONF_OPT_END
 
38
+
 
39
    DRI_CONF_SECTION_END
 
40
    DRI_CONF_SECTION_QUALITY
 
41
       DRI_CONF_FORCE_S3TC_ENABLE("false")
 
42
@@ -71,13 +75,17 @@ PUBLIC const char __driConfigOptions[] =
 
43
       DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
 
44
       DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
 
45
 
 
46
+      DRI_CONF_OPT_BEGIN_B(stub_occlusion_query, "false")
 
47
+        DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.")
 
48
+      DRI_CONF_OPT_END
 
49
+
 
50
       DRI_CONF_OPT_BEGIN_B(shader_precompile, "true")
 
51
         DRI_CONF_DESC(en, "Perform code generation at shader link time.")
 
52
       DRI_CONF_OPT_END
 
53
    DRI_CONF_SECTION_END
 
54
 DRI_CONF_END;
 
55
 
 
56
-const GLuint __driNConfigOptions = 12;
 
57
+const GLuint __driNConfigOptions = 14;
 
58
 
 
59
 #include "intel_batchbuffer.h"
 
60
 #include "intel_buffers.h"
 
61
@@ -1064,12 +1072,27 @@ set_max_gl_versions(struct intel_screen *screen)
 
62
    int gl_version_override = _mesa_get_gl_version_override();
 
63
 
 
64
    switch (screen->gen) {
 
65
-   case 3:
 
66
+   case 3: {
 
67
+      bool has_fragment_shader = driQueryOptionb(&screen->optionCache, "fragment_shader");
 
68
+      bool has_occlusion_query = driQueryOptionb(&screen->optionCache, "stub_occlusion_query");
 
69
+
 
70
       screen->max_gl_core_version = 0;
 
71
       screen->max_gl_es1_version = 11;
 
72
-      screen->max_gl_compat_version = 21;
 
73
-      screen->max_gl_es2_version = 20;
 
74
+
 
75
+      if (has_fragment_shader && has_occlusion_query) {
 
76
+         screen->max_gl_compat_version = 21;
 
77
+      } else {
 
78
+         screen->max_gl_compat_version = 14;
 
79
+      }
 
80
+
 
81
+      if (has_fragment_shader) {
 
82
+         screen->max_gl_es2_version = 20;
 
83
+      } else {
 
84
+         screen->max_gl_es2_version = 0;
 
85
+      }
 
86
       break;
 
87
+   }
 
88
+
 
89
    case 2:
 
90
       screen->max_gl_core_version = 0;
 
91
       screen->max_gl_compat_version = 13;