Skip to content

Commit

Permalink
shaders/sampling: use #pragma GLSL in EWA footer
Browse files Browse the repository at this point in the history
No real reason here but it will make adding more logic easier.
  • Loading branch information
haasn committed Jul 28, 2023
1 parent a8d5b30 commit 40a325f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/shaders/sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 40a325f

Please sign in to comment.