aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/video_core/renderer_opengl/gl_shaders.h
blob: 380648f453044d3052a24bea1cc51bb97945018e (plain)
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
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.

#pragma once

namespace GLShaders {

static const char g_vertex_shader[] = R"(
#version 150 core
in vec3 position;
in vec2 texCoord;

out vec2 UV;

mat3 window_scale = mat3(
                         vec3(1.0, 0.0, 0.0),
                         vec3(0.0, 5.0/6.0, 0.0), // TODO(princesspeachum): replace hard-coded aspect with uniform
                         vec3(0.0, 0.0, 1.0)
                         );

void main() {
    gl_Position.xyz = window_scale * position;
    gl_Position.w = 1.0;

    UV = texCoord;
})";

static const char g_fragment_shader[] = R"(
#version 150 core
in vec2 UV;
out vec3 color;
uniform sampler2D sampler;

void main() {
    color = texture(sampler, UV).rgb;
})";

}