diff options
author | marha <marha@users.sourceforge.net> | 2012-12-05 09:14:52 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-12-05 09:14:52 +0100 |
commit | e82692e521240c5f8592f9ce56c9d5b3d68870ec (patch) | |
tree | 3293b7fa02b1f5aa58b74f1fe02444085be2281e /mesalib/src/gallium/auxiliary/util/u_surface.c | |
parent | b8da71ffb17d3d16706db04115e9ba1dd8bc49b9 (diff) | |
download | vcxsrv-e82692e521240c5f8592f9ce56c9d5b3d68870ec.tar.gz vcxsrv-e82692e521240c5f8592f9ce56c9d5b3d68870ec.tar.bz2 vcxsrv-e82692e521240c5f8592f9ce56c9d5b3d68870ec.zip |
mesa git update 5 dec 2012
mesa: 484a8dcfa8c8b91b8e99174b5e4953264f32789e
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_surface.c')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_surface.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_surface.c b/mesalib/src/gallium/auxiliary/util/u_surface.c index e99431ef8..5b42afd0d 100644 --- a/mesalib/src/gallium/auxiliary/util/u_surface.c +++ b/mesalib/src/gallium/auxiliary/util/u_surface.c @@ -266,13 +266,14 @@ util_clear_depth_stencil(struct pipe_context *pipe, unsigned dstx, unsigned dsty, unsigned width, unsigned height) { + enum pipe_format format = dst->format; struct pipe_transfer *dst_trans; ubyte *dst_map; boolean need_rmw = FALSE; if ((clear_flags & PIPE_CLEAR_DEPTHSTENCIL) && ((clear_flags & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL) && - util_format_is_depth_and_stencil(dst->format)) + util_format_is_depth_and_stencil(format)) need_rmw = TRUE; assert(dst->texture); @@ -289,14 +290,14 @@ util_clear_depth_stencil(struct pipe_context *pipe, if (dst_map) { unsigned dst_stride = dst_trans->stride; - uint64_t zstencil = util_pack64_z_stencil(dst->texture->format, + uint64_t zstencil = util_pack64_z_stencil(format, depth, stencil); unsigned i, j; assert(dst_trans->stride > 0); - switch (util_format_get_blocksize(dst->format)) { + switch (util_format_get_blocksize(format)) { case 1: - assert(dst->format == PIPE_FORMAT_S8_UINT); + assert(format == PIPE_FORMAT_S8_UINT); if(dst_stride == width) memset(dst_map, (uint8_t) zstencil, height * width); else { @@ -307,7 +308,7 @@ util_clear_depth_stencil(struct pipe_context *pipe, } break; case 2: - assert(dst->format == PIPE_FORMAT_Z16_UNORM); + assert(format == PIPE_FORMAT_Z16_UNORM); for (i = 0; i < height; i++) { uint16_t *row = (uint16_t *)dst_map; for (j = 0; j < width; j++) @@ -326,10 +327,10 @@ util_clear_depth_stencil(struct pipe_context *pipe, } else { uint32_t dst_mask; - if (dst->format == PIPE_FORMAT_Z24_UNORM_S8_UINT) + if (format == PIPE_FORMAT_Z24_UNORM_S8_UINT) dst_mask = 0xffffff00; else { - assert(dst->format == PIPE_FORMAT_S8_UINT_Z24_UNORM); + assert(format == PIPE_FORMAT_S8_UINT_Z24_UNORM); dst_mask = 0xffffff; } if (clear_flags & PIPE_CLEAR_DEPTH) |