Framebuffer incomplete depending on size

Hello there,

I am experiencing unexpected behavior (unexpected by me, that is) with multisampled render targets. Here’s my current setup:

Framebuffer with
Color Attachment 0:
GL_RGBA8
GL_TEXTURE_2D_MULTISAMPLE_ARRAY
1500x1000 pixels, 2 layers, 32 samples

Color Attachment 1:
GL_RGBA32F
GL_TEXTURE_2D_MULTISAMPLE_ARRAY
1500x1000 pixels, 2 layers, 32 samples

Depth Attachment:
GL_DEPTH_COMPONENT32F
GL_TEXTURE_2D_MULTISAMPLE_ARRAY
1500x1000 pixels, 2 layers, 32 samples

Query Results:
GL_MAX_3D_TEXTURE_SIZE = 2048
GL_MAX_TEXTURE_SIZE = 16384
GL_MAX_SAMPLES = 32
GL_MAX_COLOR_TEXTURE_SAMPLES = 32
GL_MAX_DEPTH_TEXTURE_SAMPLES = 32

If I try to run this, attaching the RGBA32F texture results in an incomplete framebuffer. When creating the texture, no error is reported. If I change the size of the textures, the maximum that works for the float texture to be attachable is 1280x1024. It also works for the current resolution if I either use only 16 samples, 1 layer or RGBA8. It is obvious that I am hitting some (implementation dependent?) maximum number of samples or maximum texture size, but how can I query for that? It does not even seem to be an invalid texture, it just refuses to be attached as a render target.

There is of course no real purpose of having this thing with 32 samples other than a super shiny “screenshot quality” mode for renders, but I’d like my application to be versatile and at least catch this case when I create a texture within the queried limits that is still too large for any reason. Is there a maximum byte size for textures that I can query?