aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-06 08:33:58 +0100
committermarha <marha@users.sourceforge.net>2012-02-06 08:33:58 +0100
commitebb6162f9cbc1af0fac0b670b5aa38c8bb7a7446 (patch)
tree30d7b35b3c3d34b4539b57e1d92951ac5c8a3dfe /mesalib/src/mesa/swrast
parent68320ff05946f092b6836754c6267b1dff2f4633 (diff)
parentada3d2c30b5a7a1a79e128b7326d50c3bab77a8a (diff)
downloadvcxsrv-ebb6162f9cbc1af0fac0b670b5aa38c8bb7a7446.tar.gz
vcxsrv-ebb6162f9cbc1af0fac0b670b5aa38c8bb7a7446.tar.bz2
vcxsrv-ebb6162f9cbc1af0fac0b670b5aa38c8bb7a7446.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/swrast')
-rw-r--r--mesalib/src/mesa/swrast/s_span.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/mesalib/src/mesa/swrast/s_span.c b/mesalib/src/mesa/swrast/s_span.c
index 28f2f3d3f..422d86c00 100644
--- a/mesalib/src/mesa/swrast/s_span.c
+++ b/mesalib/src/mesa/swrast/s_span.c
@@ -1321,12 +1321,23 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
if (rb) {
GLchan rgbaSave[MAX_WIDTH][4];
- if (span->array->ChanType == GL_UNSIGNED_BYTE) {
- span->array->rgba = span->array->rgba8;
+ GLenum datatype;
+ GLuint comps;
+
+ _mesa_format_to_type_and_comps(rb->Format, &datatype, &comps);
+
+ /* set span->array->rgba to colors for render buffer's datatype */
+ if (datatype != span->array->ChanType) {
+ convert_color_type(span, datatype, 0);
}
else {
- span->array->rgba = (void *)
- span->array->attribs[FRAG_ATTRIB_COL0];
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ span->array->rgba = span->array->rgba8;
+ }
+ else {
+ span->array->rgba = (void *)
+ span->array->attribs[FRAG_ATTRIB_COL0];
+ }
}
if (!multiFragOutputs && numBuffers > 1) {