# Issue: \[BUG\] incorrect glDisable(GL\_FRAMEBUFFER\_SRGB) for MRT

**URL:** <https://forums.imgtec.com/t/issue-bug-incorrect-gldisable-gl-framebuffer-srgb-for-mrt/2951>\
**Category:** Uncategorized\
**Tags:** pvrvframe\
**Created:** [June 7, 2019, 7:52am UTC](https://forums.imgtec.com/t/issue-bug-incorrect-gldisable-gl-framebuffer-srgb-for-mrt/2951 "2019-06-07T07:52:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jialongzhai](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jialongzhai](https://forums.imgtec.com/u/jialongzhai)\
**Post date:** [June 7, 2019, 7:52am UTC](https://forums.imgtec.com/t/issue-bug-incorrect-gldisable-gl-framebuffer-srgb-for-mrt/2951/1 "2019-06-07T07:52:48Z")

</div>

> <https://github.com/powervr-graphics/Native_SDK/issues/41>

## 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

---

<div class="post-metadata">

**Author:** ![MartonTamas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/martontamas/32/297_2.png) [@MartonTamas](https://forums.imgtec.com/u/MartonTamas)\
**Post date:** [June 7, 2019, 9:17am UTC](https://forums.imgtec.com/t/issue-bug-incorrect-gldisable-gl-framebuffer-srgb-for-mrt/2951/2 "2019-06-07T09:17:09Z")

</div>

Hi,

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

thansk,  
Marton

---

<div class="post-metadata">

**Author:** ![jialongzhai](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jialongzhai](https://forums.imgtec.com/u/jialongzhai)\
**Post date:** [June 7, 2019, 2:48pm UTC](https://forums.imgtec.com/t/issue-bug-incorrect-gldisable-gl-framebuffer-srgb-for-mrt/2951/3 "2019-06-07T14:48:32Z")

</div>

I’m using the OpenGL ES emulator(libglesv2.dll) from Imagination’s [PowerVR SDK](https://www.imgtec.com/developers/powervr-sdk-tools/installers/). As far as I know, the emulator is called PVRVFrame, or at least a part of PVRVFrame.

---

<div class="post-metadata">

**Author:** ![MartonTamas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/martontamas/32/297_2.png) [@MartonTamas](https://forums.imgtec.com/u/MartonTamas)\
**Post date:** [June 10, 2019, 10:42am UTC](https://forums.imgtec.com/t/issue-bug-incorrect-gldisable-gl-framebuffer-srgb-for-mrt/2951/4 "2019-06-10T10:42:11Z")

</div>

Hi,

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

bests,  
Marton
