From 2e6bbab9aecd8e6cfb6e2e8dd408460a96365ada Mon Sep 17 00:00:00 2001 From: Elie Tournier Date: Fri, 13 Mar 2020 11:26:04 +0000 Subject: [PATCH] virgl: Enable CAP_CLEAR_TEXTURE if host supports it Signed-off-by: Elie Tournier Reviewed-by: Gert Wollny Part-of: --- src/gallium/drivers/virgl/virgl_hw.h | 1 + src/gallium/drivers/virgl/virgl_screen.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/virgl/virgl_hw.h b/src/gallium/drivers/virgl/virgl_hw.h index b2bed9165ef..ffa22eafb52 100644 --- a/src/gallium/drivers/virgl/virgl_hw.h +++ b/src/gallium/drivers/virgl/virgl_hw.h @@ -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. diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index 235d4280104..6ce08b764ec 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -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: -- 2.30.2