virgl: report MIRROR_CLAMP features better
authorGert Wollny <gert.wollny@collabora.com>
Sat, 4 Mar 2023 17:12:09 +0000 (18:12 +0100)
committerMarge Bot <emma+marge@anholt.net>
Mon, 25 Sep 2023 22:51:20 +0000 (22:51 +0000)
The new host version checks the support of these features better,
so report here accordingly. This fixes a number of texwrap piglit
tests on Intel.

v2: Stick to old test for PIPE_CAP_TEXTURE_MIRROR_CLAMP because
    host has to be backward compatible.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25343>

src/gallium/drivers/virgl/virgl_screen.c
src/virtio/virtio-gpu/virgl_hw.h

index ca19130..36580e7 100644 (file)
@@ -92,11 +92,13 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return vscreen->caps.caps.v1.max_dual_source_render_targets;
    case PIPE_CAP_OCCLUSION_QUERY:
       return vscreen->caps.caps.v1.bset.occlusion_query;
+   case PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE:
+      if (vscreen->caps.caps.v2.host_feature_check_version >= 20)
+         return vscreen->caps.caps.v2.capability_bits_v2 & VIRGL_CAP_V2_MIRROR_CLAMP_TO_EDGE;
+      FALLTHROUGH;
    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
       return vscreen->caps.caps.v1.bset.mirror_clamp &&
-      vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_HOST_IS_GLES ? 0 : 1;
-   case PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE:
-      return vscreen->caps.caps.v1.bset.mirror_clamp;
+             (vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_HOST_IS_GLES);
    case PIPE_CAP_TEXTURE_SWIZZLE:
       return 1;
    case PIPE_CAP_MAX_TEXTURE_2D_SIZE:
index b1d9cb2..e2340df 100644 (file)
@@ -585,6 +585,7 @@ enum virgl_formats {
 #define VIRGL_CAP_V2_PIPELINE_STATISTICS_QUERY (1 << 13)
 #define VIRGL_CAP_V2_DRAW_PARAMETERS      (1 << 14)
 #define VIRGL_CAP_V2_GROUP_VOTE           (1 << 15)
+#define VIRGL_CAP_V2_MIRROR_CLAMP_TO_EDGE (1 << 16)
 
 /* virgl bind flags - these are compatible with mesa 10.5 gallium.
  * but are fixed, no other should be passed to virgl either.