Developing Games on Intel Graphics
If you are gaming on graphics integrated in your Intel Processor, this is the place for you! Find answers to your questions or post your issues with PC games
486 Discussions

GL_FRAMEBUFFER_SRGB not working with newer drivers

samgubernick
Beginner
4,144 Views

System Setup Information:
-----------------------------------------

System Used: Aero 15x
CPU SKU: i7 8750
GPU SKU: UHD 630
Processor Line: H
System BIOS Version: N/A
CMOS settings: N/A
Graphics Driver Version: 100.8190 (this is the only one that works)
GOP/VBIOS Version: N/A
Operating System: Windows 10
OS Version: 19041.508
API: N/A
Occurs on non-Intel GPUs?: No

Steps to Reproduce:
-------------------------------
1. render to framebuffer
2. enable GL_FRAMEBUFFER_SRGB
3. render to window
4. disable GL_FRAMEBUFFER_SRGB

Expected Results:
-------------------------------
Output should use linear color space, not sRGB. The output on 100.8190 is correct, as is the output from the dedicated GeForce 1070 GPU with regularly updated drivers. Using https://matt77hias.github.io/blog/2018/07/01/linear-gamma-and-sRGB-color-spaces.html and a brightness value of 0.5 for reference, this version of the Intel drivers and the dedicated GPU are matching the linear gradient.

Actual Results:
-------------------------------
Output on Intel drivers newer or older than 100.8190 is wrong; it outputs colors using sRGB so everything is darker than it's supposed to be. On these versions of the drivers, a brightness value of 0.5 is matching the gamma gradient instead of the linear one.

Additional Information:
-------------------------------
All of the newer Intel drivers that I've installed have had this problem in my program. The newest version I've used is 27.20.100.8873 and it, too, ignores GL_FRAMEBUFFER_SRGB.

0 Kudos
13 Replies
Esteban_D_Intel
Moderator
4,124 Views

Hello samgubernick, 

 

Thank you for posting on the Intel® communities.  

 

First, I would like to thank you for the information provided and the troubleshooting steps that you have performed.


To better assist you I would appreciate if you could provide the following information:

 

Please run the following tool and attach the reports generated.   

    

Intel® System Support Utility (Intel® SSU) Download link 

  

1.       Open the application and click on "Scan" to see the system and device information. 

2.     By default, Intel® SSU will take you to the "Summary View".   

3.       Click on the menu where it says "Summary" to change to "Detailed View".   

4.       To save your scan, click on "Next", then "Save".   

 


 

Esteban D.

Intel Technical Support Technician  

  


0 Kudos
Esteban_D_Intel
Moderator
4,109 Views

Hello samgubernick, 


Were you able to check the previous post?   

Please let me know if you need further assistance.   

 

 

Esteban D.  

Intel Technical Support Technician   


0 Kudos
samgubernick
Beginner
4,103 Views

Hi Esteban,

Thanks for the reply! It's been a crazy week, sorry. I've attached the text file. I also want to clarify something I wrote:

