How do I pass a "uniform value" / Shader permutations

What is wrong with this implementation?

I can’t seem to find a way to pass uniforms during compile time like i could in xna, did something change?

technique WithValueOne
{
    pass Pass1
    {
        VertexShader = compile vs_5_0 VertexShaderFunction();
        PixelShader = compile ps_5_0 PixelShaderFunction(1);
    }
}

technique WithValueZero
{
    pass Pass1
    {
        VertexShader = compile vs_5_0 VertexShaderFunction();
        PixelShader = compile ps_5_0 PixelShaderFunction(0);
    }
}

and in my Pixelshader

PixelShaderFunction(VertexShaderOutput input, uniform float inputvalue)
{
     ...
     if(inputvalue > 0) 
{ do stuff }
}

MonoGame does not support this I think. I vaguely remember reading that somewhere.

So what’s a good way to not have to copy+paste shader code? I’d prefer not to dyn branch everything

I use this too in some of my shaders. And since i put them from xna to mg it builds with errors. I m curious to know why this would not be a valid call to a pixelshader method.

I think it’s not supported because it’s not possible to do something like that in glsl

that’s a shame. Once you get to an “advanced” level Monogame may really not be a good option.

I’m not sure whether to switch to Slim or Sharp DX already, since the XNA setup gives me a lot of stuff up front that is neat not to worry about.

But the lack of compute shaders and access to mip maps etc. is a big negative.

Im wondering too if i will not switch to sharpdx.

When I scratch my head during a whole afternoon to finally discover my problem was coming from a monogame limitation I keep wondering.

I would be able to circumvent this limitation about uniforms by passing parameters as it is done with setvalue but I dont know if it would be a long term solution.
Compute shaders too is a really big limitation… For ex to make advanced god rays like fallout4 without a bit hit on perfs (im thinking about conetracing and tesselation) distance fields etc.

Compute shaders are not the priority but when i will need them ill switch to sharpdx or i ll contribute to monogame if i have time