diff options
Diffstat (limited to 'src/gallium/drivers/identity/id_objects.c')
-rw-r--r-- | src/gallium/drivers/identity/id_objects.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/src/gallium/drivers/identity/id_objects.c b/src/gallium/drivers/identity/id_objects.c index d50914e7d5..ca4743f9ef 100644 --- a/src/gallium/drivers/identity/id_objects.c +++ b/src/gallium/drivers/identity/id_objects.c @@ -108,9 +108,45 @@ identity_surface_destroy(struct identity_surface *id_surface) } +struct pipe_sampler_view * +identity_sampler_view_create(struct identity_context *id_context, + struct identity_resource *id_resource, + struct pipe_sampler_view *view) +{ + struct identity_sampler_view *id_view; + + if (!view) + goto error; + + assert(view->texture == id_resource->resource); + + id_view = MALLOC(sizeof(struct identity_sampler_view)); + + id_view->base = *view; + id_view->base.reference.count = 1; + id_view->base.texture = NULL; + pipe_resource_reference(&id_view->base.texture, id_resource->resource); + id_view->base.context = id_context->pipe; + + return &id_view->base; +error: + return NULL; +} + +void +identity_sampler_view_destroy(struct identity_context *id_context, + struct identity_sampler_view *id_view) +{ + pipe_resource_reference(&id_view->base.texture, NULL); + id_context->pipe->sampler_view_destroy(id_context->pipe, + id_view->sampler_view); + FREE(id_view); +} + + struct pipe_transfer * identity_transfer_create(struct identity_context *id_context, - struct identity_resource *id_resource, + struct identity_resource *id_resource, struct pipe_transfer *transfer) { struct identity_transfer *id_transfer; @@ -144,8 +180,8 @@ identity_transfer_destroy(struct identity_context *id_context, struct identity_transfer *id_transfer) { pipe_resource_reference(&id_transfer->base.resource, NULL); - id_context->pipe->transfer_destroy(id_context->pipe, - id_transfer->transfer); + id_transfer->pipe->transfer_destroy(id_context->pipe, + id_transfer->transfer); FREE(id_transfer); } |