I have the concept and math mapped out for VA gamma shift correction, but I don't know the language yet.
Before I sink time in, I just wanted to make sure: Can you blend a post effect (gamma) using a fullscreen texture all the way from 0 to 255? And if so, can it handle odd texture sizes like 3840x2160 or does the texture need to be power of 2 then stretched to monitor res?
texture foobar < source = "some_image.png";
Width = 3840;
Height = 2160;
Texture = foobar;
float4 blablub(float2 texcoord : TEXCOORD) : SV_TARGET
float4 color = tex2D(ReShade::BackBuffer);
float4 color_post_effect = ...;
// Assuming the 0-255 blending value is stored in the red channel of the image.
// This looks it up and linearizes it to 0.0-1.0 float, since colors are represented as 0.0-1.0 in shaders.
float blending = tex2D(foobar_sampler, texcoord).r;
// Linearly interpolate between original color and whatever the post effect did, using that blending value.
color = lerp(color, color_post_effect, blending);