cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

pedela
Journeyman III

Bug: glBlitFramebuffer interpolation

When blitting from a renderbuffer to the screen, linear filtering does not work even if I set it to GL_LINEAR. I confirmed this using an NVIDIA 260 where I saw a difference between GL_NEAREST and GL_LINEAR. NVIDIA GL_NEAREST = ATI GL_LINEAR.

  • Linux 32-bit
  • Xorg 7.5
  • fglrx 10.5
  • OpenGL 3.2 compat context
  • ATI HD 4870, 5670

int width = 1280;
int height = 720;
int xWidth = XDisplayWidth(xDisplay, xWindow) - 1;
int xHeight = XDisplayHeight(xDisplay, xWindow) - 1;
GLuint fboId, rboIds[2];

glGenRenderbuffers(2, rboIds);
glBindRenderbuffer(GL_RENDERBUFFER, rboIds[0]);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, width, height);

glBindRenderbuffer(GL_RENDERBUFFER, rboIds[1]);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL, width, height);

glBindRenderbuffer(GL_RENDERBUFFER, 0);

glGenFramebuffers(1, &fboId);
glBindFramebuffer(GL_FRAMEBUFFER, fboId);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rboIds[0]);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rboIds[1]);

glClearColor(1, 0, 0, 1);
glViewport(0, 0, width, height);

while (1) {
glBindFramebuffer(GL_FRAMEBUFFER, fboId);
glClear(GL_COLOR_BUFFER_BIT);
glBindFramebuffer(GL_READ_FRAMEBUFFER, fboId);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBlitFramebuffer(0, 0, width, height, 0, 0, xWidth, xHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
glXSwapBuffers(xDisplay, xWindow);

}

 

EDIT: How do I put the code into a nice box? The forum help is not very helpful.

 

 

0 Likes
10 Replies
pboudier
Staff

what is the size of the window ?

(another way to ask the question: do you see the same issue for both minification and magnification ?)

Pierre B.

0 Likes

In that example, the screen resolution is 1920x1080. I get the same behavior whether I blit from 1280x720 to 1920x1080 or vice versa. I create a fullscreen X window whose parent is the root window. I can provide the X code if it helps. This also happens with the 10.7 driver. I subtract one from the screen width and height to workaround another bug.

0 Likes

the upscale path indeed seems to lack filtering. we will fix it.

the downscale path should work though.

 

Pierre B.

0 Likes

Great thanks!

I will test downscale again and get back to you.

0 Likes

Yes you are right, downscale does work. Thanks.

0 Likes

I have a similar issue on Windows XP. Filtering doesn't work when upscaling (didn't test downscaling yet):

Radeon X1650 Series

Catalyst™-Version 10.2

OpenGL-Version 6.14.10.8545

0 Likes
pedela
Journeyman III

Still broken with 10.10 on Linux.

0 Likes

the fix should have made it into the 10.10 hotfix driver. can you confirm ?

Pierre B.

0 Likes

I would be happy to test it, but I cannot find a link to download a hotfix for Linux. Can you provide one?

0 Likes

This is fixed with fglrx 10.11.

0 Likes