cbuffer constants : register(b0) { float2 rn_screensize; // { 2 / width, -2 / height } } struct vertexdesc { float2 position : POS; float3 color : COL; }; struct pixeldesc { float4 position : SV_POSITION; float4 color : COL; }; pixeldesc VsMain(vertexdesc vertex) { pixeldesc output; output.position = float4(vertex.position * rn_screensize - float2(1, -1), 0, 1); output.color = float4(vertex.color, 1); return output; } float4 PsMain(pixeldesc pixel) : SV_TARGET { return pixel.color; }