llvmpipe: don't support scaled formats outside vertex buffers
authorDave Airlie <airlied@redhat.com>
Mon, 8 Feb 2021 00:24:25 +0000 (10:24 +1000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 16 Feb 2021 05:31:11 +0000 (05:31 +0000)
Scaled formats are usually only needed as vertex buffer formats,
don't expose them as supported for other things.

Lavapipe will use this to export the correct formats support.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8907>

src/gallium/drivers/llvmpipe/lp_screen.c

index b2672c583672bd9fe552f9123b3485c39ae4baeb..ce487b75b61e791f2e283fb56134d55c16312c00 100644 (file)
@@ -678,6 +678,10 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
       }
    }
 
+   if (!(bind & PIPE_BIND_VERTEX_BUFFER) &&
+       util_format_is_scaled(format))
+      return false;
+
    if (bind & PIPE_BIND_DISPLAY_TARGET) {
       if(!winsys->is_displaytarget_format_supported(winsys, bind, format))
          return false;