Skip to content

Commit d137251

Browse files
committed
Mark everything in shaders as highp, switch to ES context
1 parent 6024e4b commit d137251

File tree

7 files changed

+51
-36
lines changed

7 files changed

+51
-36
lines changed

Data/Base.rte/Shaders/Blit8.frag

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
// Blit8.frag
2-
#version 330 core
2+
#version 300 es
33

4-
in vec2 textureUV;
4+
precision highp float;
5+
precision highp sampler2D;
56

6-
out vec4 FragColor;
7+
in highp vec2 textureUV;
78

8-
uniform sampler2D rteTexture;
9-
uniform sampler2D rtePalette;
9+
out highp vec4 FragColor;
10+
11+
uniform highp sampler2D rteTexture;
12+
uniform highp sampler2D rtePalette;
1013

1114
void main() {
1215
float colorIndex = texture(rteTexture, vec2(textureUV.x, -textureUV.y)).r;

Data/Base.rte/Shaders/Blit8.vert

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
#version 330 core
1+
#version 300 es
22

3-
layout(location = 0) in vec2 rteVertexPosition;
4-
layout(location = 1) in vec2 rteTexUV;
3+
precision highp float;
54

6-
out vec2 textureUV;
5+
layout(location = 0) in highp vec2 rteVertexPosition;
6+
layout(location = 1) in highp vec2 rteTexUV;
77

8-
uniform mat4 rteTransform;
9-
uniform mat4 rteProjection;
10-
uniform mat4 rteUVTransform;
8+
out highp vec2 textureUV;
9+
10+
uniform highp mat4 rteTransform;
11+
uniform highp mat4 rteProjection;
12+
uniform highp mat4 rteUVTransform;
1113

1214
void main() {
1315
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition, 0.0, 1.0);

Data/Base.rte/Shaders/PostProcess.frag

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
#version 330 core
1+
#version 300 es
22

3-
in vec2 textureUV;
3+
precision highp float;
4+
precision highp sampler2D;
45

5-
out vec4 FragColor;
6+
in highp vec2 textureUV;
67

7-
uniform sampler2D rteTexture;
8-
uniform vec4 rteColor;
8+
out highp vec4 FragColor;
9+
10+
uniform highp sampler2D rteTexture;
11+
uniform highp vec4 rteColor;
912

1013
void main() {
1114
FragColor = texture(rteTexture, textureUV) * rteColor;

Data/Base.rte/Shaders/PostProcess.vert

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
#version 330 core
1+
#version 300 es
22

3-
layout(location = 0) in vec2 rteVertexPosition;
4-
layout(location = 1) in vec2 rteTexUV;
3+
precision highp float;
54

6-
out vec2 textureUV;
5+
layout(location = 0) in highp vec2 rteVertexPosition;
6+
layout(location = 1) in highp vec2 rteTexUV;
77

8-
uniform mat4 rteTransform;
9-
uniform mat4 rteProjection;
8+
out highp vec2 textureUV;
9+
10+
uniform highp mat4 rteTransform;
11+
uniform highp mat4 rteProjection;
1012

1113
void main() {
1214
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition, 0.0, 1.0);

Data/Base.rte/Shaders/ScreenBlit.frag

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
#version 330 core
1+
#version 300 es
22

3-
in vec2 textureUV;
3+
precision highp float;
4+
precision highp sampler2D;
45

5-
out vec4 FragColor;
6+
in highp vec2 textureUV;
67

7-
uniform sampler2D rteTexture;
8-
uniform sampler2D rteGUITexture;
8+
out highp vec4 FragColor;
9+
10+
uniform highp sampler2D rteTexture;
11+
uniform highp sampler2D rteGUITexture;
912

1013
vec4 texture2DAA(sampler2D tex, vec2 uv) {
1114
vec2 texsize = vec2(textureSize(tex, 0));

Data/Base.rte/Shaders/ScreenBlit.vert

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
#version 330 core
1+
#version 300 es
22

3-
layout(location = 0) in vec2 rteVertexPosition;
4-
layout(location = 1) in vec2 rteTexUV;
3+
precision highp float;
54

6-
out vec2 textureUV;
5+
layout(location = 0) in highp vec2 rteVertexPosition;
6+
layout(location = 1) in highp vec2 rteTexUV;
77

8-
uniform mat4 rteTransform;
9-
uniform mat4 rteProjection;
8+
out highp vec2 textureUV;
9+
10+
uniform highp mat4 rteTransform;
11+
uniform highp mat4 rteProjection;
1012

1113
void main() {
1214
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition.xy, 0.0, 1.0);

Source/Managers/WindowMan.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ void WindowMan::Initialize() {
9999

100100
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
101101
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
102-
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
103-
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
102+
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
103+
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
104104
CreatePrimaryWindow();
105105
InitializeOpenGL();
106106
CreateBackBufferTexture();

0 commit comments

Comments
 (0)