I'm trying to achieve blending by using a shader to conditionally assign the fragment color.
Full shader code...
#version 450
#pragma shader_stage(fragment)
layout(binding = 1) uniform sampler2D texture_sampler;
layout(location = 0) in vec2 tex_coord;
layout(location = 1) in vec4 _rgba;
layout(location = 0) out vec4 out_color;
void main() {
vec4 oc = textureLod(texture_sampler, tex_coord, 0);
if (oc.r > _rgba.r)
oc.r = _rgba.r;
if (oc.g > _rgba.g)
oc.g = _rgba.g;
if (oc.b > _rgba.b)
oc.b = _rgba.b;
if (oc.a > _rgba.a)
oc.a = _rgba.a;
float threshhold = .5;
if (oc.a > threshhold)
out_color = oc;
}
(this flickers at run time btw...)
changing the last bit of code to...
float threshhold = .5;
//if (oc.a > threshhold)
out_color = oc;
does this...
If I remove the assignment completely, the text just dissappears. It seems that having the assignment there makes the driver expect it to always be assigned. Does anyone know why this is happening? Why can't I conditionally leave the pixel unmodified? Is there something I have to change in my Vulkan code for the pipeline?

