X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexture3d.cpp;h=4cba3afccbfade39750ef6ec00cd890182142b58;hp=680880a820be1507ba81fb0c252eafdcd98677ad;hb=7a2427020ec6ead73258aeb326dfb7e0121520f9;hpb=cdf928f03f4d8383b8fa978abc4c255a850ec061 diff --git a/source/texture3d.cpp b/source/texture3d.cpp index 680880a8..4cba3afc 100644 --- a/source/texture3d.cpp +++ b/source/texture3d.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "bindable.h" #include "error.h" @@ -83,7 +84,7 @@ void Texture3D::image(unsigned level, PixelFormat fmt, DataType type, const void return sub_image(level, 0, 0, 0, w, h, d, fmt, type, data); BindRestore _bind(this); - glTexImage3D(target, level, ifmt, width, height, depth, 0, fmt, type, data); + glTexImage3D(target, level, ifmt, width, height, depth, 0, get_upload_format(fmt), type, data); allocated |= 1< _bind(!ARB_direct_state_access, this); allocate(level); + fmt = get_upload_format(fmt); if(ARB_direct_state_access) glTextureSubImage3D(id, level, x, y, z, wd, ht, dp, fmt, type, data); else