diff options
author | marha <marha@users.sourceforge.net> | 2012-08-03 09:39:10 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-08-03 09:39:10 +0200 |
commit | e158f8fc4a9cf2f884d156ff2dfc0870facfbcba (patch) | |
tree | 9642a988d6674f27d6971ec2be7e2cdacc784862 /mesalib/src/mesa/swrast/s_texfetch.c | |
parent | ebfd1ae8f80dd16f99f9ef89c28a06f809d07f8d (diff) | |
parent | 18e75aa6ae27a6e44d93babd96afbbe0cd6077c8 (diff) | |
download | vcxsrv-e158f8fc4a9cf2f884d156ff2dfc0870facfbcba.tar.gz vcxsrv-e158f8fc4a9cf2f884d156ff2dfc0870facfbcba.tar.bz2 vcxsrv-e158f8fc4a9cf2f884d156ff2dfc0870facfbcba.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/swrast/s_texfetch.c')
-rw-r--r-- | mesalib/src/mesa/swrast/s_texfetch.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/mesalib/src/mesa/swrast/s_texfetch.c b/mesalib/src/mesa/swrast/s_texfetch.c index 12ee47963..db7c887b6 100644 --- a/mesalib/src/mesa/swrast/s_texfetch.c +++ b/mesalib/src/mesa/swrast/s_texfetch.c @@ -41,6 +41,7 @@ #include "main/texcompress_rgtc.h" #include "main/texcompress_etc.h" #include "main/teximage.h" +#include "main/samplerobj.h" #include "s_context.h" #include "s_texfetch.h" #include "../../gallium/auxiliary/util/u_format_rgb9e5.h" @@ -1147,13 +1148,14 @@ _mesa_get_texel_fetch_func(gl_format format, GLuint dims) * Initialize the texture image's FetchTexel methods. */ static void -set_fetch_functions(struct swrast_texture_image *texImage, GLuint dims) +set_fetch_functions(struct gl_sampler_object *samp, + struct swrast_texture_image *texImage, GLuint dims) { gl_format format = texImage->Base.TexFormat; ASSERT(dims == 1 || dims == 2 || dims == 3); - if (texImage->Base.TexObject->Sampler.sRGBDecode == GL_SKIP_DECODE_EXT && + if (samp->sRGBDecode == GL_SKIP_DECODE_EXT && _mesa_get_format_color_encoding(format) == GL_SRGB) { format = _mesa_get_srgb_format_linear(format); } @@ -1163,17 +1165,25 @@ set_fetch_functions(struct swrast_texture_image *texImage, GLuint dims) } void -_mesa_update_fetch_functions(struct gl_texture_object *texObj) +_mesa_update_fetch_functions(struct gl_context *ctx, GLuint unit) { + struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; + struct gl_sampler_object *samp; GLuint face, i; GLuint dims; + if (!texObj) + return; + + samp = _mesa_get_samplerobj(ctx, unit); + dims = _mesa_get_texture_dimensions(texObj->Target); for (face = 0; face < 6; face++) { for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { if (texObj->Image[face][i]) { - set_fetch_functions(swrast_texture_image(texObj->Image[face][i]), + set_fetch_functions(samp, + swrast_texture_image(texObj->Image[face][i]), dims); } } |