diff options
author | Matías Locatti <42481638+goldenx86@users.noreply.github.com> | 2022-12-11 05:38:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-11 05:38:28 +0100 |
commit | 623429a27ec943f3c1ba758aaf741589b0493ddb (patch) | |
tree | 0a0866296c4cf932d046a9332196d3cbcf3c83a8 /src/video_core/host_shaders/smaa_edge_detection.vert | |
parent | Merge pull request #9416 from liamwhite/penicillin (diff) | |
parent | video_core: Integrate SMAA (diff) | |
download | yuzu-623429a27ec943f3c1ba758aaf741589b0493ddb.tar yuzu-623429a27ec943f3c1ba758aaf741589b0493ddb.tar.gz yuzu-623429a27ec943f3c1ba758aaf741589b0493ddb.tar.bz2 yuzu-623429a27ec943f3c1ba758aaf741589b0493ddb.tar.lz yuzu-623429a27ec943f3c1ba758aaf741589b0493ddb.tar.xz yuzu-623429a27ec943f3c1ba758aaf741589b0493ddb.tar.zst yuzu-623429a27ec943f3c1ba758aaf741589b0493ddb.zip |
Diffstat (limited to 'src/video_core/host_shaders/smaa_edge_detection.vert')
-rw-r--r-- | src/video_core/host_shaders/smaa_edge_detection.vert | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/video_core/host_shaders/smaa_edge_detection.vert b/src/video_core/host_shaders/smaa_edge_detection.vert new file mode 100644 index 000000000..634a7bbb8 --- /dev/null +++ b/src/video_core/host_shaders/smaa_edge_detection.vert @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#version 460 + +#extension GL_GOOGLE_include_directive : enable + +#ifdef VULKAN +#define VERTEX_ID gl_VertexIndex +#else // ^^^ Vulkan ^^^ // vvv OpenGL vvv +#define VERTEX_ID gl_VertexID +#endif + +out gl_PerVertex { + vec4 gl_Position; +}; + +const vec2 vertices[3] = + vec2[3](vec2(-1,-1), vec2(3,-1), vec2(-1, 3)); + +layout (binding = 0) uniform sampler2D input_tex; + +layout (location = 0) out vec2 tex_coord; +layout (location = 1) out vec4 offset[3]; + +vec4 metrics = vec4(1.0 / textureSize(input_tex, 0), textureSize(input_tex, 0)); +#define SMAA_RT_METRICS metrics +#define SMAA_GLSL_4 +#define SMAA_PRESET_ULTRA +#define SMAA_INCLUDE_VS 1 +#define SMAA_INCLUDE_PS 0 + +#include "opengl_smaa.glsl" + +void main() { + vec2 vertex = vertices[VERTEX_ID]; + gl_Position = vec4(vertex, 0.0, 1.0); + tex_coord = (vertex + 1.0) / 2.0; + SMAAEdgeDetectionVS(tex_coord, offset); +} |