mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 12:31:05 +00:00
Fix the shader to be compatible with GLSL 1.2
This commit is contained in:
parent
c036688d88
commit
bca0739604
@ -7,19 +7,16 @@
|
||||
namespace GLShaders {
|
||||
|
||||
const char g_vertex_shader[] = R"(
|
||||
#version 130
|
||||
|
||||
#version 120
|
||||
in vec2 vert_position;
|
||||
in vec2 vert_tex_coord;
|
||||
out vec2 frag_tex_coord;
|
||||
|
||||
varying out vec2 frag_tex_coord;
|
||||
// This is a truncated 3x3 matrix for 2D transformations:
|
||||
// The upper-left 2x2 submatrix performs scaling/rotation/mirroring.
|
||||
// The third column performs translation.
|
||||
// The third row could be used for projection, which we don't need in 2D. It hence is assumed to
|
||||
// implicitly be [0, 0, 1]
|
||||
uniform mat3x2 modelview_matrix;
|
||||
|
||||
void main() {
|
||||
// Multiply input position by the rotscale part of the matrix and then manually translate by
|
||||
// the last column. This is equivalent to using a full 3x3 matrix and expanding the vector
|
||||
@ -30,15 +27,12 @@ void main() {
|
||||
)";
|
||||
|
||||
const char g_fragment_shader[] = R"(
|
||||
#version 130
|
||||
|
||||
in vec2 frag_tex_coord;
|
||||
out vec4 color;
|
||||
|
||||
#version 120
|
||||
varying in vec2 frag_tex_coord;
|
||||
varying out vec4 color;
|
||||
uniform sampler2D color_texture;
|
||||
|
||||
void main() {
|
||||
color = texture(color_texture, frag_tex_coord);
|
||||
color = texture2D(color_texture, frag_tex_coord);
|
||||
}
|
||||
)";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user