Respect game brightness settings (#1559)

* `RendererVulkan` -> `Presenter`

* support for Video Out gamma setting

* sRGB hack removed

* added post process pass to presenter

* splash functionality restored
This commit is contained in:
psucien 2024-11-21 11:06:53 +01:00 committed by GitHub
parent e98fab4b58
commit 3d04765a3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 518 additions and 120 deletions

View file

@ -7,6 +7,8 @@ set(SHADER_FILES
detile_m32x1.comp
detile_m32x2.comp
detile_m32x4.comp
fs_tri.vert
post_process.frag
)
set(SHADER_INCLUDE ${CMAKE_CURRENT_BINARY_DIR}/include)

View file

@ -0,0 +1,15 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#version 450
layout(location = 0) out vec2 uv;
void main() {
vec2 pos = vec2(
float((gl_VertexIndex & 1u) << 2u),
float((gl_VertexIndex & 2u) << 1u)
);
gl_Position = vec4(pos - vec2(1.0, 1.0), 0.0, 1.0);
uv = pos * 0.5;
}

View file

@ -0,0 +1,19 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#version 450
layout (location = 0) in vec2 uv;
layout (location = 0) out vec4 color;
layout (binding = 0) uniform sampler2D texSampler;
layout(push_constant) uniform settings {
float gamma;
} pp;
void main()
{
vec4 color_linear = texture(texSampler, uv);
color = pow(color_linear, vec4(1.0/(2.2 + 1.0 - pp.gamma)));
}