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
79
80
81
82
83
84
85
86
| | From cc6f303100075e286d09ca77d31749f7adcdffc6 Mon Sep 17 00:00:00 2001
From: Autumn <autumnontape@tutanota.com>
Date: Wed, 14 Jul 2021 04:37:03 -0700
Subject: [PATCH] use OpenGL 3.1 with extensions instead of OpenGL 3.3
---
alacritty/build.rs | 2 +-
alacritty/res/rect.f.glsl | 2 +-
alacritty/res/rect.v.glsl | 3 ++-
alacritty/res/text.f.glsl | 3 ++-
alacritty/res/text.v.glsl | 3 ++-
alacritty/src/renderer/mod.rs | 2 +-
6 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/alacritty/build.rs b/alacritty/build.rs
index 48841ca..28c20e2 100644
--- a/alacritty/build.rs
+++ b/alacritty/build.rs
@@ -11,7 +11,7 @@ fn main() {
let dest = env::var("OUT_DIR").unwrap();
let mut file = File::create(&Path::new(&dest).join("gl_bindings.rs")).unwrap();
- Registry::new(Api::Gl, (3, 3), Profile::Core, Fallbacks::All, ["GL_ARB_blend_func_extended"])
+ Registry::new(Api::Gl, (3, 1), Profile::Core, Fallbacks::All, ["GL_ARB_blend_func_extended", "GL_ARB_instanced_arrays", "GL_ARB_explicit_attrib_location"])
.write_bindings(GlobalGenerator, &mut file)
.unwrap();
diff --git a/alacritty/res/rect.f.glsl b/alacritty/res/rect.f.glsl
index 945eaf2..9f84237 100644
--- a/alacritty/res/rect.f.glsl
+++ b/alacritty/res/rect.f.glsl
@@ -1,4 +1,4 @@
-#version 330 core
+#version 140
flat in vec4 color;
diff --git a/alacritty/res/rect.v.glsl b/alacritty/res/rect.v.glsl
index bf9a97d..258bb36 100644
--- a/alacritty/res/rect.v.glsl
+++ b/alacritty/res/rect.v.glsl
@@ -1,4 +1,5 @@
-#version 330 core
+#version 140
+#extension GL_ARB_explicit_attrib_location : require
layout (location = 0) in vec2 aPos;
layout (location = 1) in vec4 aColor;
diff --git a/alacritty/res/text.f.glsl b/alacritty/res/text.f.glsl
index d5e2688..d4d559c 100644
--- a/alacritty/res/text.f.glsl
+++ b/alacritty/res/text.f.glsl
@@ -1,4 +1,5 @@
-#version 330 core
+#version 140
+#extension GL_ARB_explicit_attrib_location : require
in vec2 TexCoords;
flat in vec4 fg;
flat in vec4 bg;
diff --git a/alacritty/res/text.v.glsl b/alacritty/res/text.v.glsl
index 31e6f93..09c477a 100644
--- a/alacritty/res/text.v.glsl
+++ b/alacritty/res/text.v.glsl
@@ -1,4 +1,5 @@
-#version 330 core
+#version 140
+#extension GL_ARB_explicit_attrib_location : require
// Cell properties.
layout(location = 0) in vec2 gridCoords;
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs
index bac8225..3e170be 100644
--- a/alacritty/src/renderer/mod.rs
+++ b/alacritty/src/renderer/mod.rs
@@ -600,7 +600,7 @@ impl QuadRenderer {
size as *const _,
);
gl::EnableVertexAttribArray(index);
- gl::VertexAttribDivisor(index, 1);
+ gl::VertexAttribDivisorARB(index, 1);
#[allow(unused_assignments)]
{
--
2.32.0
|