From b1969585749fd9f0975427c47582995749137b2c Mon Sep 17 00:00:00 2001 From: Miguel Casas-Sanchez Date: Tue, 19 Nov 2019 02:21:12 +0000 Subject: [PATCH] i965: Ensure that all 2101010 image imports can pass framebuffer completeness. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Chrome OS would like to import and render to any supported format that has a corresponding display plane format, and this prevents throwing framebuffer incomplete for FBOs using these textures. See: crbug.com/949260 Reviewed-by: Tapani Pälli Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/intel_tex_image.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c index 95c44a0313a..bcc0853018b 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_image.c +++ b/src/mesa/drivers/dri/i965/intel_tex_image.c @@ -637,10 +637,14 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target, image->internal_format != 0 ? image->internal_format : _mesa_get_format_base_format(mt->format); - /* Setup a sized internal format for MESA_FORMAT_R10G10B10[X2|A2]_UNORM. */ + /* Fix the internal format when _mesa_get_format_base_format(mt->format) + * isn't a valid one for that particular format. + */ if (brw->mesa_format_supports_render[image->format]) { if (image->format == MESA_FORMAT_R10G10B10A2_UNORM || - image->format == MESA_FORMAT_R10G10B10X2_UNORM) + image->format == MESA_FORMAT_R10G10B10X2_UNORM || + image->format == MESA_FORMAT_B10G10R10A2_UNORM || + image->format == MESA_FORMAT_B10G10R10X2_UNORM) internal_format = GL_RGB10_A2; } -- 2.30.2