Issue: [BUG] incorrect glDisable(GL_FRAMEBUFFER_SRGB) for MRT

Description

Hi,

I find the emulator will add a glDisable(GL_FRAMEBUFFER_SRGB) call in the underlying OpenGL implementation for every draw, if my current FBO contains SRGB color attachement in GL_COLOR_ATTACHMENT1 or 2, 3, etc.

If the GL_COLOR_ATTACHMENT0 is SRGB format, the emulator works correctly, it calls glEnable(GL_FRAMEBUFFER_SRGB) .

Maybe the underlying implementation only check color attachement 0.

Repro steps

  • Create a FBO contains 3 color attachments with format:
    color0 : rgb10a2
    color1 : rgba8_srgb
    color2 : rgba8_srgb
  • bind the fbo and make some drawcalls
  • you will see the emulator calls glDisable(GL_FRAMEBUFFER_SRGB) before every draw in some graphics debugger( such as Renderdoc).

Environment

  • SDK version: 18.2@5236813
  • Operating System/Device: Windows 10/ GTX 1060

Additional Info

Hi,

thanks for contacting us regarding this issue. Can you please tell me what kind of emulator are you using?

thansk,
Marton

I’m using the OpenGL ES emulator(libglesv2.dll) from Imagination’s PowerVR SDK. As far as I know, the emulator is called PVRVFrame, or at least a part of PVRVFrame.

Hi,

thank you, I’ve created a bug report, the ID is:
87540

bests,
Marton