asahi: Mark PIPE_FORMAT_NONE "supported"
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sat, 4 Mar 2023 16:36:41 +0000 (11:36 -0500)
committerMarge Bot <emma+marge@anholt.net>
Sun, 5 Mar 2023 08:20:09 +0000 (08:20 +0000)
Kinda silly but fixes
dEQP-GLES31.functional.state_query.integer.max_framebuffer_samples_* which
queries the number of samples of a NONE format, required for
ARB_framebuffer_no_attachments to make sense.

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

src/gallium/drivers/asahi/agx_pipe.c

index 1643ec0..e6ef797 100644 (file)
@@ -1620,6 +1620,13 @@ agx_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format,
    if (MAX2(sample_count, 1) != MAX2(storage_sample_count, 1))
       return false;
 
+   if ((usage & PIPE_BIND_VERTEX_BUFFER) && !agx_vbo_supports_format(format))
+      return false;
+
+   /* For framebuffer_no_attachments, fake support for "none" images */
+   if (format == PIPE_FORMAT_NONE)
+      return true;
+
    if (usage & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW)) {
       enum pipe_format tex_format = format;
 
@@ -1639,9 +1646,6 @@ agx_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format,
          return false;
    }
 
-   if ((usage & PIPE_BIND_VERTEX_BUFFER) && !agx_vbo_supports_format(format))
-      return false;
-
    if (usage & PIPE_BIND_DEPTH_STENCIL) {
       switch (format) {
       /* natively supported