summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_resource.h
diff options
context:
space:
mode:
authorGeorge Kyriazis <george.kyriazis@intel.com>2016-03-14 17:40:14 -0500
committerTim Rowley <timothy.o.rowley@intel.com>2016-03-17 20:57:52 -0500
commitdd63fa28f14f8ddeeeca1847eb7d38f4e2bc2234 (patch)
tree2ebbbcaaa584cb02cb0456a04ba0178da3973191 /src/gallium/drivers/swr/swr_resource.h
parent952c166170aaf44af10e7463359e7a3e5e6fe65d (diff)
downloadexternal_mesa3d-dd63fa28f14f8ddeeeca1847eb7d38f4e2bc2234.zip
external_mesa3d-dd63fa28f14f8ddeeeca1847eb7d38f4e2bc2234.tar.gz
external_mesa3d-dd63fa28f14f8ddeeeca1847eb7d38f4e2bc2234.tar.bz2
gallium/swr: Cleaned up some context-resource management
Removed bound_to_context. We now pick up the context from the screen instead of the resource itself. The resource could be out-of-date and point to a pipe that is already freed. Fixes manywin mesa xdemo. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
Diffstat (limited to 'src/gallium/drivers/swr/swr_resource.h')
-rw-r--r--src/gallium/drivers/swr/swr_resource.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/gallium/drivers/swr/swr_resource.h b/src/gallium/drivers/swr/swr_resource.h
index 2fdc768..59cf028 100644
--- a/src/gallium/drivers/swr/swr_resource.h
+++ b/src/gallium/drivers/swr/swr_resource.h
@@ -54,9 +54,6 @@ struct swr_resource {
unsigned mip_offsets[PIPE_MAX_TEXTURE_LEVELS];
enum swr_resource_status status;
-
- /* pipe_context to which resource is currently bound. */
- struct pipe_context *bound_to_context;
};
@@ -120,24 +117,21 @@ swr_resource_status & operator|=(enum swr_resource_status & a,
}
static INLINE void
-swr_resource_read(struct pipe_context *pipe, struct swr_resource *resource)
+swr_resource_read(struct pipe_resource *resource)
{
- resource->status |= SWR_RESOURCE_READ;
- resource->bound_to_context = pipe;
+ swr_resource(resource)->status |= SWR_RESOURCE_READ;
}
static INLINE void
-swr_resource_write(struct pipe_context *pipe, struct swr_resource *resource)
+swr_resource_write(struct pipe_resource *resource)
{
- resource->status |= SWR_RESOURCE_WRITE;
- resource->bound_to_context = pipe;
+ swr_resource(resource)->status |= SWR_RESOURCE_WRITE;
}
static INLINE void
-swr_resource_unused(struct pipe_context *pipe, struct swr_resource *resource)
+swr_resource_unused(struct pipe_resource *resource)
{
- resource->status = SWR_RESOURCE_UNUSED;
- resource->bound_to_context = nullptr;
+ swr_resource(resource)->status = SWR_RESOURCE_UNUSED;
}
#endif