diff options
author | Brian <[email protected]> | 2007-08-10 12:13:48 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-08-10 12:14:25 -0600 |
commit | 9ac1a8d416c2bd50ca10186ca09f5e86f6fa4ce6 (patch) | |
tree | 39ac2f23794da71ec1aaf4e1629bdd889baf1b91 /src/mesa/pipe/i915simple | |
parent | 519aacef031e3271e16693308ca462346a8a160c (diff) |
pipe->region_alloc() now takes width instead of pitch, plus a flags param
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_regions.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/pipe/i915simple/i915_regions.c b/src/mesa/pipe/i915simple/i915_regions.c index e2b807f959a..b3bcae547d1 100644 --- a/src/mesa/pipe/i915simple/i915_regions.c +++ b/src/mesa/pipe/i915simple/i915_regions.c @@ -31,6 +31,7 @@ * - refcounting of buffer mappings. */ +#include "pipe/p_defines.h" #include "i915_context.h" #include "i915_winsys.h" #include "i915_blit.h" @@ -70,7 +71,7 @@ i915_region_unmap(struct pipe_context *pipe, struct pipe_region *region) static struct pipe_region * i915_region_alloc(struct pipe_context *pipe, - GLuint cpp, GLuint width, GLuint height) + GLuint cpp, GLuint width, GLuint height, GLbitfield flags) { struct i915_context *i915 = i915_context( pipe ); struct pipe_region *region = calloc(sizeof(*region), 1); @@ -82,7 +83,13 @@ i915_region_alloc(struct pipe_context *pipe, * clearly want to be able to render to textures under some * circumstances, but maybe not always a requirement. */ - unsigned pitch = ((cpp * width + 63) & ~63) / cpp; + unsigned pitch; + + /* XXX is the pitch different for textures vs. drawables? */ + if (flags & PIPE_SURFACE_FLAG_TEXTURE) /* or PIPE_SURFACE_FLAG_RENDER? */ + pitch = ((cpp * width + 63) & ~63) / cpp; + else + pitch = ((cpp * width + 63) & ~63) / cpp; region->cpp = cpp; region->pitch = pitch; |