diff options
author | marha <marha@users.sourceforge.net> | 2013-11-21 08:43:25 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-11-21 08:43:25 +0100 |
commit | bb953a87489963f63e65c797a1f2837382ff7808 (patch) | |
tree | 458f44ffc1539fad170d96a414970a42b75d1190 /mesalib/src/gallium/auxiliary/util/u_texture.c | |
parent | 73db05c85f7a8cf2439f7c333ede6ff2dc4877d7 (diff) | |
download | vcxsrv-bb953a87489963f63e65c797a1f2837382ff7808.tar.gz vcxsrv-bb953a87489963f63e65c797a1f2837382ff7808.tar.bz2 vcxsrv-bb953a87489963f63e65c797a1f2837382ff7808.zip |
xserver mesa git update 21 nov 2013
xserver commit 6403cbb143c67872ca9c58e3116ae7942def0ae1
mesa commit b7c0b61782251c1dedb0b0fb0e6654af81249910
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_texture.c')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_texture.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_texture.c b/mesalib/src/gallium/auxiliary/util/u_texture.c index d97e57a79..e865f8e73 100644 --- a/mesalib/src/gallium/auxiliary/util/u_texture.c +++ b/mesalib/src/gallium/auxiliary/util/u_texture.c @@ -42,7 +42,8 @@ void util_map_texcoords2d_onto_cubemap(unsigned face, const float *in_st, unsigned in_stride, - float *out_str, unsigned out_stride) + float *out_str, unsigned out_stride, + boolean allow_scale) { int i; float rx, ry, rz; @@ -52,8 +53,14 @@ void util_map_texcoords2d_onto_cubemap(unsigned face, /* Compute sc = +/-scale and tc = +/-scale. * Not +/-1 to avoid cube face selection ambiguity near the edges, * though that can still sometimes happen with this scale factor... + * + * XXX: Yep, there is no safe scale factor that will prevent sampling + * the neighbouring face when stretching out. A more reliable solution + * would be to clamp (sc, tc) against +/- 1.0-1.0/mipsize, in the shader. + * + * Also, this is not necessary when minifying, or 1:1 blits. */ - const float scale = 0.9999f; + const float scale = allow_scale ? 0.9999f : 1.0f; const float sc = (2 * in_st[0] - 1) * scale; const float tc = (2 * in_st[1] - 1) * scale; |