1
0
Fork 0
forked from wry/wry

wayland: implement alpha_modifier_v1

This commit is contained in:
Julian Orth 2024-03-18 19:18:30 +01:00
parent 131f0481e8
commit ff54a8ab96
37 changed files with 655 additions and 89 deletions

View file

@ -1,9 +1,21 @@
#version 450
#ifdef ALPHA_MULTIPLIER
layout(push_constant, std430) uniform Data {
layout(offset = 64) float mul;
} data;
#endif
layout(set = 0, binding = 0) uniform sampler2D tex;
layout(location = 0) in vec2 tex_pos;
layout(location = 0) out vec4 out_color;
void main() {
#ifdef ALPHA_MULTIPLIER
#ifdef ALPHA
out_color = textureLod(tex, tex_pos, 0) * data.mul;
#endif // !ALPHA
out_color = vec4(textureLod(tex, tex_pos, 0).rgb * data.mul, data.mul);
#else // !ALPHA_MULTIPLIER
out_color = textureLod(tex, tex_pos, 0);
#endif
}