aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_blit.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-10-01 20:47:44 +0200
committermarha <marha@users.sourceforge.net>2014-10-01 20:47:44 +0200
commit30eb28e89e513ba7c04e8424be0cba326a01882b (patch)
treec84d1ffa742ebc6f077abb20a6b80c56ddaea888 /mesalib/src/gallium/auxiliary/util/u_blit.c
parent438af0c7d4bf60b408b259c88205ff2193195466 (diff)
downloadvcxsrv-30eb28e89e513ba7c04e8424be0cba326a01882b.tar.gz
vcxsrv-30eb28e89e513ba7c04e8424be0cba326a01882b.tar.bz2
vcxsrv-30eb28e89e513ba7c04e8424be0cba326a01882b.zip
libxtrans pixman fontconfig mesa xserver xkeyboard-config git update 1 Oct 2014
plink 10277 xserver commit d3d845ca9e92f0a2ccde93f4242d7769cfe14164 xkeyboard-config commit 73aa90ce32967747c84a1b5fe32cee329bc3bbcf pixman commit f078727f392bc9f235df916e75634ed87177b9b4 libxtrans commit 7cbad9fe2e61cd9d5caeaf361826a6f4bd320f03 fontconfig commit 1082161ea303cf2bbc13b62a191662984131e820 mesa commit 4f7916ab4f8093fa33519dfa3d08e73b4d35ebe3
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_blit.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blit.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_blit.c b/mesalib/src/gallium/auxiliary/util/u_blit.c
index f69b4b1ab..2573bedf5 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blit.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blit.c
@@ -336,10 +336,10 @@ formats_compatible(enum pipe_format src_format,
* Copy pixel block from src surface to dst surface.
* Overlapping regions are acceptable.
* Flipping and stretching are supported.
- * \param filter one of PIPE_TEX_MIPFILTER_NEAREST/LINEAR
- * \param writemask controls which channels in the dest surface are sourced
- * from the src surface. Disabled channels are sourced
- * from (0,0,0,1).
+ * \param filter one of PIPE_TEX_FILTER_NEAREST/LINEAR
+ * \param writemask bitmask of PIPE_MASK_[RGBAZS]. Controls which channels
+ * in the dest surface are sourced from the src surface.
+ * Disabled color channels are sourced from (0,0,0,1).
*/
void
util_blit_pixels(struct blit_state *ctx,
@@ -352,7 +352,7 @@ util_blit_pixels(struct blit_state *ctx,
int dstX0, int dstY0,
int dstX1, int dstY1,
float z, uint filter,
- uint writemask, uint zs_writemask)
+ uint writemask)
{
struct pipe_context *pipe = ctx->pipe;
enum pipe_format src_format, dst_format;
@@ -364,8 +364,8 @@ util_blit_pixels(struct blit_state *ctx,
util_format_description(src_tex->format);
struct pipe_blit_info info;
- assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
- filter == PIPE_TEX_MIPFILTER_LINEAR);
+ assert(filter == PIPE_TEX_FILTER_NEAREST ||
+ filter == PIPE_TEX_FILTER_LINEAR);
assert(src_level <= src_tex->last_level);
@@ -383,11 +383,18 @@ util_blit_pixels(struct blit_state *ctx,
is_depth = util_format_has_depth(src_desc);
is_stencil = util_format_has_stencil(src_desc);
- blit_depth = is_depth && (zs_writemask & BLIT_WRITEMASK_Z);
- blit_stencil = is_stencil && (zs_writemask & BLIT_WRITEMASK_STENCIL);
+ blit_depth = is_depth && (writemask & PIPE_MASK_Z);
+ blit_stencil = is_stencil && (writemask & PIPE_MASK_S);
- assert((writemask && !zs_writemask && !is_depth && !is_stencil) ||
- (!writemask && (blit_depth || blit_stencil)));
+ if (is_depth || is_stencil) {
+ assert((writemask & PIPE_MASK_RGBA) == 0);
+ assert(blit_depth || blit_stencil);
+ }
+ else {
+ assert((writemask & PIPE_MASK_ZS) == 0);
+ assert(!blit_depth);
+ assert(!blit_stencil);
+ }
/*
* XXX: z parameter is deprecated. dst->u.tex.first_layer
@@ -437,7 +444,7 @@ util_blit_pixels(struct blit_state *ctx,
assert(info.dst.box.width >= 0);
assert(info.dst.box.height >= 0);
info.dst.box.depth = 1;
- info.dst.format = dst->texture->format;
+ info.dst.format = dst_format;
info.src.resource = src_tex;
info.src.level = src_level;
info.src.box.x = srcX0;
@@ -446,8 +453,8 @@ util_blit_pixels(struct blit_state *ctx,
info.src.box.width = srcX1 - srcX0;
info.src.box.height = srcY1 - srcY0;
info.src.box.depth = 1;
- info.src.format = src_tex->format;
- info.mask = writemask | (zs_writemask << 4);
+ info.src.format = src_format;
+ info.mask = writemask;
info.filter = filter;
info.scissor_enable = 0;
@@ -486,8 +493,8 @@ util_blit_pixels_tex(struct blit_state *ctx,
unsigned offset;
struct pipe_resource *tex = src_sampler_view->texture;
- assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
- filter == PIPE_TEX_MIPFILTER_LINEAR);
+ assert(filter == PIPE_TEX_FILTER_NEAREST ||
+ filter == PIPE_TEX_FILTER_LINEAR);
assert(tex);
assert(tex->width0 != 0);