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;
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);