summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_surface.c7
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c16
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c3
3 files changed, 16 insertions, 10 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_surface.c b/src/gallium/drivers/softpipe/sp_state_surface.c
index bc0e201130..a518248bb1 100644
--- a/src/gallium/drivers/softpipe/sp_state_surface.c
+++ b/src/gallium/drivers/softpipe/sp_state_surface.c
@@ -35,6 +35,8 @@
#include "draw/draw_context.h"
+#include "util/u_format.h"
+
/**
* XXX this might get moved someday
@@ -80,8 +82,9 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
if (sp->framebuffer.zsbuf) {
int depth_bits;
double mrd;
- depth_bits = pf_get_component_bits(sp->framebuffer.zsbuf->format,
- PIPE_FORMAT_COMP_Z);
+ depth_bits = util_format_get_component_bits(sp->framebuffer.zsbuf->format,
+ UTIL_FORMAT_COLORSPACE_ZS,
+ 0);
if (depth_bits > 16) {
mrd = 0.0000001;
}
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 4f946ccfcf..a9436a3394 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -32,6 +32,8 @@
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
+
+#include "util/u_format.h"
#include "util/u_math.h"
#include "util/u_memory.h"
@@ -63,11 +65,11 @@ softpipe_texture_layout(struct pipe_screen *screen,
pt->depth0 = depth;
for (level = 0; level <= pt->last_level; level++) {
- spt->stride[level] = pf_get_stride(pt->format, width);
+ spt->stride[level] = util_format_get_stride(pt->format, width);
spt->level_offset[level] = buffer_size;
- buffer_size += (pf_get_nblocksy(pt->format, height) *
+ buffer_size += (util_format_get_nblocksy(pt->format, height) *
((pt->target == PIPE_TEXTURE_CUBE) ? 6 : depth) *
spt->stride[level]);
@@ -237,11 +239,11 @@ softpipe_get_tex_surface(struct pipe_screen *screen,
ps->zslice = zslice;
if (pt->target == PIPE_TEXTURE_CUBE) {
- ps->offset += face * pf_get_nblocksy(pt->format, u_minify(pt->height0, level)) *
+ ps->offset += face * util_format_get_nblocksy(pt->format, u_minify(pt->height0, level)) *
spt->stride[level];
}
else if (pt->target == PIPE_TEXTURE_3D) {
- ps->offset += zslice * pf_get_nblocksy(pt->format, u_minify(pt->height0, level)) *
+ ps->offset += zslice * util_format_get_nblocksy(pt->format, u_minify(pt->height0, level)) *
spt->stride[level];
}
else {
@@ -297,7 +299,7 @@ softpipe_get_tex_transfer(struct pipe_screen *screen,
spt = CALLOC_STRUCT(softpipe_transfer);
if (spt) {
struct pipe_transfer *pt = &spt->base;
- int nblocksy = pf_get_nblocksy(texture->format, u_minify(texture->height0, level));
+ int nblocksy = util_format_get_nblocksy(texture->format, u_minify(texture->height0, level));
pipe_texture_reference(&pt->texture, texture);
pt->x = x;
pt->y = y;
@@ -374,8 +376,8 @@ softpipe_transfer_map( struct pipe_screen *screen,
}
xfer_map = map + softpipe_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;
}
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 04f61d16c4..112a6fe0cf 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -33,6 +33,7 @@
*/
#include "pipe/p_inlines.h"
+#include "util/u_format.h"
#include "util/u_memory.h"
#include "util/u_tile.h"
#include "sp_tile_cache.h"
@@ -238,7 +239,7 @@ clear_tile(struct softpipe_cached_tile *tile,
{
uint i, j;
- switch (pf_get_blocksize(format)) {
+ switch (util_format_get_blocksize(format)) {
case 1:
memset(tile->data.any, clear_value, TILE_SIZE * TILE_SIZE);
break;