From 40a325fe74ebe8d38cecf9e512de20abf0d706f8 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 28 Jul 2023 17:31:46 +0200 Subject: [PATCH] shaders/sampling: use #pragma GLSL in EWA footer No real reason here but it will make adding more logic easier. --- src/shaders/sampling.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/shaders/sampling.c b/src/shaders/sampling.c index 91096ab3..8b2a04b9 100644 --- a/src/shaders/sampling.c +++ b/src/shaders/sampling.c @@ -787,11 +787,12 @@ bool pl_shader_sample_polar(pl_shader sh, const struct pl_sample_src *src, } } - GLSL("color = vec4("$" / wsum) * color; \n", SH_FLOAT(scale)); - if (!(cmask & (1 << PL_CHANNEL_A))) - GLSL("color.a = 1.0; \n"); +#pragma GLSL \ + color = ${float:scale} / wsum * color; \ + @if (!(cmask & (1 << PL_CHANNEL_A))) \ + color.a = 1.0; \ + } - GLSL("}\n"); return true; }