summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_texture.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-07-25 09:27:09 -0600
committerBrian Paul <[email protected]>2013-07-31 06:53:48 -0600
commit365f38f3dfef292c4917e10cdf3011f22f37dc51 (patch)
tree770ab210297c6784f6db015893da20c1ae5506e3 /src/gallium/drivers/softpipe/sp_texture.h
parent99c42d11a245d6709b33353c2d88e2640f6d101e (diff)
softpipe: use new softpipe_resource_data() accessor
We should probably be using map()/unmap() when accessing resource data, but this is a little better. v2: assert that the resource is not a display target, per Jose. Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_texture.h')
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h
index 533d6252e25..96609f43489 100644
--- a/src/gallium/drivers/softpipe/sp_texture.h
+++ b/src/gallium/drivers/softpipe/sp_texture.h
@@ -93,6 +93,22 @@ softpipe_transfer(struct pipe_transfer *pt)
}
+/**
+ * Return pointer to a resource's actual data.
+ * This is a short-cut instead of using map()/unmap(), which should
+ * probably be fixed.
+ */
+static INLINE void *
+softpipe_resource_data(struct pipe_resource *pt)
+{
+ if (!pt)
+ return NULL;
+
+ assert(softpipe_resource(pt)->dt == NULL);
+ return softpipe_resource(pt)->data;
+}
+
+
extern void
softpipe_init_screen_texture_funcs(struct pipe_screen *screen);