简体   繁体   中英

Default framebuffer not gamma-correcting on Intel UHD 630

I'm using SDL2 on Windows 10 to create an OpenGL context, but when I try to get the framebuffer attachment color encoding on an Intel UHD 630, I get an Invalid Operation error instead. On my Nvidia Geforce 1070, it's returning the correct value (GL_LINEAR).

According to Khronos , my code should work:

checkGlErrors(); // no error
auto params = GLint{ 0 };
glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER,
                                      GL_BACK,
                                      GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING,
                                      &params);
checkGlErrors(); // invalid operation

What I'm reading is that Intel drivers are notoriously unreliable, but I'll be surprised if they don't support an SRGB framebuffer. For context: I'm using GL_FRAMEBUFFER_SRGB for gamma correction, and this too doesn't work on my integrated GPU even though it works perfectly on my Nvidia GPU.

Am I doing something wrong? Is there a reliable way of enabling SRGB on the default framebuffer? My drivers are up to date (27.10.100.8425). The output is gamma-corrected on my Geforce GPU but the integrated Intel GPU is rendering the default framebuffer without gamma correction, so I'm assuming there's something unique about the default framebuffer in the Intel drivers that I don't know.

Edit: The correct value should be GL_SRGB, not GL_LINEAR. The correct code for getting that parameter:

// default framebuffer, using glGetFramebuffer
glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &params);

// default framebuffer, using glGetNamedFramebuffer
glGetNamedFramebufferAttachmentParameteriv(GL_ZERO, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &params);

// named framebuffer
glGetNamedFramebufferAttachmentParameteriv(namedFramebuffer.getId(), GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &params);

It looks like it's just a driver bug. 100.8425 (the current beta driver) works well except for the SRGB issue; the current stable driver, along with several other newer drivers, all display flickering green, horizontal lines in the window. I reverted to 100.8190 and now the window is rendering correctly--identical to the Geforce GPU.

This sums up the situation: "Intel drivers suck, don't trust anything they do."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM