X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=inline;f=source%2Ftexture.cpp;h=68e4486120cb9cecdc919142727eb5f881a8d8a6;hb=344dd6a52b55d847f3346e94ec266a8864764b9d;hp=a7e4898c1edae7d73de8efe9bf425dbb69ccc569;hpb=a40fc85277dba5c34402a0e703d038efd30cc57b;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index a7e4898c..68e44861 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -97,24 +97,24 @@ DataType Texture::get_alloc_type(PixelFormat fmt) void Texture::set_internal_format(PixelFormat fmt) { - if(!get_component_size(fmt) && OES_required_internalformat) - fmt = get_default_sized_pixelformat(fmt); - FormatSwizzle swiz = NO_SWIZZLE; if(ARB_texture_rg && ARB_texture_swizzle) { - if(fmt==LUMINANCE8) + if(fmt==LUMINANCE) { - fmt = R8; + fmt = RED; swiz = R_TO_LUMINANCE; } - else if(fmt==LUMINANCE8_ALPHA8) + else if(fmt==LUMINANCE_ALPHA) { - fmt = RG8; + fmt = RG; swiz = RG_TO_LUMINANCE_ALPHA; } } + if(!get_component_size(fmt) && OES_required_internalformat) + fmt = get_default_sized_pixelformat(fmt); + require_pixelformat(fmt); ifmt = fmt; swizzle = swiz; @@ -132,6 +132,12 @@ PixelFormat Texture::get_upload_format(PixelFormat fmt) const void Texture::update_parameter(int mask) const { + if(!id) + { + dirty_params |= mask; + return; + } + if(!ARB_direct_state_access && TexUnit::current().get_texture()!=this) { TexUnit *unit = TexUnit::find_unit(this);