]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't try to set parameters for textures which aren't loaded yet
authorMikko Rasa <tdb@tdb.fi>
Mon, 25 Jan 2021 23:20:48 +0000 (01:20 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 25 Jan 2021 23:33:08 +0000 (01:33 +0200)
source/texture.cpp

index 1452cfbb44c3afe099a444cdb44d557015061051..68e4486120cb9cecdc919142727eb5f881a8d8a6 100644 (file)
@@ -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);