Module: Mesa
Branch: main
Commit: ba11f673a245a00d03c901d32ddc3489cb3ad287
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba11f673a245a00d03c901d32ddc3489cb3ad287

Author: Tapani Pälli <[email protected]>
Date:   Wed May  5 09:57:01 2021 +0300

i965: support only color formats with memory objects

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 <[email protected]>
Reviewed-by: Rohan Garg <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10646>

---

 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;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to