summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/python/st_softpipe_winsys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/python/st_softpipe_winsys.c')
-rw-r--r--src/gallium/state_trackers/python/st_softpipe_winsys.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/gallium/state_trackers/python/st_softpipe_winsys.c b/src/gallium/state_trackers/python/st_softpipe_winsys.c
index f0abd12e3d..a3294e877a 100644
--- a/src/gallium/state_trackers/python/st_softpipe_winsys.c
+++ b/src/gallium/state_trackers/python/st_softpipe_winsys.c
@@ -40,6 +40,7 @@
#include "pipe/p_format.h"
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"
+#include "util/u_format.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "softpipe/sp_winsys.h"
@@ -157,16 +158,6 @@ st_softpipe_user_buffer_create(struct pipe_winsys *winsys,
}
-/**
- * Round n up to next multiple.
- */
-static INLINE unsigned
-round_up(unsigned n, unsigned multiple)
-{
- return (n + multiple - 1) & ~(multiple - 1);
-}
-
-
static struct pipe_buffer *
st_softpipe_surface_buffer_create(struct pipe_winsys *winsys,
unsigned width, unsigned height,
@@ -176,13 +167,10 @@ st_softpipe_surface_buffer_create(struct pipe_winsys *winsys,
unsigned *stride)
{
const unsigned alignment = 64;
- struct pipe_format_block block;
- unsigned nblocksx, nblocksy;
+ unsigned nblocksy;
- pf_get_block(format, &block);
- nblocksx = pf_get_nblocksx(&block, width);
- nblocksy = pf_get_nblocksy(&block, height);
- *stride = round_up(nblocksx * block.size, alignment);
+ nblocksy = util_format_get_nblocksy(format, height);
+ *stride = align(util_format_get_stride(format, width), alignment);
return winsys->buffer_create(winsys, alignment,
usage,