There are levels to cleanliness.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
* We'll end up flushing 25 --> 70.
*/
util_range_add(&trans->range, box->x, box->x + box->width);
- vbuf->clean = FALSE;
+ vbuf->clean[0] = FALSE;
}
static const struct u_resource_vtbl virgl_buffer_vtbl =
(util_format_is_srgb(templ->format) ==
util_format_is_srgb(resource->format)));
- res->clean = FALSE;
+ res->clean[0] = FALSE;
handle = virgl_object_assign_handle();
pipe_reference_init(&surf->base.reference, 1);
pipe_resource_reference(&surf->base.texture, resource);
struct virgl_screen *vs = virgl_screen(ctx->screen);
struct virgl_resource *grres = virgl_resource(res);
- grres->clean = FALSE;
+ grres->clean[0] = FALSE;
if (virgl_res_needs_flush_wait(vctx, grres, usage)) {
ctx->flush(ctx, NULL, 0);
struct virgl_resource *dres = virgl_resource(dst);
struct virgl_resource *sres = virgl_resource(src);
- dres->clean = FALSE;
+ dres->clean[0] = FALSE;
virgl_encode_resource_copy_region(vctx, dres,
dst_level, dstx, dsty, dstz,
sres, src_level,
(util_format_is_srgb(blit->dst.resource->format) ==
util_format_is_srgb(blit->dst.format)));
- dres->clean = FALSE;
+ dres->clean[0] = FALSE;
virgl_encode_blit(vctx, dres, sres,
blit);
}
static void virgl_dirty_res(struct virgl_resource *res)
{
if (res)
- res->clean = FALSE;
+ res->clean[0] = FALSE;
}
int virgl_encode_bind_object(struct virgl_context *ctx,
query->type = pipe_to_virgl_query(query_type);
query->index = index;
query->handle = handle;
- query->buf->clean = FALSE;
+ query->buf->clean[0] = FALSE;
virgl_encoder_create_query(vctx, handle, query->type, index, query->buf, 0);
return (struct pipe_query *)query;
struct virgl_context *vctx = virgl_context(ctx);
struct virgl_query *query = virgl_query(q);
- query->buf->clean = FALSE;
+ query->buf->clean[0] = FALSE;
virgl_encoder_begin_query(vctx, query->handle);
return true;
}
unsigned usage)
{
bool readback = true;
- if (res->clean)
+ if (res->clean[0])
readback = false;
else if (usage & PIPE_TRANSFER_DISCARD_RANGE)
readback = false;
struct virgl_screen *vs = virgl_screen(screen);
struct virgl_resource *res = CALLOC_STRUCT(virgl_resource);
- res->clean = TRUE;
res->u.b = *templ;
res->u.b.screen = &vs->base;
pipe_reference_init(&res->u.b.reference, 1);
return NULL;
}
+ for (uint32_t i = 0; i < VR_MAX_TEXTURE_2D_LEVELS; i++)
+ res->clean[i] = TRUE;
+
if (templ->target == PIPE_BUFFER)
virgl_buffer_init(res);
else
struct virgl_resource {
struct u_resource u;
- boolean clean;
+ boolean clean[VR_MAX_TEXTURE_2D_LEVELS];
struct virgl_hw_res *hw_res;
struct virgl_resource_metadata metadata;
};
t->base.buffer_offset = buffer_offset;
t->base.buffer_size = buffer_size;
t->handle = handle;
- res->clean = FALSE;
+ res->clean[0] = FALSE;
virgl_encoder_create_so_target(vctx, handle, res, buffer_offset, buffer_size);
return &t->base;
}
if (trans->base.usage & PIPE_TRANSFER_WRITE) {
if (!(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT)) {
struct virgl_screen *vs = virgl_screen(ctx->screen);
- vtex->clean = FALSE;
+ vtex->clean[0] = FALSE;
vctx->num_transfers++;
vs->vws->transfer_put(vs->vws, vtex->hw_res,
&transfer->box, trans->base.stride,