X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Ftexture2d.cpp;h=e38c99deb85e2dda60603b89e97405a013c763cd;hp=a0ba9515e68babe3387b9e2af1278087b1d6d3f9;hb=HEAD;hpb=225dbd7ba2dde73bb28e54e03ae960e88e708f57 diff --git a/source/core/texture2d.cpp b/source/core/texture2d.cpp index a0ba9515..e38c99de 100644 --- a/source/core/texture2d.cpp +++ b/source/core/texture2d.cpp @@ -238,7 +238,22 @@ bool Texture2D::AsyncLoader::process() } else if(phase==2) { - if(raw_data) + if(texture.swizzle==RGBA_TO_RGB) + { + const void *data; + if(raw_data) + { + raw_data->load(); + data = raw_data->get_data(); + } + else + { + image.load(*img_loader); + data = image.get_pixels(); + } + texture.stage_pixels(transfer.get_address(), data, texture.width*texture.height); + } + else if(raw_data) raw_data->load_into(transfer.get_address()); else image.load_into(*img_loader, transfer.get_address());