diff options
author | Gert Wollny <[email protected]> | 2018-11-13 11:39:06 +0100 |
---|---|---|
committer | Gert Wollny <[email protected]> | 2019-01-28 12:18:40 +0100 |
commit | 2845939d6a720454f983e2e9a591735bd0fede9e (patch) | |
tree | 5e345326a1cf70f1783e6c1b00eb48f35f456927 /src/gallium/drivers/virgl/virgl_context.c | |
parent | 8021f1875e2d830e67aadbf2d44ddfb6f5dd2b13 (diff) |
virgl: Set sRGB write control CAP based on host capabilities
v2: - Use the renamed CAPS
- add assetions to make sure that mesa doesn't try to switch
destination surface formats when it is not supported. (Ilia Mirkin)
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_context.c')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_context.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c index 6ed4e2f8394..08f85f8574a 100644 --- a/src/gallium/drivers/virgl/virgl_context.c +++ b/src/gallium/drivers/virgl/virgl_context.c @@ -229,6 +229,11 @@ static struct pipe_surface *virgl_create_surface(struct pipe_context *ctx, if (!surf) return NULL; + assert(ctx->screen->get_param(ctx->screen, + PIPE_CAP_DEST_SURFACE_SRGB_CONTROL) || + (util_format_is_srgb(templ->format) == + util_format_is_srgb(resource->format))); + res->clean = FALSE; handle = virgl_object_assign_handle(); pipe_reference_init(&surf->base.reference, 1); @@ -990,6 +995,11 @@ static void virgl_blit(struct pipe_context *ctx, struct virgl_resource *dres = virgl_resource(blit->dst.resource); struct virgl_resource *sres = virgl_resource(blit->src.resource); + assert(ctx->screen->get_param(ctx->screen, + PIPE_CAP_DEST_SURFACE_SRGB_CONTROL) || + (util_format_is_srgb(blit->dst.resource->format) == + util_format_is_srgb(blit->dst.format))); + dres->clean = FALSE; virgl_encode_blit(vctx, dres, sres, blit); |