virgl: Enable CAP_CLEAR_TEXTURE if host supports it
authorElie Tournier <tournier.elie@gmail.com>
Fri, 13 Mar 2020 11:26:04 +0000 (11:26 +0000)
committerMarge Bot <eric+marge@anholt.net>
Thu, 7 May 2020 10:21:50 +0000 (10:21 +0000)
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4345>

src/gallium/drivers/virgl/virgl_hw.h
src/gallium/drivers/virgl/virgl_screen.c

index b2bed9165eff65420f30ae2932e5f6b7c7d89b4f..ffa22eafb52fd9b17842734a88b1c43c09859e18 100644 (file)
@@ -336,6 +336,7 @@ enum virgl_formats {
 #define VIRGL_CAP_CLIP_HALFZ           (1 << 27)
 #define VIRGL_CAP_APP_TWEAK_SUPPORT    (1 << 28)
 #define VIRGL_CAP_BGRA_SRGB_IS_EMULATED (1 << 29)
+#define VIRGL_CAP_CLEAR_TEXTURE        (1 << 30)
 
 /* virgl bind flags - these are compatible with mesa 10.5 gallium.
  * but are fixed, no other should be passed to virgl either.
index 235d4280104e6a04e594750bb8cd55d851977398..6ce08b764ece0b6791074359ac5e7542a754b7cd 100644 (file)
@@ -298,7 +298,6 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_DEPTH_BOUNDS_TEST:
    case PIPE_CAP_SHAREABLE_SHADERS:
-   case PIPE_CAP_CLEAR_TEXTURE:
    case PIPE_CAP_DRAW_PARAMETERS:
    case PIPE_CAP_TGSI_PACK_HALF_FLOAT:
    case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
@@ -352,6 +351,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS:
    case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
       return 0;
+   case PIPE_CAP_CLEAR_TEXTURE:
+      return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_CLEAR_TEXTURE;
    case PIPE_CAP_CLIP_HALFZ:
       return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_CLIP_HALFZ;
    case PIPE_CAP_MAX_GS_INVOCATIONS: