Mesa (master): st/mesa: improve the format choosing code for DrawPixels
Brian Paul
brianp at kemper.freedesktop.org
Mon Feb 4 15:31:55 UTC 2013
Module: Mesa
Branch: master
Commit: f54a9f4ff2928d2545b324b0ccc4f9fcd40819cc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f54a9f4ff2928d2545b324b0ccc4f9fcd40819cc
Author: Brian Paul <brianp at vmware.com>
Date: Fri Feb 1 11:38:28 2013 -0700
st/mesa: improve the format choosing code for DrawPixels
The code before was getting a pipe format, then calling
st_pipe_format_to_mesa_format() and then converting back again with
st_mesa_format_to_pipe_format(). This removes one conversion step.
---
src/mesa/state_tracker/st_cb_drawpixels.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index ec44a43..26d1923 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -489,12 +489,14 @@ make_texture(struct st_context *st,
intFormat = internal_format(ctx, format, type);
baseInternalFormat = _mesa_base_tex_format(ctx, intFormat);
- mformat = st_ChooseTextureFormat_renderable(ctx, intFormat,
- format, type, GL_FALSE);
- assert(mformat);
-
- pipeFormat = st_mesa_format_to_pipe_format(mformat);
- assert(pipeFormat);
+ /* Choose a pixel format for the temp texture which will hold the
+ * image to draw.
+ */
+ pipeFormat = st_choose_format(pipe->screen, 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)
More information about the mesa-commit
mailing list