Files
eden/src/video_core/host_shaders/fxaa.vert
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
851 B
GLSL
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2021-10-20 18:36:06 -05:00
#version 460
out gl_PerVertex {
vec4 gl_Position;
};
2024-01-15 00:09:34 -05:00
const vec2 vertices[3] =
vec2[3](vec2(-1,-1), vec2(3,-1), vec2(-1, 3));
2021-10-20 18:36:06 -05:00
layout (location = 0) out vec4 posPos;
#ifdef VULKAN
2021-10-22 19:22:34 +02:00
#define BINDING_COLOR_TEXTURE 0
2021-10-23 02:40:02 -04:00
#define VERTEX_ID gl_VertexIndex
2021-10-20 18:36:06 -05:00
#else // ^^^ Vulkan ^^^ // vvv OpenGL vvv
#define BINDING_COLOR_TEXTURE 0
2021-10-23 02:40:02 -04:00
#define VERTEX_ID gl_VertexID
2021-10-20 18:36:06 -05:00
#endif
layout (binding = BINDING_COLOR_TEXTURE) uniform sampler2D input_texture;
const float FXAA_SUBPIX_SHIFT = 0;
void main() {
2021-10-23 02:40:02 -04:00
vec2 vertex = vertices[VERTEX_ID];
2021-10-20 18:36:06 -05:00
gl_Position = vec4(vertex, 0.0, 1.0);
vec2 vert_tex_coord = (vertex + 1.0) / 2.0;
posPos.xy = vert_tex_coord;
posPos.zw = vert_tex_coord - (0.5 + FXAA_SUBPIX_SHIFT) / textureSize(input_texture, 0);
}