Mesa (staging/22.0): intel/isl: fix 2d view of 3d textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 16:31:24 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 18c0425a8ea8dfa0a0a4385dd2c509b10bb3aaa4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=18c0425a8ea8dfa0a0a4385dd2c509b10bb3aaa4

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Mar 25 15:19:20 2022 -0400

intel/isl: fix 2d view of 3d textures

according to KHR_gl_texture_3D_image:

    If <target> is EGL_GL_TEXTURE_3D_KHR, <buffer> must be the name of a
    complete, nonzero, GL_TEXTURE_3D (or equivalent in GL extensions) target
    texture object, cast
    into the type EGLClientBuffer.  <attr_list> should specify the mipmap
    level (EGL_GL_TEXTURE_LEVEL_KHR) and z-offset (EGL_GL_TEXTURE_ZOFFSET_KHR)
    which will be used as the EGLImage source; the specified mipmap level must
    be part of <buffer>, and the specified z-offset must be smaller than the
    depth of the specified mipmap level.

thus a 2d view of a 3d surface is not only legal, it's part of the spec and
must be supported when available

cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15584>
(cherry picked from commit 65ec846f777a8a112510d9d7a2da2f225880a0e6)

---

 .pick_status.json                 |  2 +-
 src/intel/isl/isl_surface_state.c | 15 ++++++---------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 8e20e5397fc..c93bfdd1218 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -7060,7 +7060,7 @@
         "description": "intel/isl: fix 2d view of 3d textures",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 5,
+        "resolution": 1,
         "because_sha": null
     },
     {
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index 98603d782c8..17a4341c04e 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -330,16 +330,13 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
        * assert-failures in the packing function below, we only set the field
        * when it's actually going to be used by the hardware.
        *
-       * Similaraly, the MinimumArrayElement field is ignored by all hardware
-       * prior to Sky Lake when texturing and we want it set to 0 anyway.
-       * Since it's already initialized to 0, we can just leave it alone for
-       * texture surfaces.
+       * The MinimumArrayElement field is ignored by all hardware
+       * prior to Sky Lake when texturing, and drivers are responsible
+       * for validating the correctness of this parameter.
+       * KHR_gl_texture_3D_image requires this functionality.
        */
-      if (info->view->usage & (ISL_SURF_USAGE_RENDER_TARGET_BIT |
-                               ISL_SURF_USAGE_STORAGE_BIT)) {
-         s.MinimumArrayElement = info->view->base_array_layer;
-         s.RenderTargetViewExtent = info->view->array_len - 1;
-      }
+      s.MinimumArrayElement = info->view->base_array_layer;
+      s.RenderTargetViewExtent = info->view->array_len - 1;
       break;
    default:
       unreachable("bad SurfaceType");



More information about the mesa-commit mailing list