2 Replies Latest reply on Sep 15, 2010 5:20 PM by dimple

    DX9: sRGB write-enabled clearing fails in case AA is enabled

    landmann

      Without AA enabled a RT clear with D3DRS_SRGBWRITEENABLE set to TRUE does what one expects, clearing the RT with the proper sRGB value.

      With AA enabled this does not work. Why?

      What trick is needed to activate it without using a custom pixel shader?

       PS: Of course simple to reproduce , just toggle the SRGBWRITEENABLE RS before any clear call in one of the simple DX9 samples. You see a nice background flickering which vanishes once AA is enabled.

        • DX9: sRGB write-enabled clearing fails in case AA is enabled
          landmann

          So I finally got an answer from devrel here: The ATI driver assumes that all rendering is done in linear color space in case AA is enabled. Something one could argue on (e.g. linear color space is only needed during the _downsampling_ process).

          And therefore the ATI driver just completely ignores the SRGBWRITEENABLE flag in the AA case.

          At least for a clear operation it would be possible to do the color conversion in the driver before issuing it on the GPU. We only have 8 bits per color for the clear operation, so depending on the value sRGB or linear based encoding could be beneficial.

          Summa summarum: Please either fix the driver or return an appropriate error code.