On the GeForce GPU and the older version of the Intel drivers, when GL_FRAMEBUFFER_SRGB is enabled, the rendered output correctly matches the expected sRGB gamma--not the linear gamma--since OpenGL is increasing the brightness from linear to sRGB color space. On the newer versions of the Intel drivers, OpenGL is either using an sRGB framebuffer when it's supposed to use linear color space, or it's not performing gamma correction. The result is the same: the output's too dark. I can attach comparison screenshots if that's helpful (I'll need to reinstall the newer Intel drivers). Again, 27.20.100.8190 works perfectly and matches the GeForce 1070 GPU.

0 Kudos
Esteban_D_Intel
Moderator
4,084 Views

Hello samgubernick, 

Thank you so much for your response and the information provided.


That would be perfect, I would appreciate if you could attach the screenshots with the comparison so we can have a clear look at this behavior.


Additionally, please check the following steps to get the Report for Intel® Graphics Drivers and attach the report generated.


We will be waiting for your response.


Esteban D.

Intel Technical Support Technician


0 Kudos
samgubernick
Beginner
4,091 Views

Hi Esteban,

The brighter screenshots are from 8190 and the GeForce 1070. The darker one is from the newest beta drivers (8885). I don't have a grey strip (0.5, 0.5, 0.5) to demonstrate, but if I did, the first two would should the gamma-corrected strip in sRGB while it would be too dark on 8885. I can check if there's an error that I'm ignoring in the newer Intel drivers when I'm generating the linear framebuffer, but again, it works perfectly on 8190.

Thanks again for your help!

geforce.png

intel-8190.png

intel-8885.png

   

0 Kudos
Esteban_D_Intel
Moderator
4,066 Views

Hello samgubernick,  


Thank you so much for all the information provided.

I would like to further investigate this for you.

We will provide an update as soon as possible.


Esteban D.

Intel Technical Support Technician


0 Kudos
Esteban_D_Intel
Moderator
4,059 Views

Hello samgubernick, 


We were checking the steps that you provided in your initial post to replicate the issue.

Is there a way that you could share more details about them?

Are you using any specific code or can any other detail is greatly appreciated.

This is to ensure that we are performing the same exact steps to replicate this behavior.


Esteban D.

Intel Technical Support Technician


0 Kudos
samgubernick
Beginner
4,034 Views

Thanks for looking into this!

I reinstalled the newest drivers to see if OpenGL is showing any errors that I was ignoring and I'm not seeing anything. glGetNamedFramebufferAttachmentParameteriv() is returning linear for the window framebuffer--the same as the GeForce GPU and the older, working drivers. The output from the other framebuffers seems the same, too, so I'm not sure where else to look.

More details about what I'm doing:

I'm setting the SDL attributes for OpenGL:
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, SDL_ENABLE);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, SDL_ENABLE);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
(I'm checking the SDL return code for each of these to ensure that it's returning 0, which means no error.)

After that, I'm creating the context:
SDL_GL_CreateContext(window);
SDL_GL_GetAttribute(); // for each of the above values to ensure they match
glewExperimental = GL_TRUE;
glDisable(GL_FRAMEBUFFER_SRGB);

There's a lot of code for generating the framebuffers. For the regular framebuffers, I'm generating them with this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, viewportSize.width, viewportSize.height,
0, GL_RGBA, GL_UNSIGNED_BYTE, 0);

For a framebuffer related to the window (maybe the window buffer itself--it's been a while since I thought about this), I'm generating it with this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB8, viewportSize.width, viewportSize.height,
0, GL_RGB, GL_UNSIGNED_BYTE, 0);
I'm adding attachments to the framebuffers but I don't see anything related to color space there.

To render to the window, here's the code:
clearRenderTargetColor(0, ClearColor::black);
shader.useProgram();
disableDepthTest(); // wrapper for OpenGL
enableFramebufferSrgb(); // wrapper
setBlendMode(BlendMode::none); // wrapper, disable blending
glDrawArrays(GL_TRIANGLES, 0, 6);
disableFramebufferSrgb(); // wrapper
enableDepthTest(); // wrapper

If this doesn't help track down the issue in the newer drivers, I'm happy to share the Git repository with you. I'm using Cmake and VS2019 16.8.0 Preview 5.0, and the libraries are SDL 2.0.12, Boost 1.0.73 (compiled because of serialization), SpartanJ soil2, Glew 2.2.0-rc3, Freetype 2, and GLM 0.9.9.7.

0 Kudos
samgubernick
Beginner
4,032 Views

Ok, I ran RenderDoc and it's given me some insight into what's going on. Backbuffer Color isSRGB is 0 on the newer Intel drivers whereas it's 1 on the GeForce GPU and on Intel 8190. I've attached a 7zip archive with the three captures in it.

0 Kudos
Esteban_D_Intel
Moderator
4,018 Views

Hello samgubernick,  


Thank you so much for your prompt response

As previously stated, please allow us to look into this matter.

We will provide an update as soon as possible.


 Esteban D.

Intel Technical Support Technician  


0 Kudos
Esteban_D_Intel
Moderator
3,972 Views

Hello samgubernick,  


Thank you for your patience.


After carefully studying the behavior that you are experiencing and as you are developing your own solution.


I will move the thread the appropriate forum.      


An Intel Engineer will take your case and continue with the assistance on this matter.



Esteban D.

Intel Technical Support Technician


0 Kudos
samgubernick
Beginner
3,814 Views

I installed 27.20.100.9025 but I'm still having the same problem. Any idea what changed after 8190 that would affect the framebuffer?

0 Kudos
samgubernick
Beginner
3,717 Views

The newest Intel beta driver still has the same problem with glEnable(GL_FRAMEBUFFER_SRGB); I'm working around this now by performing gamma correction in the output shader. It's inconvenient and less efficient than the hardware option but at least it works.

0 Kudos
Reply