HLSl clip(-1) not working on Android

I finally was able to port over a HLSL pixel shader (*.fx) from a 3D Windows game over to an Android app. Unfortunately using clip(-1) in my shader causes the program to crash. clip(1) works, for whatever that is worth. Ideally I will put a logic statement inside clip(), but let’s not get too crazy yet.

Does anyone have any idea how to make it work or can give me a workaround that isn’t too slow? Not that it would give the desired effect, but I can’t even get an if statement working that would return a pixel with zero alpha. Clearly I’m having a lot of trouble with shaders on Android.

To be slightly clearer: Everything compiles, and then crashes my program with a useless error “content file not found”.

Profile is set to HiDef in the Content Pipeline Tool and in the main program.


So apparently in my code there were these lines:

        myDepthStencilState = new DepthStencilState();
        myDepthStencilState.DepthBufferEnable = true; /* Enable the depth buffer */
        myDepthStencilState.DepthBufferWriteEnable = false;
        g.DepthStencilState = myDepthStencilState;

This worked fine for windows but made my shaders fail for Android.

I am still playing compiler roulette though, which is crazy.