From befb3ca31b28e70cbf5d48534dfed916410bfd6b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 22 Jul 2023 00:43:05 +0900 Subject: [PATCH] [vulkan] Clamp composed values to >= 0 This takes care of the nans that got into the output buffer resulting is weird holes in any overlays. --- libs/video/renderer/vulkan/shader/compose.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/video/renderer/vulkan/shader/compose.frag b/libs/video/renderer/vulkan/shader/compose.frag index 8a4064a62..441b9c9d9 100644 --- a/libs/video/renderer/vulkan/shader/compose.frag +++ b/libs/video/renderer/vulkan/shader/compose.frag @@ -22,7 +22,7 @@ main (void) c = subpassLoad (color).rgb; l = subpassLoad (light).rgb; e = subpassLoad (emission).rgb; - o = BlendFrags (vec4 (c * l + e, 1)).xyz; + o = max(BlendFrags (vec4 (c * l + e, 1)).xyz, vec3(0)); o = pow (o, vec3(0.83));//FIXME make gamma correction configurable frag_color = vec4 (o, 1); }