summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2009-12-17 23:41:57 +0100
committerMichal Krol <michal@vmware.com>2009-12-17 23:41:57 +0100
commitb1ed72ebe2599ec178f51d86fd42f26486b9a19b (patch)
treeb49428bb48d81bf1396ef14ee8a0a462f89d2d8e /src/gallium/drivers/llvmpipe
parentec5577a83da18890a4f334af2241aca41b6ed31b (diff)
Move the remaining format pf_get_* functions to u_format.h.
Previously they depended on format blocks, but after removing those they started depending on format encoding.
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c3
-rw-r--r--src/gallium/drivers/llvmpipe/lp_texture.c18
2 files changed, 11 insertions, 10 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index b4aabd4d7c..b18f17c0cd 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -41,6 +41,7 @@
#include "draw/draw_vertex.h"
#include "pipe/p_shader_tokens.h"
#include "pipe/p_thread.h"
+#include "util/u_format.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "lp_bld_debug.h"
@@ -166,7 +167,7 @@ shade_quads(struct llvmpipe_context *llvmpipe,
assert((y % 2) == 0);
depth = llvmpipe->zsbuf_map +
y*llvmpipe->zsbuf_transfer->stride +
- 2*x*pf_get_blocksize(llvmpipe->zsbuf_transfer->texture->format);
+ 2*x*util_format_get_blocksize(llvmpipe->zsbuf_transfer->texture->format);
}
else
depth = NULL;
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index 9e41bc4074..2c135029ea 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -69,10 +69,10 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen,
/* Allocate storage for whole quads. This is particularly important
* for depth surfaces, which are currently stored in a swizzled format. */
- nblocksx = pf_get_nblocksx(pt->format, align(width, 2));
- nblocksy = pf_get_nblocksy(pt->format, align(height, 2));
+ nblocksx = util_format_get_nblocksx(pt->format, align(width, 2));
+ nblocksy = util_format_get_nblocksy(pt->format, align(height, 2));
- lpt->stride[level] = align(nblocksx * pf_get_blocksize(pt->format), 16);
+ lpt->stride[level] = align(nblocksx * util_format_get_blocksize(pt->format), 16);
lpt->level_offset[level] = buffer_size;
@@ -251,11 +251,11 @@ llvmpipe_get_tex_surface(struct pipe_screen *screen,
*/
if (pt->target == PIPE_TEXTURE_CUBE) {
unsigned tex_height = ps->height;
- ps->offset += face * pf_get_nblocksy(pt->format, tex_height) * lpt->stride[level];
+ ps->offset += face * util_format_get_nblocksy(pt->format, tex_height) * lpt->stride[level];
}
else if (pt->target == PIPE_TEXTURE_3D) {
unsigned tex_height = ps->height;
- ps->offset += zslice * pf_get_nblocksy(pt->format, tex_height) * lpt->stride[level];
+ ps->offset += zslice * util_format_get_nblocksy(pt->format, tex_height) * lpt->stride[level];
}
else {
assert(face == 0);
@@ -314,11 +314,11 @@ llvmpipe_get_tex_transfer(struct pipe_screen *screen,
*/
if (texture->target == PIPE_TEXTURE_CUBE) {
unsigned tex_height = u_minify(texture->height0, level);
- lpt->offset += face * pf_get_nblocksy(texture->format, tex_height) * pt->stride;
+ lpt->offset += face * util_format_get_nblocksy(texture->format, tex_height) * pt->stride;
}
else if (texture->target == PIPE_TEXTURE_3D) {
unsigned tex_height = u_minify(texture->height0, level);
- lpt->offset += zslice * pf_get_nblocksy(texture->format, tex_height) * pt->stride;
+ lpt->offset += zslice * util_format_get_nblocksy(texture->format, tex_height) * pt->stride;
}
else {
assert(face == 0);
@@ -379,8 +379,8 @@ llvmpipe_transfer_map( struct pipe_screen *_screen,
}
xfer_map = map + llvmpipe_transfer(transfer)->offset +
- transfer->y / pf_get_blockheight(format) * transfer->stride +
- transfer->x / pf_get_blockwidth(format) * pf_get_blocksize(format);
+ transfer->y / util_format_get_blockheight(format) * transfer->stride +
+ transfer->x / util_format_get_blockwidth(format) * util_format_get_blocksize(format);
/*printf("map = %p xfer map = %p\n", map, xfer_map);*/
return xfer_map;
}