-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blit layered framebuffers #532
Comments
On page 540 of the OpenGL 4.6 core specification when describing glBlitFramebuffer it says:
To blit non-zero layers you can attach the texture to the framebuffer with glFramebufferTexture3D() or glFramebufferTextureLayer() and specify the layer parameter as non-zero. |
I have the following piece of code to achieve what I want but it feels heavy glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dst);
glBindFramebuffer(GL_READ_FRAMEBUFFER, src);
for (int i = 0; i < 6; ++i) {
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, src_tex, 0);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, dst_tex, 0);
glBlitFramebuffer(0, 0, width, height, 0, 0, width, height,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
} I'd prefer to have something like this glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dst);
glBindFramebuffer(GL_READ_FRAMEBUFFER, src);
// Return GL_INVALID_OPERATION if the number of layers don't match
glBlitFramebufferLayers(0, 0, width, height, 0, 0, width, height,
GL_COLOR_BUFFER_BIT, GL_NEAREST); or this glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dst);
glBindFramebuffer(GL_READ_FRAMEBUFFER, src);
for (int i = 0; i < 6; ++i) {
glBlitFramebufferLayer(0, 0, width, height, 0, 0, width, height, /*layer*/ i,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
} |
If you proposed a new extension, what platform(s) would you need it supported? You may need to convince those platforms owners to implement it. |
My main target is MESA/Linux, I don't mind going with a MESA extension if other platforms are not interested in this feature. |
Im about to draft the extension, what prefix should I use? MESA or anything else? |
Discussed internally and NVIDIA is interested in this one if it's done as an EXT. |
Awesome, I'll be pushing my draft in the beginning of next week. |
Should the extension be made against ES2 or ES3? ES2 has I also noticed that the file |
I personally don't think EXT extensions should depend on non-EXT/ARB extensions, so ES3 is probably the best one. |
I'll prepare a patch to get properly the gl3ext header. |
We don't generate a gl3ext.h - there is an empty one floating about that has some ancient history of being related to Mesa though I don't recall the details any more. In any event, extensions in gl.xml are tagged for gles2, gles1, gl, glcore, but nothing else. |
Yeah that's what i understood when trying to generate the header with |
I'm trying to copy a cubemap texture between 2 framebuffers using blits. Both
framebuffers are complete layered framebuffers with 6 layers each, with the
same size.
When doing a simple blit operation, as seen below, only one face is copied.
According to the GLES 3.2 spec 1 9.8 Layered framebuffers
But the
glClear
call before the blit behaves differentlyWhy is the blit operation only possible on the first layer but the clear is
possible on all layers? I there another way to achieve what I want to do? Could
an extension fix this?
I'd be happy to draft something if needed to fix this issue.
The text was updated successfully, but these errors were encountered: