aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-06-14 08:14:45 +0200
committermarha <marha@users.sourceforge.net>2011-06-14 08:14:45 +0200
commit6b441c10eeb02569204ff50ba8c3b739037b8141 (patch)
treef9c0dd95a41268546aeecdd31c8588c617749cd1 /mesalib/src/mesa/drivers
parent0d495843cebea4ae94a3138db2bf51da80a16391 (diff)
parent4d74e36f359d22b50302c82a922b79ac24dd3e23 (diff)
downloadvcxsrv-6b441c10eeb02569204ff50ba8c3b739037b8141.tar.gz
vcxsrv-6b441c10eeb02569204ff50ba8c3b739037b8141.tar.bz2
vcxsrv-6b441c10eeb02569204ff50ba8c3b739037b8141.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/SConscript mesalib/src/mesa/drivers/common/driverfuncs.c mesalib/src/mesa/main/texgetimage.c mesalib/src/mesa/sources.mak mesalib/src/mesa/swrast/s_texrender.c mesalib/src/mesa/vbo/vbo_exec_array.c xorg-server/xkeyboard-config/configure.in
Diffstat (limited to 'mesalib/src/mesa/drivers')
-rw-r--r--mesalib/src/mesa/drivers/common/driverfuncs.c5
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c14
2 files changed, 16 insertions, 3 deletions
diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c
index 830fcf8a2..4806d5d67 100644
--- a/mesalib/src/mesa/drivers/common/driverfuncs.c
+++ b/mesalib/src/mesa/drivers/common/driverfuncs.c
@@ -40,7 +40,6 @@
#include "main/texstore.h"
#include "main/bufferobj.h"
#include "main/fbobject.h"
-#include "main/texrender.h"
#include "main/samplerobj.h"
#include "main/syncobj.h"
#include "main/texturebarrier.h"
@@ -183,8 +182,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->NewFramebuffer = _mesa_new_framebuffer;
driver->NewRenderbuffer = _mesa_new_soft_renderbuffer;
- driver->RenderTexture = _mesa_render_texture;
- driver->FinishRenderTexture = _mesa_finish_render_texture;
+ driver->RenderTexture = _swrast_render_texture;
+ driver->FinishRenderTexture = _swrast_finish_render_texture;
driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
driver->ValidateFramebuffer = _mesa_validate_framebuffer;
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index 979926a7e..0e58aeca3 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -2691,12 +2691,26 @@ copy_tex_image(struct gl_context *ctx, GLuint dims, GLenum target, GLint level,
GLenum format, type;
GLint bpp;
void *buf;
+ struct gl_renderbuffer *read_rb = ctx->ReadBuffer->_ColorReadBuffer;
texObj = _mesa_get_current_tex_object(ctx, target);
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
/* Choose format/type for temporary image buffer */
format = _mesa_base_tex_format(ctx, internalFormat);
+
+ if (format == GL_LUMINANCE &&
+ _mesa_get_format_base_format(read_rb->Format) != GL_LUMINANCE) {
+ /* The glReadPixels() path will convert RGB to luminance by
+ * summing R+G+B. glCopyTexImage() is supposed to behave as
+ * glCopyPixels, which doesn't do that change, and instead
+ * leaves it up to glTexImage which converts RGB to luminance by
+ * just taking the R channel. To avoid glReadPixels() trashing
+ * our data, use RGBA for our temporary image.
+ */
+ format = GL_RGBA;
+ }
+
type = get_temp_image_type(ctx, format);
bpp = _mesa_bytes_per_pixel(format, type);
if (bpp <= 0) {