Am I correct in assuming that you can only get SRGB conversions for free in modern GPU's on texture reads via samplers if an SRGB texture format is used?
So if I want to access the same SRGB textures via images with image load/store I will have to do any SRGB/linear conversions manually?
IE Doing something such as:
float LinearToSRGB(float value)
{
if( value< 0.0031308 )
value*= 12.92;
else
val = 1.055 * pow(value, 1.0/2.4) - 0.055;
return value;
}
Exactly.
As long as you're not using sRGB textures, OpenGL assumes all texture data is in linear space.
To quote the OpenGL Wiki:
The various image format compatibility matrix for image load/store operations is very similar to the compatiblity for texture views, though there are some differences. The first difference is that the list of image formats that can be used for images in load/store operations is more limited: only the formats mentioned above may be used. In particular, this means that sRGB image formats cannot be used in image load/store operations. Though you can create view textures from sRGB formats to non-sRGB formats, which themselves can be used in image load/store.
https://www.khronos.org/opengl/wiki/Image_Load_Store#Format_compatibility