I try to compile this shader. It compiles ok when targeting Desktop but fails with an error "BaseInstance not supported in ES profile" on a content pipeline build phase when targeting Android. I've squeezed my shader to only reproduce this issue and here is a squeezed code:
#define VS_SHADERMODEL vs_5_0
#define PS_SHADERMODEL ps_5_0
StructuredBuffer<float4> particles;
Texture2D MainTex; // primary texture.
SamplerState MySampler { };
struct VsInputQuad
{
uint instance_id: SV_InstanceID;
};
struct VsOutputQuad
{
float4 Position : SV_Position;
float4 Color : COLOR0;
float2 TexureCoordinateA : TEXCOORD0;
};
struct PsOutputQuad
{
float4 Color : SV_TARGET;
};
VsOutputQuad vert(VsInputQuad input)
{
uint ii = input.instance_id;
VsOutputQuad ret;
ret.Position = float4(particles[ii].x,0,0,0);
ret.TexureCoordinateA = float2(0,0);
ret.Color = float4(1,1,1,1);
return ret;
}
PsOutputQuad frag(VsOutputQuad input)
{
PsOutputQuad output;
output.Color = MainTex.Sample(MySampler, input.TexureCoordinateA) * input.Color;
clip(output.Color.a - 0.01);
return output;
}
technique Draw
{
pass
{
VertexShader = compile VS_SHADERMODEL vert();
PixelShader = compile PS_SHADERMODEL frag();
}
}
I try to compile this shader. It compiles ok when targeting Desktop but fails with an error "BaseInstance not supported in ES profile" on a content pipeline build phase when targeting Android. I've squeezed my shader to only reproduce this issue and here is a squeezed code: