56 minutes ago, turanszkij said:Oh, that is actually useful then. I didn't care so much for performance implcations of gamma conversion yet, but this is a really useful feature. My other concern with the SRGB texture format was this (from MSDN):
If the driver type is set to D3D_DRIVER_TYPE_HARDWARE, the feature level is set to less than or equal to D3D_FEATURE_LEVEL_9_3, and the pixel format of the render target is set to DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, or DXGI_FORMAT_B8G8R8X8_UNORM_SRGB, the display device performs the blend in standard RGB (sRGB) space and not in linear space. However, if the feature level is set to greater than D3D_FEATURE_LEVEL_9_3, the display device performs the blend in linear space, which is ideal.
I don't intend to support DirectX 9 feature level, but nevertheless this just seems to me that proper support for this format is not 100% guaranteed.
Right, this was how older D3D9-era hardware behaved. However if you're going to try to support that level of hardware, then I think your sRGB blending behavior is probably the least of your concerns.
"Fun" fact: when D3D10 hardware came out that implemented the proper blending behavior for sRGB render targets, that new behavior was applied even to existing, shipped D3D9 games! So if you play Half Life 2 on an Nvidia GeForce 7800 and then play it on a 8800, it actually looks a little bit different in places where alpha blending is used!
27 minutes ago, matt77hias said:This makes sRGB formats useless for resources that must be read, unless you use a point sampler (so basically one texel access and no filtering). So the base color buffer of the GBuffer can benefit from an sRGB format.
I think that you misunderstood me: filtering and blending is fine with sRGB formats. It's not fine if you manually apply the transfer function and inverse transfer function in the shader. Sorry if that wasn't clear from my post.