diff options
author | José Fonseca <[email protected]> | 2013-11-19 18:54:53 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2013-11-20 07:12:59 +0000 |
commit | 060159820c05c4e9a9b577844387555b11092391 (patch) | |
tree | 11a641ae427c40618a87cbaccf841c17b00edc39 /src/gallium/auxiliary/util/u_gen_mipmap.c | |
parent | 15d8e05e1e98a9bfd5a365d0fda222668f24261f (diff) |
u_gen_mipmap: Use untampered cubemap texture coords when generating mipmaps.
It's not necessary to scale down cubemap texture coords when generating
mipmaps: we are doing a 2x minification therefore it's guaranteed that
the texture coords will always be at least 1 texel away of the edges.
Scaling down can actually be harmful, as it may cause artefacts when
generating mipmaps with nearest filtering. Sample points will lie
exactly in the middle each 2x2 texels, so the scaling factor was causing
different texels to be take on each quadrant of the cube face. This is
apparent with a 1x1 checkerboard pattern in the base mipmap level:
instead of next mipmap level receiving a constant color throughout the
face, it will have different colors for each quadrant of the face.
The behaviour for blits is left untouched for now, but the cubemap
texture coord scaling hack should be reconsidered eventually.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_gen_mipmap.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_gen_mipmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index a885f2b0f28..84bf30f08b0 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -1409,7 +1409,8 @@ set_vertex_data(struct gen_mipmap_state *ctx, }; util_map_texcoords2d_onto_cubemap(layer, &st[0][0], 2, - &ctx->vertices[0][1][0], 8); + &ctx->vertices[0][1][0], 8, + FALSE); } else if (tex_target == PIPE_TEXTURE_1D_ARRAY) { /* 1D texture array */ |