From 5b837157bde2115cf4781c5353f598eb6f0f7109 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 8 Dec 2022 16:52:29 -0500 Subject: video_core: Integrate SMAA Co-authored-by: goldenx86 Co-authored-by: BreadFish64 --- .../smaa_blending_weight_calculation.frag | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/video_core/host_shaders/smaa_blending_weight_calculation.frag (limited to 'src/video_core/host_shaders/smaa_blending_weight_calculation.frag') diff --git a/src/video_core/host_shaders/smaa_blending_weight_calculation.frag b/src/video_core/host_shaders/smaa_blending_weight_calculation.frag new file mode 100644 index 000000000..c2385a0ad --- /dev/null +++ b/src/video_core/host_shaders/smaa_blending_weight_calculation.frag @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#version 460 + +#extension GL_GOOGLE_include_directive : enable + +layout (binding = 0) uniform sampler2D edges_tex; +layout (binding = 1) uniform sampler2D area_tex; +layout (binding = 2) uniform sampler2D search_tex; + +layout (location = 0) in vec2 tex_coord; +layout (location = 1) in vec2 pix_coord; +layout (location = 2) in vec4 offset[3]; + +layout (location = 0) out vec4 frag_color; + +vec4 metrics = vec4(1.0 / textureSize(edges_tex, 0), textureSize(edges_tex, 0)); +#define SMAA_RT_METRICS metrics +#define SMAA_GLSL_4 +#define SMAA_PRESET_ULTRA +#define SMAA_INCLUDE_VS 0 +#define SMAA_INCLUDE_PS 1 + +#include "opengl_smaa.glsl" + +void main() { + frag_color = SMAABlendingWeightCalculationPS(tex_coord, + pix_coord, + offset, + edges_tex, + area_tex, + search_tex, + vec4(0) + ); +} -- cgit v1.2.3