diff options
author | Jakob Bornecrantz <[email protected]> | 2010-05-01 12:38:25 +0100 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2010-05-03 00:27:38 +0100 |
commit | c2c1f60391113490f4f90efb2786544c599ac991 (patch) | |
tree | 31b29bdffc12abd9ea8f3c776f03e8f8ae418e26 /src/gallium/drivers/identity/id_objects.c | |
parent | 59b160d286e5848851848e09c87eb64cd2631c6b (diff) |
identity: Move sampler view create and destroy to id_objects.c
Diffstat (limited to 'src/gallium/drivers/identity/id_objects.c')
-rw-r--r-- | src/gallium/drivers/identity/id_objects.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/gallium/drivers/identity/id_objects.c b/src/gallium/drivers/identity/id_objects.c index 5070c0475d3..ca4743f9ef7 100644 --- a/src/gallium/drivers/identity/id_objects.c +++ b/src/gallium/drivers/identity/id_objects.c @@ -108,6 +108,42 @@ 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, @@ -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); } |