aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom_texture.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-02-05 08:22:00 +0100
committermarha <marha@users.sourceforge.net>2013-02-05 08:23:51 +0100
commit76c527be60066b647468ad66f8e4d7dd18fa1769 (patch)
tree2e4653dc3adf874409cf9baba399fd64537115d4 /mesalib/src/mesa/state_tracker/st_atom_texture.c
parenta6d5f8de1394c338d01b65be7dba3520bf8bdf4b (diff)
downloadvcxsrv-76c527be60066b647468ad66f8e4d7dd18fa1769.tar.gz
vcxsrv-76c527be60066b647468ad66f8e4d7dd18fa1769.tar.bz2
vcxsrv-76c527be60066b647468ad66f8e4d7dd18fa1769.zip
fontconfig mesa xkeyboard-config git update 5 feb 2013
xkeyboard-config commit b4be67b48fb11989f1824dd0b1c8c399430162b0 fontconfig commit 95af7447dba7c54ed162b667c0bb2ea6500e8f32 mesa commit 86536a321d9d26137587affe687a07da71f0b526
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_texture.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c
index 4b43b2a7d..28327bc14 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c
@@ -214,7 +214,7 @@ update_single_texture(struct st_context *st,
const struct gl_sampler_object *samp;
struct gl_texture_object *texObj;
struct st_texture_object *stObj;
- enum pipe_format st_view_format;
+ enum pipe_format view_format;
GLboolean retval;
samp = _mesa_get_samplerobj(ctx, texUnit);
@@ -234,32 +234,11 @@ update_single_texture(struct st_context *st,
}
/* Determine the format of the texture sampler view */
- st_view_format = stObj->pt->format;
-
- {
- gl_format texFormat;
- enum pipe_format firstImageFormat;
-
- if (texObj->Target == GL_TEXTURE_BUFFER) {
- texFormat = stObj->base._BufferObjectFormat;
- } else {
- const struct st_texture_image *firstImage =
- st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]);
- texFormat = firstImage->base.TexFormat;
- }
- firstImageFormat = st_mesa_format_to_pipe_format(texFormat);
- if ((samp->sRGBDecode == GL_SKIP_DECODE_EXT) &&
- (_mesa_get_format_color_encoding(texFormat) == GL_SRGB)) {
- /* Don't do sRGB->RGB conversion. Interpret the texture data as
- * linear values.
- */
- const gl_format linearFormat =
- _mesa_get_srgb_format_linear(texFormat);
- firstImageFormat = st_mesa_format_to_pipe_format(linearFormat);
- }
+ view_format = stObj->pt->format;
- if (firstImageFormat != stObj->pt->format)
- st_view_format = firstImageFormat;
+ /* If sRGB decoding is off, use the linear format */
+ if (samp->sRGBDecode == GL_SKIP_DECODE_EXT) {
+ view_format = util_format_linear(view_format);
}
/* if sampler view has changed dereference it */
@@ -267,7 +246,7 @@ update_single_texture(struct st_context *st,
if (check_sampler_swizzle(stObj->sampler_view,
stObj->base._Swizzle,
stObj->base.DepthMode) ||
- (st_view_format != stObj->sampler_view->format) ||
+ (view_format != stObj->sampler_view->format) ||
stObj->base.BaseLevel != stObj->sampler_view->u.tex.first_level) {
pipe_sampler_view_reference(&stObj->sampler_view, NULL);
}
@@ -275,7 +254,7 @@ update_single_texture(struct st_context *st,
*sampler_view = st_get_texture_sampler_view_from_stobj(stObj, pipe,
samp,
- st_view_format);
+ view_format);
return GL_TRUE;
}