From 6f6a2340d40759b77ef43965efdd24f3e4e623fd Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 15 Feb 2013 08:16:33 +0100 Subject: libxcb mesa xserver xkeyboard-config git update 15 Feb 2013 xserver commit 90642948cc78834d95f7a3bddaac7ff77b68ed7e libxcb commit 0dd8f8d26a758bc385e79d9239bf6ef2e3d7bf13 xkeyboard-config commit 067b0e4fd8d4fe707d86b24ae83bcacb61624231 mesa commit 6dbe94c12cd1b3b912a7083055178e0dfd7372af --- mesalib/src/mesa/state_tracker/st_cb_drawpixels.c | 28 +++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'mesalib/src/mesa/state_tracker/st_cb_drawpixels.c') diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c index ba4f17a3d..e282bf98d 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c @@ -484,19 +484,29 @@ make_texture(struct st_context *st, gl_format mformat; struct pipe_resource *pt; enum pipe_format pipeFormat; - GLenum baseInternalFormat, intFormat; - - intFormat = internal_format(ctx, format, type); - baseInternalFormat = _mesa_base_tex_format(ctx, intFormat); + GLenum baseInternalFormat; /* Choose a pixel format for the temp texture which will hold the * image to draw. */ - pipeFormat = st_choose_format(st, intFormat, format, type, - PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, - FALSE); - assert(pipeFormat != PIPE_FORMAT_NONE); - mformat = st_pipe_format_to_mesa_format(pipeFormat); + pipeFormat = st_choose_matching_format(pipe->screen, PIPE_BIND_SAMPLER_VIEW, + format, type, unpack->SwapBytes); + + if (pipeFormat != PIPE_FORMAT_NONE) { + mformat = st_pipe_format_to_mesa_format(pipeFormat); + baseInternalFormat = _mesa_get_format_base_format(mformat); + } + else { + /* Use the generic approach. */ + GLenum intFormat = internal_format(ctx, format, type); + + baseInternalFormat = _mesa_base_tex_format(ctx, intFormat); + pipeFormat = st_choose_format(st, intFormat, format, type, + PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, + FALSE); + assert(pipeFormat != PIPE_FORMAT_NONE); + mformat = st_pipe_format_to_mesa_format(pipeFormat); + } pixels = _mesa_map_pbo_source(ctx, unpack, pixels); if (!pixels) -- cgit v1.2.3