X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftexture.cpp;h=b545b16606eaa64a47c2baac3cedd82df39df029;hb=8f373af3e375799dd739fe932bc697e8595756b4;hp=21fc7a6ae9bb41711cf079795e752196c4a2e014;hpb=fcaae0500d5c6fa842babe37450c435e4178547a;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index 21fc7a6a..b545b166 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -87,8 +87,11 @@ DataType Texture::get_alloc_type(PixelFormat fmt) void Texture::set_internal_format(PixelFormat fmt) { - if(MSP_sized_internal_formats) - fmt = get_sized_pixelformat(fmt); + if(!get_component_size(fmt) && MSP_sized_internal_formats) + { + unsigned size = (fmt==DEPTH_COMPONENT ? get_gl_api()==OPENGL_ES2 ? 2 : 4 : 1); + fmt = get_sized_pixelformat(fmt, size); + } require_pixelformat(fmt); ifmt = fmt;