static void
intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
{
+ struct intel_context *intel = intel_context(ctx);
const struct intel_renderbuffer *depthRb =
intel_get_renderbuffer(fb, BUFFER_DEPTH);
const struct intel_renderbuffer *stencilRb =
*/
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
}
+
+ /* check that texture color buffers are a format we can render into */
+ {
+ const struct gl_texture_format *supportedFormat;
+ GLuint i;
+
+ /* The texture format we can render into seems to depend on the
+ * screen depth. There currently seems to be a problem when
+ * rendering into a rgb565 texture when the screen is abgr8888.
+ */
+ if (intel->front_region->cpp == 4)
+ supportedFormat = &_mesa_texformat_argb8888;
+ else
+ supportedFormat = &_mesa_texformat_rgb565;
+
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ const struct gl_texture_object *texObj =
+ fb->Attachment[BUFFER_COLOR0 + i].Texture;
+ if (texObj) {
+ const struct gl_texture_image *texImg =
+ texObj->Image[0][texObj->BaseLevel];
+ if (texImg && texImg->TexFormat != supportedFormat) {
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ break;
+ }
+ }
+ }
+ }
}