summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/identity/id_objects.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-05-04 15:58:29 +0200
committerRoland Scheidegger <[email protected]>2010-05-04 15:58:29 +0200
commit0ae2f59c0287f4baec6c7de5f2f0fdf736fba26d (patch)
treeee14bf3e8bba80649541c4e13fc07c60baf6c248 /src/gallium/drivers/identity/id_objects.c
parent7662e3519bef3802024da3050b886068281e02b1 (diff)
parent1c920c61764b17fd9fb4a89d2db7355fbe1d7565 (diff)
Merge commit 'origin/master' into gallium-msaa
Diffstat (limited to 'src/gallium/drivers/identity/id_objects.c')
-rw-r--r--src/gallium/drivers/identity/id_objects.c42
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 d50914e7d5d..ca4743f9ef7 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);
}