aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_blitter.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-12 09:07:21 +0200
committermarha <marha@users.sourceforge.net>2011-09-12 09:07:21 +0200
commit0b40f5f4b54453a77f4b09c431f8efc6875da61f (patch)
treec1f08e0dd75a6ed7876c24c7219f93f01cab3605 /mesalib/src/gallium/auxiliary/util/u_blitter.c
parent75530c6eb2feebe234f7cb078c4caaf70c64981a (diff)
parent24a692ce832161d3b794110dd82b1508d38a0887 (diff)
downloadvcxsrv-0b40f5f4b54453a77f4b09c431f8efc6875da61f.tar.gz
vcxsrv-0b40f5f4b54453a77f4b09c431f8efc6875da61f.tar.bz2
vcxsrv-0b40f5f4b54453a77f4b09c431f8efc6875da61f.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/glsl/ast_to_hir.cpp mesalib/src/glsl/glcpp/glcpp.c mesalib/src/mesa/drivers/dri/common/dri_util.c mesalib/src/mesa/drivers/dri/common/spantmp2.h mesalib/src/mesa/drivers/dri/common/utils.c mesalib/src/mesa/drivers/dri/swrast/swrast.c mesalib/src/mesa/program/ir_to_mesa.cpp mesalib/src/mesa/state_tracker/st_extensions.c mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c pixman/configure.ac pixman/pixman/pixman-arm-neon-asm.S pixman/test/Makefile.am pixman/test/utils.c pixman/test/utils.h
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_blitter.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blitter.c52
1 files changed, 41 insertions, 11 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c
index d8e46f07c..d69fb1a11 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blitter.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c
@@ -480,10 +480,11 @@ static void blitter_set_texcoords_3d(struct blitter_context_priv *ctx,
unsigned level,
unsigned zslice,
unsigned x1, unsigned y1,
- unsigned x2, unsigned y2)
+ unsigned x2, unsigned y2,
+ boolean normalized)
{
int i;
- float r = zslice / (float)u_minify(src->depth0, level);
+ float r = normalized ? zslice / (float)u_minify(src->depth0, level) : zslice;
blitter_set_texcoords_2d(ctx, src, level, x1, y1, x2, y2);
@@ -491,6 +492,21 @@ static void blitter_set_texcoords_3d(struct blitter_context_priv *ctx,
ctx->vertices[i][1][2] = r; /*r*/
}
+static void blitter_set_texcoords_1d_array(struct blitter_context_priv *ctx,
+ struct pipe_resource *src,
+ unsigned level,
+ unsigned zslice,
+ unsigned x1, unsigned x2)
+{
+ int i;
+ float r = zslice;
+
+ blitter_set_texcoords_2d(ctx, src, level, x1, 0, x2, 0);
+
+ for (i = 0; i < 4; i++)
+ ctx->vertices[i][1][1] = r; /*r*/
+}
+
static void blitter_set_texcoords_cube(struct blitter_context_priv *ctx,
struct pipe_resource *src,
unsigned level, unsigned face,
@@ -576,6 +592,10 @@ pipe_tex_to_tgsi_tex(enum pipe_texture_target pipe_tex_target)
return TGSI_TEXTURE_3D;
case PIPE_TEXTURE_CUBE:
return TGSI_TEXTURE_CUBE;
+ case PIPE_TEXTURE_1D_ARRAY:
+ return TGSI_TEXTURE_1D_ARRAY;
+ case PIPE_TEXTURE_2D_ARRAY:
+ return TGSI_TEXTURE_2D_ARRAY;
default:
assert(0 && "unexpected texture target");
return TGSI_TEXTURE_UNKNOWN;
@@ -861,17 +881,31 @@ void util_blitter_copy_texture(struct blitter_context *blitter,
break;
/* Draw the quad with the generic codepath. */
- case PIPE_TEXTURE_3D:
- case PIPE_TEXTURE_CUBE:
+ default:
/* Set texture coordinates. */
- if (src->target == PIPE_TEXTURE_3D)
+ switch (src->target) {
+ case PIPE_TEXTURE_1D_ARRAY:
+ blitter_set_texcoords_1d_array(ctx, src, srclevel, srcbox->y,
+ srcbox->x, srcbox->x + width);
+ break;
+
+ case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_3D:
blitter_set_texcoords_3d(ctx, src, srclevel, srcbox->z,
srcbox->x, srcbox->y,
- srcbox->x + width, srcbox->y + height);
- else
+ srcbox->x + width, srcbox->y + height,
+ src->target == PIPE_TEXTURE_3D);
+ break;
+
+ case PIPE_TEXTURE_CUBE:
blitter_set_texcoords_cube(ctx, src, srclevel, srcbox->z,
srcbox->x, srcbox->y,
srcbox->x + width, srcbox->y + height);
+ break;
+
+ default:
+ assert(0);
+ }
/* Draw. */
blitter_set_rectangle(ctx, dstx, dsty, dstx+width, dsty+height, 0);
@@ -880,10 +914,6 @@ void util_blitter_copy_texture(struct blitter_context *blitter,
util_draw_vertex_buffer(ctx->base.pipe, NULL, ctx->vbuf, 0,
PIPE_PRIM_TRIANGLE_FAN, 4, 2);
break;
-
- default:
- assert(0);
- return;
}
blitter_restore_CSOs(ctx);