asahi: Forbid linear 1D Array images
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 3 Sep 2023 19:22:22 +0000 (15:22 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 5 Sep 2023 18:50:34 +0000 (18:50 +0000)
Porbably a theoretical case, but these fall down the 2D path so better not allow
it at any rate.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>

src/gallium/drivers/asahi/agx_pipe.c

index 84e7b87..95f3b71 100644 (file)
@@ -379,17 +379,20 @@ agx_linear_allowed(const struct agx_resource *pres)
       return false;
 
    switch (pres->base.target) {
-   /* 1D is always linear, even with image atomics */
+   /* Buffers are always linear, even with image atomics */
    case PIPE_BUFFER:
-   case PIPE_TEXTURE_1D:
-   case PIPE_TEXTURE_1D_ARRAY:
 
    /* Linear textures require specifying their strides explicitly, which only
     * works for 2D textures. Rectangle textures are a special case of 2D.
     *
+    * 1D textures only exist in GLES and are lowered to 2D to bypass hardware
+    * limitations.
+    *
     * However, we don't want to support this case in the image atomic
     * implementation, so linear shader images are specially forbidden.
     */
+   case PIPE_TEXTURE_1D:
+   case PIPE_TEXTURE_1D_ARRAY:
    case PIPE_TEXTURE_2D:
    case PIPE_TEXTURE_2D_ARRAY:
    case PIPE_TEXTURE_RECT: