Coming up with this on the fly, but assuming your inputs are both in the range 0-1, you should be able to pack the 2 values by storing one value as integer, and the second as fractional, into your alpha:
float Pack( in float a, in float b )
{
return floor(a * 255) + b; // stores A as integer, B as fractional
}
And to unpack, you can use:
float Unpack( in float c, inout float a, inout float b )
{
a = floor(c) / 255; // removes the fractional value and scales back to 0-1
b = frac(c); // removes the integer value, leaving B (0-1)
}
Alternatively, this might be faster for unpacking:
float Unpack( in float c, inout float a, inout float b )
{
b = frac(c); // removes the integer value, leaving B (0-1)
a = (c - b) / 255; // removes the fractional value (B) and scales back to 0-1
}
I haven't tested these at all, but I think they should work.
Edit: Just re-read the inital post and noticed you're using values from 0-255 uint, instead of float 0-1. The concept should be the same, you can either scale from 0-255 to 0-1, or you can just invert the scaling I applied (instead of increasing A, decrease B).