From ba11f673a245a00d03c901d32ddc3489cb3ad287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Wed, 5 May 2021 09:57:01 +0300 Subject: [PATCH] i965: support only color formats with memory objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are issues with depth support and lack of support for combined depth+stencil, let's support only color formats for now. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4712 Fixes: f73aeca0ce3 ("i965: Initial implementation for EXT_memory_object_*") Signed-off-by: Tapani Pälli Reviewed-by: Rohan Garg Part-of: --- src/mesa/drivers/dri/i965/brw_surface_formats.c | 1 - src/mesa/drivers/dri/i965/brw_tex.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c index c3bdac4befc..72fa53d5d71 100644 --- a/src/mesa/drivers/dri/i965/brw_surface_formats.c +++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c @@ -197,7 +197,6 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format) [MESA_FORMAT_RGBX_UNORM16] = ISL_FORMAT_R16G16B16X16_UNORM, [MESA_FORMAT_RGBX_FLOAT16] = ISL_FORMAT_R16G16B16X16_FLOAT, [MESA_FORMAT_RGBX_FLOAT32] = ISL_FORMAT_R32G32B32X32_FLOAT, - [MESA_FORMAT_Z_UNORM16] = ISL_FORMAT_R16_UNORM, }; assert(mesa_format < MESA_FORMAT_COUNT); diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index ee2a5f3ced7..cbb4cd26ca7 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -353,6 +353,10 @@ intel_texture_for_memory_object(struct gl_context *ctx, struct gl_texture_image *image = tex_obj->Image[0][0]; struct isl_surf surf; + /* Only color formats are supported. */ + if (!_mesa_is_format_color_format(image->TexFormat)) + return GL_FALSE; + isl_tiling_flags_t tiling_flags = ISL_TILING_ANY_MASK; if (tex_obj->TextureTiling == GL_LINEAR_TILING_EXT) tiling_flags = ISL_TILING_LINEAR_BIT;