From 8f2656c75b8e91a8e90755280845d0e278a62ab4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 13 Feb 2018 14:08:14 +1000 Subject: [PATCH] virgl: add ARB_sample_shading support. This enable ARB_sample_shading if the renderer supports it. Signed-off-by: Dave Airlie --- src/gallium/drivers/virgl/virgl_encode.c | 3 ++- src/gallium/drivers/virgl/virgl_protocol.h | 1 + src/gallium/drivers/virgl/virgl_screen.c | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/virgl/virgl_encode.c b/src/gallium/drivers/virgl/virgl_encode.c index 2ee8eac771c..80e60bc284a 100644 --- a/src/gallium/drivers/virgl/virgl_encode.c +++ b/src/gallium/drivers/virgl/virgl_encode.c @@ -180,7 +180,8 @@ int virgl_encode_rasterizer_state(struct virgl_context *ctx, VIRGL_OBJ_RS_S0_LINE_STIPPLE_ENABLE(state->line_stipple_enable) | VIRGL_OBJ_RS_S0_LINE_LAST_PIXEL(state->line_last_pixel) | VIRGL_OBJ_RS_S0_HALF_PIXEL_CENTER(state->half_pixel_center) | - VIRGL_OBJ_RS_S0_BOTTOM_EDGE_RULE(state->bottom_edge_rule); + VIRGL_OBJ_RS_S0_BOTTOM_EDGE_RULE(state->bottom_edge_rule) | + VIRGL_OBJ_RS_S0_FORCE_PERSAMPLE_INTERP(state->force_persample_interp); virgl_encoder_write_dword(ctx->cbuf, tmp); /* S0 */ virgl_encoder_write_dword(ctx->cbuf, fui(state->point_size)); /* S1 */ diff --git a/src/gallium/drivers/virgl/virgl_protocol.h b/src/gallium/drivers/virgl/virgl_protocol.h index 1430422b9cf..7688ac5e8e1 100644 --- a/src/gallium/drivers/virgl/virgl_protocol.h +++ b/src/gallium/drivers/virgl/virgl_protocol.h @@ -181,6 +181,7 @@ enum virgl_context_cmd { #define VIRGL_OBJ_RS_S0_LINE_LAST_PIXEL(x) (((x) & 0x1) << 28) #define VIRGL_OBJ_RS_S0_HALF_PIXEL_CENTER(x) (((x) & 0x1) << 29) #define VIRGL_OBJ_RS_S0_BOTTOM_EDGE_RULE(x) (((x) & 0x1) << 30) +#define VIRGL_OBJ_RS_S0_FORCE_PERSAMPLE_INTERP(x) (((x) & 0x1) << 31) #define VIRGL_OBJ_RS_POINT_SIZE 3 #define VIRGL_OBJ_RS_SPRITE_COORD_ENABLE 4 diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index 2af621ec2dc..f4f3195ce3f 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -193,9 +193,11 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param) return vscreen->caps.caps.v1.max_texture_gather_components; case PIPE_CAP_DRAW_INDIRECT: return vscreen->caps.caps.v1.bset.has_indirect_draw; + case PIPE_CAP_SAMPLE_SHADING: + case PIPE_CAP_FORCE_PERSAMPLE_INTERP: + return vscreen->caps.caps.v1.bset.has_sample_shading; case PIPE_CAP_TEXTURE_GATHER_SM5: case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT: - case PIPE_CAP_SAMPLE_SHADING: case PIPE_CAP_FAKE_SW_MSAA: case PIPE_CAP_TEXTURE_GATHER_OFFSETS: case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION: @@ -217,7 +219,6 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR: case PIPE_CAP_DEPTH_BOUNDS_TEST: case PIPE_CAP_TGSI_TXQS: - case PIPE_CAP_FORCE_PERSAMPLE_INTERP: case PIPE_CAP_SHAREABLE_SHADERS: case PIPE_CAP_CLEAR_TEXTURE: case PIPE_CAP_DRAW_PARAMETERS: -- 2.30.2