_ScreenParams works great. but values are inaccurate in profiler.
Test shader:
Shader "ScreenParams"
{
SubShader
{
Pass
{
Cull Off
CGPROGRAM
#pragma vertex V
#pragma fragment P
void V(uint i:SV_VertexID,out half4 c:SV_POSITION) {c=half4((i<<1&2)*2-1.,1-2.*(i&2),1,1);}
float4 P (float4 vertex:SV_POSITION) : SV_TARGET
{
float2 uv = vertex.xy/_ScreenParams.xy;
return float4(lerp(1..xxxx,0..xxxx,step(max(uv.x,uv.y),0.5)));
}
ENDCG
}
}
}