Framebuffers do not support depth texture arrays on Nvidia?

I have a texture array, which is created and initialized like this:


auto size = 4096;
auto depth = 4;
GLuint fbo;
glGenFramebuffers(1,&fbo);
glBindFramebuffer(GL_FRAMEBUFFER,fbo);

GLuint tex;
glGenTextures(1,&tex);
glBindTexture(GL_TEXTURE_2D_ARRAY,tex);

glTexImage3D(
	GL_TEXTURE_2D_ARRAY,0,GL_DEPTH_COMPONENT24,
	size,size,depth,1,GL_DEPTH_COMPONENT,GL_FLOAT,NULL
);
/*
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);

glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_COMPARE_FUNC,GL_LEQUAL);
glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_COMPARE_MODE,GL_COMPARE_R_TO_TEXTURE);

glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_R,GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_BORDER);
glm::vec4 col(1.f,1.f,1.f,1.f);
glTexParameterfv(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_BORDER_COLOR,&col[0]);
*/ // Problem occurs regardless of these

glFramebufferTextureLayer(GL_FRAMEBUFFER,GL_DEPTH_ATTACHMENT,tex,0,0);
auto status = glCheckFramebufferStatus(GL_FRAMEBUFFER);

On my AMD-card this works just fine, however when trying it on a Nvidia-machine (With OpenGL 4.5 support), the return value is GL_FRAMEBUFFER_UNSUPPORTED.
I’ve checked whether any of the gl-calls invoke an error, but glGetError returns 0 for all of them, both on the AMD- and the Nvidia-machine.

What am I doing that is ‘unsupported’ here and what can I do to get around it?

What am I doing that is ‘unsupported’ here

Who knows?

GL_FRAMEBUFFER_UNSUPPORTED is the framebuffer completeness state you get when your implementation doesn’t like your combination of framebuffer formats.

NVIDIA usually has decent debug output support, so turn that on and check the debug messages you get. It may help clue you in. You will of course need to create a debug context to use it.

what can I do to get around it?

If you can’t get NVIDIA’s implementation to tell you much more about it, then there’s not much you can do.

What’s odd is that GL_DEPTH_COMPONENT24 is a required format. Which means that NVIDIA isn’t allowed to return GL_FRAMEBUFFER_UNSUPPORTED for it. It may be that the driver is confused because you’re only attaching one layer of the image to the framebuffer.

You’re clamping to a border color… and creating a texture with border texels?

Try not using border texels.

[QUOTE=Alfonse Reinheart;1279837]NVIDIA usually has decent debug output support, so turn that on and check the debug messages you get. It may help clue you in. You will of course need to create a debug context to use it.
[/QUOTE]
Thank you, I didn’t know that feature existed!
Turns out Nvidia doesn’t support DEPTH_ATTACHMENT with bordered textures; Removing the border solved the issue!

Yet another reason to use the core OpenGL profile. It would have given you an OpenGL error for using a non-zero border.