projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
76a1017
)
gallium: Shorthand functions for computing stride and sizes for a rect.
author
José Fonseca
<jfonseca@vmware.com>
Wed, 10 Jun 2009 14:31:12 +0000
(15:31 +0100)
committer
José Fonseca
<jfonseca@vmware.com>
Wed, 10 Jun 2009 14:31:12 +0000
(15:31 +0100)
src/gallium/include/pipe/p_format.h
patch
|
blob
|
history
diff --git
a/src/gallium/include/pipe/p_format.h
b/src/gallium/include/pipe/p_format.h
index a279eefef9ec1f71e93423744f93d348d121e45c..187377f92ae8272fc250c77f0b2893371abe06c4 100644
(file)
--- a/
src/gallium/include/pipe/p_format.h
+++ b/
src/gallium/include/pipe/p_format.h
@@
-536,6
+536,18
@@
pf_get_nblocks(const struct pipe_format_block *block, unsigned width, unsigned h
return pf_get_nblocksx(block, width)*pf_get_nblocksy(block, height);
}
+static INLINE size_t
+pf_get_stride(const struct pipe_format_block *block, unsigned width)
+{
+ return pf_get_nblocksx(block, width)*block->size;
+}
+
+static INLINE size_t
+pf_get_2d_size(const struct pipe_format_block *block, size_t stride, unsigned height)
+{
+ return pf_get_nblocksy(block, height)*stride;
+}
+
static INLINE boolean
pf_is_depth_stencil( enum pipe_format format )
{