Created attachment 113255 [details]
When binding a layered texture to a framebuffer, the framebuffer is marked as layered. When a renderbuffer is bound to the same attachment point, it replaces the texture, but mesa doesn't clear the layered state. When checking for framebuffer completeness, the left over layered state is used, even though renderbuffers don't have layered state. This can result in framebuffer incompleteness with GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS when there are no layered attachment points.
This occurs on the 10.4 branch at 54da987baec25fbaf6975c93f197ddbfe65a303c and the master branch at 49299ef6fa0cf88e7101512400a4e74efa300941.
Created attachment 113256 [details]
Created attachment 113257 [details]
Apitrace trace from reproducer
I've confirmed that your patch fixes the test case provided, and push it to master.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.